Difference between revisions of "Comtitles"
(Created page with "=Comtitle Cheat Sheet= For the basic command syntax and variability, please see 'help comtitle' instead. This information is also located in '+help comtitle' in game, and is...") |
(No difference)
|
Revision as of 04:03, 14 September 2020
Comtitle Cheat Sheet
For the basic command syntax and variability, please see 'help comtitle' instead.
This information is also located in '+help comtitle' in game, and is for answering questions and spiffitude.
- Bob wants a comtitle on Public. His Public channel alias is pub.
- Bob decides he wants his title to be 'A dog named' because he is silly.
- He also likes bright red, and cats, and squirrels, and weasels.
PLAIN TITLE
- comtitle pub=A dog named
COLORED TITLE
- @force me=comtitle pub=%xh%xrA dog named%xn
- @force me=comtitle pub=[ansi(hr,A dog named)]
- It is worth noting that without the @force me=, anyone who typed 'pub who'
- would see Bob's name and comtitle written as:
- %xh%xrA dog named%xn Bob
- Rather than:
- A dog named Bob
RANDOM TITLE
Making a title flip randomly between a list of options is pretty simple. It IS code, so if you are code-allergic, get yourself a cootie shot before you read further.
First thing you need to do is write up what you want the options to look like.
There is a handy dandy function called pickrand() which, as its name implies, picks stuff at random. See 'help pickrand' for a description.
By default, what it picks is separated by spaces. To give you some fancy code jargon, "the thing which separates stuff" is called a delimiter. If you want your title to have spaces in it, as Bob does, you will have to change the delimiter. It's customary to use the pipe, the straight up and down thingy usually right above your Return/Enter key, sharing space with \.
If you want to use a different delimiter, you have to tell the code what it should be looking for, or it WILL look at your spaces instead.
- pickrand(list|of|stuff|delimited|by|pipes,|)
- e.g. pickrand(dog cat squirrel weasel)
- -> picks randomly between dog, cat, squirrel or weasel.
- e.g. pickrand(A dog|A cat|A squirrel|A weasel,|)
- -> picks randomly between A dog, A cat, A squirrel or A weasel.
It is also worth noting that, because the code uses commas, if you WANT to have a comma in your comtitle, you will need to 'escape' it -- i.e. make the code ignore it. Just stick a % or a \ in front of it.
- e.g. The Great%, the Wise%, and
- -> would show up as: [Public] The Great, the Wise, and Bob says, "Hi!"
So to make a random title which picked between bright red versions of 'A <thing> named', Bob would set the following attribute on himself:
- &random-title me=pickrand(%xh%xrA dog named%xn|%xh%xrA cat named%xn|%xh%xrA weasel named%xn,|)
Then, to make the Public channel use that as his comtitle, he would set the following code as his comtitle:
- comtitle pub=[u(random-title)]
NOTE: If you want to test your pickrand() code without spamming everybody on the channel, you can type 'think [u(random-title)]' and it will show the results only to you.