Juno_okyo

Auto 7giay.exe

Sep 13th, 2015
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.89 KB | None | 0 0
  1. #NoTrayIcon
  2. Opt('WinTitleMatchMode', 2)
  3. Global Const $TITLE = 'Khanh KG - 2015'
  4.  
  5. main() ; Here we go!
  6.  
  7. Func main()
  8.     If Not ProcessExists('7giay.exe') Or Not WinExists($TITLE) Then
  9.         MsgBox(16 + 262144, 'Error', 'Please run program first!')
  10.         Return False
  11.     EndIf
  12.  
  13.     WinActivate($TITLE)
  14.     ControlClick($TITLE, '', '[NAME:batdau]')
  15.  
  16.     ; Auto calculate
  17.     _setTxt(4, _getTxt('cong') + _getTxt('cong', 2))
  18.     _setTxt(3, _getTxt('tru') - _getTxt('tru', 2))
  19.     _setTxt(2,_getTxt('nhan') * _getTxt('nhan', 2))
  20.     _setTxt(1, _getTxt('chia') / _getTxt('chia', 2))
  21. EndFunc   ;==>main
  22.  
  23. Func _getTxt($ctrl, $n = 1)
  24.     $ctrl &= ($n == 1) ? 't' : 'p'
  25.     Return Number(ControlGetText($TITLE, '', '[NAME:' & $ctrl & ']'))
  26. EndFunc   ;==>_getTxt
  27.  
  28. Func _setTxt($ctrl, $newTxt)
  29.     Return ControlSetText($TITLE, '', '[CLASS:WindowsForms10.EDIT.app.0.378734a; INSTANCE:' & $ctrl & ']', $newTxt)
  30. EndFunc   ;==>_setTxt
Add Comment
Please, Sign In to add comment