Jump to content

Pause Function Help


Recommended Posts

I already looked at using hot key.. but when I try doing this

#include <Misc.au3>

$g_szVersion = "ScriptBT"
If WinExists($g_szVersion) Then Exit ; It's already running
AutoItWinSetTitle($g_szVersion)

HotKeySet( "{END}","_killEricMSBot")
Func _killEricMSBot() 
    ProcessClose("EricMSBot.exe")
EndFunc

MsgBox(0, "Guide to Start", "Start F9,Stop END,Pause Insert ")
Global $Sending 
HotKeySet("{F9}", "ToggleSend") 
While 1     
    
    Sleep(100) 
WEnd 

Func ToggleSend()     
    $Sending = NOT $Sending     
    While $Sending     
    Send('{ENTER}')
    Sleep(2000)
    Send('@reborn c')
    Sleep(4000)
    WEnd 
EndFunc

HotKeySet("{Insert}", "TogglePause")
Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        
        sleep(15000)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

It doesnt pause like I want it too, it just keep going

Edited by ExoCore
Link to comment
Share on other sites

Try

#include <Misc.au3>

Global $Sending , $Paused, $g_szVersion = "ScriptBT"

If WinExists($g_szVersion) Then Exit ; It's already running
AutoItWinSetTitle($g_szVersion)

HotKeySet( "{END}","_killEricMSBot")
HotKeySet("{Insert}", "TogglePause")
HotKeySet("{F9}", "ToggleSend")

MsgBox(0, "Guide to Start", "Start F9,Stop END,Pause Insert ")

While 1

    Sleep(100)
WEnd

Func _killEricMSBot()
    ProcessClose("EricMSBot.exe")
EndFunc

Func ToggleSend()
    $Sending = NOT $Sending
    While $Sending
    Send('{ENTER}')
    Sleep(2000)
    Send('@reborn c')
    Sleep(4000)
    WEnd
EndFunc

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

        sleep(15000)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Try

#include <Misc.au3>

Global $Sending , $Paused, $g_szVersion = "ScriptBT"

If WinExists($g_szVersion) Then Exit ; It's already running
AutoItWinSetTitle($g_szVersion)

HotKeySet( "{END}","_killEricMSBot")
HotKeySet("{Insert}", "TogglePause")
HotKeySet("{F9}", "ToggleSend")

MsgBox(0, "Guide to Start", "Start F9,Stop END,Pause Insert ")

While 1

    Sleep(100)
WEnd

Func _killEricMSBot()
    ProcessClose("EricMSBot.exe")
EndFunc

Func ToggleSend()
    $Sending = NOT $Sending
    While $Sending
    Send('{ENTER}')
    Sleep(2000)
    Send('@reborn c')
    Sleep(4000)
    WEnd
EndFunc

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

        sleep(15000)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

ty so much :mellow:

I got a question, how do i make something send(once every whatever) when I also want the other function to still running

I see what i did wrong now

Edited by ExoCore
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...