Advertisement
tastypear

auto order for hexin

May 25th, 2019
917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.13 KB | None | 0 0
  1. #include <MsgBoxConstants.au3>
  2.  
  3. HotKeySet("{F7}", "quit")
  4.  
  5. $begin = TimerInit()
  6. $timeDif = 0
  7. $orderCount = 0
  8. $quitFlag = 0
  9. $defaultClass = "[CLASS:#32770]"
  10. $yes = "是(&Y)"
  11. $orderInterface = "[TITLE:网上股票交易系统5.0]"
  12.  
  13. while true
  14.     if WinExists($defaultClass,$yes) then
  15.         WinActivate($defaultClass,$yes)
  16.         ControlClick($defaultClass, "", 6 )
  17.         ContinueLoop
  18.     elseif not $quitFlag then
  19.         order()
  20.     elseif sleep(1000) and WinActive($orderInterface) then
  21.         $info = "统计", "委托单:" & $orderCount &@CRLF & "耗时:" & $timeDif & "s"
  22.         MsgBox($MB_SYSTEMMODAL, $info)
  23.         exit
  24.     else
  25.         ContinueLoop
  26.     endif  
  27. wend
  28.  
  29. func order()
  30.     do
  31.         ControlSetText($orderInterface, "", 1032,"519888")
  32.         ControlSetText($orderInterface, "", 1033,"0.010")
  33.         ControlSetText($orderInterface, "", 1034,"3000")
  34.     until (ControlGetText($orderInterface, "", 1032)="519888" and ControlGetText($orderInterface, "", 1033)="0.010" and ControlGetText($orderInterface, "", 1034)="1000")
  35.     ControlClick($orderInterface,"",1006)
  36.     $orderCount +=1
  37. endfunc
  38.  
  39. Func quit()
  40.     $timeDif = Int(TimerDiff($begin)/1000)
  41.     $quitFlag += 1
  42. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement