
Elsys
Members-
Posts
9 -
Joined
-
Last visited
Elsys's Achievements

Seeker (1/7)
0
Reputation
-
compiler logic problem and or compiler error
Elsys replied to Elsys's topic in AutoIt General Help and Support
bump? -
compiler logic problem and or compiler error
Elsys replied to Elsys's topic in AutoIt General Help and Support
I would create a new thread yet this one isnt broke so why fix it? may as well ask everything I need in one thread rather than spamming the forums with mulitiple ones. Anyway this is hopefully the last thing Ill have to ask for help with during this project. Not that I dont appreciate the response's Im just being impatiant and expecting to know everything through some weird mind osmosis. Anyway on to the question my buffing script has changed alot since the code I posted before I have 3 seprate buffs each needing their own timer I have defined timers for them but only the first timer works the other two will execute the key I set but will not do it on a timed basis. My script not the entire thing just the main file and the buff script its a multi file script I have resolved the declaration issues I had before. #include <GUIConstants.au3> Opt ("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=C:\Documents and Settings\ChristopherMcCormack\My Documents\Elbot.kxf $Form1 = GUICreate ("EL Bot", 301, 401, -1, -1) GUISetIcon ("C:\Program Files\Wizet\MapleStory\MapleStory.exe") GUISetBkColor (0xFFFFFF) GUISetOnEvent ($GUI_EVENT_CLOSE, "AForm1Close") GUISetOnEvent ($GUI_EVENT_MINIMIZE, "AForm1Minimize") GUISetOnEvent ($GUI_EVENT_MAXIMIZE, "AForm1Maximize") GUISetOnEvent ($GUI_EVENT_RESTORE, "AForm1Restore") $Button1 = GUICtrlCreateButton ("(Not allowed)", 224, 32, 41, 37, $BS_BITMAP) GUICtrlSetImage ($Button1, "C:\Documents and Settings\ChristopherMcCormack\My Documents\BlurMetalDc0.bmp") GUICtrlSetOnEvent (-1, "AButton1Click") GUICtrlSetTip (-1, "Launch MS") $Pic1 = GUICtrlCreatePic ("C:\Documents and Settings\ChristopherMcCormack\My Documents\1024x768_1.jpg", 0, 0, 297, 377, BitOR ($SS_NOTIFY, $WS_GROUP)) $Label1 = GUICtrlCreateLabel ("EL Bot Version 1.0", 24, 32, 124, 20) GUICtrlSetFont (-1, 8, 800, 0, "System") GUICtrlSetColor (-1, 0xFF0000) GUICtrlSetBkColor (-1, 0xFFFFFF) $List1 = GUICtrlCreateList ("", 200, 160, 89, 110) GUICtrlSetData (-1, "3 Diffrent Buffs|AutoAttack|AutoLoot|Configuration|Hp Bot|Mp Bot") GUICtrlSetColor (-1, 0xFF0000) GUICtrlSetBkColor (-1, 0x000000) $MenuItem1 = GUICtrlCreateMenu ("File") $MenuItem2 = GUICtrlCreateMenuItem ("Open Config", $MenuItem1) GUICtrlSetOnEvent(-1, "menload") $MenuItem3 = GUICtrlCreateMenuItem ("Save Config", $MenuItem1) GUICtrlSetOnEvent(-1, "mensave") $MenuItem4 = GUICtrlCreateMenuItem ("Configure Bot" , $MenuItem1) GUICtrlSetOnEvent(-1, "ConfigBot") $MenuItem5 = GUICtrlCreateMenuItem ("Exit", $MenuItem1) GUICtrlSetOnEvent(-1, "menexit") $MenuItem8 = GUICtrlCreateMenu ("Help") $MenuItem9 = GUICtrlCreateMenuItem ("Readme", $MenuItem8) $MenuItem10 = GUICtrlCreateMenuItem ("About", $MenuItem8) GUISetState (@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $AutoatkRun = 0 Global $AutoclickerRun = 0 Global $AutoLootRun = 0 Global $buff1Run = 0 Global $buff2Run = 0 Global $buff3Run = 0 Global $timebuff1 = TimerInit() Global $timebuff2 = TimerInit() Global $timebuff3 = TimerInit() Opt ("MouseCoordMode", 0) While 1 HotKeySet("{F4}" , "PreBuff3") HotKeySet("{F10}", "Autoattk") HotKeySet("{F2}", "PreBuff1") HotKeySet("{F3}", "PreBuff2") HotKeySet("{F9}", "Autoloot") HotKeySet ("{F5}", "GrabMana") HotKeySet ("{F6}", "GrabHP") HotKeySet ("{F7}", "prepoth") HotKeySet ("{F8}", "prepotm") HotKeySet("{F11}" , "Autoclicker") WEnd Func AButton1Click() Run ("C:\Program Files\Wizet\MapleStory\MapleStory.exe") EndFunc ;==>AButton1Click Func AForm1Close() MsgBox (0, "Close", "Exiting...") Exit EndFunc ;==>AForm1Close Func AForm1Maximize() GUISetState (@SW_MAXIMIZE) EndFunc ;==>AForm1Maximize Func AForm1Minimize() GUISetState (@SW_MINIMIZE) EndFunc ;==>AForm1Minimize Func AForm1Restore() GUISetState (@SW_RESTORE) EndFunc ;==>AForm1Restore Func KeyConfig() Global $delay1 = InputBox ("Buff Delay1", "Please Enter your desired buff delay for your first buff in Seconds.", "Seconds") Switch @Error Case 0 Global $delay2 = InputBox ("Buff Delay2", "Please Enter your desired buff delay for your second buff in Seconds.", "Seconds") Switch @Error Case 0 Global $delay3 = InputBox ("Buff Delay3", "Please Enter your desired buff delay for your third buff in Seconds.", "Seconds") Switch @Error Case 0 Global $buffkey1 = InputBox ("Buff Key1", "Please Enter your desired buff key for your first buff.", "Key") Switch @Error Case 0 Global $buffkey2 = InputBox ("Buff Key2", "Please Enter your desired buff key for your second buff.", "Key") Switch @Error Case 0 Global $buffkey3 = InputBox ("Buff Key3", "Please Enter your desired buff key for your third buff.", "Key") Switch @Error Case 0 Global $autoakey = InputBox ("Auto Attack Key", "Please Enter your desired Auto Attack Key.", "Key") Switch @Error Case 0 Global $autolkey = InputBox ("Auto Loot Key", "Please Enter your desired Auto Loot Key.", "Key") Switch @Error Case 0 Global $authpot = InputBox ("HP Pot Key", "Please Enter your desired HP Pot Key.", "Key") Switch @Error Case 0 Global $autmpot = InputBox ("MP Pot Key", "Please Enter your desired MP Pot Key.", "Key") MsgBox(0 , "Success" , "You have successfully configured ELBot") Case 1 MsgBox (16, "Unsuccessful", "You must reconfigure your keys for the bot to work please do so, Or load a previously working configuration" , 5) Case Else MsgBox (16, "Error" , "An Error has occured",5) EndSwitch Case 1 MsgBox (16, "Unsuccessful", "You must reconfigure your keys for the bot to work please do so, Or load a previously working configuration" , 5) Case Else MsgBox (16, "Error" , "An Error has occured",5) EndSwitch Case 1 MsgBox (16, "Unsuccessful", "You must reconfigure your keys for the bot to work please do so, Or load a previously working configuration" , 5) Case Else MsgBox (16, "Error" , "An Error has occured",5) EndSwitch Case 1 MsgBox (16, "Unsuccessful", "You must reconfigure your keys for the bot to work please do so, Or load a previously working configuration" , 5) Case Else MsgBox (16, "Error" , "An Error has occured",5) EndSwitch Case 1 MsgBox (16, "Unsuccessful", "You must reconfigure your keys for the bot to work please do so, Or load a previously working configuration" , 5) Case Else MsgBox (16, "Error" , "An Error has occured",5) EndSwitch Case 1 MsgBox (16, "Unsuccessful", "You must reconfigure your keys for the bot to work please do so, Or load a previously working configuration" , 5) Case Else MsgBox (16, "Error" , "An Error has occured",5) EndSwitch Case 1 MsgBox (16, "Unsuccessful", "You must reconfigure your keys for the bot to work please do so, Or load a previously working configuration" , 5) Case Else MsgBox (16, "Error" , "An Error has occured",5) EndSwitch Case 1 MsgBox (16, "Unsuccessful", "You must reconfigure your keys for the bot to work please do so, Or load a previously working configuration" , 5) Case Else MsgBox (16, "Error" , "An Error has occured",5) EndSwitch Case 1 MsgBox (16, "Unsuccessful", "You must reconfigure your keys for the bot to work please do so, Or load a previously working configuration" , 5) Case Else MsgBox (16, "Error" , "An Error has occured",5) EndSwitch EndFunc ;==>KeyConfig Func ConfigBot() Call ("KeyConfig") EndFunc ;==>ConfigBot Func configload () Global $delay1 = IniRead(@ScriptDir&'\elbotcon.ini', "DelayKey1", "$delay1", "NotFound") Global $delay2 = IniRead(@ScriptDir&'\elbotcon.ini', "DelayKey2", "$delay1", "NotFound") Global $delay3 = IniRead(@ScriptDir&'\elbotcon.ini', "DelayKey3", "$delay2", "NotFound") Global $buffkey1 = IniRead(@ScriptDir&'\elbotcon.ini', "BuffKey1", "$buffkey1", "NotFound") Global $buffkey2 = IniRead(@ScriptDir&'\elbotcon.ini', "BuffKey2", "$buffkey2", "NotFound") Global $buffkey3 = IniRead(@ScriptDir&'\elbotcon.ini', "BuffKey3", "$buffkey3", "NotFound") Global $autoakey = IniRead(@ScriptDir&'\elbotcon.ini', "AutoAttackKey", "$autoakey", "NotFound") Global $autolkey = IniRead(@ScriptDir&'\elbotcon.ini', "AutoLootKey", "$autolkey", "NotFound") Global $authpot = IniRead(@ScriptDir&'\elbotcon.ini', "AutoHPPot", "$authpot", "NotFound") Global $autmpot = IniRead(@ScriptDir&'\elbotcon.ini', "AutoMPPot", "$autmpot", "NotFound") Global $hotkey1 = IniRead(@ScriptDir&'\elbotcon.ini', "HotKey1", "$hotkey1", "NotFound") Global $hotkey2 = IniRead(@ScriptDir&'\elbotcon.ini', "HotKey2", "$hotkey2", "NotFound") Global $hotkey3 = IniRead(@ScriptDir&'\elbotcon.ini', "HotKey3", "$hotkey3", "NotFound") Global $hotkey4 = IniRead(@ScriptDir&'\elbotcon.ini', "HotKey4", "$hotkey4", "NotFound") Global $hotkey5 = IniRead(@ScriptDir&'\elbotcon.ini', "HotKey5", "$hotkey5", "NotFound") Global $hotkey6 = IniRead(@ScriptDir&'\elbotcon.ini', "HotKey6", "$hotkey6", "NotFound") Global $hotkey7 = IniRead(@ScriptDir&'\elbotcon.ini', "HotKey7", "$hotkey7", "NotFound") Global $hotkey8 = IniRead(@ScriptDir&'\elbotcon.ini', "HotKey8", "$hotkey8", "NotFound") Global $hotkey9 = IniRead(@ScriptDir&'\elbotcon.ini', "HotKey9", "$hotkey9", "NotFound") MsgBox(0, "Save Config", "Configuration Loaded!", 5) EndFunc Func menload() Call ("configload") EndFunc Func configsave() IniWrite(@ScriptDir&'\elbotcon.ini', "DelayKey1", "$delay1", $delay1) IniWrite(@ScriptDir&'\elbotcon.ini', "DelayKey2", "$delay2", $delay2) IniWrite(@ScriptDir&'\elbotcon.ini', "DelayKey3", "$delay3", $delay3) IniWrite(@ScriptDir&'\elbotcon.ini', "BuffKey1", "$buffkey1",$buffkey1) IniWrite(@ScriptDir&'\elbotcon.ini', "BuffKey2", "$buffkey2", $buffkey2) IniWrite(@ScriptDir&'\elbotcon.ini', "BuffKey3", "$buffkey3", $buffkey3) IniWrite(@ScriptDir&'\elbotcon.ini', "AutoAttackKey", "$autoakey", $autoakey) IniWrite(@ScriptDir&'\elbotcon.ini', "AutoLootKey", "$autolkey", $autolkey) IniWrite(@ScriptDir&'\elbotcon.ini', "AutoHPPot", "$authpot", $authpot) IniWrite(@ScriptDir&'\elbotcon.ini', "AutoMPPot", "$autmpot", $autmpot) MsgBox(0, "Save Config", "Configuration Saved!", 5) EndFunc ;==>configsave Func mensave() Call ("configsave") EndFunc ;==>ConfigSave Func menexit() Call ("AForm1Close") EndFunc ;==>menexit Opt ("SendKeyDelay", 10) #include "pothp.au3" #include "potmana.au3" #include "grabmana.au3" #include "grabhp.au3" #include "buff1.au3" #include "buff2.au3" #include "buff3.au3" #include "autoattack.au3" #include "autoloot.au3" #include "autoclicker.au3" Ill probably put the hotkey customized settings back in after im finished getting everything working with a little help of course. Func PreBuff1() $buff1Run = Not $buff1Run While 1 If Not $buff1Run Then Return If TimerDiff($timebuff1)/1000>$delay1 Then Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") Global $timebuff1 = TimerInit() EndIf WEnd EndFunc Two other identical functions like this are used for buffs this first one works the others do not. Not totally Identical the vars are redefined in the other two buff scripts ie buff1 buff2 and buff3 $timebuff1 $timebuff2 $timebuff3 working with my delay variable I set with that series of input boxes in that large switchtable then saving the values to an ini in a different function and pulling them from the ini in a load function. I havent quite gotten to having a customizable name for the ini files yet allowing multiple configurations for different characters. Back to the problem at hand the first buff bound to F2 as a hotkey is working as it should If I deactivate that buff and Activate F3 for obvious reasons (the script isnt multithreaded soon to be rectified even if in a ghetto sort of way) it will simply spam the buffkey heavily. example buff one activates qqqqq ten seconds pass qqqqq ect buff two or three activates wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww(ect forever) same function same variable values just diffrent variable names whats the deal? I even gave the macro ten seconds to make sure a new timestamp was avalible for the second buff. Not that it matters what order I activate the macros in buff one works the other two spam no matter what. -
compiler logic problem and or compiler error
Elsys replied to Elsys's topic in AutoIt General Help and Support
I found out how to do the error checking using @error to check for a change to 1 on an input box inside a series of switch tables. And I have looked at that but I dont understand what Key means is that like $var? and what Section Name is used for. Value of course being the value you want to save or load. -
compiler logic problem and or compiler error
Elsys replied to Elsys's topic in AutoIt General Help and Support
Thanks for the tip, you were very helpful. Now I just gotta figgure out how to cancel all remaining input boxes when cancel is selected on any one of them. As in I hit cancel and the next box pops up, I want to hit cancel and then completely exit the function but not the script. Also how must a ini file be formatted and how do you pass variable values into the ini and have them be read back later a save/load operation is what im going for. I can do the save dialog already My Script is almost complete, and Ive only asked a question twice thus far I feel preatty good about myself. If sombody would like to help me with those remaining two things thats cool. I will be working on the problem while these questions are up so dont think im just a slacker/leecher. -
compiler logic problem and or compiler error
Elsys replied to Elsys's topic in AutoIt General Help and Support
Because I reworded it in case people did not understand my wording can be confusing at times... I did say that at the end of the thread -
compiler logic problem and or compiler error
Elsys posted a topic in AutoIt General Help and Support
I have a rather complex script or at least its complex for me having only 3 days auto it experience in total. The compiler keeps telling me such and such function is already defined even though ive only defined it once I have even searched all my script files for the function name finding only one function definition. There is also a part of the script that searches pixels for a auto mana/hp pot mechanism im wondering if the way I have it written will reexecute my find pixel color at mouse position when I ask it to find a pixel in an area. Here is the area of the scripts in question I have already posted the full script in this thread minus the changes ive made to try to please the compiler. I am really close to finishing the script and this is simply maddening. Below is a list of the errors I recieve when trying to compile the warnings im not really worried about I dont care at this point that the script isnt the cleanest in the world. >C:\Program Files\AutoIt3\SciTE\..\au3check.exe "C:\Documents and Settings\ChristopherMcCormack\Desktop\EL Bot.au3" AutoIt3 Syntax Checker v1.54 Copyright (c) Tylo 2006 C:\Documents and Settings\ChristopherMcCormack\Desktop\buff3.au3(4,24) : WARNING: $delay3: possibly used before declaration. $condelay2 = ($delay3 * ~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\buff3.au3(9,20) : WARNING: $buffkey3: possibly used before declaration. Send ("{"&$buffkey3& ~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\buff2.au3(4,24) : WARNING: $delay1: possibly used before declaration. $condelay1 = ($delay1 * ~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\buff2.au3(9,20) : WARNING: $buffkey1: possibly used before declaration. Send ("{"&$buffkey1& ~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\buff1.au3(3,16) : ERROR: PreBuff1() already defined. Func PreBuff1() ~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\buff1.au3(8,14) : ERROR: Buff1() already defined. Func Buff1() ~~~~~~~~~~~~ ^ C:\Documents and Settings\ChristopherMcCormack\Desktop\autoloot.au3(6,22) : WARNING: $autolkey: possibly used before declaration. Send ("{"&$autolkey& ~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\hpmp.au3(14,15) : WARNING: $hpsearch: possibly used before declaration. If $hpsearch = ~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\hpmp.au3(14,57) : WARNING: $hppos: possibly used before declaration. If $hpsearch = PixelSearch( 584, 595, 218, 321, $hppos ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\hpmp.au3(15,19) : WARNING: $authpot: possibly used before declaration. Send("{"&$authpot& ~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\hpmp.au3(24,15) : WARNING: $mpsearch: possibly used before declaration. If $mpsearch = ~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\hpmp.au3(24,59) : WARNING: $manapos: possibly used before declaration. If $mpsearch = PixelSearch( 585, 595, 328, 430, $manapos ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\hpmp.au3(25,19) : WARNING: $autmpot: possibly used before declaration. Send("{"&$autmpot& ~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\autoattk.au3(6,30) : WARNING: $autoakey: possibly used before declaration. send ("{"&$autoakey& ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\ELBot.au3(4,23) : WARNING: $hotkey1: possibly used before declaration. HotKeySet("{"&$hotkey1& ~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\ELBot.au3(6,23) : WARNING: $hotkey2: possibly used before declaration. HotKeySet("{"&$hotkey2& ~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\ELBot.au3(8,23) : WARNING: $hotkey7: possibly used before declaration. HotKeySet("{"&$hotkey7& ~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\ELBot.au3(10,23) : WARNING: $hotkey8: possibly used before declaration. HotKeySet("{"&$hotkey8& ~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\ELBot.au3(12,23) : WARNING: $hotkey3: possibly used before declaration. HotKeySet("{"&$hotkey3& ~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\ELBot.au3(14,23) : WARNING: $hotkey4: possibly used before declaration. HotKeySet("{"&$hotkey4& ~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\ELBot.au3(16,23) : WARNING: $hotkey5: possibly used before declaration. HotKeySet("{"&$hotkey5& ~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\ELBot.au3(18,23) : WARNING: $hotkey6: possibly used before declaration. HotKeySet("{"&$hotkey6& ~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\buffconfig.au3(4,124) : WARNING: $delay3: declared global in function only. Prefer top of file. Global $delay3 = InputBox("Buff Delay3", "Please Enter your desired buff delay for your third buff in Seconds.", "Seconds") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\ELBot.au3(14,39) : ERROR: PreBuff2(): undefined function. HotKeySet("{"&$hotkey4&"}", "PreBuff2") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\ChristopherMcCormack\Desktop\EL Bot.au3 - 3 error(s), 21 warning(s) >Exit code: 2 Time: 0.319 My auto potion function below Func GrabMana() $manapos = hex(pixelgetcolor(mousegetpos(0),mousegetpos(1)),6) EndFunc Func GrabHp() $hppos = hex(pixelgetcolor(mousegetpos(0),mousegetpos(1)),6) EndFunc Func prepoth() AdlibEnable ("hprepot", 250) EndFunc Func hprepot() If $hpsearch = PixelSearch( 584, 595, 218, 321, $hppos ) <> $hppos = hex(pixelgetcolor(mousegetpos(0),mousegetpos(1)),6) Then Send("{"&$authpot&"}") EndIf EndFunc Func prepotm() AdlibEnable ( "mprepot" , 250) EndFunc Func mprepot() If $mpsearch = PixelSearch( 585, 595, 328, 430, $manapos ) <> $manapos = hex(pixelgetcolor(mousegetpos(0),mousegetpos(1)),6) Then Send("{"&$autmpot&"}") EndIf EndFunc My auto buffing function where their is supposedly a redefined function Global $condelay1 = 0 Func PreBuff1() $condelay1 = ($delay1 * 1000) AdlibEnable ( "Buff1" , $condelay1) EndFunc Func Buff1() Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") EndFunc The thread where my full script is posted also asking for help I wrote this thread to help clarify my wording so that I might get some help. http://www.autoitscript.com/forum/index.ph...c=38874&hl= -
Ok so I get a few compiler errors with this script and its probably a really simple fix but this is my first autoit experience so I thought I was doing preatty well for myself. The script isnt entirely finished yet but its getting close. Also I was under the impression that explicit declarations were not required but obviously they are... Either that or its a syntax error or somthing. #include <GUIConstants.au3> #include "buffconfig.au3" #include "buff3.au3" #include "buff2.au3" #include "buff1.au3" #include "autoloot.au3" #include "hpmp.au3" #include "autoattk.au3" #include "ELBot.au3" Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=C:\Documents and Settings\ChristopherMcCormack\My Documents\Elbot.kxf $Form1 = GUICreate("EL Bot", 301, 401, -1, -1) GUISetIcon("C:\Program Files\Wizet\MapleStory\MapleStory.exe") GUISetBkColor(0xFFFFFF) GUISetOnEvent($GUI_EVENT_CLOSE, "AForm1Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "AForm1Minimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "AForm1Maximize") GUISetOnEvent($GUI_EVENT_RESTORE, "AForm1Restore") $Button1 = GUICtrlCreateButton("(Not allowed)", 224, 32, 41, 37, $BS_BITMAP) GUICtrlSetImage($Button1, "C:\Documents and Settings\ChristopherMcCormack\My Documents\BlurMetalDc0.bmp") GUICtrlSetOnEvent(-1, "AButton1Click") GUICtrlSetTip(-1, "Launch MS") $Pic1 = GUICtrlCreatePic("C:\Documents and Settings\ChristopherMcCormack\My Documents\1024x768_1.jpg", 0, 0, 297, 377, BitOR($SS_NOTIFY,$WS_GROUP)) GUICtrlSetOnEvent(-1, "APic1Click") $Label1 = GUICtrlCreateLabel("EL Bot Version 1.0", 24, 32, 124, 20) GUICtrlSetFont(-1, 8, 800, 0, "System") GUICtrlSetColor(-1, 0xFF0000) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetOnEvent(-1, "ALabel1Click") $List1 = GUICtrlCreateList("", 200, 160, 89, 110) GUICtrlSetData(-1, "3 Diffrent Buffs|AutoAttack|AutoLoot|Configuration|Hp Bot|Mp Bot") GUICtrlSetColor(-1, 0xFF0000) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetOnEvent(-1, "AList1Click") $MenuItem1 = GUICtrlCreateMenu("File") $MenuItem2 = GUICtrlCreateMenuItem("Open Config", $MenuItem1) $MenuItem3 = GUICtrlCreateMenuItem("Save Config", $MenuItem1) $MenuItem4 = GUICtrlCreateMenuItem("Exit", $MenuItem1) $MenuItem5 = GUICtrlCreateMenu("Help") $MenuItem6 = GUICtrlCreateMenuItem("Readme", $MenuItem5) $MenuItem7 = GUICtrlCreateMenuItem("About", $MenuItem5) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Opt("MouseCoordMode", 0) While 1 Sleep(100) WEnd Func AButton1Click() Run("C:\Program Files\Wizet\MapleStory\MapleStory.exe") EndFunc Func AForm1Close() MsgBox(0, "Close", "Exiting...") Exit EndFunc Func AForm1Maximize() GUISetState(@SW_MAXIMIZE) EndFunc Func AForm1Minimize() GUISetState(@SW_MINIMIZE) EndFunc Func AForm1Restore() GUISetState(@SW_RESTORE) EndFunc Func OpenConfig() GUICtrlSetOnEvent($MenuItem2, "KeyConfig") EndFunc Func ConfigSave() GUICtrlSetOnEvent($MenuItem3, "configsave") EndFunc Func menexit() GUICtrlSetOnEvent($MenuItem3, "AForm1Close") EndFunc My Main GUI Opt("SendKeyDelay", 10) While 1 = 1 HotKeySet("{"&$hotkey1&"}", "GrabMana") HotKeySet("{"&$hotkey2&"}", "GrabHP") HotKeySet("{"&$hotkey7&"}", "prepoth") HotKeySet("{"&$hotkey8&"}" , "prepotm") HotKeySet("{"&$hotkey3&"}", "PreBuff1") HotKeySet("{"&$hotkey4&"}", "PreBuff2") HotKeySet("{"&$hotkey5&"}", "PreBuff3") HotKeySet("{"&$hotkey6&"}" , "Autoattk") HotKeySet("{"&$hotkey7&"}" , "Autoloot") WEnd Hotkeys Func KeyConfig() Global $delay1 = InputBox("Buff Delay1", "Please Enter your desired buff delay for your first buff in Seconds.", "Seconds") Global $delay2 = InputBox("Buff Delay2", "Please Enter your desired buff delay for your second buff in Seconds.", "Seconds") Global $delay3 = InputBox("Buff Delay3", "Please Enter your desired buff delay for your third buff in Seconds.", "Seconds") Global $buffkey1 = InputBox("Buff Key1", "Please Enter your desired buff key for your first buff.", "Key") Global $buffkey2= InputBox("Buff Key2", "Please Enter your desired buff key for your second buff.", "Key") Global $buffkey3 = InputBox("Buff Key3", "Please Enter your desired buff key for your third buff.", "Key") Global $autoakey = InputBox ("Auto Attack Key" , "Please Enter your desired Auto Attack Key." , "Key") Global $autolkey = InputBox ("Auto Loot Key" , "Please Enter your desired Auto Loot Key." , "Key") Global $authpot = InputBox ("HP Pot Key" , "Please Enter your desired HP Pot Key." , "Key") Global $autmpot = InputBox ("MP Pot Key" , "Please Enter your desired MP Pot Key." , "Key") Global $hotkey1 = InputBox ("Hotkey" , "Please Enter your desired Mana Set Key." , "Key") Global $hotkey2 = InputBox ("Hotkey" , "Please Enter your desired HP Set Key." , "Key") Global $hotkey3 = InputBox ("Hotkey" , "Please Enter your desired Buff 1 Key." , "Key") Global $hotkey4 = InputBox ("Hotkey" , "Please Enter your desired Buff 2 Key." , "Key") Global $hotkey5 = InputBox ("Hotkey" , "Please Enter your desired Buff 3 Key." , "Key") Global $hotkey6 = InputBox ("Hotkey" , "Please Enter your desired Attack Set Key." , "Key") Global $hotkey7 = InputBox ("Hotkey" , "Please Enter your desired Loot Set Key." , "Key") Global $hotkey8 = InputBox ("Hotkey" , "Please Enter your desired Mana Heal Hot Key." , "Key") Global $hotkey9 = InputBox ("Hotkey" , "Please Enter your desired HP Heal Hotkey." , "Key") MsgBox(48, "Successful", "You have succesfully configured EL Bot to your settings", 5) EndFunc My configuration wizard which dumps into variables all over the script and into a text file in my save config script Func configsave() Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send ("Buff Key 1") Send ("{"&$buffkey1&"}") Send ("Buff Key 2") Send ("{"&$buffkey2&"}") Send ("Buff Key 3") Send ("{"&$buffkey3&"}") Send ("Delay 1") Send ("{"&$delay1&"}") Send ("Delay 2") Send ("{"&$delay2&"}") Send ("Delay 3") Send ("{"&$delay3&"}") Send ("Auto Attack") Send ("{"&$autoakey&"}") Send ("Auto Loot") Send ("{"&$autolkey&"}") Send ("^s") Send ("EL Bot Config") Send ("{Enter}") MsgBox(48, "Successful", "You have succesfully saved your settings", 5) EndFunc This is my save proceedure and I will be writing a open proceedure that will grab these variables and plug them back into the script. Global $AutoatkRun = 0 Func Autoattk() $AutoatkRun = Not $AutoatkRun While 1 If Not $AutoatkRun Then Return send ("{"&$autoakey&"}") WEnd EndFunc Auto Attack Macro Global $AutoLootRun = 0 Func Autoloot() $AutoLootRun = Not $AutoLootRun While 1 if Not $AutoLootRun Then Return Send ("{"&$autolkey&"}") WEnd EndFunc Autoloot Macro $hpsearch = PixelSearch( 584, 595, 218, 321, $hppos ) $mpsearch = PixelSearch( 585, 595, 328, 430, $manapos ) Func GrabMana() $manapos = hex(pixelgetcolor(mousegetpos(0),mousegetpos(1)),6) EndFunc Func GrabHp() $hppos = hex(pixelgetcolor(mousegetpos(0),mousegetpos(1)),6) EndFunc Func prepoth() AdlibEnable ("hprepot", 250) EndFunc Func hprepot() If $hpsearch <> $hppos Then Send("{"&$authpot&"}") EndIf EndFunc Func prepotm() AdlibEnable ( "mprepot" , 250) EndFunc Func mprepot() If $mpsearch <> $manapos Then Send("{"&$autmpot&"}") EndIf EndFunc Auto Potion Macro Global $condelay1 = 0 Func PreBuff1() $condelay1 = ($delay1 * 1000) AdlibEnable ( "Buff1" , $condelay1) EndFunc Func Buff1() Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") EndFunc Buffing Macro Their are 2 other snipets like this one they all do the same thing but on different keys Global $condelay1 = 0 Func PreBuff1() $condelay1 = ($delay1 * 1000) AdlibEnable ( "Buff1" , $condelay1) EndFunc Func Buff1() Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") Send ("{"&$buffkey1&"}") EndFunc I was trying really hard not to ask for help Ive been up for 48 hours tweaking this thing... Id really really appreciate it if somone would help me see where I made mistakes in syntax and or show more effciant procedures and explain why the syntax is formated in that way and or what makes those proceedures more effcient. Then again if thats too much work you dont have to explain I was just really interested in learning. I have attached a zip with the script files in it as well if thats any help. EL_Bot.zip
-
How would one store a key as a variable?
Elsys replied to Elsys's topic in AutoIt General Help and Support
I did end up doing this though in a less clean way... Saving the values to text is all well and good but how would I get autoit to pull those values from the file or read from the file. Now that I successfully saved it as a configuration file their surely must be a way to load it so that my users don't have to run my configuration editor every time the bot loads. Kinda defeats the purpose of having a customized configuration no? And thank you for your help your code is alot cleaner than what I was using. -
Alright so I have a series of input boxes for a bot im making for maple story... yes sounds so very important eh well to me it is. Anyway so here I have these input boxes attached to a series of macros for auto buffing currently I have only the delay boxes in the script I scraped the others because they would produce 4 rather than produce the characters I wanted them to. What I wish to do in short is allow the bot's user to configure their keys as to which key is used in game to buff the hotkeys are static but if this works I might just be able to fix that. Id also like to understand how the .ini functions work and weather it might be possible to store the values people will put through my configuration setup wizard even though its not a whole lot. I tried this method of doing it: Send("{$var}") hoping that that would successfully give me the right result. Such as a user puts in the word Insert or Home or PGDN and then that variable should be populated with the correct value resulting in. Send("{Home}") of course this didnt work and now im stumped im sure theirs a GUI way to do this however im not quite ready to dive into the complexities of that. I also thought about the ACII way of doing things yet I think it would prove to be the same result as ASC must be placed before the number so you cant simply have an ASCII Chart conversion in the script. 079 = "{SPACE}" Im not even sure I can do that in AutoIt anyway its probably not a part of the syntax as "Space" isnt expressed as a variable and if it was it would do me no good since thats the output im trying to achive.