Help - Search - Members - Calendar
Full Version: Macros
BatMUD > BatMUD forums > Batclient
Rigger
Note: I did this at work, I don't know if I got all the builtin macros - if you have productive changes please post them, I'll keep updating this post as I get more information.

Macros can be used at the client side to execute mud commands and set variables.

Things to know about macros:

  • They cannot receive information (as in you can't use a macro like a command with $* etc.).
  • Macros are performed client side - so a macro in a command will not work.
  • Macros are activated using the / prefix (e.g. /testmacro).
  • Only user macros are displayed in the /macrolist (in the same way that the builtin commands are not displayed when you type command).
  • Macros can accept client side variables.
  • Macros can be activated by a trigger - the documented ability to accept regex strings (%1 etc.) does not currently function.
You can list current user macros by typing /macrolist

To create a macro use the following command:

macro <name> = <content>

where <name> is the name of the macro you want to create, and <content> is what you want to happen.

For example:

macro hello = say Hello my good friend and how are you today?

when you type

/hello

into the client

say Hello my good friend and how are you today?

is sent to the mud.

As mentioned, client variables can be used within macros. Client variables start with an @, they are placed within the content of the macro, and when sent to the mud the actual value of the variable is sent. This topic is discussed in detail in the upcoming variables topic.

What makes macros useful is the builtin macros. Below is a list of builtin macros, what they do, and a real-mud example of when that might be used.
[b]

Note:[/b] The builtin (and probably the user) macros are all case sensitive!




/partyTarget[0-9] This is probably the most useful builtin macro at the moment, it sets the @partyTarget variable to the member in the position selected.
  • /partyTarget1 sets @partyTarget to the player in position in 1,1
  • /partyTarget2 sets @partyTarget to the player in position in 1,2
  • /partyTarget3 sets @partyTarget to the player in position in 1,3
  • /partyTarget4 sets @partyTarget to the player in position in 2,1
  • /partyTarget5 sets @partyTarget to the player in position in 2,2
  • /partyTarget6 sets @partyTarget to the player in position in 2,3
  • /partyTarget7 sets @partyTarget to the player in position in 3,1
  • /partyTarget8 sets @partyTarget to the player in position in 3,2
  • /partyTarget9 sets @partyTarget to the player in position in 3,3
  • /partyTarget0 Not sure, perhaps an oof player? What happens if there is more than one oof player?
Important: These macros are activated when you click on the position in the party window; they are also, by default keybound to the CTRL+keypadnumber (not the top row numbers though).

Why are these macros important?

Well, as you can make macro's call other macros, and use variables within macros it lets you setup single keypresses to perform actions on party member. - no-more reconfiguring aliases every time you get someone with a name like hyzanticudapwnzyunzdrgnd in your party.



For example:

Lets say you want to setup a deaths door macro, that when you press Alt+numpad. (position 1,1 would be as on the keypad 7 etc as keypad 7 looks like position 1,1 in the party window).

First of all we make the macro that will perform the action.

macro dd11 = /partyTarget1;cast 'deaths door' @partyTarget

What's this mean?

dd11 <= Is the macro that we created (deaths door 1,1)
/partyTarget1 <= This sets the @partyTarget variable to the name of the player in the 1,1 position
; <= This is the standard command delimiter, check in ingame help if you don't know about this.
cast 'deaths door' @partyTarget <= This casts deaths door at @partyTarget, which is the person in position 1,1.

The could be simplified more by making cast 'deaths door' $* into a command, lets say the command 'aid', That way if you reinc nomad, or e-relig and need to use first aid or cstim - you can change one command and all your macros would work again.

Doing it that way would give:

command aid cast 'deaths door' $*
macro dd11 = /partyTarget1;aid @partyTarget


You'd then repeat this for each party position:
macro dd12 = /partyTarget2;aid @partyTarget
macro dd13 = /partyTarget3;aid @partyTarget
macro dd21 = /partyTarget4;aid @partyTarget

etc...

Now, by typing /dd11 you automatically cast deaths door at the person currently in position 1,1 (this avoids the old issues of members changing, positions being out of whack etc.)

To assign the macro to the keypad simply open the keybinding window and type the macro (with the / ) next to the appropriate key combination.

You can also assign macro's to an action button, that way you could click (click what's that?) on the party member, and then on the spell you want to cast on that party member.

macro csw = cast 'cure serious wounds' @partyTarget
Then assign /csw to actionbutton1 Then when you want to cast csw at a member, click on their icon then click actionbutton1.




The following command line macros do exactly what they say they do, I'm not sure why they have a space (it makes me think that macros can indeed receive input in some way... hmm)/commandline moveCursorToEnd
/commandline moveCursorToBeginning
/commandline moveCursorOneWordForward
/commandline moveCursorOneWordBackward
/commandline historyNextCommand
/commandline historyPreviousCommand
/commandline deleteFromCursorToEndOfLine
/commandline deleteFromCursorToEndOfWord
/commandline deletePreviousWord



