Advertisement
AntidotE

buying-selling cargo 1 by 1

Mar 13th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.65 KB | None | 0 0
  1. HotKeySet("{PAUSE}","zzz")
  2. HotKeySet("=","switch_flag_buy")
  3. HotKeySet("-","switch_flag_sell")
  4. Opt("SendKeyDelay",20)
  5. Opt("SendKeyDownDelay",20)
  6. Dim $flag_sell = False
  7. Dim $flag_buy = False
  8.  
  9. While 1
  10.     $nMsg = GUIGetMsg()
  11.     If $flag_sell Then
  12.         do_routine_sell()
  13.     EndIf
  14.     If $flag_buy Then
  15.         do_routine_buy()
  16.     EndIf
  17. WEnd
  18.  
  19. func switch_flag_sell()
  20.     $flag_sell = not $flag_sell
  21.     $flag_buy = False
  22. EndFunc
  23.  
  24. func switch_flag_buy()
  25.     $flag_buy = not $flag_buy
  26.     $flag_sell = False
  27. EndFunc
  28.  
  29. func do_routine_sell()
  30.     Send(" {LEFT} ")
  31.     Sleep(200)
  32. endfunc
  33.  
  34. func do_routine_buy()
  35.     Send(" {RIGHT} ")
  36.     Sleep(200)
  37. endfunc
  38.  
  39. func zzz()
  40.     Exit(0)
  41. endfunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement