Sign in to follow this  
Followers 0
Salryn

(Help) Script Closing after running once

2 posts in this topic

I have written a simple macro, and it works loverly, but I want to add to it im not sure how, and it closes after iv ran it once :)

<<Features I want to add (things I need help with)>>

1: Double click on it to start it.

2: The ability for it to run in the taskbar and set a hotkey for when I want to run it, because right now I have to right click it on my desktop and click Run Script, then switch back to my game, and do this everytime I want to use it, would be nice to run it and set a hotkey and bobs your uncle :whistle:

________________________________________________

The Code

________________________________________________

WinWaitActive("Vanguard: Saga of Heroes")

Send("{F1}")

Send("+2")

Send("/g Buffing The Group STAY CLOSE {Enter}")

Send("/g Buffing %td{!} {Enter}")

Send("1")

Sleep("2500")

Send("2")

Sleep("2500")

Send("3")

Sleep("2500")

Send("4")

Sleep("2500")

Send("5")

Sleep("2500")

Send("/g Buffing Finished on %td{!} {Enter}")

Send("{F2}")

Send("/g Buffing %td{!} {Enter}")

Send("1")

Sleep("2500")

Send("2")

Sleep("2500")

Send("3")

Sleep("2500")

Send("4")

Sleep("2500")

Send("5")

Sleep("2500")

Send("/g Buffing Finished on %td{!} {Enter}")

Send("{F3}")

Send("/g Buffing %td{!} {Enter}")

Send("1")

Sleep("2500")

Send("2")

Sleep("2500")

Send("3")

Sleep("2500")

Send("4")

Sleep("2500")

Send("5")

Sleep("2500")

Send("/g Buffing Finished %td{!} {Enter}")

Send("{F4}")

Send("/g Buffing %td{!} {Enter}")

Send("1")

Sleep("2500")

Send("2")

Sleep("2500")

Send("3")

Sleep("2500")

Send("4")

Sleep("2500")

Send("5")

Sleep("2500")

Send("/g Buffing Finished on %td{!} {Enter}")

Send("{F5}")

Send("/g Buffing %td{!} {Enter}")

Send("1")

Sleep("2500")

Send("2")

Sleep("2500")

Send("3")

Sleep("2500")

Send("4")

Sleep("2500")

Send("5")

Sleep("2500")

Send("/g Buffing Finished on %td{!} {Enter}")

Send("{F6}")

Send("/g Buffing %td{!} {Enter}")

Send("1")

Sleep("2500")

Send("2")

Sleep("2500")

Send("3")

Sleep("2500")

Send("4")

Sleep("2500")

Send("5")

Sleep("2500")

Send("/g Buffing Complete {Enter}")

Send("+1")

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Your script could be shortened I'm sure, but anyway, here's what you want, I believe:

HotKeySet('{ESC}', 'quit')  ; esc to exit script
HotKeySet('^b', 'buffnstuff')  ; ctrl + b to buff.  change to whatever you want

Func buffnstuff()
    WinWaitActive("Vanguard: Saga of Heroes")
    Send("{F1}")
    Send("+2")
    Send("/g Buffing The Group STAY CLOSE {Enter}")
    dabuffs()
    Send("{F2}")
    dabuffs()
    Send("{F3}")
    dabuffs()
    Send("{F4}")
    dabuffs()
    Send("{F5}")
    dabuffs()
    Send("{F6}")
    dabuffs()
    Send("/g Buffing Complete {Enter}")
    Send("+1")
EndFunc

Func dabuffs()
    Send("/g Buffing %td{!} {Enter}")
    Send("1")
    Sleep("2500")
    Send("2")
    Sleep("2500")
    Send("3")
    Sleep("2500")
    Send("4")
    Sleep("2500")
    Send("5")
    Sleep("2500")
    Send("/g Buffing Finished on %td{!} {Enter}")
EndFunc

While 1  ; this keeps your script open
    Sleep(100)
WEnd

Func quit()
    Exit
EndFunc

edit - short version

Edited by xcal

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