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 

Key broadcasting 'lag' problem

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



Joined: 09 Mar 2010
Posts: 2

PostPosted: Fri Mar 12, 2010 3:33 pm    Post subject: Key broadcasting 'lag' problem Reply with quote

Hello quite new here Smile ... Don't think theres another post with this question but if there is then just give me the link Smile

So using notepad i've made a AHK script my self and with some help of duelboxing.com to multibox on WoW. My script seems to be working fine and does everything it should. However, it seems to sort of 'lag'. Not all the time but it somewhat spikes from time to time. Most of the time it's when if am holding 'W' to move the main character forward on the game, when a realise the key it carries on moving farward for about 3-5 seconds depending on how long the key was held down.
As far as i know the script doesn't have any type of delay and this lag doesn't happen all the time and only when a lot of keys are been pressed or hold down.

Heres a section of my script:
Code:

WinGet, wowid, List, World of Warcraft
$ScrollLock::Suspend, Toggle
$1::             
ifWinActive, World of Warcraft
{                                     
   ControlSend,, {1 down}, ahk_id %wowid1%
   ControlSend,, {1 down}, ahk_id %wowid2%
   ControlSend,, {1 down}, ahk_id %wowid3%
   ControlSend,, {1 down}, ahk_id %wowid4%
   ControlSend,, {1 down}, ahk_id %wowid5% 
} else {                           
   Send, {1}
}
Return

$1 up::             
ifWinActive, World of Warcraft
{                                     
   ControlSend,, {1 up}, ahk_id %wowid1%
   ControlSend,, {1 up}, ahk_id %wowid2%
   ControlSend,, {1 up}, ahk_id %wowid3%
   ControlSend,, {1 up}, ahk_id %wowid4%
   ControlSend,, {1 up}, ahk_id %wowid5% 
} else {                           
   Send, {1}
}
Return

$2::             
ifWinActive, World of Warcraft
{                                     
   ControlSend,, {2 down}, ahk_id %wowid1%
   ControlSend,, {2 down}, ahk_id %wowid2%
   ControlSend,, {2 down}, ahk_id %wowid3%
   ControlSend,, {2 down}, ahk_id %wowid4%
   ControlSend,, {2 down}, ahk_id %wowid5% 
} else {                           
   Send, {1}
}
Return

$2 up::             
ifWinActive, World of Warcraft
{                                     
   ControlSend,, {2 up}, ahk_id %wowid1%
   ControlSend,, {2 up}, ahk_id %wowid2%
   ControlSend,, {2 up}, ahk_id %wowid3%
   ControlSend,, {2 up}, ahk_id %wowid4%
   ControlSend,, {2 up}, ahk_id %wowid5% 
} else {                           
   Send, {1}
}
Return

$3::             
ifWinActive, World of Warcraft
{                                     
   ControlSend,, {3 down}, ahk_id %wowid1%
   ControlSend,, {3 down}, ahk_id %wowid2%
   ControlSend,, {3 down}, ahk_id %wowid3%
   ControlSend,, {3 down}, ahk_id %wowid4%
   ControlSend,, {3 down}, ahk_id %wowid5% 
} else {                           
   Send, {1}
}
Return

$3 up::             
ifWinActive, World of Warcraft
{                                     
   ControlSend,, {3 up}, ahk_id %wowid1%
   ControlSend,, {3 up}, ahk_id %wowid2%
   ControlSend,, {3 up}, ahk_id %wowid3%
   ControlSend,, {3 up}, ahk_id %wowid4%
   ControlSend,, {3 up}, ahk_id %wowid5% 
} else {                           
   Send, {1}
}
Return

$4::             
ifWinActive, World of Warcraft
{                                     
   ControlSend,, {4 down}, ahk_id %wowid1%
   ControlSend,, {4 down}, ahk_id %wowid2%
   ControlSend,, {4 down}, ahk_id %wowid3%
   ControlSend,, {4 down}, ahk_id %wowid4%
   ControlSend,, {4 down}, ahk_id %wowid5% 
} else {                           
   Send, {1}
}
Return

$4 up::             
ifWinActive, World of Warcraft
{                                     
   ControlSend,, {4 up}, ahk_id %wowid1%
   ControlSend,, {4 up}, ahk_id %wowid2%
   ControlSend,, {4 up}, ahk_id %wowid3%
   ControlSend,, {4 up}, ahk_id %wowid4%
   ControlSend,, {4 up}, ahk_id %wowid5% 
} else {                           
   Send, {1}
}
Return


the script is very long if it has anything to do with how large it is (3393 lines)
I've not compiled it yet as am always tweaking it if compiling it makes it more responsive.

Thanks for your time, LightWrath
Back to top
View user's profile Send private message
TLM



Joined: 21 Aug 2006
Posts: 2926
Location: The Shell

PostPosted: Fri Mar 12, 2010 5:05 pm    Post subject: Reply with quote

Try placing
Code:
SetBatchLines, -1
at the top of the script.

Also you may want to condense the repeat actions down to something like this:
Code:
SetBatchLines, -1

id = wowid

WinGet, wowid, List, World of Warcraft
$ScrollLock::Suspend, Toggle
$1::
ifWinActive, World of Warcraft
{
   while (a_index <= 5)
   ControlSend,, {1 down}, % "ahk_id " id . a_index
} else {                           
   Send, {1}
}
return
; and so on......
hth
_________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞
Back to top
View user's profile Send private message
LightWrath



Joined: 09 Mar 2010
Posts: 2

PostPosted: Fri Mar 12, 2010 5:17 pm    Post subject: Reply with quote

Hi there TLM, Thanks for your reply.
I'll try the "SetBatchLines, -1" and if that doesn't work out i'll try what you sugested below it. Thanks
LightWrath
Back to top
View user's profile Send private message
Display posts from previous:   
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