 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Physical Guest
|
Posted: Wed Mar 07, 2007 8:09 pm Post subject: Problem with Pause |
|
|
i am trying to make my script able to be paused right after running then resume when i unpause it. I tried to use the Pause::Pause to bind the pause key to pause which works but it wont run the rest of my script even if i do not pause it. If i remove that line then the rest of the script runs normally how it is suppose to. I even tried adding a Pause, Off bleow it, then above it and neither work. I double click the taskbar icon to see what was run in the script and it keeps stopping as soon as it hits the Pause::Pause. Any help on fixing this would be greatly appreciated.
| Code: |
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <myemail@nowhere.com>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#InstallKeybdHook ; Install Keyboard Hook
#UseHook ON ; Turn Hook On
#Persistent
#SingleInstance FORCE
Process, Priority,, Realtime ; Set Script priority to Realtime
Pause, Off
Pause::Pause
Sleep, 3000
SendRaw U
Sleep, 100
Loop 5
{
Loop 10
{
SendRaw 1
Sleep, 3000
SendRaw 2
Sleep, 1500
SendRaw 3
Sleep, 1000
}
SendRaw P
Sleep, 100
SendRaw P
Sleep, 100
SendRaw P
Sleep, 10000
SendRaw 3
Sleep, 1000
}
|
|
|
| Back to top |
|
 |
Veovis
Joined: 13 Feb 2006 Posts: 389 Location: Utah
|
Posted: Wed Mar 07, 2007 8:46 pm Post subject: |
|
|
| AHK manual wrote: | | After the script has been loaded, it begins executing at the top line, continuing until a Return, Exit, hotkey/hotstring label, or the physical end of the script is encountered (whichever comes first). This top portion of the script is referred to as the auto-execute section. |
_________________
"Power can be given overnight, but responsibility must be taught. Long years go into its making." |
|
| Back to top |
|
 |
Physical Guest
|
Posted: Wed Mar 07, 2007 9:09 pm Post subject: |
|
|
| well i am not sure how that applies to my problem but ty anyway. After reading it i tried another thing. No matter where in my script i put the Pause::Pause, as soon as it reaches that point the script stops. If anyone can please help me get this pause thing working properly i would greatly appreciate it. The help file doesnt go into anymore detail about what else i should do. Otherwise i am just going to have to remove it completely and put a longer sleep so i can manually pause the script by clicking the tray icon. Ty for any help. |
|
| Back to top |
|
 |
Zippo() Guest
|
Posted: Wed Mar 07, 2007 9:55 pm Post subject: |
|
|
What Veovis posted means you needed to put the pause hotkey outside of the auto-execute section:
| Code: |
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <myemail@nowhere.com>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#InstallKeybdHook ; Install Keyboard Hook
#UseHook ON ; Turn Hook On
#Persistent
#SingleInstance FORCE
Process, Priority,, Realtime ; Set Script priority to Realtime
Pause, On ;This will stop the script
Sleep, 3000
SendRaw U
Sleep, 100
Loop 5
{
Loop 10
{
SendRaw 1
Sleep, 3000
SendRaw 2
Sleep, 1500
SendRaw 3
Sleep, 1000
}
SendRaw P
Sleep, 100
SendRaw P
Sleep, 100
SendRaw P
Sleep, 10000
SendRaw 3
Sleep, 1000
}
Return ;1st return, ends auto-execute section
Pause::Pause, Toggle ;Toggle pause state |
|
|
| Back to top |
|
 |
Physical Guest
|
Posted: Thu Mar 08, 2007 2:36 am Post subject: |
|
|
Thanks very much for the help, it works  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|