Sign in to follow this  
Followers 0
Guest cyber2025

Replacement For Goto From Verson 2?

5 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
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

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