Jump to content
Sign in to follow this  
ElitePlayer

Help out this n00b

Recommended Posts

ElitePlayer

I just wanted to start out with this script:

Assign "Insert" Key as a trigger to start pressing a Key (Say "G") and hold it until I press "Pause" as a hotkey to pause the script and then resume with "Insert" Key. Finally, close the script with "End" key.

Any help would be greatly appreciated. :">

Share this post


Link to post
Share on other sites
BrettF
ElitePlayer

HotkeySet is your friend :)

Can you like show it to me with the script itself?

I'm totally lost.

Share this post


Link to post
Share on other sites
BrettF

Global $Paused
HotKeySet("{INSERT}", "Trigger")
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{END}", "END")

While 1
    Sleep(100)
WEnd

Func Trigger ()
While 1
    Send ("G")
    Sleep (100)
    Send ("G")
    Sleep (100)
    Send ("G")
    Sleep (100)
    Send ("G")
    Sleep (100)
WEnd
    Exit
EndFunc   ;==>_Func

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func END ()
    Exit
EndFunc

That should get you started....

Share this post


Link to post
Share on other sites
ElitePlayer

Global $Paused
HotKeySet("{INSERT}", "Trigger")
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{END}", "END")

While 1
    Sleep(100)
WEnd

Func Trigger ()
While 1
    Send ("G")
    Sleep (100)
    Send ("G")
    Sleep (100)
    Send ("G")
    Sleep (100)
    Send ("G")
    Sleep (100)
WEnd
    Exit
EndFunc   ;==>_Func

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func END ()
    Exit
EndFunc

That should get you started....

That works perfectly if you speak but I'm trying to implement this in a game where you have to hold down that button("G"). This doesn't work in that case. I wonder wats wrong :)

Share this post


Link to post
Share on other sites
BrettF

What stoping the script in between the keypresses?

What happens if you hold down "G"??

gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg...

all mine dose is (spaces is sleep...)

g g g g g g g g g g g g g g g g g g g g........

So what should you do?

Share this post


Link to post
Share on other sites
BALA

From help file:

To hold a key down (generally only useful for games)
    Send("{a down}");Holds the A key down
    Send("{a up}");Releases the A key

EDIT: made a big mistake earlier, I fixed it now XD

Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites
ElitePlayer

Both of you thanks a lot. I made it to work like this:

Global $Paused
HotKeySet("{INSERT}", "Trigger")
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{END}", "END")

While 1
    Sleep(100)
WEnd

Func Trigger ()
While 1
    Send ("{g down}")
    Sleep (100)
WEnd
    Exit
EndFunc   ;==>_Func

Func TogglePause()
    $Paused = NOT $Paused
    Send ("{g up}")
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func END ()
    Send ("{g up}")
    Exit
EndFunc
Edited by ElitePlayer

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.