Help - Search - Members - Calendar
Full Version: A timer inside a macro
AC Tools Everything Macro > AC Tool Macros > Other Macros
Morael
Hello guys!!

Im realy new to macro, i already read the FAQ but i can't figure how to do a macro like this:


CODE
Procedure Swimming
  keydown w 5 sec
  keydown s 5 sec
  end


But every "delay 17000" i want to call this next Procedure

CODE
Procedure Heal Self
  leftclick // Heal Self
end


And go back to the Swimming!!!


Can u guys help me plz???


Thankz!!
Vanberk
If you open the AC Tool Help and search after ProcessMessages, you will find what you need.
If you still have problem to put everything together click here and look if you can find out how it works.

-Vanberk
Morael
QUOTE(Vanberk @ May 28 2009, 07:23 PM) *
If you open the AC Tool Help and search after ProcessMessages, you will find what you need.
If you still have problem to put everything together click here and look if you can find out how it works.

-Vanberk



Tnkz i will gona try!!
Morael
CODE
Procedure Delay // I don't like the default Selec Active Window cause didn't work alwas with my Windows Vista

delay 1500
end

Procedure Swimming
  
  keydown w 9 sec
  keydown s 9 sec
  ProcessMessages
  end
  
Procedure Heal Self EVERY 16000
  leftclick // se cura
  End

//Start Macro
   Call Delay
Loop 100000
End



This way???

Only one problem.... if the delay end in the middle of the Swimming Process, he only execute after this process end!!

There is a way to fix this?
Vanberk
Is that the whole macro?
Because there are no ways to get inside the Swimming or Heal Self procedure.
And if you do not call the Swimming procedure you cant get the Heal Self to trigger since the ProcessMessages is inside Swimming.

I don't really know what I can help you with, and I don't want to give you the whole script done.. else you will not learn anything.
But i can give you some advice.

Here is an example on the ProcessMessages that you can find inside AC Tool Help (actool.chm)
CODE
Procedure BuffMe Every 15 Min
  // Some Character Buff Code Goes Here
End
  
Procedure CheckCritter When $Critter = Tusker
  // Some Kill Code Goes Here
End
  
While 1 = 1
  ProcessMessages
End


-Vanberk
Morael
CODE
Procedure Espere // I don't like the default Selec Active Window cause didn't work alwas with my Windows Vista

delay 3 sec
end

Procedure Swimming
  
  keydown w 9 sec // 9 Seconds Forward
  keydown s 9 sec // 9 Seconds Back
  ProcessMessages
  end
  
Procedure Heal Self EVERY 16000
  keys 2
  delay 300
  leftclick // Cast Heal Self Spell
  End
  
Procedure Staff Hotkey 3 EVERY 30 min
  keys 3
  delay 3 sec
  end
  
Procedure Staff Hotkey 4 EVERY 61 min
  delay 5 sec
  keys 4
  delay 3 sec
  end

//Start Macro
   Call Espere
Loop 100000
Call Swimming
        End



This is the whole macro!!!

It is working... the only problem is that the Swimming need to finish to execute the Heal Self.... i wish some kind of command that execute this EVERY 16000 even when are running other Procedure!!! it is possible?
Bear
QUOTE(Morael @ May 29 2009, 09:30 AM) *
It is working... the only problem is that the Swimming need to finish to execute the Heal Self.... i wish some kind of command that execute this EVERY 16000 even when are running other Procedure!!! it is possible?


Not Really, you could use a Timer in place of the 16000, but it won't be triggered until the ProcessMessages command is hit.

Code Snip taken from AC1:BuffHo
CODE
procedure selfbuff When {ElapsedMsec} > $SelfBuffCounter
    Compute SelfBuffCounter = {ElapsedMsec} + 2700000 // Add 45 minutes to 'Now'
End
Morael
Tnkz a lot guys....

i will keep using this


CODE
Procedure Espere // I don't like the default Selec Active Window cause didn't work alwas with my Windows Vista

delay 3 sec
end

Procedure Swimming
  
  keydown w 9 sec // 9 Seconds Forward
  keydown s 9 sec // 9 Seconds Back
  ProcessMessages
  end
  
Procedure Heal Self EVERY 16000
  keys 2
  delay 300
  leftclick // Cast Heal Self Spell
  End
  
Procedure Staff Hotkey 3 EVERY 30 min
  keys 3
  delay 3 sec
  end
  
Procedure Staff Hotkey 4 EVERY 61 min
  delay 5 sec
  keys 4
  delay 3 sec
  end

//Start Macro
   Call Espere
Loop 100000
Call Swimming
        End



It is realy close of what i want smile.gif
Ahk
If you add another processmessages in between the first swim and the second swim you'd trim off 9 seconds of possible extra delays in the swim code.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.