Jump to content

Repeat x Times? Part2 / Episode III


Go to solution Solved by BogdanNicolescu,

Recommended Posts

Posted (edited)

 

Coming from here i try this:

Global $Paused=True

HotKeySet("{F6}", "TogglePause")
HotKeySet("{F7}", "Terminate")


$i = 0
$repeats=InputBox("Repeats", "How many Loops?", "")
While 2
If Not $Paused Then ;to see if paused or not
Sleep(400)
Send("{DOWN}")
Sleep(400)
Send("{APPSKEY}")
Sleep(400)
Send("{DOWN 4}")
Sleep(400)
Send("{ENTER}")
Sleep(3000)
Send("{ENTER}")
Sleep(400)

$i = ( $i + 1 )
EndIf
WEnd




Func TogglePause()
    $Paused= Not $Paused;if true set to false and vice versa
EndFunc

Func Terminate() ;exit
    Exit
 EndFunc

What am i doing wrong?

What i want to achive is to have a way to tell the script how many times to loop AND!! to have a way to pause it.

I will play around with it to see what i can come up with ...

Edited by BogdanNicolescu
Link to post
Share on other sites
  • Solution
Posted (edited)

Finally, after 3hrs, this is what i came up with:

 

Global $Paused=True

HotKeySet("{F6}", "TogglePause")
HotKeySet("{F7}", "Terminate")


$i = 0
While $i < 10
If Not $Paused Then ;to see if paused or not
Sleep(400)
Send("{DOWN}")
Sleep(400)
Send("{APPSKEY}")
Sleep(400)
Send("{DOWN 4}")
Sleep(400)
Send("{ENTER}")
Sleep(3000)
Send("{ENTER}")
Sleep(400)

$i = ( $i + 1 )
EndIf
WEnd



Func TogglePause()
    $Paused= Not $Paused;if true set to false and vice versa
EndFunc

Func Terminate() ;exit
    Exit
 EndFunc

Global $Paused=True

HotKeySet("{F6}", "TogglePause")
HotKeySet("{F7}", "Terminate")


$i = 0 <= this i don't know what is doing
While $i < 10 <= this is for the loop (kinda)
If Not $Paused Then ;to see if paused or not <= this is to check if it is paused or not

...
code

.....

$i = ( $i + 1 ) <= this is part of "this i don't know what is doing"
EndIf <= this is part of "this is to check if it is paused or not"
WEnd <= this is part of "this is for the loop (kinda)"

Func TogglePause()
    $Paused= Not $Paused;if true set to false and vice versa
EndFunc

Func Terminate() ;exit
    Exit
EndFunc

Edited by BogdanNicolescu
Link to post
Share on other sites
Posted (edited)

You could still use an inputbox using the same logic.

HotKeySet("{F6}", "TogglePause")
HotKeySet("{F7}", "Terminate")

Local $bPaused=True, $i = 0
Local $iRepeat=InputBox("Repeats", "How many Loops?", 10)
While $i < $iRepeat
    If Not $bPaused Then ;to see if paused or not
        Sleep(400)
        Send("{DOWN}")
        Sleep(400)
        Send("{APPSKEY}")
        Sleep(400)
        Send("{DOWN 4}")
        Sleep(400)
        Send("{ENTER}")
        Sleep(3000)
        Send("{ENTER}")
        Sleep(400)
        $i += 1
    Else
        Sleep(100)
    EndIf
WEnd

Func TogglePause()
    $bPaused= Not $bPaused;if true set to false and vice versa
EndFunc

Func Terminate() ;exit
    Exit
 EndFunc

 

Edited by Subz
Link to post
Share on other sites
10 minutes ago, Subz said:

You could still use an inputbox using the same logic.

HotKeySet("{F6}", "TogglePause")
HotKeySet("{F7}", "Terminate")

Local $bPaused=True, $i = 0
Local $iRepeat=InputBox("Repeats", "How many Loops?", 10)
While $i < $iRepeat
    If Not $bPaused Then ;to see if paused or not
        Sleep(1000)
        
        ؟؟؟code???
        
        ConsoleWrite("Pass#" & $i & @CRLF)
        $i += 1
    Else
        ConsoleWrite("Paused" & @CRLF)
        Sleep(100)
    EndIf
WEnd

Func TogglePause()
    $bPaused= Not $bPaused;if true set to false and vice versa
EndFunc

Func Terminate() ;exit
    Exit
 EndFunc

 

Sorry to be so dropped in head, but this is where the code should be plastered?

        Sleep(1000)
        
        ؟؟؟code???
        
        ConsoleWrite("Pass#" & $i & @CRLF)

I've worked on this way to much than i should have to :)) 🤪

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...