Jump to content
Macro Express Forums

Macro express 3 macro repeating


HolySkin

Recommended Posts

Im trying to create a macro for a game, I'm half successfull but can't quite get it to work correctly, please help.

 

OK so i have a macro that works( kinda), it simply presses buttons 2-9 witha half second timer between each keytype. I have made this macro programme specific, and within the programme window, have set up a piece of the screen to act as a button to start this command.

 

How can i get this macro to repeat itself untill i press the stop button (part of the screen alocated as a button) again?

I use the scripting editor because its easier for me, but in idrect editor it looks like:-

 

<ACTIVATE2:Dark Age of Camelot, Copyright © 2001-06 Mythic Entertainment, Inc.><TEXTTYPE:2><MSD:0050><TEXTTYPE:3><MSD:0050><TEXTTYPE:4>

<MSD:0050><TEXTTYPE:5><MSD:0050><TEXTTYPE:6><MSD:0050><TEXTTYPE:7>

<MSD:0050><TEXTTYPE:8><MSD:0050><TEXTTYPE:9><DELAY:10>

 

after the <DELAY:10> (10 second delay) i want this macro to start over again, untill i manually stop it with my stop/start button.

 

Please, if you can help - keep this ultra simple for me, im a novice with macro'ing, and its my 1st day usig this software

Link to post
Share on other sites
Im trying to create a macro for a game, I'm half successfull but can't quite get it to work correctly, please help.

 

OK so i have a macro that works( kinda), it simply presses buttons 2-9 witha half second timer between each keytype. I have made this macro programme specific, and within the programme window, have set up a piece of the screen to act as a button to start this command.

 

How can i get this macro to repeat itself untill i press the stop button (part of the screen alocated as a button) again?

I use the scripting editor because its easier for me, but in idrect editor it looks like:-

 

<ACTIVATE2:Dark Age of Camelot, Copyright © 2001-06 Mythic Entertainment, Inc.><TEXTTYPE:2><MSD:0050><TEXTTYPE:3><MSD:0050><TEXTTYPE:4>

<MSD:0050><TEXTTYPE:5><MSD:0050><TEXTTYPE:6><MSD:0050><TEXTTYPE:7>

<MSD:0050><TEXTTYPE:8><MSD:0050><TEXTTYPE:9><DELAY:10>

 

after the <DELAY:10> (10 second delay) i want this macro to start over again, untill i manually stop it with my stop/start button.

 

Please, if you can help - keep this ultra simple for me, im a novice with macro'ing, and its my 1st day usig this software

 

I don't have 'Dark Age of Camelot' so I'll show you with Notepad instead.

 

First, give up the idea of toggling the macro on and off with the exactly the same activation, as you'll hit all sorts of unnecessary problems. I'd suggest a couple of alternative options.

 

Whichever method of stopping you use, place the routine inside a Repeat that loops indefinitely. I've shown one way of doing that.

 

The easiest way of stopping it is with your abort hotkey, which here is set to the default of Scroll Lock + Pause. Or, if your taskbar isn't hidden, simply r-click the 'running man' icon that appears in your system tray when any macro is running.

 

So here is that method. First the script and then the code you can paste into your Direct Editor.

 

Activate Window: "TEMP-HolySkin.txt - Notepad"

Repeat Until %T1% <> %T1%

Text Type: 2

Delay 50 Milliseconds

Text Type: 3

Delay 50 Milliseconds

Text Type: 4

Delay 50 Milliseconds

Text Type: 5

Delay 50 Milliseconds

Text Type: 6

Delay 50 Milliseconds

Text Type: 7

Delay 50 Milliseconds

Text Type: 8

Delay 50 Milliseconds

Text Type: 9

Delay 10 Seconds

Repeat End

Macro Return

 

<ACTIVATE2:TEMP-HolySkin.txt - Notepad><REP3:08:000002:000001:0001:1:01:T1><TEXTTYPE:2><MSD:0050><TEXTTYPE:3><MSD:0050><TEXTTYPE:4><MSD:0050><TEXTTYPE:5><MSD:0050><TEXTTYPE:6><MSD:0050><TEXTTYPE:7><MSD:0050><TEXTTYPE:8><MSD:0050><TEXTTYPE:9><DELAY:10><ENDREP><MRETURN>

 

