Jump to content

Script stopping randomly


Lokhtar
 Share

Recommended Posts

I have the following script:

Do
    MouseClick("right", 648, 340, 2);
    Sleep(10000);
Until 1=2

This should run forever, right? But after one or two loops, it sometimes just stops. And I have no idea why. I am running Windows Vista. I am doing something in the window while this is going on (and switching windows, etc), but this should not affect the script.

EDIT: Just found out that when it stops, and I right click on it on the taskbar, the 'script paused' option is checked. What could cause it to be paused?

Edited by Lokhtar
Link to comment
Share on other sites

how funny - wonder why

try this -to toggle it on/off press esc

HotKeySet("{ESC}", "_Toggle")
$Restrict = False

; ============================================================================
; Main Loop
; ============================================================================

While 1
    Sleep(10)
    If $Restrict = True Then
        MouseClick("right", 648, 340, 2);
        Sleep(10000);
    EndIf
WEnd

; ============================================================================
; Functions
; ============================================================================
Func _Toggle()
    If $Restrict = True Then
        Global $Restrict= False
    Else
        Global $Restrict = True
    EndIf
EndFunc   ;==>_Toggle
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...