So I used 'Koda' to make the GUI real quick.
I've got 2 basic functions to check my characters HP and MP and use potions if needed. I've got no idea how to combine this into the script.
I'd like to be able to click the check box on either/both and then click start to begin the script, and pause to... well, pause it.
I've spent the past 3 hours googling and testing things, but nothing explains HOW they do what they do, so I'm lost on how to actually do it.
Any help is appreciated.
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 250, 94, 192, 124)
$Button1 = GUICtrlCreateButton("Start", 168, 40, 75, 25)
$Button2 = GUICtrlCreateButton("Pause", 168, 8, 75, 25)
$Checkbox1 = GUICtrlCreateCheckbox("Enable auto-HP potions", 8, 8, 137, 17)
$Checkbox2 = GUICtrlCreateCheckbox("Enable auto-MP potions", 8, 40, 129, 17)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
;=====Functions=====
Func UseHP()
$coord = PixelSearch(312, 771, 324, 776, 0xDD0033) ;define where you want to search on your HP bar
If $coord = 0 Then
Send("{ALT}") ;This is the macro to use an HP potion
Sleep(1000)
Else
Send("{LCTRL}") ;This is what happens when your HP is fine
Sleep(1000)
EndIf
EndFunc ;==>UseHP
Func UseMP()
$coord2 = PixelSearch(485, 771, 506, 776, 0x22BBFF) ;define where you want to search on your MP bar
If $coord2 = 0 Then
Send("{1}") ;This is the macro to use an MP potion
Sleep(1000)
Else
Send("{LCTRL}") ;This is what happens when your MP is fine
Sleep(1000)
EndIf
EndFunc ;==>UseMP
;=====End Functions=====






