Jump to content

Replacement For Goto From Verson 2?


Guest cyber2025
 Share

Recommended Posts

Guest cyber2025

I am working on a rather simple macro. It was made in v. 2 but I have edited it for v. 3

I fixed most of it but now I am trying to make a loop, the goto feature is removed from v. 2.

I will post the script, please tell me how to change it to loop for v. 3

Sleep(2000)

MouseClick("left", 0, 500, 2)

loop:

MouseClick("left", 0, 500, 2)

MouseClick("left", 0, 500, 2)

MouseClick("left", 0, 500, 2)

MouseClick("left", 0, 500, 2)

HotKeySet("{ESC}", "Terminate")

Func Terminate()

MsgBox(4096,"", "The End")

Exit

EndFunc

Goto,loop

Thanks,

Cyber2025

Link to comment
Share on other sites

Guest cyber2025

Thanks for the reply, I just want to make sure I have this correct. It seems when I run this I get an error message.

Line 10 (file"C:\Documents and Settings\Administrator\Desktop\macro.au3"):

Func Terminate()

Error: "While" statement has no matching "Wend" statement.

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

WinActivate(SwgClient)

Sleep(2000)

MouseClick("left", 0, 500, 2)

While 1 = 1

MouseClick("left", 0, 500, 2)

MouseClick("left", 0, 500, 2)

MouseClick("left", 0, 500, 2)

MouseClick("left", 0, 500, 2)

HotKeySet("{ESC}", "Terminate")

Func Terminate()

MsgBox(4096,"", "The End")

Exit

EndFunc

Wend

Thanks,

Cyber2025

Link to comment
Share on other sites

The Wend needs to come before the Func, i.e.

WinActivate(SwgClient)
Sleep(2000)
MouseClick("left", 0, 500, 2)
While 1 = 1
  MouseClick("left", 0, 500, 2)
  MouseClick("left", 0, 500, 2)
  MouseClick("left", 0, 500, 2)
  MouseClick("left", 0, 500, 2)
  HotKeySet("{ESC}", "Terminate")
WEnd

Func Terminate()
  MsgBox(4096,"", "The End")
  Exit
EndFunc

GrahamS

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...