AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need help

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
jantzen05



Joined: 20 Aug 2004
Posts: 8

PostPosted: Wed Sep 15, 2004 9:46 am    Post subject: Need help Reply with quote

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
View user's profile Send private message MSN Messenger
BoBo
Guest





PostPosted: Wed Sep 15, 2004 10:11 am    Post subject: Reply with quote

Quote:
Rigtig Shadowbane?

Are you from the Netherlands/Denmark/Sweden/Norway ?
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Wed Sep 15, 2004 10:29 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jantzen05



Joined: 20 Aug 2004
Posts: 8

PostPosted: Wed Sep 15, 2004 11:13 am    Post subject: Reply with quote

I will try that thank you. and yes I am danish.
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group