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 

Macro for game
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ben75
Guest





PostPosted: Fri Oct 30, 2009 5:09 pm    Post subject: Macro for game Reply with quote

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]
Back to top
Guest






PostPosted: Fri Oct 30, 2009 5:11 pm    Post subject: Reply with quote

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
 
Back to top
sinkfaze



Joined: 18 Mar 2008
Posts: 2427

PostPosted: Fri Oct 30, 2009 5:13 pm    Post subject: Reply with quote

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
}

_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message
ben75
Guest





PostPosted: Fri Oct 30, 2009 5:14 pm    Post subject: Reply with quote

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
Back to top
Guest






PostPosted: Fri Oct 30, 2009 5:16 pm    Post subject: Reply with quote

so what exactly are u trying to do, maybe we can rewrite it
Back to top
ben75
Guest





PostPosted: Fri Oct 30, 2009 5:24 pm    Post subject: Reply with quote

i'm trying to launch several spells in the same time like 4 or 5 spells by using only my m button
Back to top
Carcophan



Joined: 24 Dec 2008
Posts: 768
Location: :noitacoL

PostPosted: Fri Oct 30, 2009 5:28 pm    Post subject: Reply with quote

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

_________________
"Unfortunately a "COM for Dummies" book would be a little like "Neurosurgery for Dummies," in the end you're just gonna have to learn" ~Tank
Back to top
View user's profile Send private message AIM Address
Z_Gecko
Guest





PostPosted: Fri Oct 30, 2009 5:33 pm    Post subject: Reply with quote

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.
Back to top
Guest






PostPosted: Fri Oct 30, 2009 5:34 pm    Post subject: Reply with quote

try:
Code:
MButton::
Send {F2}
Send {F3}
Send {F4}
Send {F6}
Send {F8}
return

dose it work?
Back to top
ben75
Guest





PostPosted: Fri Oct 30, 2009 5:36 pm    Post subject: Reply with quote

there is no delay between these spells and yes it's possible to launch several spells at once
Back to top
ben75
Guest





PostPosted: Fri Oct 30, 2009 8:18 pm    Post subject: Reply with quote

Anonymous wrote:
try:
Code:
MButton::
Send {F2}
Send {F3}
Send {F4}
Send {F6}
Send {F8}
return

dose it work?


no same problem
Back to top
ben75
Guest





PostPosted: Fri Oct 30, 2009 8:18 pm    Post subject: Reply with quote

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
Back to top
Guest






PostPosted: Fri Oct 30, 2009 8:41 pm    Post subject: Reply with quote

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?
Back to top
ben75
Guest





PostPosted: Fri Oct 30, 2009 11:26 pm    Post subject: Reply with quote

it just stops working after 5 10 mins.. i can't rlly say why
Back to top
Guest






PostPosted: Fri Oct 30, 2009 11:35 pm    Post subject: Reply with quote

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?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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