An alternative that gets close to your original requirement is to stop it by just moving the mouse to that same area you clicked to start it, but this time not clicking. In my case I activated both macros by left clicking a small area of Notepad about an inch wide, just to the right of 'Help'. After starting it I made sure I kept the mouse away from that little strip. To stop it, I just moved it back again. Hopefully you can see from the script how that works. In short, it just check at the end of each loop whether the mouse is within the specified area, and if so it breaks out and hence ends the macro.

 

Activate Window: "TEMP-HolySkin.txt - Notepad"

Repeat Until %T1% <> %T1%

Text Type: 2

Delay 50 Milliseconds

Text Type: 3

Delay 50 Milliseconds

Text Type: 4

Delay 50 Milliseconds

Text Type: 5

Delay 50 Milliseconds

Text Type: 6

Delay 50 Milliseconds

Text Type: 7

Delay 50 Milliseconds

Text Type: 8

Delay 50 Milliseconds

Text Type: 9

Delay 10 Seconds

Get Mouse Position Screen: %N1%, %N2%

If Variable %N1% > 285

AND

If Variable %N1% < 367

AND

If Variable %N2% > 320

AND

If Variable %N2% < 336

Break

End If

Repeat End

Macro Return

 

<ACTIVATE2:TEMP-HolySkin.txt - Notepad><REP3:08:000002:000001:0001:1:01:T1><TEXTTYPE:2><MSD:0050><TEXTTYPE:3><MSD:0050><TEXTTYPE:4><MSD:0050><TEXTTYPE:5><MSD:0050><TEXTTYPE:6><MSD:0050><TEXTTYPE:7><MSD:0050><TEXTTYPE:8><MSD:0050><TEXTTYPE:9><DELAY:10><MOUSEPOS:T:01:02><IFVAR2:2:01:4:285><AND><IFVAR2:2:01:3:367><AND><IFVAR2:2:02:4:320><AND><IFVAR2:2:02:3:336><BREAK><ENDIF><ENDREP><MRETURN>

 

--

Terry, East Grinstead, UK

Link to post
Share on other sites

Another way to do it:

 

Use the properties tab to schedule your macro to run once every second. Do not initiate it by clicking on an area of the screen. (Also use Options | Preferences | Scheduler to set the ME timer interval to 1 second).

At the beginning of your macro, Restore Variable N1, then check the value of N1 to see if it equals 1. If it doesn't equal 1, Macro Stop.

 

Write a second macro that IS started by clicking on an area of the screen. Each time it runs, all it does is:

Restore Variable N1

If N1 = 1, set it to zero, else set it to 1.

Save Variable N1

 

So each time you click on your screen area, you will be toggling variable N1 between zero and one. Each second, your original macro will run, and depending on the state of variable N1, it will either do its typing, or will just end without doing anything.

 

Incidentally, 50 ms delay is 1/20 of a second. Use 500 ms if you want a half-second delay.

 

P.S. Oops! The above may not really work right with ME 3, but should work with ME Pro. The problem is, if you click the screen during the ten second delay period, the toggle macro will probably not run -- I'm not sure without trying it. That's because ME 3 allows only one macro at a time to run.

Link to post
Share on other sites

Thank you kindly for your reply and feedback - however i have an issue with both.

 

The 1st one - how can i make a hotkey abort? does it need to be scripted into the original macro or is there a way of setting it outside of the script you wrote?

 

the 2nd one - this works fine, but it seems i need to hover my mouse over the the mouse activation location i set at a specific time, is there anyway to make it abort ANY time i hover over the specific zone? curently it does not do this, not sure if our aware.

 

the trouble is, if the macro runs indeffinatly and i try to talk to people, during this 10 second break it will, at the appropriate time set my the macro spam in 123456789 in my sentances, so i need a way to disable it ingame if i need to communicate to people.

 

Is default abort scroll lock + pause? (repeating myself now - i need this changing)

Link to post
Share on other sites

scroll lock + pause is the standard sequence to abort a running macro.

 

To abort when the mouse hovers, try this: instead of a single 10-second delay, do a repeat loop with 1000 delays of 1/100 second each. Something like this:

repeat 1000 times

get mouse position (x and y coordinates)

if mouse position within your abort area

macro stop

else

delay 10 ms

repeat end

 

So when you move your mouse to the "abort" area, the macro will end within about 1/100 of a second.

 

Due to ME overhead, 1000 delays of 1/100 second each will wind up being more than 10 seconds total, but you can test it, time it on your watch, and adjust the number of repeats appropriately.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...