custom emote aliases

If it's no bug or an idea, but it's still MUD-related, it goes here.

Moderator: Wizards

Post Reply
Message
Author
User avatar
Israfel
Veteran
Posts: 103
Joined: Tue Oct 24, 2017 6:51 am

custom emote aliases

#1 Post by Israfel » Wed Sep 02, 2020 11:11 pm

Here are a couple of handy aliases for anyone wanting to make their own custom emotes that they plan to use regularly on their characters - mannerisms, ritual moves, race/guild specific emotes, or just adding more flavour to a few standard actions.

The following two aliases are for Mushclient. They store all your emotes in one or two aliases so you don't end up with random aliases all over the place, and also let you print a list of them in case you forget.

There are two aliases here. One is for emotes that work without a target (eg just waving). The other is for emotes you use with a target (eg waving to someone). I've made a few samples below. With these aliases you can use the same emote command for both types. This means you can write a ‘nosepick’ emote that doesn’t need a target, but can also ‘nosepick israfel’.

To use the single variant, type:

Code: Select all

*nosepick
Result:
You emote: Israfel picks his nose dubiously.
To use the targeted variant, type:

Code: Select all

*nosepick volog
Result:
You emote: Israfel picks his nose whilst staring creepily at Volog.
To list all single variant emotes:
*list

Result:
EMOTE LIST:
brandish : emote #me# brandishes #me:p# #plain iron broadsword# above #me:p# head.
nosepick : emote #me# picks #me:p# nose dubiously.
wipe : emote Humming to #me:o#self, #me# wipes #me:p# filthy hands on #me:p# clothes.
[END]
To list all targeted emotes:
*list target

Result:
EMOTE LIST:
brandish : emote #me# brandishes #me:p# #plain iron broadsword# at #target#.
nosepick : emote #me# picks #me:p# nose whilst staring creepily at #target#.
wipe : emote Humming to #me:o#self, #me# wipes #me:p# filthy hands on #target:s# clothes.
[END]
To add your own emotes, open the alias menu and click edit. Find the list of emotes in the text and add new entries to the table like this:

Code: Select all

 local emotes = {
	["brandish"] = "emote #me# brandishes #me:p# #plain iron broadsword# above #me:p# head.",
	["nosepick"] = "emote #me# picks #me:p# nose dubiously.",
	["wipe"] = "emote Humming to #me:o#self, #me# wipes #me:p# filthy hands on #me:p# clothes.",
To install these, copy the two sets of code below, open the alias menu and click ‘paste’ on the bottom of the menu.

Single variant alias:

Code: Select all

<aliases>
  <alias
   name="emote_self"
   match="^\*(.+?)$"
   enabled="y"
   expand_variables="y"
   group="emotes"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100"
  >
  <send>
   --[[
  INSTRUCTIONS
  To use this emote alias, create your list of emotes in the table below.
  Make sure to follow the formatting provided. This is a list of emotes
  with no target.
  
  To use an emotefrom this list, type * followed by the command only.
  For example: *nosepick
  ]]
  
  local emotes = {
	["brandish"] = "emote #me# brandishes #me:p# #plain iron broadsword# above #me:p# head.",
	["nosepick"] = "emote #me# picks #me:p# nose dubiously.",
	["wipe"] = "emote Humming to #me:o#self, #me# wipes #me:p# filthy hands on #me:p# clothes.",

	--[[ add more emotes underneath the last one in the list using the same formatting as above. That is:
	["command"] = "emote text", 
	That's it! enjoy. ]]
}

require "pairsbykeys"
local filler = " "

if emotes ["%1"] then
	local s = emotes ["%1"]
	Send (s)
elseif
	string.lower("%1") == "list" then
	ColourNote ("silver","black","EMOTE LIST:")
	for k, v in pairsByKeys (emotes) do
		local key = tostring(k)
		local val = tostring(v)&#9;
		local fill2 = string.rep (filler, 15 - string.len (key))&#9;
		key = (key .. fill2 .. ": ")
		NoteStyle (0)
		ColourTell ("silver","black", key)
		ColourTell ("yellow","black", val)
		Note ("")
	end
	ColourNote ("silver","black","[END]")
else
	ColourNote ("silver","black","Emote command not recognised.")
end
</send>
  </alias>
</aliases>
Targeted variant alias:

Code: Select all

<aliases>
  <alias
   name="emote_target"
   match="^\*(.+?) (.+?)$"
   enabled="y"
   expand_variables="y"
   group="emotes"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100"
  >
  <send>
  
  --[[
  INSTRUCTIONS
  To use this emote alias, create your list of emotes in the table below.
  Make sure to follow the formatting provided. This is a list of emotes
  with a target included.
  
  To use an emote from this list, type * followed by the command and the target.
  For example: *nosepick volog
  ]]
  
  local emotes = {
	["brandish"] = "emote #me# brandishes #me:p# #plain iron broadsword# at #%2#.",
	["nosepick"] = "emote #me# picks #me:p# nose whilst staring creepily at #%2#.",
	["wipe"] = "emote Humming to #me:o#self, #me# wipes #me:p# filthy hands on #%2:s# clothes.",

	--[[ add more emotes underneath the last one in the list using the same formatting as above. That is:
	["command"] = "emote text", 
	To give the emote a target (for example if you want to brandish at 'volog'), make sure you put #%2# into the emote text.
	That's it! enjoy. ]]
}

require "pairsbykeys"
local filler = " "

if emotes ["%1"] then
	local s = emotes ["%1"]
	Send (s)
elseif
	string.lower("%1") == "list" then
	ColourNote ("silver","black","EMOTE LIST:")
	for k, v in pairsByKeys (emotes) do
		local key = tostring(k)
		local val = tostring(v)&#9;
		local fill2 = string.rep (filler, 15 - string.len (key))&#9;
		key = (key .. fill2 .. ": ")
		NoteStyle (0)
		ColourTell ("silver","black", key)
		ColourTell ("yellow","black", val)
		Note ("")
	end
	ColourNote ("silver","black","[END]")
else
	ColourNote ("silver","black","Emote command not recognised.")
end
</send>
  </alias>
</aliases>

User avatar
Arsicas
Master
Posts: 247
Joined: Sun Aug 07, 2011 4:20 am

Re: custom emote aliases

#2 Post by Arsicas » Thu Sep 03, 2020 12:28 pm

Ah, I was wondering how to make those targeted emotes. Thanks!
Duncan hisses in Common: love not keepzss zssomeone alive
You speak softly in Common: Sometimes it's all that keeps one
alive.
You smile slightly.

User avatar
Israfel
Veteran
Posts: 103
Joined: Tue Oct 24, 2017 6:51 am

Re: custom emote aliases

#3 Post by Israfel » Thu Sep 03, 2020 6:24 pm

Oh and in case the instructions in the targeted variant aren't clear, the %2 in the emote line represents the target (eg volog), and the # and : symbols are used just like they're described in the emote helpfile.

So if you want to write a targeted 'armcross' emote you'd write something like this in the list:

Code: Select all

["armcross"] = "emote #me# crosses #me:p# arms and looks sternly at #%2#.",
Just be sure to put this in the targeted alias list, not the regular one.

Post Reply