Jump to content
Kaesssq

[NEW] Return in while - (Locked)

Recommended Posts

Hey there

Wanted to ask if there was a way to return to the beginning of a while loop, lets say there's 10 lines of a while and in line 8 there occurs a problem which should let the loop return to line 1 where the loop starts? Is there a possible way to do this? If its easy or simple sorry i just started autoit and im pretty new in it.

 

Share this post


Link to post
Share on other sites
Posted (edited)

Do you have an example of what you want to do ?

Anyway, you could skip the processing of the code, if you know that there was an error, with If ... endif, and so the code would automatically start with the line 1.

Local $quit = 0, $txt

While $quit = 0

    $txt = InputBox("Name input:", "Please enter your name" & @CRLF & "enter x to exit")
    If $txt = "x" Then
        $quit = 2
    ElseIf $txt = "" Then          ;Skip

    Else                            ;Here is your processing code
        MsgBox(0, "Hello", "and Welcome " & $txt)
        $quit = 1
    EndIf

WEnd

If $quit = 2 Then MsgBox(0, "Error", "Exit was choosen")

 

Edited by Dan_555

~Dan~ :Emu.Zone now with Desktop Pets / DeskMates - (Bugfixed UniScrMate 4.1)

Share this post


Link to post
Share on other sites

while(1)

        $pix= PixelSearch(891,308,929,329,0XF9EFEF,2)

        if not (@error) then 
            sleep(4000);wacht 4 seconden
            MouseClick("left", $pix[0], $pix[1],1,50) 
            Sleep(5000)
        EndIf
        if(@error) then
            $pixInSafe= PixelSearch(811,30,1108,64,0xFFCB05,1)
            if not (@error) then 
            ViewReset()
            MouseClick("left",305,745,1,1)        
        
            MouseClick("left",Random(1600,1688),Random(55,78),1,50)
            sleep(6000) 
            fist()
            EndIf
            if(@error) Then


                fist()           ---> so here in this function it could happen that the fist function can do a kick then it should get out of this if and return to the first if with $pix pixelsearch and start the loop over?


            EndIf
        EndIf

   
WEnd
 

Share this post


Link to post
Share on other sites
40 minutes ago, Kaesssq said:

fist()           ---> so here in this function it could happen that the fist function can do a kick

Looks like a game automation to me. Am I right?


Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Share this post


Link to post
Share on other sites

Its normally named something else and does something else, i just changed it to fist and just gave an example thats it

Share this post


Link to post
Share on other sites
Posted (edited)

This is the second time you are pointed to the forum rules....  and will also be the last time as the next offense will result in a ban.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...