/PartyWindow This macro activates and deactivates the party window.

/OOFWindow
This macro activates and deactivates the out of formation window.

/BattleWindow
This macro activates and deactivates the battle window.

Note: when you deactivate this window all the content is then displayed in your generic tab.



/KeybindingWindow This macro activates and deactivates the keybinding window - Use this window to keybind macros to keypress combinations example you could bind the F1 key to the /PartyWindow macro - from that point every time the F1 key is pressed the party window is activated/deactivated.

/RealmMapWindow This macro activates and deactivates the realm map window.
/ScriptWindow This macro activates and deactivates the script editor window. Note: The script editor does not prompt if you want to save changes - be careful.

/LoginWindow This macro activates and deactivates the login window.

/MapWindow This macro activates and deactivates the map window.
Note: when you deactivate this window all the content is then displayed in your generic tab.

/HorizontalActionButtons This macro activates and deactivates the horizontal action buttons window.

/VerticalActionButtons This macro activates and deactivates the vertical action buttons window.


Gorehound
I just spent 30 mins trying to get these to work only to find the macros dont exist.
If someone else is trying make buttons or whatever that cast spells at party slots, you can just use @party_11 ... @party_33 variable as target.

cast major heal at @party_11
etc.

Edit:
apparently they still exist but are called /PartyTarget1-9 now, not /partyTarget1-9
the target is still called @partyTarget and not @PartyTarget to make it as confusing as possible

QUOTE (Rigger @ Feb 11 2009, 06:36 PM) *
/partyTarget[0-9] This is probably the most useful builtin macro at the moment, it sets the @partyTarget variable to the member in the position selected.
  • /partyTarget1 sets @partyTarget to the player in position in 1,1
  • /partyTarget2 sets @partyTarget to the player in position in 1,2
  • /partyTarget3 sets @partyTarget to the player in position in 1,3
  • /partyTarget4 sets @partyTarget to the player in position in 2,1
  • /partyTarget5 sets @partyTarget to the player in position in 2,2
  • /partyTarget6 sets @partyTarget to the player in position in 2,3
  • /partyTarget7 sets @partyTarget to the player in position in 3,1
  • /partyTarget8 sets @partyTarget to the player in position in 3,2
  • /partyTarget9 sets @partyTarget to the player in position in 3,3
  • /partyTarget0 Not sure, perhaps an oof player? What happens if there is more than one oof player?
Important: These macros are activated when you click on the position in the party window; they are also, by default keybound to the CTRL+keypadnumber (not the top row numbers though).

Why are these macros important?

Well, as you can make macro's call other macros, and use variables within macros it lets you setup single keypresses to perform actions on party member. - no-more reconfiguring aliases every time you get someone with a name like hyzanticudapwnzyunzdrgnd in your party.

[indent]

For example:

Lets say you want to setup a deaths door macro, that when you press Alt+numpad. (position 1,1 would be as on the keypad 7 etc as keypad 7 looks like position 1,1 in the party window).

First of all we make the macro that will perform the action.

macro dd11 = /partyTarget1;cast 'deaths door' @partyTarget

What's this mean?

dd11 <= Is the macro that we created (deaths door 1,1)
/partyTarget1 <= This sets the @partyTarget variable to the name of the player in the 1,1 position
; <= This is the standard command delimiter, check in ingame help if you don't know about this.
cast 'deaths door' @partyTarget <= This casts deaths door at @partyTarget, which is the person in position 1,1.

The could be simplified more by making cast 'deaths door' $* into a command, lets say the command 'aid', That way if you reinc nomad, or e-relig and need to use first aid or cstim - you can change one command and all your macros would work again.

Doing it that way would give:

command aid cast 'deaths door' $*
macro dd11 = /partyTarget1;aid @partyTarget


You'd then repeat this for each party position:
macro dd12 = /partyTarget2;aid @partyTarget
macro dd13 = /partyTarget3;aid @partyTarget
macro dd21 = /partyTarget4;aid @partyTarget

etc...

Now, by typing /dd11 you automatically cast deaths door at the person currently in position 1,1 (this avoids the old issues of members changing, positions being out of whack etc.)

To assign the macro to the keypad simply open the keybinding window and type the macro (with the / ) next to the appropriate key combination.

You can also assign macro's to an action button, that way you could click (click what's that?) on the party member, and then on the spell you want to cast on that party member.

macro csw = cast 'cure serious wounds' @partyTarget
Then assign /csw to actionbutton1 Then when you want to cast csw at a member, click on their icon then click actionbutton1.
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-2024 Invision Power Services, Inc.