Jump to content

Recommended Posts

Posted

ok i only want one part of this to happen on the load and then the outher part to loop please help me thanx in advance

[ Code]

HotKeySet("1", "end")

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

$title = "SwgClient"

WinWait($title,"")

While 1

If Not WinActive($title,"") Then WinActivate($title,"")

MouseMove ( 769, 710 ) ;i want this to only happen once when i first run it

MouseClick("Left", 769, 710, 1, 1);i want this to only happen once when i first run it

MouseMove ( 207, 212 ) ;i want this to loop

MouseClick("Left", 207, 212, 1, 1) ;i want this to look

WEnd

Func end()

Exit (0)

EndFunc ;==>end

[ /Code]

Posted

A simple change should take care of it for you:

HotKeySet("1", "end")
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)

$title = "SwgClient"

WinWait($title,"")

If Not WinActive($title,"") Then WinActivate($title,"");copied out of the While loop so it sets up for the next two (non-looping) lines

MouseMove ( 769, 710 ) ;Only runs once because it's not in the While loop
MouseClick("Left", 769, 710, 1, 1);Only runs once because it's not in the While loop
While 1
If Not WinActive($title,"") Then WinActivate($title,"")
MouseMove ( 207, 212 ) ;Loops because it's within While...WEnd
MouseClick("Left", 207, 212, 1, 1) ;Loops because it's within While...WEnd
WEnd

Func end()
Exit (0) 
EndFunc ;==>end

How's that?

"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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...