Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;-----------------------
- ListLines, Off
- My_ScriptName:=%True%
- Try Menu, Tray, Icon, %My_ScriptName%
- Gui, SingleInstance_force:Show, Hide, [%My_ScriptName%]
- Gui, SingleInstance_force:+HwndMy_guiid
- DetectHiddenWindows, On
- WinGet, My_list, List, [%My_ScriptName%] ahk_class AutoHotkeyGUI
- Loop, % My_list {
- IfEqual, My_guiid, % My_id:=My_list%A_Index%, Continue
- WinGet, My_pid, PID, ahk_id %My_id%
- WinClose, ahk_class AutoHotkey ahk_pid %My_pid%
- WinWaitClose, ahk_id %My_id%
- }
- DetectHiddenWindows, Off
- SetWorkingDir, % RegExReplace(My_ScriptName,"\\[^\\]*$")
- ;-----------------------
- Reload() {
- static My_ScriptName:=%True%
- Try {
- if My_ScriptName=
- return
- else if InStr(My_ScriptName,".exe")
- Run, "%My_ScriptName%"
- else
- Run, "%A_AhkPath%" "%My_ScriptName%"
- ExitApp
- }
- }
- ListLines, On
- ;-----------------------
- #NoEnv
- #NoTrayIcon
- #SingleInstance Force
- #Persistent
- ListLines Off
- ComObjError(False)
- Gui, +ToolWindow +MinimizeBox
- Gui, Color, White
- Gui, Font, Bold
- Gui, Show, x810 y400 h110 w210, MacroHS
- Gui, Add, GroupBox, w190 h95
- Gui, Add, Text, x20 y25 w50 h20, Usuario:
- Gui, Add, Edit, x80 y22 w80 h20 vusuario,
- Gui, Add, Text, x20 y51 w50 h20, Senha:
- Gui, Add, Edit, x80 y48 w80 h20 vsenha Password,
- Gui, Add, Button, x90 y75 w40 h20 section, Login
- Gui, Add, Button, x150 y75 w40 h20 gQuitter, Sair
- Gui, Add, Button, x170 y22 w20 h20 section, ?
- Gui, Show
- Return
- GuiEscape:
- Quitter:
- ExitApp
- Return
- Button?:
- Gui, Submit, NoHide
- MsgBox, 0, Vendas / Suport,MacroHS `nWhatsapp: +55 (85)9901-3957
- Return
- ButtonLogin:
- Gui, Submit, Hide
- if (usuario == "" || senha == ""){
- soundbeep
- MsgBox, 16, Login Usuario, Usuario ou Senha não informado !!
- ExitApp
- }
- HttpObj := ComObjCreate("WinHttp.WinHttpRequest.5.1")
- HttpObj.Open("GET", "http://heitor.photo/teste/macro/login.php?usuario=" usuario "&senha=" senha "&acao=ENTRAR", false)
- HttpObj.Send()
- Sleep 100
- Shared := HttpObj.ResponseText
- RegExMatch(Shared, "<status>(.*?)</status>", Status)
- RegExMatch(Shared, "<date>(.*?)</date>", Validade)
- RegExMatch(Shared, "<alert>(.*?)</alert>", Alerta)
- RegExMatch(Shared, "<msg>(.*?)</msg>", Menssagem)
- RegExMatch(Shared, "<location>(.*?)</location>", Localizacao)
- Status := RegExReplace(Status,"<.+?>")
- Validade := RegExReplace(Validade,"<.+?>")
- Alerta := RegExReplace(Alerta,"<.+?>")
- Menssagem := RegExReplace(Menssagem,"<.+?>")
- Localizacao := RegExReplace(Localizacao,"<.+?>")
- if (Status = "[LOGADO]"){
- soundbeep
- Gui, Hide
- MsgBox, 16, Login Usuario, Usuario Logado em outro Local !!
- ExitApp
- }
- else if (Status = "[ERRO]"){
- soundbeep
- Gui, Hide
- MsgBox, 16, Login Usuario, Usuario ou Senha Inválido !!
- ExitApp
- }
- else if (Status = "[SUSPENSO]"){
- soundbeep
- Gui, Hide
- MsgBox, 16, Login Usuario, Tempo de uso Expirado !!
- MsgBox, 0, Entre em contato,MacroHS `nWhatsapp: +55 (85)9901-3957
- ExitApp
- }
- else if (Status = "[ATIVO]"){
- if (Alerta = "ON"){
- MsgBox, 0, Alerta do Sistema, %Menssagem%
- }
- soundbeep
- Gui, Destroy
- IfExist, Settings.ini,{
- IniRead, Key1, Settings.ini, Settings, Suspender, %Key1%
- IniRead, ReadVal1, Settings.ini, Recoil, RecoilTiming, %ReadVal1%
- }Else{
- IniRead, Key1, Settings.ini, Settings, Suspender, F1
- IniWrite, %Key1%, Settings.ini, Settings, Suspender
- IniRead, SaveVal1, Settings.ini, Recoil, RecoilTiming, 1
- IniWrite, %SaveVal1%, Settings.ini, Recoil, RecoilTiming
- }
- Hotkey, %Key1%, ~$hkWrite
- Suspend
- Gui, Color, White, Font, Bold
- Gui, Font, Bold
- Gui, Add, Text, x15 y90 w200 h23 +0x200 +left, %usuario% - %Localizacao%
- Gui, Add, Text, x15 y15 w95 h20 +0x200 +left, Recoil Mouse:
- Gui, Add, ComboBox, x100 y17 w55 vRCT, %ReadVal1%||1|2|3|4|5|6|7|8|9|10
- Gui, Add, Text, x15 y55 w95 h20 +0x200 +left, Suspender:
- Gui, Add, DropDownList, x100 y57 w55 vSuspend, %Key1%||F1|F2|F3|F4|F5|F6|F7|F8|F9|F10
- Gui, Add, Button, gSair x180 y17 w60 h20, Sair
- Gui, Add, Button, gSaveVal x180 y57 w60 h20, Salvar
- Gui, Show, w262 h120, Expira %Validade%
- Return
- ~*$LButton::
- Loop
- {
- GetKeyState, state, LButton, P
- if state=u
- break
- Gui, Submit, nohide
- mouseXY(0,-RCT)
- sleep, 8
- }
- Return
- mouseXY(x,y)
- {
- DllCall("mouse_event",int,1,int,x,int,y,uint,0,uint,0)
- }
- Return
- ~$hkWrite:
- Suspend, Permit
- Suspend, Toggle
- Return
- SaveVal:
- IniDelete, Settings.ini, Settings, Suspender
- IniRead, Key1, Settings.ini, Settings, Suspender, %Suspend%
- IniWrite, %Key1%, Settings.ini, Settings, Suspender
- IniDelete, Settings.ini, Recoil, RecoilTiming
- IniRead, SaveVal1, Settings.ini, Recoil, RecoilTiming, %RCT%
- IniWrite, %SaveVal1%, Settings.ini, Recoil, RecoilTiming
- MsgBox, 0, MacroHS, Configurações Salvas !!
- goSub ~$hkWrite
- Return
- Sair:
- HttpObj := ComObjCreate("WinHttp.WinHttpRequest.5.1")
- HttpObj.Open("GET", "http://heitor.photo/teste/macro/login.php?usuario=" usuario "&senha=" senha "&acao=SAIR", false)
- HttpObj.Send()
- Gui, Hide
- soundbeep
- MsgBox, 0, MacroHS, Usuario %usuario% Deslogado
- ExitApp
- Return
- }
- else{
- soundbeep
- MsgBox, 16, Erro no Servidor !!, Entre em Contato `nMacroHS `nWhatsapp: +55 (85)9901-3957
- ExitApp
- }
- Return
- GuiClose:
- MsgBox, 0, MacroHS, Clique em Sair
- ExitApp
- #SingleInstance off
Add Comment
Please, Sign In to add comment