Jump to content

compiler logic problem and or compiler error


Elsys
 Share

Recommended Posts

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=

Link to comment
Share on other sites

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

I wrote this thread to help clarify my wording so that I might get some help.

Link to comment
Share on other sites

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()    
~~~~~~~~~~~~    ^

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.

maybe a problem with au3check. Just run the script (NOT from Scite) and fix the bugs as they pop up.

BTW: You should rethink your design. You are setting global variables in a function, but you use those

variables in includes BEFORE KeyConfig() is ever called. That will not work and it's the reason for the 1000 errors

in your script!

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

maybe a problem with au3check. Just run the script (NOT from Scite) and fix the bugs as they pop up.

BTW: You should rethink your design. You are setting global variables in a function, but you use those

variables in includes BEFORE KeyConfig() is ever called. That will not work and it's the reason for the 1000 errors

in your script!

Cheers

Kurt

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.

Link to comment
Share on other sites

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.

If you mean the errors shown by the interpreter, then there is no way to exit just that "function". It will allways cancel the whole script. Actually that's what au3check is for.

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.

See help file: Ini* functions, like IniRead, IniWrite, IniReadSection

A standard ini file looks like:

[sectionName]

Key=Value

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

If you mean the errors shown by the interpreter, then there is no way to exit just that "function". It will allways cancel the whole script. Actually that's what au3check is for.

See help file: Ini* functions, like IniRead, IniWrite, IniReadSection

A standard ini file looks like:

[sectionName]

Key=Value

Cheers

Kurt

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.

Link to comment
Share on other sites

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.

Run the help file samples of IniWrite and IniRead and have a look at the file and you will understand what key means.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Add

#include-once

at the top of all of your files.

EDIT: Fix the link in your first post!

Edited by Uten
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Moderators

bump?

The reason most (well myself anyway) haven't attempted to help you is the length of your script. When you have an issue, re-write a "small" (around 50 lines) to re-create the error or issue you are having. I personally don't look at anything that I have to scroll unless it's in a codebox, but even then, if I have to scroll more than three times, I lose interest.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...