Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 22

Thread: hatter.ash - Tea anyone!?

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

    Default

    My bad for not looking at the correct version!
    Thanks.
    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

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

    Default

    Code:
    > call hatter meat
    
    Buff selected: Dances with Tweedles
    You can't equip a Uncle Hobo's stocking cap
    I simply added this to lines 123 and 147:
    PHP Code:
    && can_equip(itm
    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

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

    Default

    Thanks. Update in the first post.
    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.

  4. #14

    Default

    I'm using this as part of my daily farming scripting and right now am calling it with cli_execute because main() does so much I'm not sure how to run it via import. Is this possible or am I stuck with doing calling it via cli? I know it doesn't really matter it just annoys me to use cli_execute inside my ash scripts for some reason.

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

    Default

    If you import a script it will not execute anything in main(). However, taking a look at the script you don't need to use main() if you already know what effect you want, like this...

    PHP Code:
    import "hatter.ash";

    if(
    get_property("_madTeaParty") == "false")
       
    hatCheck($effect[Quadrilled]); 
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


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

    Default

    I'm using this as part of my daily farming scripting and right now am calling it with cli_execute because main() does so much I'm not sure how to run it via import. Is this possible or am I stuck with doing calling it via cli? I know it doesn't really matter it just annoys me to use cli_execute inside my ash scripts for some reason.
    Originally Posted by fianor View Post
    I decided to make the script more import friendly for those who dislike using cli_execute for whatever reason.

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


    Also, it helps that the code was just horrible, I mean, who makes functions that all return void and set global variable flags for other functions to check instead of just returning a useful value in the first place? And what was with the global hats map that went through every item in the game even if you were just using the help command?? Come on guys, if the code sucks, please let me know.

    Update

    • Re-factored code.
    • Eliminated global variables and maps.
    • Changed functions to have more useful return values.


    This is an extensive overhaul that has only been tested once so let me know if I screwed anything up.
    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.

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

    Default

    Also, it helps that the code was just horrible, I mean, who makes functions that all return void and set global variable flags for other functions to check instead of just returning a useful value in the first place? And what was with the global hats map that went through every item in the game even if you were just using the help command?? Come on guys, if the code sucks, please let me know.
    Originally Posted by That FN Ninja View Post
    LoL! I'm sorry. I never actually looked at the code for this script until I tried to answer fianor's question. I hadn't even found all those problems yet! Isn't it wonderful that prompted you to refactor everything now?
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


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

    Default

    LoL! I'm sorry. I never actually looked at the code for this script until I tried to answer fianor's question. I hadn't even found all those problems yet! Isn't it wonderful that prompted you to refactor everything now?
    Originally Posted by Bale View Post
    Yeah, it's actually quite amusing to look at code that you wrote in the past and realize how much you've learned. More amusing yet is the idea that in six months or so I'm probably going to be looking at the code I just wrote for this update and be thinking about how horrible it is.
    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.

  9. #19

    Default

    I decided to make the script more import friendly for those who dislike using cli_execute for whatever reason.
    Originally Posted by That FN Ninja
    It just feels wrong. It's like speaking English to a translator who understands Spanish but just says the same English words to the other guy cause he speaks English too. Stop looking at me like that ...

    -----------------------------------------------

    Not sure whether to be extremely happy that you fixed all this, or to be really angry at either myself for spending the time trying, or myself for failing to make it better before you beat me to it.

    I think I'll choose the first option.

    Oh, and it of course worked perfectly.
    Last edited by fianor; 06-18-2011 at 12:02 AM.

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

    Default

    Update

    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's a screen shot.


    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
    Originally Posted by fronobulax View Post
    Gotta give some love to the edge cases every once in awhile.
    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
  •