Jump to content

goto


Recommended Posts

Welcome to the wonderful world of functions.

Look up Func in the help file... it gives a good description

erm... maybe a bit scary for someone who isnt familliar with them. This example might be better.

HotKeySet("F8", "Toggle")
HotKeySet("ESC", "Terminate")
$active=0

While 1
    If $active = 1 Then MouseClick("left")
    Sleep(500)
WEnd

Func Toggle()
    If $active = 1 Then
        $active = 0
    Else
        $active = 1
    EndIf
EndFunc

Func Terminate()
    Exit
EndFunc
Edited by SpookMeister

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

what statment is like the goto so my script would look like this

:lable

dao this

and this

and that

goto :lable

how would I do that with autoit v3????

If that is a loop that repeats the stuff in the middle then:

While 1
dao this 
and this 
and that 
Wend

If you post more specifically what you are tryign to do we could help you a little better.

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

what statment is like the goto so my script would look like this

:lable

dao this

and this

and that

goto :lable

how would I do that with autoit v3????

Not to be a punk, dakota, but you DO know there's a help file with AutoIt, right? This is the third post by you today that is easily answered by searching there.

Look for While, For or Do loops in the help file to replace "goto"

From the Help File:

4. Where is the "goto" command?

Gone. It's evil. No, you can't ask why - it just is. It's like that lump of rock they find in the microwave at the end of the film Time Bandits :D

AutoIt v3 features most of the common "loops" in use today and with these Goto is no longer required. Look up While, Do, For, ExitLoop, ContinueLoop and Functions for the modern way of doing things :D And while you are looking at help file sections check out these on loops, conditional statements and functions. I promise you, once you have got the hang of such things you will be able to script in virtually any other language within a couple of minutes.

Just to get you started, the most basic use of Goto in version 2.64 was an infinite loop like:

:mylabel

...do something...

...and something else...

goto, mylabel

A simple v3 version of that is a While loop that is always "true".

While 1 = 1

...do something...

...do something else...

Wend

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
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...