espetoet

Untitled

Oct 14th, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.55 KB | None | 0 0
  1. ;-----------------------
  2. ListLines, Off
  3. My_ScriptName:=%True%
  4. Try Menu, Tray, Icon, %My_ScriptName%
  5. Gui, SingleInstance_force:Show, Hide, [%My_ScriptName%]
  6. Gui, SingleInstance_force:+HwndMy_guiid
  7. DetectHiddenWindows, On
  8. WinGet, My_list, List, [%My_ScriptName%] ahk_class AutoHotkeyGUI
  9. Loop, % My_list {
  10. IfEqual, My_guiid, % My_id:=My_list%A_Index%, Continue
  11. WinGet, My_pid, PID, ahk_id %My_id%
  12. WinClose, ahk_class AutoHotkey ahk_pid %My_pid%
  13. WinWaitClose, ahk_id %My_id%
  14. }
  15. DetectHiddenWindows, Off
  16. SetWorkingDir, % RegExReplace(My_ScriptName,"\\[^\\]*$")
  17. ;-----------------------
  18. Reload() {
  19. static My_ScriptName:=%True%
  20. Try {
  21. if My_ScriptName=
  22. return
  23. else if InStr(My_ScriptName,".exe")
  24. Run, "%My_ScriptName%"
  25. else
  26. Run, "%A_AhkPath%" "%My_ScriptName%"
  27. ExitApp
  28. }
  29. }
  30. ListLines, On
  31. ;-----------------------
  32. #NoEnv
  33. #NoTrayIcon
  34. #SingleInstance Force
  35. #Persistent
  36. ListLines Off
  37. ComObjError(False)
  38.  
  39. Gui, +ToolWindow +MinimizeBox
  40. Gui, Color, White
  41. Gui, Font, Bold
  42. Gui, Show, x810 y400 h110 w210, MacroHS
  43. Gui, Add, GroupBox, w190 h95
  44. Gui, Add, Text, x20 y25 w50 h20, Usuario:
  45. Gui, Add, Edit, x80 y22 w80 h20 vusuario,
  46. Gui, Add, Text, x20 y51 w50 h20, Senha:
  47. Gui, Add, Edit, x80 y48 w80 h20 vsenha Password,
  48. Gui, Add, Button, x90 y75 w40 h20 section, Login
  49. Gui, Add, Button, x150 y75 w40 h20 gQuitter, Sair
  50. Gui, Add, Button, x170 y22 w20 h20 section, ?
  51. Gui, Show
  52. Return
  53. GuiEscape:
  54.  
  55. Quitter:
  56. ExitApp
  57. Return
  58.  
  59. Button?:
  60. Gui, Submit, NoHide
  61. MsgBox, 0, Vendas / Suport,MacroHS `nWhatsapp: +55 (85)9901-3957
  62. Return
  63.  
  64. ButtonLogin:
  65.  
  66. Gui, Submit, Hide
  67.  
  68. if (usuario == "" || senha == ""){
  69. soundbeep
  70. MsgBox, 16, Login Usuario, Usuario ou Senha não informado !!
  71. ExitApp
  72. }
  73.  
  74. HttpObj := ComObjCreate("WinHttp.WinHttpRequest.5.1")
  75. HttpObj.Open("GET", "http://heitor.photo/teste/macro/login.php?usuario=" usuario "&senha=" senha "&acao=ENTRAR", false)
  76. HttpObj.Send()
  77. Sleep 100
  78.  
  79. Shared := HttpObj.ResponseText
  80.  
  81. RegExMatch(Shared, "<status>(.*?)</status>", Status)
  82. RegExMatch(Shared, "<date>(.*?)</date>", Validade)
  83. RegExMatch(Shared, "<alert>(.*?)</alert>", Alerta)
  84. RegExMatch(Shared, "<msg>(.*?)</msg>", Menssagem)
  85. RegExMatch(Shared, "<location>(.*?)</location>", Localizacao)
  86.  
  87. Status := RegExReplace(Status,"<.+?>")
  88. Validade := RegExReplace(Validade,"<.+?>")
  89. Alerta := RegExReplace(Alerta,"<.+?>")
  90. Menssagem := RegExReplace(Menssagem,"<.+?>")
  91. Localizacao := RegExReplace(Localizacao,"<.+?>")
  92.  
  93.  
  94. if (Status = "[LOGADO]"){
  95. soundbeep
  96. Gui, Hide
  97. MsgBox, 16, Login Usuario, Usuario Logado em outro Local !!
  98. ExitApp
  99. }
  100. else if (Status = "[ERRO]"){
  101. soundbeep
  102. Gui, Hide
  103. MsgBox, 16, Login Usuario, Usuario ou Senha Inválido !!
  104. ExitApp
  105. }
  106. else if (Status = "[SUSPENSO]"){
  107. soundbeep
  108. Gui, Hide
  109. MsgBox, 16, Login Usuario, Tempo de uso Expirado !!
  110. MsgBox, 0, Entre em contato,MacroHS `nWhatsapp: +55 (85)9901-3957
  111. ExitApp
  112. }
  113. else if (Status = "[ATIVO]"){
  114.  
  115. if (Alerta = "ON"){
  116. MsgBox, 0, Alerta do Sistema, %Menssagem%
  117. }
  118. soundbeep
  119. Gui, Destroy
  120. IfExist, Settings.ini,{
  121. IniRead, Key1, Settings.ini, Settings, Suspender, %Key1%
  122. IniRead, ReadVal1, Settings.ini, Recoil, RecoilTiming, %ReadVal1%
  123. }Else{
  124. IniRead, Key1, Settings.ini, Settings, Suspender, F1
  125. IniWrite, %Key1%, Settings.ini, Settings, Suspender
  126. IniRead, SaveVal1, Settings.ini, Recoil, RecoilTiming, 1
  127. IniWrite, %SaveVal1%, Settings.ini, Recoil, RecoilTiming
  128. }
  129.  
  130. Hotkey, %Key1%, ~$hkWrite
  131.  
  132. Suspend
  133. Gui, Color, White, Font, Bold
  134. Gui, Font, Bold
  135.  
  136. Gui, Add, Text, x15 y90 w200 h23 +0x200 +left, %usuario% - %Localizacao%
  137.  
  138. Gui, Add, Text, x15 y15 w95 h20 +0x200 +left, Recoil Mouse:
  139. Gui, Add, ComboBox, x100 y17 w55 vRCT, %ReadVal1%||1|2|3|4|5|6|7|8|9|10
  140.  
  141. Gui, Add, Text, x15 y55 w95 h20 +0x200 +left, Suspender:
  142. Gui, Add, DropDownList, x100 y57 w55 vSuspend, %Key1%||F1|F2|F3|F4|F5|F6|F7|F8|F9|F10
  143.  
  144. Gui, Add, Button, gSair x180 y17 w60 h20, Sair
  145. Gui, Add, Button, gSaveVal x180 y57 w60 h20, Salvar
  146.  
  147. Gui, Show, w262 h120, Expira %Validade%
  148. Return
  149.  
  150. ~*$LButton::
  151. Loop
  152. {
  153. GetKeyState, state, LButton, P
  154. if state=u
  155. break
  156. Gui, Submit, nohide
  157. mouseXY(0,-RCT)
  158. sleep, 8
  159. }
  160. Return
  161.  
  162. mouseXY(x,y)
  163. {
  164. DllCall("mouse_event",int,1,int,x,int,y,uint,0,uint,0)
  165. }
  166. Return
  167.  
  168. ~$hkWrite:
  169. Suspend, Permit
  170. Suspend, Toggle
  171. Return
  172.  
  173. SaveVal:
  174. IniDelete, Settings.ini, Settings, Suspender
  175. IniRead, Key1, Settings.ini, Settings, Suspender, %Suspend%
  176. IniWrite, %Key1%, Settings.ini, Settings, Suspender
  177.  
  178. IniDelete, Settings.ini, Recoil, RecoilTiming
  179. IniRead, SaveVal1, Settings.ini, Recoil, RecoilTiming, %RCT%
  180. IniWrite, %SaveVal1%, Settings.ini, Recoil, RecoilTiming
  181.  
  182. MsgBox, 0, MacroHS, Configurações Salvas !!
  183. goSub ~$hkWrite
  184. Return
  185.  
  186. Sair:
  187. HttpObj := ComObjCreate("WinHttp.WinHttpRequest.5.1")
  188. HttpObj.Open("GET", "http://heitor.photo/teste/macro/login.php?usuario=" usuario "&senha=" senha "&acao=SAIR", false)
  189. HttpObj.Send()
  190. Gui, Hide
  191. soundbeep
  192. MsgBox, 0, MacroHS, Usuario %usuario% Deslogado
  193. ExitApp
  194. Return
  195. }
  196. else{
  197. soundbeep
  198. MsgBox, 16, Erro no Servidor !!, Entre em Contato `nMacroHS `nWhatsapp: +55 (85)9901-3957
  199. ExitApp
  200. }
  201. Return
  202.  
  203. GuiClose:
  204. MsgBox, 0, MacroHS, Clique em Sair
  205.  
  206. ExitApp
  207. #SingleInstance off
Add Comment
Please, Sign In to add comment