PDA

View Full Version : Executing a macro on a slave from master?



Pennie
07-17-2008, 02:32 AM
I'm new at this and trying to read over everything, but one question I can't seem to resolve is if there is a way to click a command button on the master and have that execute a macro (i.e. heal main tank) on a specific slave?

The closest I've found so far was to use Bindpad to create a macro bound to a keystroke, then I could have the keystroke passed through Octopus to the slave and it would execute the heal, but is there a way so I could have a normal button I could click without having to resort to all the keybinding?

Thanks!

bbj
07-17-2008, 04:27 AM
a macro must be triggerd by a keystroke event lest it be considered automation.

ElectronDF
07-17-2008, 08:01 AM
There isn't a good way to pass most things mouse related to alts. In my opinion there will never be. Sorry. The best thing you can use is a keystroke. Get a Logitech G15 keyboard and map the G keys to something weird like CTRL-Numpad# and then pass that to your alts. It is pretty near your movement keys and you just reach over with your pinky and push it.

Pennie
07-17-2008, 09:18 AM
OK well I'm (sorta) glad I didn't just completely miss some wonderous addon that could do that, so in that light I'll talk about an idea I had and see if that's possible.

First off, is there any sort of "eval" function in the WoW API like what you can do in javascript:

eval('alert("test");');

Where this would actually execute the string inside the eval so you could dynamically build a string to then execute?

If so then what I was thinking is have a special channel (or whisper) system where the master sends a specific command whisper to the slave which then takes it and executes, so is psuedocode, it would look something like:

On Master:

<press button>
Whispers: /run heal_RenewMT

On Slave:

XYZ whispers: /run heal_RenewMT
<decodes command, heal_RenewMT>
Does a: eval("heal_RenewMT">

This runs the local macro heal_RenewMT which obvously casts a Renew on the MT.

All this would hinge on the ability to evaluate a dynamically generated string (i.e. the command received from master), but if there is such a beast, it should be able to be done I'd imagine, it could be used in a bot-ish situation, but in this case the user would be generating all input just like pressing a keystroke, they would have to press the button on the MT's screen to direct the slave to issue the heal.

ElectronDF
07-17-2008, 09:24 AM
You can't whisper commands. You can whisper text if you want, but you can't take the text to make it a command.

Why are you so against pushing a key to heal with your alt? Keys can be broadcast and they can be used on a hotbar to operate macros.

Freddie
07-17-2008, 09:50 AM
Pennie, could you clarify the original question? Were you asking about the trigger or about the third-party program's output?

I thought you were asking whether it's possible to trigger this event by clicking an on-screen button with the mouse in your master WoW's window. Did I misunderstand?

Everybody's talking here about output (the keystrokes that the third-party program injects into the target WoW) but that's a separate issue.

Pennie
07-17-2008, 10:30 AM
I'm not against pushing a key to heal, but I've never been much of a keybinder myself, I find it easier to work with buttons than keys personally, which is why I'm working that angle.

To clarify, what I'm looking to do is on the master, I'd like to have a button on an actionbar I could press that would then trigger the slave to issue a heal on myself (i.e. MT). I was looking for an addon that might do this that I would not have to bind a bunch of keys in order to do, but from what I'm gathering, the only way to do anything is to run a program that could take a single keystroke and then remap that into a slash command on the slave to execute the desired action.

Sorry for all the confusion on this.

Freddie
07-17-2008, 11:03 AM
To clarify, what I'm looking to do is on the master, I'd like to have a button on an actionbar I could press that would then trigger the slave to issue a heal on myself (i.e. MT). I was looking for an addon that might do this that I would not have to bind a bunch of keys in order to do...
The trigger and key binds are separate things. The first thing is triggering the action by clicking an action bar button. I'm not an expert on WoW, but I don't think it's possible to make your master WoW control another instance of WoW. because that would allow a huge level of automation and Blizzard would never do it. So you can't really use the action bar button as a trigger. What you have to do is use a third-party program to intercept your physical input event (clicking a mouse button while the mouse cursor is over the action bar button) and have the third-party program carry out the desired action. This doesn't involve any key binding -- it involves writing a script for the third-party program -- and you could just as well tell the third-party program that you want to trigger the action by pressing a key combination. In fact you could do both.

In other words, whether you trigger the event with a key or mouse, nothing needs to be bound because the trigger is seen by the third-party program, not by WoW.

Once the action is triggered, you have a choice of three ways to inject the output into the target WoW. Which one you pick has nothing to do with the way you choose to trigger the action. They are unrelated.

1. Inject a slash command onto the chat line. This is probably a bad idea because it's inefficient and it may violate the rules.

2. Inject a key combination that's bound to a scripted macro. This is probably the best way because it's faster, more reliable, and less likely to violate rules. It requires a single key binding.

3. Inject a simulated mouse click on an action bar button in the target WoW. This is less robust than (2) and also requires a binding.

Elili
07-17-2008, 01:02 PM
Pushing buttons with a mouse = the devil.

To the best of my knowledge there is no way to push a button on one instance of WoW with a mouse click, and have it relay a command / macro to another instance of WoW.

The closest thing you could do to this, providing you've got a lot of time for testing and patience, is setup a third party application (Like hotkeynet) to pass your mouse clicks, and setup your alt's buttons in the exact same place as your "Dummy" buttons on your main. However, I did find once by accident that while using HotKeyNet if you tell it to pass your left mouseclick to your main characters screen, then click on it, it will indefinitly pass left mouse click for the rest of your life, or until you find a way to crash Hotkeynet (I had to hard reset because I was unable to get windows to do anything else). This in theory would happen with any program, and therefore make mouseclicking in that way all but impossible.

Freddie
07-17-2008, 01:28 PM
The closest thing you could do to this, providing you've got a lot of time for testing and patience, is setup a third party application (Like hotkeynet) to pass your mouse clicks, and setup your alt's buttons in the exact same place as your "Dummy" buttons on your main. However, I did find once by accident that while using HotKeyNet if you tell it to pass your left mouseclick to your main characters screen, then click on it, it will indefinitly pass left mouse click for the rest of your life, or until you find a way to crash Hotkeynet (I had to hard reset because I was unable to get windows to do anything else).
Congratulations on your narrow escape! You can avoid this problem with HotkeyNet by defining the trigger so the mouse click gets broadcast only when a particular toggle (like ScrollLock) is on or off, or when you simultaneously press some second key or button. Some day soon I'll add conditional triggers to HotkeyNet so you'll be able to restrict the action so it happens only when you click in a particular window.

I thought Pennie could also do this in a second way by defining "virtual buttons" in an existing game window. Somebody suggested this idea in this forum once, and it's on my list of things to add to HotkeyNet. The idea is, you define existing objects like buttons or health bars in the game window as virtual buttons for the third party program. You could also draw new buttons as a semi-transparent overlay. I thought AutoHotKey already had this feature but I just looked at its documentation and I don't see a way.

Pennie
07-17-2008, 01:30 PM
LOL mouse clicking is good for u!

I did some more investigating and looks like what I had wanted to do USED to be possible, but as of patch 2.0.1, they made RunMacro() and RunMacroText() protected, so you couldn't whisper a command string and then turn around and do a RunMacro(strWhisperString) (or even RunMacroText()) and have it run the local macro on the target's instance of wow.exe.

Guess I'm gonna have to get used to keybinding unless i wanna go back to two keyboards/mousies. :(

Elili
07-17-2008, 02:19 PM
Congratulations on your narrow escape! You can avoid this problem with HotkeyNet by defining the trigger so the mouse click gets broadcast only when a particular toggle (like ScrollLock) is on or off, or when you simultaneously press some second key or button. Some day soon I'll add conditional triggers to HotkeyNet so you'll be able to restrict the action so it happens only when you click in a particular window.

I thought Pennie could also do this in a second way by defining "virtual buttons" in an existing game window. Somebody suggested this idea in this forum once, and it's on my list of things to add to HotkeyNet. The idea is, you define existing objects like buttons or health bars in the game window as virtual buttons for the third party program. You could also draw new buttons as a semi-transparent overlay. I thought AutoHotKey already had this feature but I just looked at its documentation and I don't see a way.The real question is, Would there be a way to define a hotkey to only react to "Physical" mouse clicks, as opposed to virtual mouse clicks?

Freddie
07-17-2008, 02:27 PM
The real question is, Would there be a way to define a hotkey to only react to "Physical" mouse clicks, as opposed to virtual mouse clicks?
HotkeyNet isn't supposed to react to its own mouse clicks or keystrokes ... if that was happening, it was a bug, so please tell me if it did and I'll fix it.

As far as reacting to injected clicks or keystrokes from other programs, HotkeyNet treats them like physical ones. This allows it to work with other programs. If you have a scenario where this is undesirable, please tell me. I could add an option to turn this behavior on and off. It just never occurred to me that anybody would want to.

Suvega
07-17-2008, 02:43 PM
Let me just finish this thread for you guys ;)

