Jump to content

Script, Help pls


Hyflex
 Share

Recommended Posts

Global $Paused
HotKeySet("{HOME}", "Togp")
HotKeySet("{END}", "Close")

While 1
    Sleep(100)
WEnd

Func Togp()
    $Paused = NOT $Paused
    While $Paused

>>>HERE NEED HELP<<<

    WEnd
EndFunc

Func Close()
    Exit 0
EndFunc

Where it says: ">>>HERE NEED HELP<<<" that is where i want it to do.

Press the letter s and then wait 1 sec. But i want it to repeat 500 Times. and i want a little box to be in the top left telling me how many times its done the code i think its ToolTip

Can someone help :)

Link to comment
Share on other sites

Global $Paused
HotKeySet("{HOME}", "Togp")
HotKeySet("{END}", "Close")

While 1
    Sleep(100)
WEnd

Func Togp()
    $Paused = Not $Paused
    While $Paused

        For $i = 1 To 500
            ToolTip("Run No" & $i)
            Send("s")
            Sleep(1000)
        Next
    WEnd
EndFunc   ;==>Togp

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


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

i looked and found it pretty fast typing in For

EDIT: ugh big dod writes it for him, why not let him learn :)

For...Next 
--------------------------------------------------------------------------------

Loop based on an expression.


For <variable> = <start> To <stop> [Step <stepval>]
    statements
    ...
Next


 

Parameters

variable The variable used for the count. 
start The initial numeric value of the variable. 
stop The final numeric value of the variable. 
stepval [optional] The numeric value (possibly fractional) that the count is increased by each loop. Default is 1. 

 

Remarks

The Variable will be created automatically with a LOCAL scope, even when MustDeclareVars is on.

For...Next statements may be nested. The For loop terminates when the value of variable exceeds the stop threshold. If stepVal or stop is a variable, its value is only read the first time the loop executes.

A For loop will execute zero times if:
   start > stop and step > 0, or
   start < stop and step is negative


 

Related

ContinueLoop, ExitLoop

For $i = 5 to 1 Step -1
    MsgBox(0, "Count down!", $i)
Next
MsgBox(0,"", "Blast Off!")
Edited by thatsgreat2345
Link to comment
Share on other sites

If he runs mine it will not work properly for him, I did not fix the pause/unpause part.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

If you want to do some scripting, start "learning" debugging. :)

You think Send is not working - so lets see.

Send does simulate a keypress. If you can't see anything happening, open a notepad window, get the given code and see if anything happens.

Run ('notepad.exe')
Sleep (1000)
For $i = 1 To 500
            ToolTip("Run No" & $i)
            Send("s")
            Sleep(1000)
Next

I'd bet it works. So get rid of those while-stuff, as bigdog said...

Link to comment
Share on other sites

If you want to do some scripting, start "learning" debugging. :)

You think Send is not working - so lets see.

Send does simulate a keypress. If you can't see anything happening, open a notepad window, get the given code and see if anything happens.

Run ('notepad.exe')
Sleep (1000)
For $i = 1 To 500
            ToolTip("Run No" & $i)
            Send("s")
            Sleep(1000)
Next

I'd bet it works. So get rid of those while-stuff, as bigdog said...

It works when typeing but he game is not reconiseing a keypress.
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...