Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import win32api, win32con, time, sys, os
- def wait(t):
- fin = time.time()+t
- while time.time() < fin:
- if win32api.GetAsyncKeyState(win32con.VK_ESCAPE): end(); sys.exit()
- keyPress(VK_E); time.sleep(0.5)
- VK_E = win32api.VkKeyScan('e')
- def keyPress(vk): win32api.keybd_event(vk,0); win32api.keybd_event(vk,0,win32con.KEYEVENTF_KEYUP)
- ad = [win32api.VkKeyScan(k) for k in "ad"]
- def walk(ix):
- dx = ad[ix]; win32api.keybd_event(dx,0); wait(0.3);
- win32api.keybd_event(dx,0,win32con.KEYEVENTF_KEYUP)
- def moveMouse(dx,dy): win32api.mouse_event(win32con.MOUSEEVENTF_MOVE,dx,dy) # update roblox cursor
- def setMouse(pos): win32api.SetCursorPos(pos); moveMouse(10,0); time.sleep(0.1); moveMouse(-8,0)
- def click(): win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0); win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,0,0)
- def clickAt(pos):
- for i in range(2): setMouse(pos); time.sleep(0.1)
- click()
- customers = 1185,345
- slotYes = 980,420
- slotOK = 1060,420
- t = input("m,s\n").split(",")
- if t[0]=="": t = ["0","0"] # enter
- elif t[0]==" ": t = ["10","0"] # space enter
- elif len(t)==1: t+=["0"] # minute enter
- print("%sm %ss"%tuple(t))
- s = int(t[0])*60 + int(t[1])
- nextSlot = time.time()+s
- print("Press CTRL to start")
- while not win32api.GetAsyncKeyState(win32con.VK_CONTROL): time.sleep(0.5)
- if time.time() > nextSlot: nextSlot = time.time()+2
- os.system("cls")
- start = time.time()
- def end():
- d = int(time.time()-start)
- m,s = divmod(d,60)
- h,m = divmod(m,60)
- input("%ih %im %is"%(h,m,s))
- while not win32api.GetAsyncKeyState(win32con.VK_ESCAPE):
- if time.time() > nextSlot:
- walk(0); walk(0) # 1. walk to slot machine
- wait(1) # 2. open slot machine (clicks customers away)
- clickAt(slotYes) # 3. click yes
- nextSlot = time.time()+600 # (timer reset)
- walk(1); walk(1) # 4. walk to customers
- wait(10) # (wait for rewards popup)
- clickAt(slotOK) # 5. click ok
- wait(5) # (incase popup lags)
- clickAt(slotOK) # 5. click ok
- wait(5) # (incase popup lags)
- clickAt(slotOK) # 5. click ok
- keyPress(VK_E)
- time.sleep(0.5)
- end()
Advertisement
Advertisement