CMud Scripting
By request, a thread now exists to post cmud scripts and/or make requests for help with them. This probably isn't the place to ask someone to write you something from scratch, but {basic|advanced} code help is fine.
Justus asked for my autologging events, so here those are. OnConnect turns it on, OnDisconnect toggles it, effectively turning it off. It formats the filename as sessionname_month_day_year.txt
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<event event="OnConnect" priority="38520" copy="yes">
<value>#log %concat(%title,"_",%time(m),"_",%time(d),"_",%time(y))</value>
</event>
</cmud>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<event event="OnDisconnect" priority="38530" copy="yes">
<value>#log</value>
</event>
</cmud>
I am the righteous one...
the claims are stated - it's the world I've created
the claims are stated - it's the world I've created
0
Comments
"On the battlefield I am a god. I love war. The steel, the smell, the corpses. I wish there were more. On the first day I drove the Northmen back alone at the ford. Alone! On the second I carried the bridge! Me! Yesterday I climbed the Heroes! I love war! I… I wish it wasn’t over."
the claims are stated - it's the world I've created
the claims are stated - it's the world I've created
the claims are stated - it's the world I've created
(Ring): You say, "Syntax for if is."
(Ring): You say, "#if (condition) {true action} {false action}."
(Ring): You say, "You're missing {}."
the claims are stated - it's the world I've created
#if (condition) {true stuff} {#if (second condition) {else if stuff} {else stuff}}
EDIT: It looks like my caveat above regarding switch statements may not be true in cmud, so that may be your cleanest bet.
the claims are stated - it's the world I've created
Looking for a little bit of help backward engineering something. I've been trying to make myself a prettified elixlist table. I had one before but damned if I can find it or remember the workaround I'm having.
</code></p><code>Basically I've been using %tab to space things out, but two digit vial amounts are screwing it up.<br><br>I found the below after searching for answers, and it does exactly what I want, but I don't know how. Whether with single or double or triple digit numbers in the vial, the display structure is maintained.<br><br>#SAY | %format( "&s &8.0f", Frost:, @frostvial) | %format( "&s &8.0f", Venom:, @venomvial) | %format( "&s &8.0f", Speed:, @speedvial) |;#SAY | %format( "&s &3.0f", Levitation:, @levitationvial) | %format( "&s &6.0f", Caloric:, @caloricvial) | %format( "&s &9.0f", Mass:, @massvial) |<br><br>I've read the file for %format and it isn't explaining anything. The &s &8.0f is obviously the part working the magick but I can't find where in the documentation to explain how or why.<br><br>Basically I could finish the script I want by swapping out my own variables etc but I'd like to understand why the damn thing works. :/<br><br>Edit: And I don't know how I broke the forum display either now. :D<br>
Since you're dealing with whole numbers exclusively, I'd suggest switching to &d instead of &f.
As for the other special pattern characters, the help file for %format does give information (any typos below are from the documentation, not from me!):
Format strings consist of a string of characters, with special format specifiers of the type &w.dx where w is the width of the field, d is the number of decimal places, and x is the format type.
Valid format types:
e: scientific notation(full format)
f: floting point (defaults to 2 decimal places)
g: scientific notation(abbreviated)
m: money (defaults to 2 decimal places)
n: number (commas every 3 digits, defaults to 2 decimal places)
s: string
d: integer (decimal). Same as n but without the commas
-----------------------end documentation-----------------------
If that isn't helpful, here's an example.
%format("This is a pattern string containing within it a string: %s and a number right-aligned to 6 digits: %6d", @replacesthepercents, @replacesthepercentd)
In that example I use % instead of &, because I'm used to printf, but either symbol will work.
If you want to left-align something instead of right-align it, you can do this: %-15s
That will left-align the string used to replace it up to 15 characters, and truncate the rest.
The important thing to remember is that the replacements occur left-to-right, so the first argument after the format string replaces the first %something, the second argument the second %something, etc.
the claims are stated - it's the world I've created
I've figured out one way to do what I want (envenom with a 2 random toxins from a list) but the only way I could think to deal with doubling up was to use paired toxins, so the string looks like for ex. |noctec mebaral|noctec vitriol|vitriol mebaral| etc, six in total entries for the smoke toxins. I'll have another @variable for smoke tox without vitriol, one for tlock, one for kelp, one for etc etc.
I'm using #send dstab @target {%item(@smoketox,%random(1,6))} for example, to pull the toxins from the string list.
What I'd like instead to do is have the string list just contain noctec|mebaral|vitriol|iodine but I can't figure an easy way to prevent doubling up of toxins.
So I'd #send dstab @target {random toxin from list} {random toxin from same list but not the first one used}
I thought maybe of making a new list every dstab and using %delitem to strip the first toxin, but that seems overly clunky and I feel like there is/should be a simpler way.
Making a new list is certainly one way to do it, and probably more efficient than this. Just make sure it's a local var.
#local $toxin1, $toxin2
$toxin1=%item(@toxinlist, %random(%numitems(@toxinlist))
$toxin2=%item(@toxinlist, %random(%numitems(@toxinlist))
#while ($toxin1 = $toxin2) {$toxin2=%item(@toxinlist, %random(%numitems(@toxinlist))}
#send dstab @target $toxin1 $toxin2
the claims are stated - it's the world I've created
#var {curstack} {}
@{queue eqbal quickjab @target %pop( tstack) %pop( tstack)}
Instead of using #var, use #local. Local variable references are slightly faster. You can still use a local var as a stringlist.
the claims are stated - it's the world I've created
Soooo, I think I need to go back to square one. I will be back, with much more basic questions (like, wtf should I start with?!) tomorrow :embarassed:
the claims are stated - it's the world I've created
Trying to make a highlight for single shardfall notifications. I've every version of the trigger I can think of but it will not fire.
^Your keen senses notice a single shard flying towards
Is like the most general pattern I could come up with. All I want to do is color that single line red. Am I missing something super simple here?
#CO red
should work.
Though I went back to zmud after cmud ate my system twice.
Edit:
<trigger priority="2380" id="238">
<pattern>^Your keen senses notice a single shard flying towards</pattern>
<value>#EC Hi
#Co 492
</value>
</trigger>
Is the XML