Jump to content

Script beeing paused


Recommended Posts

my script does something pause's or blocks or just get stuck randomly , its not always on the same place tried adding "winwait"/"winactive" or remove then , still same.

is there a way to send a key stroke if the script pause or idle's for more then 7 minutes ?

Thanks ^_^

Link to comment
Share on other sites

  • Developers

Add the following line at the top of your script to allow you to figure out what line its pausing by hovering over the tray icon:

Opt("TrayIconDebug", 1)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Hello. It would be easier if you would show us this problematic code ^_^

p.s-try using TrayIconDebug to check what pleace of code the script is blocking.

EDIT:

Jos was faster than me ;)

Edited by Uriziel01
Link to comment
Share on other sites

Hello ,

So i had a look on my script and searched were it usualy gets stuck , and im fixing it .

While that doesn't happen i added a small tool to it to let me pause or exit the running script, but what happens in fact the code below what it does it counts from 1 to 999 but its always looping.

Global $Paused
HotKeySet("{pause}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
While 1
    For $x = 1 to 999
        Sleep(1)
        ToolTip($x & " - Running",200,200)
    Next
WEnd

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        ToolTip($x & " - Paused",200,200)
    Wend
EndFunc

Func Terminate()
    Exit 0
EndFunc

Also i noticed my script stops at a weird place , i added something on the beggin of the script cause i had a problem with my script because the ALT key was getting stuck , so i added the follow .

Func _SendEx($ss,$warn = "")
    Local $iT = TimerInit()
    
    While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")
        if $warn <> "" and TimerDiff($iT) > 1000 Then
            MsgBox(262144, "Warning", $warn)
        EndIf
      sleep(50)
    WEnd
    Send($ss) 
EndFunc;==>_SendEx

and

Opt("TrayIconDebug", 1)

in order to help me with debug. Some of the times my script stops at " Sleep(50) " and some other times on the " WEnd " of the function _sendEx which i find very wierd... also i never had a msgbox with error.

Thanks

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...