AutoHotkey Community

It is currently May 26th, 2012, 10:55 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Macro for game
PostPosted: October 30th, 2009, 6:09 pm 
well i was wondering why i need to reload the following script sometimes because it stops working for no reasons :

MButton::
Loop
{
Send {F2}
Send {F3}
Send {F4}
Send {F6}
Send {F8}
Sleep, 200
return
}

I'm using it for a game now since a while and it's quite frustrating to reload it every 5-10 min because i don't really know what's causing this trouble...

[Title edited. Please write descriptive titles for your topics. ~jaco0646]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2009, 6:11 pm 
what is the purpose of the loop when there is a return inside to stop the hotkey?
Code:
    

MButton::

Send {F2}
Send {F3}
Send {F4}
Send {F6}
Send {F8}
Sleep, 200
return
 


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2009, 6:13 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
Are you sure the script has stopped working, or has the game stopped responding to the key presses?

Try this and see what happens:

Code:
MBUTTON::
SetKeyDelay, 50, 10, Play
Loop {
SendPlay {F2}{F3}{F4}{F6}{F8}
Sleep, 200
}

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2009, 6:14 pm 
i'm a complete noob to say it clearly , i picked up this script while i was checking around these broads and it seemed to work properly until i discover it's not :p


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2009, 6:16 pm 
so what exactly are u trying to do, maybe we can rewrite it


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2009, 6:24 pm 
i'm trying to launch several spells in the same time like 4 or 5 spells by using only my m button


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2009, 6:28 pm 
Offline

Joined: December 24th, 2008, 3:25 am
Posts: 1401
Location: :noitacoL
You do not have sleep timers between the commands, most games require a 'cool down' for spells, and unless the game can queue multiple spells at once, you will need to sleep between them, so you can send them 1 after another.

Quote:
it seemed to work properly until i discover it's not


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2009, 6:33 pm 
http://www.autohotkey.com/docs/FAQ.htm#games
so, try this:
Code:
MBUTTON::
SetKeyDelay, 50, 10, Play
SendPlay {F2}{F3}{F4}{F6}{F8}
return
and check the AHK-Manual for SetKeyDelay and change the Values for Delay and PressDuration (marked red in the script) until it works.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2009, 6:34 pm 
try:
Code:
MButton::
Send {F2}
Send {F3}
Send {F4}
Send {F6}
Send {F8}
return

dose it work?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2009, 6:36 pm 
there is no delay between these spells and yes it's possible to launch several spells at once


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2009, 9:18 pm 
Anonymous wrote:
try:
Code:
MButton::
Send {F2}
Send {F3}
Send {F4}
Send {F6}
Send {F8}
return

dose it work?


no same problem


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2009, 9:18 pm 
sinkfaze wrote:
Are you sure the script has stopped working, or has the game stopped responding to the key presses?

Try this and see what happens:

Code:
MBUTTON::
SetKeyDelay, 50, 10, Play
Loop {
SendPlay {F2}{F3}{F4}{F6}{F8}
Sleep, 200
}


if i'm using delay then i got another problem , my mouse bug and doesn t move fluently


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2009, 9:41 pm 
what exactly is the problem
Quote:
it's quite frustrating to reload it every 5-10 min

u didnt really explain what happen, did it crash? did it just stop working? did it work slowly but still going? did it reload by itself every 5-10mins?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2009, 12:26 am 
it just stops working after 5 10 mins.. i can't rlly say why


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2009, 12:35 am 
what do u mean by "stop working"
did the Mbutton doesnt work?
is the AHK script still running?
is the AHK script not detecting Mbutton even u press Mbutton? (u can check by double clicking the icon shows the current running lines)
we need more information other than its not working
or how about make a settimer that makes the script reload every 5mins?
is that the whole script u are using?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: hyper_, JSLover, Kirtman, Leef_me, Maestr0, Miguel, XstatyK and 60 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