Jump to content
Sign in to follow this  
ExoCore

Pause Function Help

Recommended Posts

ExoCore

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

Share this post


Link to post
Share on other sites
wakillon

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

Share this post


Link to post
Share on other sites
ExoCore

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

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.