a really pointless little alias I wrote

edited August 2013 in Mechanic's Corner
So this isn't exactly a work of staggering genius but I wanted to make an alias list for when I forget my aliases (which is always!), only I wanted it to be elegant, so I wasted like an hour of my life making this: 

image

I know it's nothing remarkable, but since I spent so long on something nobody else is ever going to see I thought I'd share the "code" here, so that someone else can adapt it for themselves:

<p style="margin: 0px;"><!--StartFragment-->echo("\n\n")</p> <p style="margin: 0px;">cecho(string.format([[<antique_white>.------------------------------------------------------------------------------.</p> <p style="margin: 0px;">| |</p> <p style="margin: 0px;">| <orange_red>So you forgot your aliases again? <antique_white>|</p> <p style="margin: 0px;">| |</p> <p style="margin: 0px;">|<a_darkmagenta> GEOMANCY <antique_white>|</p> <p style="margin: 0px;">| |</p> <p style="margin: 0px;">| tuning - tune poison/cutting/asphyx |</p> <p style="margin: 0px;">| twirl - twirl staff duh |</p> <p style="margin: 0px;">| demup - demesne the slow way |</p> <p style="margin: 0px;">| fexup - works outside demesne too! |</p> <p style="margin: 0px;">| quake - the quick way! |</p> <p style="margin: 0px;">| ccc - chasm! |</p> <p style="margin: 0px;">| |</p> <p style="margin: 0px;">|<dark_orchid> PSIONICS <antique_white>|</p> <p style="margin: 0px;">| |</p> <p style="margin: 0px;">| tb1 - choke/throatlock/burst |</p> <p style="margin: 0px;">| tb2 - trip/burst/throatlock |</p> <p style="margin: 0px;">| tc1 - choke/burst/clot/throatlock |</p> <p style="margin: 0px;">| tbs - burst/bodyscan - trigger for heartburst! |</p> <p style="margin: 0px;">| tkl - burst/fistleg/fistleg |</p> <p style="margin: 0px;">| tka - burst/fistarm/fistarm |</p> <p style="margin: 0px;">| tkb - burst/fisthead/fistchest |</p> <p style="margin: 0px;">| tkf - alteraura/fisthead/fling! |</p> <p style="margin: 0px;">| dcb - dagger/choke/barrier |</p> <p style="margin: 0px;">| |</p> <p style="margin: 0px;">|<MediumPurple> PHANTASMS <antique_white>|</p> <p style="margin: 0px;">| |</p> <p style="margin: 0px;">| phantom - weave phantom |</p> <p style="margin: 0px;">| claws - weave claws |</p> <p style="margin: 0px;">| redmask - weave redmask |</p> <p style="margin: 0px;">| |</p> <p style="margin: 0px;">| |</p> <p style="margin: 0px;">'------------------------------------------------------------------------------']]))</p> <p style="margin: 0px;">echo("\n\n")<!--EndFragment--></p>


Please do let me know if I've done anything particularly dumb, or if there's a better way and I totally wasted my time! Maybe if I feel the need to waste more time I'll play around with it some more.


