Jump to content

While error


Kiesp
 Share

Recommended Posts

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

Link to comment
Share on other sites

$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]

Link to comment
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- #
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...