Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

Freebie Scripts

ShecksShecks Member Posts: 626 ✭✭✭ - Distinguished
Figured it'd be nice to share a few simple things I think would be useful for people not big into lua/mudlet.

First one is an easy dragon talisman color format, just because it was annoying to have so much gray chaos going on when I checked talismans.

Second one is a simple little affliction coloring thing I put together, which over time lets you stop reading them entirely (as you learn to just react to the colors).  Nothing special, but might be useful to someone.  (uses the hecho(str) function)

I also have a great (non-GMCP) wielding script I can share if requested via message or in game.




"Ignore the boos.  They usually come from the cheap seats."
ShirszaeCorrZincorKaitaliShadrac

Comments

  • AkayaAkaya Member Posts: 32 ✭✭ - Stalwart

    Shecks said:


    Second one is a simple little affliction coloring thing I put together, which over time lets you stop reading them entirely (as you learn to just react to the colors).  Nothing special, but might be useful to someone.  (uses the hecho(str) function)
    http://pastebin.com/DrViKdd2


    That's a lot of if statements. Are you supposed to run this function each time you get an affliction?





    Antonius
  • JonathinJonathin Grand Rapids, MIMember Posts: 3,323 @@ - Legendary Achaean

    My site will remain up, but will not be maintained. The repository will continue to have scripts added to it if I decide to play another game. Maybe I'll see you around in Starmourn!
    Tutorials and scripts  The Repository

  • ValdenValden Member Posts: 544 ✭✭✭✭✭ - Grand Achaean
    Now with less IF statements!
    http://pastebin.com/CA0APfaM
    AkayaShirszae
  • AkayaAkaya Member Posts: 32 ✭✭ - Stalwart
    Valden said:
    Now with less IF statements!
    http://pastebin.com/CA0APfaM
    Brilliant.
  • AntoniusAntonius Member Posts: 4,828 @@ - Legendary Achaean
    Valden said:
    Now with less IF statements!
    http://pastebin.com/CA0APfaM
    Probably want to return affs[aff] or aff so it has a fallback in the case that the affliction isn't mapped to anything, as it does in the original script.
    Valden
  • ValdenValden Member Posts: 544 ✭✭✭✭✭ - Grand Achaean
    Antonius said:
    Valden said:
    Now with less IF statements!
    http://pastebin.com/CA0APfaM
    Probably want to return affs[aff] or aff so it has a fallback in the case that the affliction isn't mapped to anything, as it does in the original script.
    I'll confess to being lazy and just rewriting the code with a search replace for most of it :-\"
  • ShecksShecks Member Posts: 626 ✭✭✭ - Distinguished
    edited February 2014
    Technically using a table isn't any faster than ifs, since a table call basically does the exact same thing, but also adds in loop operations and variables. ( you just don't see any of it). To make the thing more elegant, they should be elseifs not ifs, and should have the most common afflictions listed first.

    Anywho, I don't really put that much emphasis on efficiency in non-recursive functions, because on a modern machine that can change a million pixels a hundred times a second, whether or not you use a table or ifs is 100% ignorable.
    "Ignore the boos.  They usually come from the cheap seats."
  • PenwizePenwize Member Posts: 1,513 @@ - Legendary Achaean
    Shecks said:
    Technically using a table isn't any faster than ifs, since a table call basically does the exact same thing, but also adds in loop operations and variables. ( you just don't see any of it).
    This is actually not true.  Table access is usually done via hashing, a significantly faster operation, and not with ifs, loops or pattern matching.
    EldVadimusesShecks
  • ShecksShecks Member Posts: 626 ✭✭✭ - Distinguished
    edited February 2014
    You're right, a brief google search concludes.  With that said, I don't think it matters in the slightest.  The CPU operation to print each character takes up ten thousand times the amount of processing power as either version of that function.  Efficiency is something I worry about when it comes to complex or looped functions.  The only example I can think of for Achaea is pathfinding, but curing algorithm speed might be noticeably impacted, if your code is advanced enough.
    "Ignore the boos.  They usually come from the cheap seats."
  • PenwizePenwize Member Posts: 1,513 @@ - Legendary Achaean
    That's ... actually not true either, especially with an interpreted language like LUA. 

    Still, you're at least right in that speed only actually matters in places that are run frequently enough, or on large enough volumes of data, that it will actually start to cause a slowdown.  This could be one of those places, depending on how often he actually calls that echo function, but chances are it's not.  If he happens to call it on every single prompt as part of an update loop for a status window, for example, it's probably going to contribute to system slowness.  Best practices let you avoid having to hunt things like that down later when you do start to notice a general sluggishness to your system as you build it up.
    Shecks
  • ShecksShecks Member Posts: 626 ✭✭✭ - Distinguished
    edited February 2014
    If we really cared about (perfect) efficiency, we'd all use C++ systems =P.
    "Ignore the boos.  They usually come from the cheap seats."
    Siduri
  • ShecksShecks Member Posts: 626 ✭✭✭ - Distinguished
    edited March 2014

    For mac users, I came a very useful little trick:

    os.execute([[terminal-notifier -message "Hello World." -title "Message Title"]])


    This makes one of those nifty little notification boxes that appears up top, then fades away after a few seconds.  Very nice for notifications if you don't have mudlet on top.  I use it for gank alerts when I'm bashing, and I have sounds toggled off.

    "Ignore the boos.  They usually come from the cheap seats."
    Utianima
  • UtianimaUtianima Norway and AustriaMember Posts: 259 ✭✭✭✭ - Eminent
    Shecks said:

    For mac users, I came a very useful little trick:

    os.execute([[terminal-notifier -message "Hello World." -title "Message Title"]])


    This makes one of those nifty little notification boxes that appears up top, then fades away after a few seconds.  Very nice for notifications if you don't have mudlet on top.  I use it for gank alerts when I'm bashing, and I have sounds toggled off.

    Great tip, thanks! This might singlehandedly make me go back to Mudlet :)

  • JonathinJonathin Grand Rapids, MIMember Posts: 3,323 @@ - Legendary Achaean
    edited March 2014
    Ubuntu has something similar called notify-osd. There has been a timeout bug since forever so if you want to change the time it takes for the balloons to disappear, download the notifyOSD Configuration tool and set the timeout that way (it's persistent, unfortunately).

    Vadi posted the original on the Mudlet forums ages ago but

    function notifySend (sub,...)

    os.execute([[notify-send ]]..sub..[[ "]] .. ... .. [["]])

    end

    My site will remain up, but will not be maintained. The repository will continue to have scripts added to it if I decide to play another game. Maybe I'll see you around in Starmourn!
    Tutorials and scripts  The Repository

  • XliXli Member Posts: 354 ✭✭✭ - Distinguished
    Shecks said:
    First one is an easy dragon talisman color format, just because it was annoying to have so much gray chaos going on when I checked talismans.

    Great script, thanks @Shecks, makes my talisman pieces look purdy. However, it only works when doing the full "talismans list", how could I adjust it so it also fires when I do "talismans list bluedragon", for example?
    Hiroma tells you, "I just got to listen to someone complain about your deadly axekick being the bane of their existence."
    Archdragon Mizik Corten, Herald of Ruin says, "Man, that was a big axk."
    Hellrazor Cain de Soulis, Sartan's Hammer says, "Your [sic] a beast."
  • ShecksShecks Member Posts: 626 ✭✭✭ - Distinguished
    For some reason using that command outputs them in a different format (with parantheses around the quantity that you have).  You just have to modify the trigger to work with that, or add a separate trigger line.
    "Ignore the boos.  They usually come from the cheap seats."
  • XliXli Member Posts: 354 ✭✭✭ - Distinguished
    edited March 2014
    Shecks said:
    For some reason using that command outputs them in a different format (with parantheses around the quantity that you have).  You just have to modify the trigger to work with that, or add a separate trigger line.
    Ah, the brackets... now all becomes clear, TY!

    And here's the extra line I needed to add: ^\s+\((\d).*(\d+)\s+Dragon\s+(\w+)$
    Post edited by Xli on
    Hiroma tells you, "I just got to listen to someone complain about your deadly axekick being the bane of their existence."
    Archdragon Mizik Corten, Herald of Ruin says, "Man, that was a big axk."
    Hellrazor Cain de Soulis, Sartan's Hammer says, "Your [sic] a beast."
  • UtianimaUtianima Norway and AustriaMember Posts: 259 ✭✭✭✭ - Eminent
    Utianima said:
    Shecks said:

    For mac users, I came a very useful little trick:

    os.execute([[terminal-notifier -message "Hello World." -title "Message Title"]])


    This makes one of those nifty little notification boxes that appears up top, then fades away after a few seconds.  Very nice for notifications if you don't have mudlet on top.  I use it for gank alerts when I'm bashing, and I have sounds toggled off.

    Great tip, thanks! This might singlehandedly make me go back to Mudlet :)
    I went back to Mudlet! :)

    This is not working for me, though. Tried it as an alias, and in a script (and calling it from an alias with os.execute()). Any tips or additional intrustructions?

    Cheers :D

  • UtianimaUtianima Norway and AustriaMember Posts: 259 ✭✭✭✭ - Eminent
    Utianima said:


    Utianima said:


    Shecks said:


    For mac users, I came a very useful little trick:

    os.execute([[terminal-notifier -message "Hello World." -title "Message Title"]])



    This makes one of those nifty little notification boxes that appears up top, then fades away after a few seconds.  Very nice for notifications if you don't have mudlet on top.  I use it for gank alerts when I'm bashing, and I have sounds toggled off.


    Great tip, thanks! This might singlehandedly make me go back to Mudlet :)


    I went back to Mudlet! :)

    This is not working for me, though. Tried it as an alias, and in a script (and calling it from an alias with os.execute()). Any tips or additional intrustructions?

    Cheers :D

    I found out I had to download and install terminal-notifier first. I did so following these instructions:
    http://m.cnet.com/news/how-to-invoke-alerts-from-the-os-x-terminal/57532444

    I can now create notifiers from the terminal, but still does not work from within Mudlet.

    I also checked that Mudlet has been allowed to control system, from within System Preferences.

    What can I be missing, @Shecks‌ ?

  • ShecksShecks Member Posts: 626 ✭✭✭ - Distinguished
    edited March 2014
    Are you using mavericks?
    @Utianima
    "Ignore the boos.  They usually come from the cheap seats."
  • UtianimaUtianima Norway and AustriaMember Posts: 259 ✭✭✭✭ - Eminent
    edited March 2014

  • ShecksShecks Member Posts: 626 ✭✭✭ - Distinguished
    edited March 2014
    Catch me in game, we'll figure it out... As long as you're not killing mah kelpies. (9-16 hours from now)
    "Ignore the boos.  They usually come from the cheap seats."
    Utianima
  • UtianimaUtianima Norway and AustriaMember Posts: 259 ✭✭✭✭ - Eminent
    Thanks! Will do, @Shecks :)

  • StrataStrata United States of DerpMember Posts: 1,753 @ - Epic Achaean
    Can't wait until people start making triggers that pass stuff from the mud to os.execute()
    Then you're all gonna be like "oops... yeah that was a good idea."
    image
    Kei
  • UtianimaUtianima Norway and AustriaMember Posts: 259 ✭✭✭✭ - Eminent
    ..Huh? @Strata‌

    I am gonna make the triggers myself, and can turn them off if it turns out a bad idea. How can others create triggers for me? :s Must be something I am not getting here

  • UtianimaUtianima Norway and AustriaMember Posts: 259 ✭✭✭✭ - Eminent
    Made it work! Thanks @Shecks

    My problem was I had done a manual install of terminal-notifier. Had to install it via gem (sudo gem install terminal-notifier). See "Download" section in the readme here, for more information:

    Shecks
Sign In to Comment.