Comments

  • Eep! Just realised the spaces are out in the first section - I fixed it on mine, but when I tried to edit the post to fix it there it broke the code tag ;-;

    Apologies for the double post!
  • Here is a ~teaser~ for my next pointless alias...... stay tuned

    or not

    image

    P.S: Anybody know how to get colour working properly with echoLink? Tried setting formatting with setBg() or w/e then specifying to use the main window, like the manual says, but it didn't work. This is why I hate scripting!

  • edited September 2013
    I'm too shy to make a thread for this, but I was looking for a way to capture a comma seperated value, like the amount of power in a nexus, and I found this perfect little function (at http://rosettacode.org/wiki/Strip_a_set_of_characters_from_a_string#Lua) :

    function stripchars( str, chr )<br>local s = ""<br>for g in str:gmatch( "[^"..chr.."]" ) do<br>s = s .. g<br>end<br>return s<br>end<br>

    For novices like me, what you do is paste this into a new script in mudlet, and call it something sensible, then save it. Then when you want to work with a number that's all messed up by commas, ie capturing it and doing maths with it, you do something like

    <br><font size="3"><span style="line-height: normal;">Trigger line:</span></font><br><font size="3"><span style="line-height: normal;">^The power of the nexus is at (.+).</span></font><br><br><font size="3"><span style="line-height: normal;">Script:</span></font><br><font size="3"><span style="line-height: normal;">if nexuspower == "" then</span></font><br><font size="3"><span style="line-height: normal;"> nexuspower = stripchars(matches[2], ",")</span></font><br><span style="font-size: medium; line-height: normal;">nexuspower</span><font size="3"><span style="line-height: normal;">&nbsp;= tonumber(</span></font><span style="font-size: medium; line-height: normal;">nexuspower</span><font size="3"><span style="line-height: normal;">)</span></font><br><font size="3"><span style="line-height: normal;">cecho("<SpringGreen>\n Didn't find an existing value for nexus power! Resetting from capture.")</span></font><br><font size="3"><span style="line-height: normal;">else</span></font><br><br><font size="3"><span style="line-height: normal;">new</span></font><span style="font-size: medium; line-height: normal;">nexuspower</span><font size="3"><span style="line-height: normal;">&nbsp;= stripchars(matches[2], ",")</span></font><br><font size="3"><span style="line-height: normal;">new</span></font><span style="font-size: medium; line-height: normal;">nexuspower</span><font size="3"><span style="line-height: normal;">&nbsp;= tonumber(new</span></font><span style="font-size: medium; line-height: normal;">nexuspower</span><font size="3"><span style="line-height: normal;">)</span></font><br><font size="3"><span style="line-height: normal;">powerchange = new</span></font><span style="font-size: medium; line-height: normal;">nexuspower</span><font size="3"><span style="line-height: normal;">&nbsp;-&nbsp;</span></font><span style="font-size: medium; line-height: normal;">nexuspower</span><br><span style="font-size: medium; line-height: normal;">nexuspower</span><font size="3"><span style="line-height: normal;">&nbsp;= new</span></font><span style="font-size: medium; line-height: normal;">nexuspower</span><br><font size="3"><span style="line-height: normal;">cecho("<SpringGreen></span></font><springgreen style="font-size: 10pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">\n The Megalith is at " ..<span style="font-size: medium;">nexuspower</span>.. " power")<br>cecho("<SpringGreen><springgreen>\n You added " ..powerchange.. " power")<br>permittedlinks = permittedlinks + powerchange / 2<br>cecho("<SpringGreen><springgreen>\n You may draw " ..permittedlinks.. " links")<br><br>end<br></springgreen></springgreen></springgreen>
    There are a few more things needed to make this script work properly - a way to reset those variables, and a way to deduct a link each time you draw one. I added simple lines for that to the power management script I found floating around (a credit to its mysterious creator!)
    BUT
    What I couldn't do is find a way to factor in my ration allowed by the city each weave regardless of donation - how can I make something happen when the date changes? And what exactly IS a 'weave' anyway? Is it the same 25 hour period as a lusternian day, or is it a server reset time that's totally OOC, or what? Help ;-;
  • Reyl - I didn't do it for all of my aliases, but I do have it for all of my main combat ones.

    Can be useful especially since I've changed a lot of the aliases.
    Avatar by the amazing @Feyrll
  • A weave is a real life day, it changes at midnight GMT. So an IC explanation for one OOC day.
  • NeosNeos The Subtle Griefer
    Did you use one of the example custom prompts in the m&m docs? If so, that one was my original custom prompt, before I changed it around. /random statement/observation
    Love gaming? Love gaming stuff? Sign up for Lootcrate and get awesome gaming items. Accompanying video.

     Signature!


    Celina said:
    You can't really same the same, can you?
    Zvoltz said:
    "The Panthron"
  • I did, hehe. Fairly happy with it as is, I used to have my target there but I got rid of it again. I deleted a few things from the example to save clutter too, ie why does it have both xp so far and xp remaining? :p
  • Reyl said:

    P.S: Anybody know how to get colour working properly with echoLink? Tried setting formatting with setBg() or w/e then specifying to use the main window, like the manual says, but it didn't work. This is why I hate scripting!

    You need to add 'true' at the end of echoLink so it knows to use your formatting and not the default... computers aren't always clever
  • Figured I'd resurrect this dumb thread rather than make a new one: here's a sloppy five-minute trigger that non-americans might find useful? It just gives you the US east/west times when you type TIME. It doesn't account for daylight time, but that doesn't really concern me as I only made it so i could have a quick way to check why nobody seemed to be online!


    PATTERN:
    ^In your world, it is \d{4}\/\d{2}\/\d{2} (\d{2})\:(\d{2})\:\d{2} GMT.$

    SCRIPT:

    local hour = matches[2]

    local minute = matches[3]



    --[[ if you wanted to change this, ie to account for daylight time or adapt it for a

    different timezone obviously you would just change it to (hour +/- x)]]


    cecho("\n<dodger_blue> US EAST | WEST: "..((hour - 5) % 12)..":"..minute.."|"..((hour - 8) % 12)..":"..minute)



    WHAT IT LOOKS LIKE IF YOU CBF USING YR IMAGINATION:


    image

Sign In or Register to comment.