Originally Posted by Interest07
change the HPMPAutoPotCheck() function to this:
Code:
Func HPMPAutoPotCheck()
If IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_HP_FLAG_KEY, 0) = 1 Then
If GUICtrlRead($PERC_HP) < Int(IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_HP_PERC_KEY, 1)) Then
_SendMessage($HANDLE, 256, KEYCODE(IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_HP_KEY, 0)))
$HPTimer = TimerInit()
Endif
EndIf
If IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOTOP_FLAG_KEY, 0) = 1 Then
If GUICtrlRead($PERC_HP) < Int(IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOTOP_PERC_KEY, 1)) Then
_SendMessage($HANDLE, 256, KEYCODE(IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOTOP_KEY, 0)))
$HPTimer = TimerInit()
Endif
EndIf
If IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_MP_FLAG_KEY, 0) = 1 Then
If GUICtrlRead($PERC_MP) < Int(IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_MP_PERC_KEY, 1)) Then
_SendMessage($HANDLE, 256, KEYCODE(IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_MP_KEY, 0)))
$MPTimer = TimerInit()
Endif
EndIf
EndFunc
change the function SetLifeSupport to this:
Code:
Func SetLifeSupport()
Global $FORM_LIFESUPPORT = GUICreate("Life Support", 621, 250, -1, -1, -1, -1, $PROPHETBOT)
GUISetOnEvent($GUI_EVENT_CLOSE, "WindowLifeSupportCloseClicked")
GUISwitch($FORM_LIFESUPPORT)
GUISetBkColor(0x000000)
Global $BUTTON_SAVE_AUTOPOTREST = GUICtrlCreateButton("Save", 389, 225, 80, 18)
GUICtrlSetOnEvent(-1, "SaveAutoPotRest")
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBKColor(-1, 0x000000)
;Auto Rest Section
;--------------------------------------------------------------------------------
Global $CHECK_AUTO_REST_HP, $CHECK_AUTO_REST_MP, $SLIDE_AUTO_REST_HP, $SLIDE_AUTO_REST_MP, $REST_KEY
Global $GROUP_AUTO_REST = GUICtrlCreateGroup("Automatic Rest", 5, 5, 160, 215)
GUICtrlSetOnEvent(-1, "SaveAutoPotRest")
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($GROUP_AUTO_REST), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
GUICtrlSetTip(-1, "Bot Status")
;Auto-Rest HP
Global $CHECK_AUTO_REST_HP = GUICtrlCreateCheckbox("Restore HP", 20, 25, 90, 20)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($CHECK_AUTO_REST_HP), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0x000000)
If IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOREST_HP_KEY, "0") = 1 Then
$STATE = $GUI_CHECKED
Else
$STATE = $GUI_UNCHECKED
EndIf
GUICtrlSetState(-1, $STATE)
Global $SLIDE_AUTO_REST_HP = GUICtrlCreateSlider(25, 50, 100, 20)
GUICtrlSetData(-1, IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOREST_HP_PERC_KEY, "0"))
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetLimit(-1, 100, 0)
GUICtrlCreateLabel("0 50 100% HP", 30, 70, 120, 20)
GUICtrlSetColor(-1, 0xC0C0C0)
;End Auto-Rest HP
;Auto-Rest MP
Global $CHECK_AUTO_REST_MP = GUICtrlCreateCheckbox("Restore MP", 20, 100, 90, 20)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($CHECK_AUTO_REST_MP), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, 0x000000)
If IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOREST_MP_KEY, "0") = 1 Then
GUICtrlSetState(-1, $GUI_CHECKED)
Else
GUICtrlSetState(-1, $GUI_UNCHECKED)
EndIf
Global $SLIDE_AUTO_REST_MP = GUICtrlCreateSlider(25, 130, 100, 20)
GUICtrlSetData(-1, IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOREST_MP_PERC_KEY, "0"))
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetLimit(-1, 100, 0)
GUICtrlCreateLabel("0 50 100% MP", 30, 150, 120, 20)
GUICtrlSetColor(-1, 0xC0C0C0)
;End Auto-Rest MP
;Auto-Rest Key
GUICtrlCreateLabel("Key:", 20, 180, 50, 20)
GUICtrlSetColor(-1, 0xC0C0C0)
Global $REST_KEY = GUICtrlCreateCombo(IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOREST_KEY, "--"), 60, 180, 50, 20)
GUICtrlSetData(-1, $KEYCODE , "")
;End Auto-Rest Key
;--------------------------------------------------------------------------------
;End Auto Rest Section
;Auto Loot Section
;--------------------------------------------------------------------------------
Global $CHECK_AUTO_PICK, $AUTO_PICK_TIMES, $AUTO_PICK_KEY
Global $GROUP_AUTO_PICK = GUICtrlCreateGroup("Automatic Get Loot", 170, 5, 300, 50)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($GROUP_AUTO_PICK), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
Global $CHECK_AUTO_PICK = GUICtrlCreateCheckbox("Auto Loot", 185, 25, 80, 20)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($CHECK_AUTO_PICK), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x800080)
GUICtrlSetBkColor(-1, 0x000000)
If IniRead($SOFTWARE_CONFIG, $CFG_LOOT_ROOT_KEY, $CFG_LOOT_FLAG_KEY, "0") = 1 Then
GUICtrlSetState(-1, $GUI_CHECKED)
Else
GUICtrlSetState(-1, $GUI_UNCHECKED)
EndIf
GUICtrlCreateLabel("Key:", 275, 28, 40, 20)
GUICtrlSetColor(-1, 0xC0C0C0)
Global $AUTO_PICK_KEY = GUICtrlCreateCombo("", 305, 25, 50, 50)
GUICtrlSetData(-1, $KEYCODE , IniRead($SOFTWARE_CONFIG, $CFG_LOOT_ROOT_KEY, $CFG_LOOT_KEY, "--"))
GUICtrlCreateLabel("Times:", 360, 28, 40, 20)
GUICtrlSetColor(-1, 0xC0C0C0)
Global $AUTO_PICK_TIMES = GUICtrlCreateInput("", 400, 26, 50, 18)
GUICtrlSetData(-1, IniRead($SOFTWARE_CONFIG, $CFG_LOOT_ROOT_KEY, $CFG_LOOT_TIMES_KEY, "1"))
;--------------------------------------------------------------------------------
;End Auto Loot Section
;Auto Pot Section
;--------------------------------------------------------------------------------
Global $CHECK_AUTOPOT_FLAG_HP, $CHECK_AUTOPOT_FLAG_MP, $SLIDE_AUTOPOT_HP, $SLIDE_AUTOPOT_MP, $AUTOPOT_HP_PERC, $AUTOPOT_MP_PERC
Global $AUTOPOT_HP_KEY, $AUTOPOT_MP_KEY
Global $CHECK_RES_ON_DIE
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
Global $GROUP_AUTOPOT = GUICtrlCreateGroup("Automatic Pot", 170, 60, 445, 160)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($GROUP_AUTOPOT), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
;Auto-Pot HP
Global $CHECK_AUTOPOT_FLAG_HP = GUICtrlCreateCheckbox("Auto-Pot HP", 185, 85, 90, 20)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($CHECK_AUTOPOT_FLAG_HP), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0x000000)
If IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_HP_FLAG_KEY, "0") = 1 Then
$STATE = $GUI_CHECKED
Else
$STATE = $GUI_UNCHECKED
EndIf
GUICtrlSetState(-1, $STATE)
Global $SLIDE_AUTOPOT_HP = GUICtrlCreateSlider(190, 110, 100, 20)
GUICtrlSetData(-1, IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_HP_PERC_KEY, "0"))
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetLimit(-1, 100, 0)
GUICtrlCreateLabel("0 50 100% HP", 195, 130, 120, 20)
GUICtrlSetColor(-1, 0xC0C0C0)
GUICtrlCreateLabel("Key:", 185, 157, 50, 20)
GUICtrlSetColor(-1, 0xC0C0C0)
Global $AUTOPOT_HP_KEY = GUICtrlCreateCombo(IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_HP_KEY, "--"), 215, 155, 50, 20)
GUICtrlSetData(-1, $KEYCODE , "")
;End Auto-Pot HP
;Auto-Pot MP
Global $CHECK_AUTOPOT_FLAG_MP = GUICtrlCreateCheckbox("Auto-Pot MP", 330, 85, 90, 20)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($CHECK_AUTOPOT_FLAG_MP), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, 0x000000)
If IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_MP_FLAG_KEY, "0") = 1 Then
GUICtrlSetState(-1, $GUI_CHECKED)
Else
GUICtrlSetState(-1, $GUI_UNCHECKED)
EndIf
Global $SLIDE_AUTOPOT_MP = GUICtrlCreateSlider(335, 110, 100, 20)
GUICtrlSetData(-1, IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_MP_PERC_KEY, "0"))
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetLimit(-1, 100, 0)
GUICtrlCreateLabel("0 50 100% MP", 340, 130, 120, 20)
GUICtrlSetColor(-1, 0xC0C0C0)
GUICtrlCreateLabel("Key:", 330, 157, 50, 20)
GUICtrlSetColor(-1, 0xC0C0C0)
Global $AUTOPOT_MP_KEY = GUICtrlCreateCombo(IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_MP_KEY, "--"), 360, 155, 50, 20)
GUICtrlSetData(-1, $KEYCODE, "")
;End Auto-Pot MP
;AutoToP
Global $AUTOTOP_KEY, $CHECK_AUTOTOP_FLAG, $SLIDE_AUTOTOP, $AUTOTOP_PERC, $CFG_HEAL_AUTOTOP_FLAG_KEY = $NAME & "--" & "AutoToPFlag", $CFG_HEAL_AUTOTOP_PERC_KEY = $NAME & "--" & "AutoToPPerc", $CFG_HEAL_AUTOTOP_KEY = $NAME & "--" & "AutoToPKey"
Global $CHECK_AUTOTOP_FLAG = GUICtrlCreateCheckbox("Auto-ToP", 475, 85, 90, 20) ;+145
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($CHECK_AUTOTOP_FLAG), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
If IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOTOP_FLAG_KEY, "0") = 1 Then
GUICtrlSetState(-1, $GUI_CHECKED)
Else
GUICtrlSetState(-1, $GUI_UNCHECKED)
EndIf
Global $SLIDE_AUTOTOP = GUICtrlCreateSlider(480, 110, 100, 20)
GUICtrlSetData(-1, IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOTOP_PERC_KEY, "0"))
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetLimit(-1, 100, 0)
GUICtrlCreateLabel("0 50 100% HP", 485, 130, 120, 20)
GUICtrlSetColor(-1, 0xC0C0C0)
GUICtrlCreateLabel("Key:", 475, 157, 50, 20)
GUICtrlSetColor(-1, 0xC0C0C0)
Global $AUTOTOP_KEY = GUICtrlCreateCombo(IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOTOP_KEY, "--"), 505, 155, 50, 20)
GUICtrlSetData(-1, $KEYCODE, "")
;End AutoToP
;Res On Die
Global $CHECK_RES_ON_DIE = GUICtrlCreateCheckbox("Res On Die", 185, 190, 90, 20)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($CHECK_RES_ON_DIE), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFF00)
GUICtrlSetBkColor(-1, 0x000000)
If IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_RES_ON_DIE_KEY, "0") = 1 Then
GUICtrlSetState(-1, $GUI_CHECKED)
Else
GUICtrlSetState(-1, $GUI_UNCHECKED)
EndIf
Global $BUTTON_SETRAIL = GUICtrlCreateButton("Set Rail", 280, 191, 80, 18)
GUICtrlSetOnEvent(-1, "SetRailList")
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBKColor(-1, 0x000000)
Global $BUTTON_TESTRAIL = GUICtrlCreateButton("Test Rail", 370, 191, 80, 18)
GUICtrlSetOnEvent(-1, "RunRail")
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBKColor(-1, 0x000000)
;End Res On Die
;Move To Corpse
Global $CHECK_MOVE_TO_CORPSE = GUICtrlCreateCheckbox("Move To Corpse", 20, 225, 120, 20)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($CHECK_MOVE_TO_CORPSE), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFF00)
GUICtrlSetBkColor(-1, 0x000000)
If IniRead($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_MOVE_TO_CORPSE_KEY, "0") = 1 Then
GUICtrlSetState(-1, $GUI_CHECKED)
Else
GUICtrlSetState(-1, $GUI_UNCHECKED)
EndIf
;Move To Corpse
;--------------------------------------------------------------------------------
;End Auto Pot Section
GUISetState(@SW_SHOW, $FORM_LIFESUPPORT)
EndFunc
and change the saveAutoPotRest function to this:
Code:
Func SaveAutoPotRest()
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOREST_HP_KEY, GUICtrlRead($CHECK_AUTO_REST_HP))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOREST_HP_PERC_KEY, GUICtrlRead($SLIDE_AUTO_REST_HP))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOREST_MP_KEY, GUICtrlRead($CHECK_AUTO_REST_MP))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOREST_MP_PERC_KEY, GUICtrlRead($SLIDE_AUTO_REST_MP))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOREST_KEY, GUICtrlRead($REST_KEY))
IniWrite($SOFTWARE_CONFIG, $CFG_LOOT_ROOT_KEY, $CFG_LOOT_FLAG_KEY, GUICtrlRead($CHECK_AUTO_PICK))
IniWrite($SOFTWARE_CONFIG, $CFG_LOOT_ROOT_KEY, $CFG_LOOT_KEY, GUICtrlRead($AUTO_PICK_KEY))
IniWrite($SOFTWARE_CONFIG, $CFG_LOOT_ROOT_KEY, $CFG_LOOT_TIMES_KEY, GUICtrlRead($AUTO_PICK_TIMES))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_HP_FLAG_KEY, GUICtrlRead($CHECK_AUTOPOT_FLAG_HP))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_HP_PERC_KEY, GUICtrlRead($SLIDE_AUTOPOT_HP))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_MP_FLAG_KEY, GUICtrlRead($CHECK_AUTOPOT_FLAG_MP))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_MP_PERC_KEY, GUICtrlRead($SLIDE_AUTOPOT_MP))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_HP_KEY, GUICtrlRead($AUTOPOT_HP_KEY))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOPOT_MP_KEY, GUICtrlRead($AUTOPOT_MP_KEY))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_RES_ON_DIE_KEY, GUICtrlRead($CHECK_RES_ON_DIE))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_MOVE_TO_CORPSE_KEY, GUICtrlRead($CHECK_MOVE_TO_CORPSE))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOTOP_FLAG_KEY, GUICtrlRead($CHECK_AUTOTOP_FLAG))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOTOP_PERC_KEY, GUICtrlRead($SLIDE_AUTOTOP))
IniWrite($SOFTWARE_CONFIG, $CFG_HEAL_ROOT_KEY, $CFG_HEAL_AUTOTOP_KEY, GUICtrlRead($AUTOTOP_KEY))
GUIDelete($FORM_LIFESUPPORT)
EndFunc ;==>SaveAutoPotRest
that should make it less like a quick fix :) (It would add a slider to the autopot form etc.)
|