 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jantzen05
Joined: 20 Aug 2004 Posts: 8
|
Posted: Wed Sep 15, 2004 9:46 am Post subject: Need help |
|
|
I have this script. My problem is that if it runs through with no option it executes anyway and I dont want it to do that.
What can I do to fix it. | Code: | ;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <myemail@nowhere.com>
;
; Script Function:
; Template AutoHotkey script.
;
; This next example will visit all open windows and display info
; about each of them:
WinGet, id, list, Shadowbane, , Program Manager
Loop, %id%
{
StringTrimRight, this_id, id%a_index%, 0
WinActivate, ahk_id %this_id%
WinGetClass, this_class, ahk_id %this_id%
WinGetTitle, this_title, ahk_id %this_id%
MsgBox, 3, , Rigtig Shadowbane?`nahk_id %this_id%`n%this_title%`n`nContinue?
IfMsgBox, YES, break
IfMsgBox, CANCEL, ExitApp
}
Loop
{
Sleep, 1000
ControlSend,,c , ahk_id %this_id%; Combat Mode
Sleep, 2000
ControlSend,,4 , ahk_id %this_id%; Offensive stance
Sleep, 4000
ControlSend,,c , ahk_id %this_id%; Combat Mode
Sleep, 2000
ControlSend,,3 , ahk_id %this_id%; Free thought int buff.
Sleep, 4000
Loop, 25
{
ControlSend,,6 , ahk_id %this_id%; Needs of the One
Sleep, 6000
Loop, 2
{
ControlSend,,5 , ahk_id %this_id%; Psychic Shout
Sleep, 6000
ControlSend,,2 , ahk_id %this_id%; Surpass Limits
Sleep, 4000
ControlSend,,1 , ahk_id %this_id%; Psychic Healing
Sleep, 6000
}
}
}
SCROLLLOCK::pause ; Pauses this script.
Pause::ExitApp ; Terminates this script. |
|
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Wed Sep 15, 2004 10:11 am Post subject: |
|
|
| Quote: | | Rigtig Shadowbane? |
Are you from the Netherlands/Denmark/Sweden/Norway ? |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Wed Sep 15, 2004 10:29 am Post subject: |
|
|
| Quote: | | if it runs through with no option it executes anyway and I dont want it to do that. | If it doesn't find any windows, you could detect that this way: | Code: | WinGet, id, list, Shadowbane, , Program Manager
; And right beneath the above line, add this:
if id = 0
{
MsgBox There are no windows. ; Remove this line if you don't want it.
return
} |
You could also assign a hotkey to the section where the second loop starts, so that it only runs when you press the hotkey.
By the way, I edited your post just to apply the "code" style so that it's internal indentation would show through. This is no fault of yours; it's just a quirk of how the forum generates its HTML. |
|
| Back to top |
|
 |
jantzen05
Joined: 20 Aug 2004 Posts: 8
|
Posted: Wed Sep 15, 2004 11:13 am Post subject: |
|
|
| I will try that thank you. and yes I am danish. |
|
| 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
|