AutoHotkey Community

It is currently May 27th, 2012, 1:05 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: March 29th, 2008, 4:42 pm 
Offline

Joined: March 29th, 2008, 4:00 pm
Posts: 3
This is my issue;

I run Autohotkey, have a working script, run two programs, everything works fine. But after a while, I have to manually reload the script because it doesn't work anymore. After reloading, everything works fine again.
Does anyone have any idea what the problem could be?
Thanks in advance


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2008, 6:10 pm 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
Your script is obviously possessed by politicians who, though appearing to work at first, end up just doing nothing as soon as your attention is elsewhere.

btw, you forgot to put your script between [code][/code] tags in your post.

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 5th, 2008, 8:11 pm 
Offline

Joined: October 10th, 2007, 7:43 pm
Posts: 29
Location: Montreal, Canada
One idea is that your script is indefinitely waiting for something. It can happen if you are not using correctly a command like ClipWait, WinWait, WinWaitActive, WinWaitClose and so on.

_________________
epconfig
Enterpad Keyboard for AutoHotkey


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 7th, 2008, 9:38 pm 
Offline

Joined: March 29th, 2008, 4:00 pm
Posts: 3
[VxE] wrote:
Your script is obviously possessed by politicians who, though appearing to work at first, end up just doing nothing as soon as your attention is elsewhere.

btw, you forgot to put your script between [code][/code] tags in your post.

lol :)

Anyway, here's my script:
Code:
killbroadcast = 0
WinGet, wowid, List, World of Warcraft

~Pause::
KeyWait, Pause, D
If(%killbroadcast% = 0)
{
    killbroadcast = 1
}
else
{
    killbroadcast = 0
    WinGet, wowid, List, World of Warcraft
}
Return

~1::
KeyWait 1, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, 1, ahk_id %target_window%
         }
      }
   }
}
Return

~2::
KeyWait 2, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, 2, ahk_id %target_window%
         }
      }
   }
}
Return

~3::
KeyWait 3, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, 3, ahk_id %target_window%
         }
      }
   }
}
Return

~4::
KeyWait 4, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, 4, ahk_id %target_window%
         }
      }
   }
}
Return

~5::
KeyWait 5, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, 5, ahk_id %target_window%
         }
      }
   }
}
Return

~6::
KeyWait 6, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, 6, ahk_id %target_window%
         }
      }
   }
}
Return

~7::
KeyWait 7, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, 7, ahk_id %target_window%
         }
      }
   }
}
Return

~8::
KeyWait 8, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, 8, ahk_id %target_window%
         }
      }
   }
}
Return

~9::
KeyWait 9, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, 9, ahk_id %target_window%
         }
      }
   }
}
Return

~0::
KeyWait 0, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, 0, ahk_id %target_window%
         }
      }
   }
}
Return

~-::
KeyWait -, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, -, ahk_id %target_window%
         }
      }
   }
}
Return

~=::
KeyWait =, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, =, ahk_id %target_window%
         }
      }
   }
}
Return

~F1::
KeyWait F1, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, {F1}, ahk_id %target_window%
         }
      }
   }
}
Return

~F2::
KeyWait F2, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, {F2}, ahk_id %target_window%
         }
      }
   }
}
Return

~F3::
KeyWait F3, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, {F3}, ahk_id %target_window%
         }
      }
   }
}
Return

~F4::
KeyWait F4, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, {F4}, ahk_id %target_window%
         }
      }
   }
}
Return

~F5::
KeyWait F5, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, {F5}, ahk_id %target_window%
         }
      }
   }
}
Return

~F6::
KeyWait F6, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, {F6}, ahk_id %target_window%
         }
      }
   }
}
Return

~F7::
KeyWait F7, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, {F7}, ahk_id %target_window%
         }
      }
   }
}
Return

~F8::
KeyWait F8, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, {F8}, ahk_id %target_window%
         }
      }
   }
}
Return

~F9::
KeyWait F9, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, {F9}, ahk_id %target_window%
         }
      }
   }
}
Return

~F10::
KeyWait F10, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, {F10}, ahk_id %target_window%
         }
      }
   }
}
Return

~F11::
KeyWait F11, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, {F11}, ahk_id %target_window%
         }
      }
   }
}
Return

~F12::
KeyWait F12, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, {F12}, ahk_id %target_window%
         }
      }
   }
}
Return

~/::
KeyWait /, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      killbroadcast=1
   }
}
Return

~Enter::
KeyWait Enter, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% <> 0)
   {
      killbroadcast = 0
   }
   else
   {
      killbroadcast = 1
   }
}
Return

~NumpadEnter::
KeyWait NumpadEnter, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% <> 0)
   {
      killbroadcast = 0
   }
   else
   {
      killbroadcast = 1
   }
}
Return

~Backspace::
KeyWait Backspace, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
   If(%killbroadcast% = 0)
   {
      Loop, %wowid%
      {
         target_window := wowid%A_index%
         If (Active_Window <> target_window)
         {
            ControlSend,, {Backspace}, ahk_id %target_window%
         }
      }
   }
}
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 7th, 2008, 11:12 pm 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
Try replacing every instance of
Code:
{
   If(%killbroadcast% <> 0) ; this is your error line
   {
      killbroadcast = 0
   }
   else
   {
      killbroadcast = 1
   }
}

with
Code:
killbroadcast := !killbroadcast

then, replace every remaining instance of
Code:
If (%killbroadcast% <> 0)

with
Code:
If killbroadcast

then, replace every remaining instance of
Code:
If (%killbroadcast% = 0)

with
Code:
If !killbroadcast

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2008, 7:45 pm 
Offline

Joined: March 29th, 2008, 4:00 pm
Posts: 3
Thanks alot mate, gonna try it right away!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Amandaville, BrandonHotkey, chaosad, Yahoo [Bot] and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group