AutoHotkey Community

It is currently May 27th, 2012, 11:33 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: August 20th, 2005, 1:50 pm 
Offline

Joined: December 28th, 2004, 2:55 pm
Posts: 1
Hi.

This makro is done to be run at a game. It shall do some stuff and "buff" you every 10 min. Since I sometimes chane the "stuff" i thought i simply do a
If (A_TickCount > last_buff + 600000)
{
Gosub PBuffs
}
instead of counting the waits of the "stuff" part.

Pbuffs looks like:

ControlSend, ,!1, ahk_id %sb_id%; Free Though (Int)
Sleep 4500.........

My problem is now that when I use Gosub PBuffs inside this If then the ! (alt +) is being ignored.

the scrips, at least the important parts:

This one works as it should do, it presses alt + 1 inside sub PFuffs

Loop
{
Gosub PBuffs
Loop 20
{
do something and sleep a lot
}
}
Return

; Personal Buffs
PBuffs:
ControlSend, ,{END}, ahk_id %sb_id%
ControlSend, ,!1, ahk_id %sb_id%; Free Though (Int)
Sleep 4500
........
Return ; End Procedure


This one doesnt work, though PBuffs is completely unchanged and it gets called, I tested that with a msg box instead of key presses. Makro presses 1 instead of alt+1
Code:
last_buff = 0

Loop
  {
  If (A_TickCount > last_buff + 600000)
    {
    Gosub PBuffs
    last_buff = %A_TickCount%
  }
  Loop 20
    {
       Do something too, but without loop if possible.
  }
}
Return

; Personal Buffs
PBuffs:
  ControlSend, ,{END}, ahk_id %sb_id%
  ControlSend, ,!1, ahk_id %sb_id%; Free Though (Int)
  Sleep 4500
  .....
Return ; End Procedure


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 20th, 2005, 2:24 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
From a brief review of the scripts, I don't see anything wrong, nor can I think of any explanation. But I'll review the program more in case something stands out.

If you can ever reproduce misbehavior in a common application such as Notepad, that would help track this down. Also, if you find out anything more about it, please post here.

Thanks.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 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