muteanddeaf Posted April 6, 2009 Share Posted April 6, 2009 this my 1st post so please dont flame me I made a script for perfect world PH (its a bot) and im hoping you guys could help and give me some advice how can I clean and improve my code Im also looking for other ways to send keys in an active and inactive window without messing up the keyboard and some good and easy tutorials for win api for games specially for making bots because i have no idea what is win api and what can win api can do I would be very very greatful if someone could point me in the right direction and tnx in advance.... perfect world bot with ini Nekolangot.rar expandcollapse popup;========================================== ;Nekolangot Perfect World PH Bot ;ver 1.0b ;muteanddeaf@gmail.com ;www.codeme.greatnow.com ;========================================== #include <GUIConstants.au3> #include <Timers.au3> #include <NomadMemory.au3> HotKeySet("{F9}","pexit") HotKeySet("{F11}","skillatak") HotKeySet("{Pause}","stopbot") HotKeySet("{F10}","inisave") HotKeySet("{insert}","getmobid") HotKeySet("{pgdn}","target") HotKeySet("{end}","resetmob") ;Variables Initailization global $Data, $minmpPointer, $maxmpPointer,$minhpPointer, $maxhpPointer;memory variables global $hpminData,$hpmaxData,$mpminData,$mpmaxData Global $mob, $Pointer_1, $targetPointer,$cancel = 0, $true = 1 global $buffTimeDif1,$bufftime_hours1,$buffTimeDif2,$bufftime_hours2,$buffTimeDif3,$bufftime_hours3,$pet1Data global $x = 0, $z = 0, $y = 0, $a = 0, $b = 0;counters... global $mobid[9] global $skilltimer[5] $skilltimer[0] = TimerInit() $skilltimer[1] = TimerInit() $skilltimer[2] = TimerInit() $skilltimer[3] = TimerInit() $skilltimer[4] = TimerInit() global $bufftimer[5] $bufftimer[0] = TimerInit() $bufftimer[1] = TimerInit() $bufftimer[2] = TimerInit() $bufftimer[3] = TimerInit() $bufftimer[4] = TimerInit() global $lcb global $skillCombo[5] global $skillCheckboxstate[5] global $skillCheckbox[5] global $scb[5] global $buffcombo[5] global $buffCheckboxstate[5] global $buffCheckbox[5] global $bcb[5] global $buff_timer[5] global $buffdelay[5] global $petheckboxstate[3] global $petCheckbox[3] global $pcb[2] global $skill_checkbox[5],$buff_checkbox[5],$cbc = 0 $skill_checkbox[0] = "skill_checkbox1" $skill_checkbox[1] = "skill_checkbox2" $skill_checkbox[2] = "skill_checkbox3" $skill_checkbox[3] = "skill_checkbox4" $skill_checkbox[4] = "skill_checkbox5" $buff_checkbox[0] = "buff_checkbox1" $buff_checkbox[1] = "buff_checkbox2" $buff_checkbox[2] = "buff_checkbox3" $buff_checkbox[3] = "buff_checkbox4" $buff_checkbox[4] = "buff_checkbox5" dim $skillflist = "1|2|3|4|5|6|F1|F2|F3|F4|F5|F6|F7|F8" Dim $percentlist = "5|10|15|20|25|30|35|40|45|50|55|60|65|70|75|80|85|90|95|100" $configloc = (@ScriptDir & "\config.ini");ini config location $targetOffset = IniRead($configloc, "HP_MP_offsets", "target_offset", "NotFound") $StaticAddress = IniRead($configloc, "HP_MP_offsets", "staticadd", "NotFound") $Offset1 = IniRead($configloc, "HP_MP_offsets", "pointer1", "NotFound") $Offsetminhp = IniRead($configloc, "HP_MP_offsets", "minhppointer", "NotFound") $Offsetmaxhp = IniRead($configloc, "HP_MP_offsets", "maxhppointer", "NotFound") $Offsetminmp = IniRead($configloc, "HP_MP_offsets", "minmppointer", "NotFound") $Offsetmaxmp = IniRead($configloc, "HP_MP_offsets", "maxmppointer", "NotFound") $pet1offset2 = IniRead($configloc, "petoffset1", "pet1offset2", "NotFound") $pet1offset3 = IniRead($configloc, "petoffset1", "pet1offset3", "NotFound") $pet2offset3 = IniRead($configloc, "petoffset1", "pet2offset3", "NotFound") $pet1offset4 = IniRead($configloc, "petoffset1", "pet1offset4", "NotFound") $iniskill1 = IniRead($configloc, "skill_key", "skill1", "NotFound") $iniskill2 = IniRead($configloc, "skill_key", "skill2", "NotFound") $iniskill3 = IniRead($configloc, "skill_key", "skill3", "NotFound") $iniskill4 = IniRead($configloc, "skill_key", "skill4", "NotFound") $iniskill5 = IniRead($configloc, "skill_key", "skill5", "NotFound") $iniskilldelay1 = IniRead($configloc, "skill_delay_key", "skill_delay_key1", "NotFound") $iniskilldelay2 = IniRead($configloc, "skill_delay_key", "skill_delay_key2", "NotFound") $iniskilldelay3 = IniRead($configloc, "skill_delay_key", "skill_delay_key3", "NotFound") $iniskilldelay4 = IniRead($configloc, "skill_delay_key", "skill_delay_key4", "NotFound") $iniskilldelay5 = IniRead($configloc, "skill_delay_key", "skill_delay_key5", "NotFound") $iniHP_key = IniRead($configloc, "HP_MP_keys", "HP_key", "NotFound") $iniMP_key = IniRead($configloc, "HP_MP_keys", "MP_key", "NotFound") $iniHP_percent = IniRead($configloc, "HP_MP_percent", "HP_percent", "NotFound") $iniMP_percent = IniRead($configloc, "HP_MP_percent", "MP_percent", "NotFound") $inilootkey = IniRead($configloc, "loot", "loot_key", "NotFound") $iniloottimes = IniRead($configloc, "loot", "loot_times", "NotFound") $inibuffskey1 = IniRead($configloc, "buffs", "buffskey1", "NotFound") $inibuffskey2 = IniRead($configloc, "buffs", "buffskey2", "NotFound") $inibuffskey3 = IniRead($configloc, "buffs", "buffskey3", "NotFound") $inibuffskey4 = IniRead($configloc, "buffs", "buffskey4", "NotFound") $inibuffskey5 = IniRead($configloc, "buffs", "buffskey5", "NotFound") $inibufftimer1 = IniRead($configloc, "buffs", "timer1", "NotFound") $inibufftimer2 = IniRead($configloc, "buffs", "timer2", "NotFound") $inibufftimer3 = IniRead($configloc, "buffs", "timer3", "NotFound") $inibufftimer4 = IniRead($configloc, "buffs", "timer4", "NotFound") $inibufftimer5 = IniRead($configloc, "buffs", "timer5", "NotFound") $inibuffdelay1 = IniRead($configloc, "buffs", "buffdelay1", "NotFound") $inibuffdelay2 = IniRead($configloc, "buffs", "buffdelay2", "NotFound") $inibuffdelay3 = IniRead($configloc, "buffs", "buffdelay3", "NotFound") $inibuffdelay4 = IniRead($configloc, "buffs", "buffdelay4", "NotFound") $inibuffdelay5 = IniRead($configloc, "buffs", "buffdelay5", "NotFound") $iniskillCheckbox1 = IniRead($configloc, "checkbox_state", "skill_checkbox1", "NotFound") $iniskillCheckbox2 = IniRead($configloc, "checkbox_state", "skill_checkbox2", "NotFound") $iniskillCheckbox3 = IniRead($configloc, "checkbox_state", "skill_checkbox3", "NotFound") $iniskillCheckbox4 = IniRead($configloc, "checkbox_state", "skill_checkbox4", "NotFound") $iniskillCheckbox5 = IniRead($configloc, "checkbox_state", "skill_checkbox5", "NotFound") $inibuffcheckbox1 = IniRead($configloc, "checkbox_state", "buff_checkbox1", "NotFound") $inibuffcheckbox2 = IniRead($configloc, "checkbox_state", "buff_checkbox2", "NotFound") $inibuffcheckbox3 = IniRead($configloc, "checkbox_state", "buff_checkbox3", "NotFound") $inibuffcheckbox4 = IniRead($configloc, "checkbox_state", "buff_checkbox4", "NotFound") $inibuffcheckbox5 = IniRead($configloc, "checkbox_state", "buff_checkbox5", "NotFound") $iniloot_checkbox = IniRead($configloc, "checkbox_state", "loot_checkbox", "NotFound") $inipethealtkey = IniRead($configloc, "pets", "pethealkey", "NotFound") $inipethp1 = IniRead($configloc, "pets", "pets_hp1", "NotFound") $inipethp2 = IniRead($configloc, "pets", "pets_hp2", "NotFound") $windowname = IniRead($configloc, "client_name", "clientwindowname", "NotFound") ;End of Variables Initailization ;GUI Start $MainForm = GUICreate("Nekolangot", 410, 355, -1, -1) $Clientname = GUICtrlCreateInput($windowname, 72, 8, 113, 21) GUICtrlCreateLabel("Client Name:", 8, 8, 61, 17) ;memory read $ProcessID = WinGetProcess(GUICtrlRead($Clientname)) $DllHandle = _MemoryOpen($ProcessID) $Data = _MemoryRead($StaticAddress, $DllHandle) $Pointer_1 = '0x' & hex($Data + $Offset1) $Data = _MemoryRead($Pointer_1, $DllHandle) ;HP_MP groups GUICtrlCreateGroup("HP/MP", 192, 0, 217, 65) $HPskill = GUICtrlCreateCombo("", 304, 16, 41, 25) GUICtrlSetData(-1,$skillflist,$iniHP_key) $MPskill = GUICtrlCreateCombo("", 304, 40, 41, 25) GUICtrlSetData(-1,$skillflist,$iniMP_key) $guiHPpercent = GUICtrlCreateCombo("", 352, 16, 41, 25) GUICtrlSetData(-1,$percentlist,$iniHP_percent) $guiMPpercent = GUICtrlCreateCombo("", 352, 40, 41, 25) GUICtrlSetData(-1,$percentlist,$iniMP_percent) GUICtrlCreateLabel("%", 392, 16, 12, 17) GUICtrlCreateLabel("%", 392, 40, 12, 17) ;Skill Combo boxes groups GUICtrlCreateGroup("SKILLS", 0, 32, 97, 137) $skillCombo[0] = GUICtrlCreateCombo("", 24, 48, 65, 25) GUICtrlSetData(-1,$skillflist ,$iniskill1) $skillCombo[1] = GUICtrlCreateCombo("", 24, 72, 65, 25) GUICtrlSetData(-1,$skillflist ,$iniskill2) $skillCombo[2] = GUICtrlCreateCombo("",24, 96, 65, 25) GUICtrlSetData(-1,$skillflist ,$iniskill3) $skillCombo[3] = GUICtrlCreateCombo("",24, 120, 65, 25) GUICtrlSetData(-1,$skillflist ,$iniskill4) $skillCombo[4] = GUICtrlCreateCombo("",24, 144, 65, 25) GUICtrlSetData(-1,$skillflist ,$iniskill5) $skillCheckbox[0] = GUICtrlCreateCheckbox("", 8, 48, 17, 17) $skillCheckboxstate[0] = GuiCtrlSetState($iniskillCheckbox1, $GUI_CHECKED) $skillCheckbox[1] = GUICtrlCreateCheckbox("", 8, 72, 17, 17) $skillCheckboxstate[1] = GuiCtrlSetState($iniskillCheckbox2, $GUI_CHECKED) $skillCheckbox[2] = GUICtrlCreateCheckbox("", 8, 96, 17, 17) $skillCheckboxstate[2] = GuiCtrlSetState($iniskillCheckbox3, $GUI_CHECKED) $skillCheckbox[3] = GUICtrlCreateCheckbox("", 8, 120, 17, 17) $skillCheckboxstate[3] = GuiCtrlSetState($iniskillCheckbox4, $GUI_CHECKED) $skillCheckbox[4] = GUICtrlCreateCheckbox("", 8, 144, 17, 17) $skillCheckboxstate[4] = GuiCtrlSetState($iniskillCheckbox5, $GUI_CHECKED) ;Skill delay group GUICtrlCreateGroup("SKILL DELAY",104, 32, 81, 137) global $skilldelay[5] $skilldelay[0] = GUICtrlCreateInput($iniskilldelay1, 112, 48, 65, 21) $skilldelay[1] = GUICtrlCreateInput($iniskilldelay2, 112, 72, 65, 21) $skilldelay[2] = GUICtrlCreateInput($iniskilldelay3, 112, 96, 65, 21) $skilldelay[3] = GUICtrlCreateInput($iniskilldelay4, 112, 120, 65, 21) $skilldelay[4] = GUICtrlCreateInput($iniskilldelay5, 112, 144, 65, 21) ;loot Group GUICtrlCreateGroup("LOOT", 0, 168, 185, 49) $lootcombo = GUICtrlCreateCombo("", 24, 184, 65, 25) GUICtrlSetData(-1,$skillflist,$inilootkey) $loottimes = GUICtrlCreateInput($iniloottimes, 104, 184, 65, 21) $lootCheckbox = GUICtrlCreateCheckbox("", 8, 184, 17, 17) GuiCtrlSetState($iniloot_checkbox, $GUI_CHECKED) ;Buff Combo Box Groups $buffgroups = GUICtrlCreateGroup("Buffs", 0, 216, 97, 137) $buffcombo[0] = GUICtrlCreateCombo("", 24, 232, 65, 25) GUICtrlSetData(-1,$skillflist,$inibuffskey1) $buffcombo[1] = GUICtrlCreateCombo("", 24, 256, 65, 25) GUICtrlSetData(-1,$skillflist,$inibuffskey2) $buffcombo[2] = GUICtrlCreateCombo("", 24, 280, 65, 25) GUICtrlSetData(-1,$skillflist,$inibuffskey3) $buffcombo[3] = GUICtrlCreateCombo("", 24, 304, 65, 25) GUICtrlSetData(-1,$skillflist,$inibuffskey4) $buffcombo[4] = GUICtrlCreateCombo("", 24, 328, 65, 25) GUICtrlSetData(-1,$skillflist,$inibuffskey5) $buffCheckbox[0] = GUICtrlCreateCheckbox("", 8, 232, 17, 17) $buffCheckboxstate[0] = GuiCtrlSetState($inibuffcheckbox1, $GUI_CHECKED) $buffCheckbox[1] = GUICtrlCreateCheckbox("", 8, 256, 17, 17) $buffCheckboxstate[1] = GuiCtrlSetState($inibuffcheckbox2, $GUI_CHECKED) $buffCheckbox[2] = GUICtrlCreateCheckbox("", 8, 280, 17, 17) $buffCheckboxstate[2] = GuiCtrlSetState($inibuffcheckbox3, $GUI_CHECKED) $buffCheckbox[3] = GUICtrlCreateCheckbox("", 8, 304, 17, 17) $buffCheckboxstate[3] = GuiCtrlSetState($inibuffcheckbox4, $GUI_CHECKED) $buffCheckbox[4] = GUICtrlCreateCheckbox("", 8, 328, 17, 17) $buffCheckboxstate[4] = GuiCtrlSetState($inibuffcheckbox5, $GUI_CHECKED) ;Buff Timer Groups $Bufftimergroups = GUICtrlCreateGroup("Timer___Delay", 96, 216, 89, 137) $buff_timer[0] = GUICtrlCreateInput($inibufftimer1, 106, 229, 33, 21) $buff_timer[1] = GUICtrlCreateInput($inibufftimer2, 106, 253, 33, 21) $buff_timer[2] = GUICtrlCreateInput($inibufftimer3, 106, 277, 33, 21) $buff_timer[3] = GUICtrlCreateInput($inibufftimer4, 107, 301, 33, 21) $buff_timer[4] = GUICtrlCreateInput($inibufftimer5, 107, 323, 33, 21) $buffdelay[0] = GUICtrlCreateInput($inibuffdelay1, 146, 229, 33, 21) $buffdelay[1] = GUICtrlCreateInput($inibuffdelay2, 146, 253, 33, 21) $buffdelay[2] = GUICtrlCreateInput($inibuffdelay3, 146, 277, 33, 21) $buffdelay[3] = GUICtrlCreateInput($inibuffdelay4, 148, 301, 33, 21) $buffdelay[4] = GUICtrlCreateInput($inibuffdelay4, 149, 325, 33, 21) ;Pet Groups $petgroup = GUICtrlCreateGroup("YJ_Pets", 192, 64, 129, 89) $pethealcombo = GUICtrlCreateCombo("", 200, 80, 113, 25) GUICtrlSetData(-1,$skillflist,$inipethealtkey) $pethp1 = GUICtrlCreateInput($inipethp1, 240, 104, 49, 21) $pethp2 = GUICtrlCreateInput($inipethp2, 240, 128, 49, 21) $inipetcheckbox1 = IniRead($configloc, "checkbox_state", "pet_checkbox1", "NotFound") $inipetcheckbox2 = IniRead($configloc, "checkbox_state", "pet_checkbox2", "NotFound") $petCheckbox[0] = GUICtrlCreateCheckbox("", 296, 104, 17, 17) $petheckboxstate[0] = GuiCtrlSetState($inipetcheckbox1, $GUI_CHECKED) $petCheckbox[1] = GUICtrlCreateCheckbox("", 296, 128, 17, 17) $petheckboxstate[1] = GuiCtrlSetState($inipetcheckbox2, $GUI_CHECKED) $Label19 = GUICtrlCreateLabel("F9 = Exit Program", 192, 160, 212, 17) $Label11 = GUICtrlCreateLabel("Pause/Break = Stop Bot", 192, 184, 210, 17) $Label12 = GUICtrlCreateLabel("Pagedown = Start Bot", 192, 208, 210, 17) $Label13 = GUICtrlCreateLabel("Insert = getmobid/insert mob to the list", 192, 232, 210, 17) $Label14 = GUICtrlCreateLabel("End = Delete Mob list", 192, 256, 210, 17) $Label15 = GUICtrlCreateLabel("F10 = save", 192, 280, 210, 17) GUISetState(@SW_SHOW) ;END of GUI loadmobs() while 1 ;main LOOP; HPMPmemread() checkboxcheckstate() readpetHP() wend ;Functions starts here Func skillatak() checkboxcheckstate() local $TimeDif[5],$time_hours[5],$ct=0,$st=0 For $ct = 0 to 4 Step +1 $TimeDif[$ct] = TimerDiff($skilltimer[$ct]) $time_hours[$ct] = Int($TimeDif[$ct] / 1000) Next For $st = 0 to 4 Step +1 if $scb[$st] = 1 Then if $time_hours[$st] >= GUICtrlRead($skilldelay[$st]) Then ControlSend ( GUICtrlRead($Clientname), "", "", "{" & GUICtrlRead($skillCombo[$st]) & " 1}") $skilltimer[$st] = TimerInit() EndIf EndIf Next HPMPmemread() autoHP() autoMP() baps() readpetHP() EndFunc ;Auto baps Function Func baps() local $TimeDif[5],$time_hours[5],$ct=0,$st=0 For $ct = 0 to 4 Step +1 $TimeDif[$ct] = TimerDiff($bufftimer[$ct]) $time_hours[$ct] = Int($TimeDif[$ct] / 1000) Next For $st = 0 to 4 Step +1 if $bcb[$st] = 1 Then if $time_hours[$st] >= GUICtrlRead($buff_timer[$st]) Then ControlSend ( GUICtrlRead($Clientname), "", "", "{" & GUICtrlRead($buffcombo[$st]) & " 1}") $skilldelay[$st] = TimerInit() sleep (GUICtrlRead($buffdelay[$st])) EndIf EndIf Next EndFunc ;HP and MP memory read func HPMPmemread() ;Min HP memory read $minhpPointer = '0x' & hex($Data + $Offsetminhp) $hpminData = _MemoryRead($minhpPointer, $DllHandle) ;Max HP memory read $maxhpPointer = '0x' & hex($Data + $Offsetmaxhp) $hpmaxData = _MemoryRead($maxhpPointer, $DllHandle) ;Min MP memory read $minmpPointer = '0x' & hex($Data + $Offsetminmp) $mpminData = _MemoryRead($minmpPointer, $DllHandle) ;Max MP memory read $maxmpPointer = '0x' & hex($Data + $Offsetmaxmp) $mpmaxData = _MemoryRead($maxmpPointer, $DllHandle) GUICtrlCreateLabel($hpminData, 200, 16, 41, 17) GUICtrlCreateLabel($hpmaxData, 256, 16, 44, 17) GUICtrlCreateLabel($mpminData, 200, 40, 42, 17) GUICtrlCreateLabel($mpmaxData, 256, 40, 45, 17) endfunc ;read pet HP Functions func readpetHP() local $pet2Data $petData = _MemoryRead($StaticAddress, $DllHandle) $pet1Pointer_1 = '0x' & hex($petData + $Offset1) $petData = _MemoryRead($pet1Pointer_1, $DllHandle) ;1st pet slot if $pcb[0] = 1 Then $pet1Pointer_2 = '0x' & hex($petData + $pet1offset2) $pet1Data = _MemoryRead($pet1Pointer_2, $DllHandle) $pet1Pointer_3 = '0x' & hex($pet1Data + $pet1offset3) $pet1Data = _MemoryRead($pet1Pointer_3, $DllHandle) $pet1Pointer_4 = '0x' & hex($pet1Data + $pet1offset4) $pet1Data = _MemoryRead($pet1Pointer_4, $DllHandle) if $pet1Data < GUICtrlRead($pethp1) Then ControlSend ( GUICtrlRead($Clientname), "", "", "{" & GUICtrlRead($pethealcombo) & " 1}") EndIf GUICtrlCreateLabel($pet1Data, 200, 104, 29, 17) EndIf ;2nd pet slot if $pcb[1] = 1 Then $pet2Pointer_2 = '0x' & hex($petData + $pet1offset2) $pet2Data = _MemoryRead($pet2Pointer_2, $DllHandle) $pet2Pointer_3 = '0x' & hex($pet2Data + $pet2offset3) $pet2Data = _MemoryRead($pet2Pointer_3, $DllHandle) $pet2Pointer_4 = '0x' & hex($pet2Data + $pet1offset4) $pet2Data = _MemoryRead($pet2Pointer_4, $DllHandle) if $pet2Data < GUICtrlRead($pethp2) Then ControlSend ( GUICtrlRead($Clientname), "", "", "{" & GUICtrlRead($pethealcombo) & " 1}") EndIf GUICtrlCreateLabel($pet2Data, 200, 128, 29, 17) EndIf endfunc ;Auto HP func autoHP() $HPpercent = $hpmaxData*(GUICtrlRead($guiHPpercent)/100) IF $hpminData < $HPpercent Then ControlSend ( GUICtrlRead($Clientname), "", "", "{" & GUICtrlRead($HPskill) & " 1}") EndIf ;toolTip($HPpercent) EndFunc ;Auto MP func autoMP() $MPpercent = $mpmaxData*(GUICtrlRead($guiMPpercent)/100) IF $mpminData < $MPpercent Then ControlSend ( GUICtrlRead($Clientname), "", "", "{" & GUICtrlRead($MPskill) & " 1}") EndIf EndFunc ;Select target func target() toolTip("Main program starting",500,300) sleep(1000) toolTip("") WinActivate(GUICtrlRead($Clientname), "") while 1 $mob = _MemoryRead($StaticAddress, $DllHandle) $Pointer_1 = '0x' & hex($mob + $Offset1) $mob = _MemoryRead($Pointer_1, $DllHandle) $targetPointer = '0x' & hex($mob + $targetOffset) $mob = _MemoryRead($targetPointer, $DllHandle) if $x > 8 Then $x = 0 EndIf if $mob <= 0 Then loot() sleep (600) _MemoryWrite($targetPointer, $DllHandle, $mobid[$x]) $x = $x +1 EndIf if $mob > 0 Then skillatak() EndIf WEnd endFunc ;Mob Selection Function func getmobid() $mob = _MemoryRead($StaticAddress, $DllHandle) $Pointer_1 = '0x' & hex($mob + $Offset1) $mob = _MemoryRead($Pointer_1, $DllHandle) $targetPointer = '0x' & hex($mob + $targetOffset) $mob = _MemoryRead($targetPointer, $DllHandle) if $y > 8 Then $y = 0 endif if $mob > 0 Then $mobid[$y] = $mob IniWrite($configloc, "moblist",$y, $mobid[$y]) toolTip("Mob Selection successfull",500,300) sleep(1000) toolTip("") EndIf $y = $y +1 EndFunc ;Loot Function func loot() global $z = 0 if $lcb = 1 Then while $z <= GUICtrlRead($loottimes) ControlSend ( GUICtrlRead($Clientname), "", "", "{" & GUICtrlRead($lootcombo) & " 1}") $z = $z +1 WEnd EndIf EndFunc ;Mob reset Function func resetmob() while $a <10 IniWrite($configloc, "moblist",$a, "") ;sleep(500) $a= $a + 1 WEnd toolTip("Mobs List Cleared",500,300) sleep(1000) toolTip("") EndFunc ;Load mobs Function func loadmobs() while $b <9 $mobid[$b]=IniRead($configloc, "moblist",$b, "") $b= $b + 1 WEnd EndFunc func inisave() For $cbc = 0 to 4 Step +1 if $scb[$cbc] = 1 Then IniWrite($configloc, "checkbox_state", $skill_checkbox[$cbc], "-1") EndIf Next For $cbc = 0 to 4 Step +1 if $bcb[$cbc] = 1 Then IniWrite($configloc, "checkbox_state", $buff_checkbox[$cbc], "-1") EndIf Next For $cbc = 0 to 4 Step +1 if $scb[$cbc] = 4 Then IniWrite($configloc, "checkbox_state", $skill_checkbox[$cbc], "0") EndIf Next For $cbc = 0 to 4 Step +1 if $bcb[$cbc] = 4 Then IniWrite($configloc, "checkbox_state", $buff_checkbox[$cbc], "0") EndIf Next if $lcb = 1 then IniWrite($configloc, "checkbox_state", "loot_checkbox", "-1") ElseIf $lcb = 4 Then IniWrite($configloc, "checkbox_state", "loot_checkbox", "0") EndIf if $pcb[0] = 1 Then IniWrite($configloc, "checkbox_state", "pet_checkbox1", "-1") elseif $pcb[0] = 4 Then IniWrite($configloc, "checkbox_state", "pet_checkbox1", "0") EndIf if $pcb[1] = 1 Then IniWrite($configloc, "checkbox_state", "pet_checkbox2", "-1") elseif $pcb[1] = 4 Then IniWrite($configloc, "checkbox_state", "pet_checkbox2", "0") EndIf iniWrite($configloc, "client_name", "clientwindowname", GUICtrlRead($Clientname)) ;saves skills key to ini IniWrite($configloc, "skill_key", "skill1", GUICtrlRead($skillCombo[0])) IniWrite($configloc, "skill_key", "skill2", GUICtrlRead($skillCombo[1])) IniWrite($configloc, "skill_key", "skill3", GUICtrlRead($skillCombo[2])) IniWrite($configloc, "skill_key", "skill4", GUICtrlRead($skillCombo[3])) IniWrite($configloc, "skill_key", "skill5", GUICtrlRead($skillCombo[4])) ;saves skill delay to ini IniWrite($configloc, "skill_delay_key", "skill_delay_key1", GUICtrlRead($skilldelay[0])) IniWrite($configloc, "skill_delay_key", "skill_delay_key2", GUICtrlRead($skilldelay[1])) IniWrite($configloc, "skill_delay_key", "skill_delay_key3", GUICtrlRead($skilldelay[2])) IniWrite($configloc, "skill_delay_key", "skill_delay_key4", GUICtrlRead($skilldelay[3])) IniWrite($configloc, "skill_delay_key", "skill_delay_key5", GUICtrlRead($skilldelay[4])) ;saves HP and MP keys to ini IniWrite($configloc, "HP_MP_keys", "HP_key", GUICtrlRead($HPskill)) IniWrite($configloc, "HP_MP_keys", "MP_key", GUICtrlRead($MPskill)) ;saves HP and MP percent to ini IniWrite($configloc, "HP_MP_percent", "HP_percent", GUICtrlRead($guiHPpercent)) IniWrite($configloc, "HP_MP_percent", "MP_percent", GUICtrlRead($guiMPpercent)) ;saves loot key and loot times to ini IniWrite($configloc, "loot", "loot_key", GUICtrlRead($lootcombo)) IniWrite($configloc, "loot", "loot_times", GUICtrlRead($loottimes)) ;saves buff keys to ini IniWrite($configloc, "buffs", "buffskey1", GUICtrlRead($buffcombo[0])) IniWrite($configloc, "buffs", "buffskey2", GUICtrlRead($buffcombo[1])) IniWrite($configloc, "buffs", "buffskey3", GUICtrlRead($buffcombo[2])) IniWrite($configloc, "buffs", "buffskey4", GUICtrlRead($buffcombo[3])) IniWrite($configloc, "buffs", "buffskey5", GUICtrlRead($buffcombo[4])) ;saves buff timer to ini IniWrite($configloc, "buffs", "timer1", GUICtrlRead($buff_timer[0])) IniWrite($configloc, "buffs", "timer2", GUICtrlRead($buff_timer[1])) IniWrite($configloc, "buffs", "timer3", GUICtrlRead($buff_timer[2])) IniWrite($configloc, "buffs", "timer4", GUICtrlRead($buff_timer[3])) IniWrite($configloc, "buffs", "timer5", GUICtrlRead($buff_timer[4])) ;saves buff delays to ini IniWrite($configloc, "buffs", "buffdelay1", GUICtrlRead($buffdelay[0])) IniWrite($configloc, "buffs", "buffdelay2", GUICtrlRead($buffdelay[1])) IniWrite($configloc, "buffs", "buffdelay3", GUICtrlRead($buffdelay[2])) IniWrite($configloc, "buffs", "buffdelay4", GUICtrlRead($buffdelay[3])) IniWrite($configloc, "buffs", "buffdelay5", GUICtrlRead($buffdelay[4])) ;saves pet heal key and pet hp to ini IniWrite($configloc, "pets", "pethealkey", GUICtrlRead($pethealcombo)) IniWrite($configloc, "pets", "pets_hp1", GUICtrlRead($pethp1)) IniWrite($configloc, "pets", "pets_hp2", GUICtrlRead($pethp2)) toolTip("Nekolangot Config Save",450,150) sleep(1000) toolTip("") EndFunc Func checkboxcheckstate() ;checks all checkboxes $scb[0]=GUICtrlRead($skillCheckbox[0]) $scb[1]=GUICtrlRead($skillCheckbox[1]) $scb[2]=GUICtrlRead($skillCheckbox[2]) $scb[3]=GUICtrlRead($skillCheckbox[3]) $scb[4]=GUICtrlRead($skillCheckbox[4]) $lcb=GUICtrlRead($lootCheckbox) $bcb[0]=GUICtrlRead($buffCheckbox[0]) $bcb[1]=GUICtrlRead($buffCheckbox[1]) $bcb[2]=GUICtrlRead($buffCheckbox[2]) $bcb[3]=GUICtrlRead($buffCheckbox[3]) $bcb[4]=GUICtrlRead($buffCheckbox[4]) $pcb[0]=GUICtrlRead($petCheckbox[0]) $pcb[1]=GUICtrlRead($petCheckbox[1]) ;tooltip($lcb) EndFunc func stopbot() toolTip("halting main program",500,300) sleep(1000) toolTip("") while 1 WEnd endfunc Func pexit() toolTip("Exiting Main Program",500,300) sleep(1000) toolTip("") _MemoryClose($DllHandle) Exit EndFunc AshWyatt 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now