AutoHotkey Community

It is currently May 27th, 2012, 5:32 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: March 12th, 2010, 4:33 pm 
Offline

Joined: March 9th, 2010, 2:16 am
Posts: 2
Hello quite new here :) ... Don't think theres another post with this question but if there is then just give me the link :)

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 12th, 2010, 6:05 pm 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
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

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 12th, 2010, 6:17 pm 
Offline

Joined: March 9th, 2010, 2:16 am
Posts: 2
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


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], dra, HotkeyStick, rbrtryn, XstatyK and 66 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