Jump to content
Sign in to follow this  
hawky

Error: Variable used without being declared.

Recommended Posts

hawky

Hello everybody,

i made a script that repeat hes self,

if i push on Home on my keyboard it does something(F1 or it say something)

now i want when i push Page Up that it does something too but when i run the script it say:

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

AutoIt Error

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

Line 42 (File "C:\Downloads\click botje.au3"):

if $sendf2 == "1" Then

if ^ ERROR

Error: Variable used without being declared.

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

OK

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

if someone have another methode of scripting say it please

here is my script:

Global $sendf1
HotKeySet("{ESC}", "Terminate")
HotKeySet("{HOME}", "startp")
HotKeySet("{Ins}", "pauze")
HotKeySet("{PGUP}", "startp2")

While 1
    Sleep(100)
    if $sendf1 == "1" Then 
Send("hoer")
Send("{ENTER}")
    EndIf
WEnd

While 1
    Sleep(100)
    if $sendf2 == "1" Then 
Send("hoer")
Send("{ENTER}")
    EndIf
WEnd

Func Terminate()
    Exit 0
EndFunc

Func startp()
  if $sendf1 == "1" Then
    $sendf1="0"
  else 
    $sendf1="1"
EndIf
EndFunc

Func startp2()
  if $sendf2 == "1" Then
    $sendf2="0"
  else 
    $sendf2="1"
EndIf
EndFunc

Func pauze()
    
Endfunc

this is the code with the error and this without error:

Global $sendf1
HotKeySet("{ESC}", "Terminate")
HotKeySet("{HOME}", "startp")
HotKeySet("{Ins}", "pauze")

While 1
    Sleep(100)
    if $sendf1 == "1" Then 
Send("hoer")
Send("{ENTER}")
    EndIf
WEnd
Func Terminate()
    Exit 0
EndFunc

Func startp()
  if $sendf1 == "1" Then
    $sendf1="0"
  else 
    $sendf1="1"
EndIf
EndFunc

Func pauze()
    
Endfunc
Edited by hawky

Share this post


Link to post
Share on other sites
narayanjr

Global $sendf2

you need to add that to the top just like you did for Global $sendf1 that will get rid of the not declared problem

and thecommented While statement is never being hit you should combine both while statements together like so

While 1
    Sleep(100)
    if $sendf1 == "1" Then
Send("hoer")
Send("{ENTER}")
    EndIf

    if $sendf2 == "1" Then
Send("hoer")
Send("{ENTER}")
    EndIf
WEndoÝ÷ Ù«­¢+Ù±½°ÀÌØí͹Ä)±½°ÀÌØí͹È)!½Ñ-åMÐ ÅÕ½ÐííM
ôÅÕ½Ðì°ÅÕ½ÐíQɵ¥¹ÑÅÕ½Ðì¤)!½Ñ-åMÐ ÅÕ½Ðíí!=5ôÅÕ½Ðì°ÅÕ½ÐíÍÑÉÑÀÅÕ½Ðì¤)!½Ñ-åMÐ ÅÕ½Ðíí%¹ÍôÅÕ½Ðì°ÅÕ½ÐíÁÕéÅÕ½Ðì¤)!½Ñ-åMÐ ÅÕ½ÐííAUAôÅÕ½Ðì°ÅÕ½ÐíÍÑÉÑÀÈÅÕ½Ðì¤()]¡¥±Ä(M±À ÄÀÀ¤(¥ÀÌØí͹ÄôôÅÕ½ÐìÄÅÕ½ÐìQ¡¸)M¹ ÅÕ½Ðí¡½ÈÅÕ½Ðì¤)M¹ ÅÕ½Ðíí9QIôÅÕ½Ðì¤(¹%)]¹(Ì)]¡¥±Ä(M±À ÄÀÀ¤(¥ÀÌØí͹ÈôôÅÕ½ÐìÄÅÕ½ÐìQ¡¸)M¹ ÅÕ½Ðí¡½ÈÅÕ½Ðì¤)M¹ ÅÕ½Ðíí9QIôÅÕ½Ðì¤(¹%)]¹()Õ¹Qɵ¥¹Ñ ¤(á¥ÐÀ)¹Õ¹()Õ¹ÍÑÉÑÀ ¤(¥ÀÌØí͹ÄôôÅÕ½ÐìÄÅÕ½ÐìQ¡¸(ÀÌØí͹ÄôÅÕ½ÐìÀÅÕ½Ðì(±Í(ÀÌØí͹ÄôÅÕ½ÐìÄÅÕ½Ðì)¹%)¹Õ¹()Õ¹ÍÑÉÑÀÈ ¤(¥ÀÌØí͹ÈôôÅÕ½ÐìÄÅÕ½ÐìQ¡¸(ÀÌØí͹ÈôÅÕ½ÐìÀÅÕ½Ðì(±Í(ÀÌØí͹ÈôÅÕ½ÐìÄÅÕ½Ðì)¹%)¹Õ¹()Õ¹ÁÕé ¤()¹Õ¹
Edited by narayanjr

Share this post


Link to post
Share on other sites
hawky

mmm wonder what this script is all about .....

lol its just for my game lineage 2, i make simple heal bots

if i push home i target myself and heal the healer and when pgup i heal my other char

and yes im dutch haha :)

Share this post


Link to post
Share on other sites
hawky

Ok problem fixed (thanks too narayanjr)

i made 1 while thing aah whatever look self:

Global $sendf1
Global $sendf2
HotKeySet("{ESC}", "Terminate")
HotKeySet("{HOME}", "startp")
HotKeySet("{Ins}", "pauze")
HotKeySet("{PGDN}", "startp2")

While 1
    Sleep(100)
    if $sendf1 == "1" Then
Send("test")
Send("{ENTER}")
    EndIf
    Sleep(100)
    if $sendf2 == "1" Then
Send("test")
Send("{ENTER}")
    EndIf
WEnd

Func Terminate()
    Exit 0
EndFunc

Func startp()
  if $sendf1 == "1" Then
    $sendf1="0"
  else
    $sendf1="1"
EndIf
EndFunc

Func startp2()
  if $sendf2 == "1" Then
    $sendf2="0"
  else
    $sendf2="1"
EndIf
EndFunc

Func pauze()
   
Endfunc
Edited by hawky

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  

×