multiboxing help

Post Reply
addlemixie
Posts: 1
Joined: Mon May 14, 2018 1:02 am

multiboxing help

Post by addlemixie »

I was trying to figure out how to send commands to a different tabbed connection. Ideally, I don't want to do things like emotes which would fire a trigger on the secondary account, but was instead hoping that I could simply type a command in the main window and have it sent to the secondary window instead.

I've gotten as far as creating a script and then calling it as an event which does send it to the secondary window, but I can't figure out how to NOT send it to the primary.

Code: Select all

function castheal(event, arg)
	send("c 'cure light' "..arg)
 end

-- Register the event handler.
registerAnonymousEventHandler("multiboxheal", "castheal")
and then the trigger from the main window is
^heal (\w+)
which sends:
raiseGlobalEvent("multiboxheal", matches[2])

When i type "heal bob" in the main window, I was hoping to get c 'cure light' bob in the second window and nothing in the first.
Instead, I'm getting the c 'cure light' bob in the second window, but I am sending "heal bob" to the first.

How do I stop the "heal bob" being sent?

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: multiboxing help

Post by Vadi »

It does not get sent to the current profile by design - are you sure this is all you've setup?

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: multiboxing help

Post by SlySven »

Um, do you mean trigger or alias ^heal (\w+)?

Is that function castheal in a permanent script with the same name in the secondary profile and is registered to handle the "multiboxheal" event - does a command-line invocation of `registerAnonymouseEventHandler` show up in the scripts window {I always create my event handlers in the Editor so I'm not sure on this}?

I am not sure whether the signature for the castheal function is right - event handlers ought to be varadic (take a variable number of arguments) with a last argument of ... which is then parsed with the select("#", ...) call to get the number of values in the ... "argument" and then individual arguments can be picked out with select(n, ...} where n = 1 to the value returned from the call with a "#" as the first argument. The reason I point this out is that the raiseGlobalEvent(...) gets an extra last argument which is the name of the sending profile and which might need to be dropped in some cases and used in others...

Post Reply