Due to limitations in UI, it is IMPOSSIBLE to do anything that involves targeting and casting without user input on any computer WHILE IN COMBAT.

Thus, you will HAVE to bind a key on your alts to do this. This is INTENTIONAL, and came with WoW 2.0 LUA changes.
Anyway to do this, that doesn't involve binding a key, that has a macro assigned to it, WILL GET YOU BANNED. No IF's AND'S or BUT's.

Use trinity bars. You can bind random combination of keys to an INFINITE number of buttons. Furthermore, the buttons can be macros with infinite length. Thus you can do this all from wtihin your actionbars.

Elili
07-17-2008, 02:52 PM
The real question is, Would there be a way to define a hotkey to only react to "Physical" mouse clicks, as opposed to virtual mouse clicks?
HotkeyNet isn't supposed to react to its own mouse clicks or keystrokes ... if that was happening, it was a bug, so please tell me if it did and I'll fix it.

As far as reacting to injected clicks or keystrokes from other programs, HotkeyNet treats them like physical ones. This allows it to work with other programs. If you have a scenario where this is undesirable, please tell me. I could add an option to turn this behavior on and off. It just never occurred to me that anybody would want to.I'll go reproduce it (This was a version or two ago so it may be unreproducable, but I have the file I used saved so) and post it with you later then.

Freddie
07-17-2008, 03:06 PM
Thanks.

Edit: Don't bother looking, Elili. Based on what you said I found the bug. I just fixed it and posted a corrected build, number 115. Thanks very much for telling me.

Frosty
07-18-2008, 07:28 AM
It's early...and I haven't had much coffee yet.
But this has me really confused on why you wouldn't just want to use the following:

Main Toon
Key = #1 on action bar with nothing in it..blank..no spell..no macro...

Healer Toon
Key = #1 on action bar with macro in it containing:
/target party1
/cast <heal spell name>
-----> you can even add the following which I find helpful in cobat situations
/assist

bbj
07-22-2008, 08:37 AM
sorry i i dontmake a whole herd of sense, butimposting from my hospital bed ;-)

anyways,

the eval function dont exist. There is however a way to dynamically create a macro. Problem is twofold. To execute that macro you need a keystroke to trigger it, and you can only build the macro while out of combat. The in combat/out of combat thing was created by blizzard to stop automation type things like what youre proposing.

For examples on how to create dynamic macro's you can look at decursive. Somewhere in there it does it.