-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbeg.py
More file actions
40 lines (26 loc) · 750 Bytes
/
beg.py
File metadata and controls
40 lines (26 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import asyncio
timer = 0
def updatetimer():
global timer
timer+=1
async def bgloop(TIME, funktorun):
#Sleep value for reward loop in seconds, love being rewarded for sleeping
while True:
funktorun()
await asyncio.sleep(TIME)
async def inp():
while True:
s = input('~')
if s=='l' or s =='L':
print('Trying to list')
if s=='r' or s == 'R':
print('Trying to recruit members')
#Description: List of async tasks to run in the on ready event
async def tasks():
await asyncio.wait([
inp(),
bgloop(1, updatetimer),
])
loop = asyncio.get_event_loop()
loop.run_until_complete(tasks())
loop.close()