thank you for your effort, but it won't stop healing when the [ ] is unchecked.
I've figured it out now, compiled it to exe and it works as expected, when checkbox is checked [v] EP heals, when unchecked EP stops healing , and exit button also works
Now only need to add toggle button (Ctrl-F10), or .ini file to customize active window name for EP and key for healing. Not that important though, just for learning purpose. If anyone can help with that please reply in this thread.
btw thanks everyone for helping :)
I've figured it out now, compiled it to exe and it works as expected, when checkbox is checked [v] EP heals, when unchecked EP stops healing , and exit button also works
Code:
#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>
; GUI
GuiCreate("AutoHeal", 200, 100) ; create Gui Window 200x100 pixels
GuiSetIcon(@SystemDir & "\AutohealICON.bmp", 0) ; set program icon
; CHECKBOX
$Checkname="AutoHeal On/Off (Ctrl-F10)" ;name to display at GUI
$checkbox=GuiCtrlCreateCheckbox($Checkname, 10, 30, 150, 20) ;create Checkbox
; GUI MESSAGE LOOP
GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
$healstate = GuiCtrlRead($CheckBox) ; read checkbox value (checked 1 or unchecked 0)
If $healstate=1 then Autoheal() ; checkbox is checked and execute keypress "6" continuously
If $healstate=0 then exitloop ; checkbox is unchecked and stop pressing "6"
WEnd
FUNC autoheal()
ControlSend("Element Client","","","6") ; send keypress 6 to window "Element Client"
EndFunc
btw thanks everyone for helping :)