Help - Search - Members - Calendar
Full Version: Creating a key-pressing macro?
AC Tools Everything Macro > AC Tool Macros > Macro Development
guitarussia
Hi there. I am trying to create a very simple macro but I do not see how it does not work even after I checked numerous tutorials. It's so simple it's stupid.
Here is the goal of the script:
To press (a key) within (an active window) every (x) seconds and (restart/loop)

Here is what my attempt looked like:

setactivewindow LastChaos - Aeria Games & Entertainment (Window 800x600) // this is the name of my window
procedure heal
loop 9999999999999 // just so that it keeps on looping early for ever
keys 1
delay 560 sec
if 1=1
then call heal // is this part right?
end // will it loop if I just say end like I did here?

Obviously as I stated above this was a failed attempt:
The window activates when the macro is initiated but nothing further happens- the script is not followed any further
Do I have too much stuff in the script?
Is there a simpler form you guys can think of?
Remember the goal of the script is:
To press (a key) within (an active window) every (x) seconds and (restart/loop)

Thnx in advance
DaMOB
QUOTE(guitarussia @ Jan 21 2009, 08:26 PM) *
Hi there. I am trying to create a very simple macro but I do not see how it does not work even after I checked numerous tutorials. It's so simple it's stupid.
Here is the goal of the script:
To press (a key) within (an active window) every (x) seconds and (restart/loop)

Here is what my attempt looked like:

setactivewindow LastChaos - Aeria Games & Entertainment (Window 800x600) // this is the name of my window
procedure heal
loop 9999999999999 // just so that it keeps on looping early for ever
keys 1
delay 560 sec
if 1=1
then call heal // is this part right?
end // will it loop if I just say end like I did here?

Obviously as I stated above this was a failed attempt:
The window activates when the macro is initiated but nothing further happens- the script is not followed any further
Do I have too much stuff in the script?
Is there a simpler form you guys can think of?
Remember the goal of the script is:
To press (a key) within (an active window) every (x) seconds and (restart/loop)

Thnx in advance

Procedures must be called to work and you are missing an end statement as well (why ACTool didn't shit the bed on you I dunno). Oh, another thing there is no THEN statement (this isn't QBasic) in ACTool.
guitarussia
I just revised and simplified the string to the simplest form (without a procedure whatsoever):

CODE
setactivewindow LastChaos - Aeria Games & Entertainment (Window 800x600) // make sure to type in YOUR window's resolution
while 1=1
keys 1 // this can be any hotkey you set
delay 600 sec // set the pause to your liking
end


I made this to train my pet afk in the game Last Chaos
This is a small section of the code as I also copied a code from a WoW bot and changed it up slightly to use a health potion whenever my health bar goes to the left of a certain pixle
Now all I want to do is automatically close the window whenever the Mob's health goes below a certain pixle as it means that someone else has most likly intruded and could report me for using a Macro (Just for safety)
It should not be hard at all, but I am just trying to figure out the new pixle position
I also don't know which command closes the active window :/ but I'll figure it out
I am also adding a "savescreen" command before the window closes so I may see why I logged out when Pet Leveling afk
This macro is meant for the healer class but it is extremely easy to change it to fit the knight class just delete the 3rd procedure (heal) and set your knight's hotkeys correctly and boom wink.gif
It is unfinished yet as all it does right now is feed the pet, heal the pet, and heal you
I still need to add the screenshot ---> logout feature
once I do I will release the code here for public use biggrin.gif
if you want what I have so far plz pm me
Ahk
Test in notepad, if you see your output the way it's supposed to happen then you know AcTool is working.

Some games use DirectInput (which doesn't see AcTool's output), and others have hack protection. You need to investigate these two issues.

To close a window you can use @{F4} (both special keys/modifiers listed in the help), or you could much more properly use the mouse and keyboard to simulate a log out.

You're probably being logged out because your game is not seeing you do anything at all, or it sees that you haven't moved in 600 seconds and boots you for inactivity and/or botting. You could get make random delays and move your character ever so slightly or go all out and run around like a madman, it's up to you on how to handle the problems.
guitarussia
QUOTE(Ahk @ Jan 22 2009, 06:35 PM) *
Test in notepad, if you see your output the way it's supposed to happen then you know AcTool is working.

Some games use DirectInput (which doesn't see AcTool's output), and others have hack protection. You need to investigate these two issues.

To close a window you can use @{F4} (both special keys/modifiers listed in the help), or you could much more properly use the mouse and keyboard to simulate a log out.

You're probably being logged out because your game is not seeing you do anything at all, or it sees that you haven't moved in 600 seconds and boots you for inactivity and/or botting. You could get make random delays and move your character ever so slightly or go all out and run around like a madman, it's up to you on how to handle the problems.


That's right, I completely forgot that Alt+F4 closes the current active window. Tjanks for reminding me. I can now use a conditional statement to close the game whever the health of the mob I am attacking passes a certain pixle. All I need to figure out now is the x and the y or the target pixle which will take all of 2 seconds biggrin.gif
Alright ty, I am zurethat I can finish this bot in the next hour now

And to clarify, I am not encountering issues with hack detection tools nor am I experiencing disconnections. And the game registers all of the script like a charm. Load RGB and all procedures work.
ACTool is a charm, I have never before worked with macros but this is easy and extremely useful biggrin.gif
Alright I will get back once I am finished adding on the rest of the script
kampas
Hi i dont understand why this code dont work in Priston Tale II it looks like this

CODE
setactivewindow PristonTale II Enigma
loop 99999
keys 1
delay 500
end


And it doesnt work. I dont know why, but on other window for example notepad it works fine. any ideas?
Ahk
If it works in notepad, it's not AcTool coding error or anything like that. Chances are your game uses directinput or has a hack shield...a search for both will turn up a lot of information and a possible workaround.
kampas
Ok thanks. I wondering how do i make a macro which could take hp potions for example not every 20secs or so, but macro which detects hp it self and if its lower than 50% my macro uses a potion? Do i need to get hmy hp code or something?
Bear
QUOTE(kampas @ Mar 14 2009, 02:58 AM) *
Ok thanks. I wondering how do i make a macro which could take hp potions for example not every 20secs or so, but macro which detects hp it self and if its lower than 50% my macro uses a potion? Do i need to get hmy hp code or something?


Well, If your Simple Macro didn't work, why would a more Complex macro work?
kampas
Well i will bybass game guard... and im curious how to make a marco to detect my own hp, how does it work?
Ahk
Use LoadRGB or IsObject ... that is the easiest way if it works. The help has examples on how to use these.

A small note though, you must use the Object..End button under Object Commands on the right hand frame, otherwise it will not insert your object at all into the macro code. Read the object primer first...it will explain a lot.
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.