Jump to content

Help out this n00b


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :)
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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