Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 22

Thread: hatter.ash - Tea anyone!?

  1. #1
    Senior Member That FN Ninja's Avatar
    Join Date
    Jun 2009
    Location
    Right behind you!
    Posts
    372

    Wink hatter.ash - Tea anyone!?

    hatter.ash - Tea anyone!?
    Enjoying tea the mafia way.

    I was admiring the usage function in bounty.ash and was inspired to write this. Also, I saw a feature request regarding this. Also, my CS1400 professor is accepting this as extra credit. Also, I love tea! Well, at least the FUZE - Black & Green Tea with Acai Berry. That stuff is addictive!


    Usage:

    call hatter.ash [argument]
    or
    hatter.ash [argument]
    or
    alias tea => ashq import<hatter.ash> hatter($string[%%])

    Arguments:

    an integer value
    Visits the hatter with a hat that has the number of non-space characters specified.

    current
    equipped

    Visits the hatter with the hat you are currently wearing.

    hat
    Where hat is the name of the hat to use. Visits the hatter with the hat specified.

    buff
    Where buff is the name of the buff to get. Uses mafias fuzzy matching.
    (i.e. "pep" = "Assaulted with Pepper")

    Other arguments:

    ml, monster level, fe, fam exp, familiar experience, moxie, muscle, myst, mysticality, wd, weapon, weap dam, weapon damage, %spell, %spell dam, %spell damage, hp, max hp, maximum hp, mp, max mp, maximum mp, sleaze, sleaze dam, sleaze damage, spell, spell dam, spell damage, cold, cold dam, cold damage, spooky, spooky dam, spooky damage, stench, stench dam, stench damage, hot, hot dam, hot damage, %wd, %weapon, %wep dam, %weapon damage, meat, %moxie, %muscle, %myst, %mysticality, fw, fam weight, familiar weight, stats, stat, stat gain, item, items

    Note: It is case insensitive. So, meat = Meat = MEAT

    If you forget or need a reminder of the arguments and what they do just call the script with one of the help arguments (h, ?, help, usage) to display a table of valid arguments and what they do.

    Also, the help arguments now display the hats associated with a particular buff. They are printed in blue if you own them or if they are easily obtained. They are printed in red if you have access to them but cannot equip them. Their location is also printed. This includes hats located in your closet, display, starter hats from gum on a string, NPC hats, etc. Here are a few screen shots:

    hatter 1.PNG hatter 2.PNG

    Examples:

    call hatter.ash 22
    Gets the buff corresponding to the hat whose length (excluding white space) is 22.

    hatter.ash dances
    Does a fuzzy match on hat buffs to see if one matches dances and gets that buff.

    hatter.ash meat
    Gets the buff that will increase meat drops

    To utilize this script from within another script import it and use the hatter() function:
    import<hatter.ash>
    hatter("meat");

    or use cli_execute() like so:
    cli_execute("call hatter.ash meat");


    If you find this script useful, donations in the form of in-game ninja paraphernalia are always appreciated! Thanks and enjoy the script.

    Change log:
    05.25.2010 - Re-equips the hat you were wearing when the script was called.
    05.30.2010 - The help function can now be called even if you've already got your buff for the day.
    01.16.2011 - Added a can_equip() check to the hat selection logic. Thanks slyz.
    06.16.2011 - Re-factored code. Eliminated global variables and maps. Changed functions to have more useful return values.
    06.26.2011 - v1.4 Extend the help command to list all hats. They are printed in blue (along with their location) if you own them or if they are easily obtained.
    Attached Files
    Last edited by That FN Ninja; 07-02-2011 at 09:02 PM. Reason: update v1.41
    TraFa - Training Familiars the Mafia way! queen_cookie.ash - Get your queen cookies.
    TurTa - Turtle Taming the Mafia way! hatter.ash - Mad Hatter buffs.
    DwaFa - Dwarven Factory puzzle solver.
    Miner - Automated ore mining.

  2. #2

    Default

    Heres what I would recommend:

    It would be great if you could run the script with no arguments at all. It would do the following,

    1) Go through every hat in your inventory and figure out how many letters are in it. Store all the unique values into a Map.
    2) Go through every unique value in the Map, printing a synopsis of the buff that you can get.
    3) Query the user, asking them to input the number of the desired buff.
    4) Equip the appropriate hat and get the buff.
    5) Reequip whatever hat they had started with.

    I think this would be a LOT more user-friendly. Looking at your script, you seem to already have the knowledge of how to do Maps and get the Length of an item, get hats owned, etc. So I think its just a matter of rearranging your code some.
    In fact, you could still retain all of the functionality of the script as is. Running it with no params would simply make it do items 1,2, and 3 first. Then you'd call your function as if you were calling the script with an integer input, based on what they entered.

    This would be friggin awesome!
    Last edited by SinginSally; 05-25-2010 at 06:34 PM.

  3. #3
    Senior Member mredge73's Avatar
    Join Date
    Dec 2008
    Location
    Houston TX
    Posts
    519

    Default

    3) There has been much debate about it but the ability to query the user for an integer input has been turned down by the devs numerous times.
    The only way to do it is with two script files were one accepts an integer argument and returns that argument back to the main. I have seen it done somewhere in these forums.

    Anyway, good script ideas!

  4. #4
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    Just checking if people know the CLI command: hatter

    This script does several things that the CLI command does not, but the command will tell you the effects of all the hats you have. Just felt that the command needs to be mentioned since hatter does do one thing that this script does not accomplish.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  5. #5
    Senior Member That FN Ninja's Avatar
    Join Date
    Jun 2009
    Location
    Right behind you!
    Posts
    372

    Default

    @ Bale
    Thanks for the input. I actually wrote this script with the built-in hatter command in mind, sort of as an extension of that command.

    @ SinginSally
    As Bale pointed out, the hatter cli command already completes the first two items in your list. As for querying the user, I do not what to do that other than the way it is now. If you call the script without an argument it will prompt you for one. As far as re-equipping the previous hat, that is functionality that is unduly missing and I will upload that change right after this post. Thank you for the advice.

    @mredge
    An example of the functionality you are referring to is my in_control.ash located here.
    TraFa - Training Familiars the Mafia way! queen_cookie.ash - Get your queen cookies.
    TurTa - Turtle Taming the Mafia way! hatter.ash - Mad Hatter buffs.
    DwaFa - Dwarven Factory puzzle solver.
    Miner - Automated ore mining.

  6. #6

    Default

    Bale, one step ahead of me again. :-) That is great to know about the new Hatter mafia command.

    In that case Id suggest the following: If the user does enter one of the Help/?/whatever arguments, you might want to even cli_execute("hatter") before typing out your text.

    I was unaware of the limitation of entering an integer. Ive seen pop up boxes and just assumed you could input anything.

  7. #7
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    I was unaware of the limitation of entering an integer. Ive seen pop up boxes and just assumed you could input anything.
    Originally Posted by SinginSally View Post
    Perhaps mredge73 was unclear. Any soft of variable can be entered at the start of a script. Those are the many pop up boxes you may have seen. However, after a script has started, only yes/no can be asked of the user. The problem is that you wish to enter an integer after the script already began.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  8. #8
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,129

    Default

    It would be nice if the script (or hatter, but that would be a feature request) knew about hats in a display case or Hagnk's or a closet. As a Display Case completest I am always trading off the utility of an item in game vs. the completeness of my collection vs. the cost of a duplicate. This lets me make a more informed choice in an easier way than using the wiki and the display case manager. But I am an edge case
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  9. #9
    Developer
    Join Date
    Nov 2008
    Location
    Paris, France
    Posts
    4,510

    Default

    I haven't tried this script, but after having a look I would have a small feature request: could it re-equip the currently equipped hat after getting the buff?
    Try the Nemesis Quest Script or the FamiliarFeeder interface.
    *shakes KoLMafia tech support magic 8-ball* Update mafia to the latest daily .JAR!
    NEW Dad ASCENSION STARTED 20120730
    ------------------------------
    Welcome to Parenthood, Noob

  10. #10
    Senior Member That FN Ninja's Avatar
    Join Date
    Jun 2009
    Location
    Right behind you!
    Posts
    372

    Default

    Already implemented. SinginSally pointed that out and I added in the functionality the same day I posted the script.
    TraFa - Training Familiars the Mafia way! queen_cookie.ash - Get your queen cookies.
    TurTa - Turtle Taming the Mafia way! hatter.ash - Mad Hatter buffs.
    DwaFa - Dwarven Factory puzzle solver.
    Miner - Automated ore mining.

Similar Threads

  1. New Content - Implemented 30+ character Hatter buff
    By guyy in forum Bug Reports
    Replies: 1
    Last Post: 06-22-2013, 04:06 AM
  2. 11968: fix matching for hatter command
    By RSS Bot in forum Latest SVN Changes
    Replies: 0
    Last Post: 03-14-2013, 06:18 PM
  3. Replies: 0
    Last Post: 03-11-2012, 11:50 PM
  4. Bug - Fixed Hatter Buff without potion in inventory
    By dungbeetle in forum Bug Reports
    Replies: 1
    Last Post: 02-22-2012, 05:56 AM
  5. 10414: do the same for the Hatter daily deed.
    By RSS Bot in forum Latest SVN Changes
    Replies: 0
    Last Post: 02-06-2012, 09:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •