forked from andikasujanadi/andikasujanadi.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
73 lines (58 loc) · 1.36 KB
/
bot.py
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from pynput.keyboard import Key, Listener, Controller
import time
import threading
on=True
start=False
openStock="8646"
me="88"
ae="120"
pengeluaran="40"
keyboard = Controller()
def on_press(key):
print('{0} pressed'.format(key))
pass
def on_release(key):
global on, start
print('{0} release'.format(key))
if key == Key.shift_l:
start=True
if key == Key.esc:
on = False
return on
sys.exit()
def printbot(openStock,me,ae,pengeluaran):
keyboard.type(openStock)
right()
right()
right()
right()
right()
right()
right()
down()
keyboard.type(me)
keyboard.type(ae)
keyboard.type(pengeluaran)
sys.exit()
def tab():
keyboard.press(Key.tab)
keyboard.release(Key.tab)
def right():
keyboard.press(Key.right)
keyboard.release(Key.right)
def down():
keyboard.press(Key.down)
keyboard.release(Key.down)
def enter():
keyboard.press(Key.enter)
keyboard.release(Key.enter)
def hello():
global on, start
while on:
while start:
printbot(str(startnumber))
time.sleep(3)
x = threading.Thread(target=hello, args=())
x.start()
with Listener(on_press=on_press, on_release=on_release) as listener:
listener.join()