Sign in to follow this  
Followers 0
Kiesp

While error

5 posts in this topic

hi there..

every time i make a while loop i get an error.. an example from my recent script:

global $war
HotKeySet("{end}","attack") ;set the end key to a function called attack.
$wow = WinActive("World of Warcraft") ; checks to see if the wow window is in focus.
;if wow window is focused it will i will check if the end key is pressed. if so it
;will send the key 5 every 250 millisecond until it is pressed again.
While $wow = 1
    func attack()
        $war = not $war
        While $war
            send("5")
            sleep(250)
        WEnd
    EndFunc
WEnd

the error msg is attached

is there an error in the script or is it a bug?


http://www.autoitscript.com/forum/index.php?showtopic=69911 <-- Best hacker ever :D

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$title = "World of Warcraft"

global $war = 0
HotKeySet("{end}","wartoggle") 

winwaitactive($title)
While WinActive($title)
    sleep(250)
    if $war = 1 Then
        send("5")
    EndIf   
WEnd

func wartoggle()
    $war = not $war
EndFunc

Edited by lod3n

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

global $war
HotKeySet("{end}","attack") ;set the end key to a function called attack.
$wow = WinActive("World of Warcraft") ; checks to see if the wow window is in focus.
;if wow window is focused it will i will check if the end key is pressed. if so it
;will send the key 5 every 250 millisecond until it is pressed again.
While $wow = 1
Sleep(100)
WEnd

    func attack()
        $war = not $war
        While $war
            send("5")
            sleep(250)
        WEnd
    EndFunc


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

thx alot both of u... i just edited it to make it more me :)


http://www.autoitscript.com/forum/index.php?showtopic=69911 <-- Best hacker ever :D

Share this post


Link to post
Share on other sites
:)

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

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