Jump to content

My new SWG Script


Recommended Posts

Hey all,

This is the first time I've taken a crack at this and well I need a lil help. I've got to the point where my macro does what I need it to do and click where I want it to. My only problem is I cant get it to end. I want to be able to press a button and it ends my macro. Can anyone help me out? The button I would prefer to break the loop would be f12 or something. (frist time programming)

Regards

Lestat :D

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

WinWait("SwgClient","")

If Not WinActive("SwgClient","") Then WinActivate("SwgClient","")

WinWaitActive("SwgClient","")

While 1

MouseMove(117,261)

MouseDown("left")

MouseUp("left")

MouseDown("left")

MouseUp("left")

MouseMove(182,249)

MouseDown("left")

MouseUp("left")

MouseDown("left")

MouseUp("left")

Wend

Link to comment
Share on other sites

Welcome to the forums!

Check out HotKeySet and Exit in the help file.

It'll be like this:

HotKeySet("{F12}", "_end")
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
WinWait("SwgClient","")
If Not WinActive("SwgClient","") Then WinActivate("SwgClient","")
WinWaitActive("SwgClient","")
While 1
MouseMove(117,261)
MouseDown("left")
MouseUp("left")
MouseDown("left")
MouseUp("left")
MouseMove(182,249)
MouseDown("left")
MouseUp("left")
MouseDown("left")
MouseUp("left")
Wend
Func _end()
   Exit
EndFunc

#)

Edited by nfwu
Link to comment
Share on other sites

Welcome to the forums!

Check out HotKeySet and Exit in the help file.

It'll be like this:

HotKeySet("{F12}", "_end")
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
WinWait("SwgClient","")
If Not WinActive("SwgClient","") Then WinActivate("SwgClient","")
WinWaitActive("SwgClient","")
While 1
MouseMove(117,261)
MouseDown("left")
MouseUp("left")
MouseDown("left")
MouseUp("left")
MouseMove(182,249)
MouseDown("left")
MouseUp("left")
MouseDown("left")
MouseUp("left")
Wend
Func _end()
   Exit
EndFunc

Hey, that didnt work. It wouldnt break out of the macro :D I have to shutdown my computer to turn it off. What I'm thinking is because the hotkey thing isnt in my loop it doesnt get a chance to get to it. What do you think?

#)

Link to comment
Share on other sites

Well it worked! Thanks so much for your help! Turned out F12 is indeed reserved by windows. I changed it to F11 and it works now! Feels good to have made it without having to resort to someone elses program. Your help is much appreciated!

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