Results 1 to 10 of 1947

Thread: Winterbay's Helpful Automatic Monsterbasher (WHAM)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member Winterbay's Avatar
    Join Date
    Feb 2010

    Default Winterbay's Helpful Automatic Monsterbasher (WHAM)

    WHAM 5.6
    relay WHAM dontuse 0.4.3

    This script is a developed version of the SpamAttack script that exists in this forum in several different places. It is a rather robust way to handle most monsters (and those it can't handle it'll tell you and potentially also print some nice helpful info for, requires a verbosity of at least 3).

    The script tries to calculate the cheapest way to kill the monster by smart use of your skills and items. As such the script is pretty calculation heavy and may take a few seconds to run. The speed after version 2.0 is almost negligible unless the scripts decides on a very elaborate strategy to kill the monster.

    As of version 5.6 (released on 2013-06-10) the script and its relay-counterpart is installed and udated via SVN. In order to use the very useful feature you need a recent build of Kol Mafia. After logging in type the following in the CLI and press enter:
    svn checkout

    After the command has run you will have WHAM.ash in your /scripts folder and relay_WHAM_dontuse.ash in your /relay folder. In case you get a prompt about overwriting files press OK (if not make sure that any older versions of WHAM is removed). In order to update the scripts in the future either type svn update in the CLI or tick "Update installed SVN projects on login" in Mafia's preferences (found at the bottom under SVN).

    This script relies heavily on vprint() and the output is regulated with Zlib's verbosity-setting and it is possible to get it to output nothing with useful info starting at a verbosity level of 3. If you set the verbosity to 10 the script will
    a) Print information regarding all the skills and items it thinks you have available and the amount of damage you might do with them (both before and after taking monster resistance into account)
    b) Output a bunch of text-files to your /data folder for debugging purposes and
    c) Abort execution before it actually does anything with the monster

    The script has several layers of verbosity that can be set depending on how interested you are in what is going on. A rough guideline is:
    3-4: Basic helpful information
    5-7: Increasingly more verbose output on what is going on without being overly intrusive
    8-11: Increasing amounts of debugging information, 10 and 11 will abort without perfoming anything actual actions (also completely bypasses SmartStasis integration)

    Please post feedback and suggestions since I'm always interested in making the script more useful. In case you want to help out test new features you can also install the beta version of WHAM by the following command:
    svn checkout

    In order for the script to run properly you will need the following support scripts:

    You also need to set your Combat Action to "custom combat script" and create an entry containing:
    [ default ]
    consult WHAM.ash
    In case you want to you can also fine tune a couple of things in the script:

    1. The amount of turns the script should try to calculate before executing and retrying (defaults to 15)
    2. The hitchance you are willing to risk (defaults to 50%, or 0.5 to be exact)
    3. The max number of rounds you are willing to let the script automate skill-slinging before it reverts control to you (defaults to 30)
    4. A boolean safety parameter. If set to true the script will execute your best option and re-calculate your options form the result until either you are dead or the monster is (defaults to false, new form 2.8)
    5. A boolean parameter that if set tu true will make you not use any items at all when fighting (defauilts to false, new from 3.1)
    6. An integer parameter indicating how many extra rounds you wish WHAM to refrain from stasising (defaults to 0, new from 4.1)
    7. A boolean parameter to toggle use of the Sea Lasso in The Sea (defaults to false, new from 5.3)
    8. A boolean parameter that can be set to swap WHAM from trying to do things as profitable as possible to kill the monster as quick as possible without factoring in cost in any way (default false, new from 5.4)
    9. Two integer parameters indicating how much we are willing to spend to make the combat one round shorter, one for ronin and one for aftercore (to allow for different playstyle in the different cases) (defaults to 5 and 50 respectively, new from r13)
    10. A relay script relay_WHAM_dontuse that can be used to finetune the items and skills used by WHAM. Explanations on how to use it is shown when run. Put it in the /relay folder and run from the drop down in the relay browser. Requires Jason's htmlform in order to function (linked above).

    In order to change them use commands like this in the CLI:
    zlib WHAM_round_limit = <wanted number>
    zlib WHAM_hitchance = <wanted fraction>
    zlib WHAM_maxround = <wanted number>
    zlib WHAM_AlwaysContinue = true or false
    zlib WHAM_noitemsplease = true or false
    zlib WHAM_safetymargin = <wanted number>
    zlib WHAM_UseSeaLasso = true or false
    zlib WHAM_killit = true or false
    zlib WHAM_roundcost_aftercore= <wanted number>
    zlib WHAM_roundcost_ronin = <wanted number>
    Since these variables are set upon first execution it is advisable to run the script from the script-menu once before entering combat if you want to change them. If you do so, you can abort at the first pop-up (or set verbosity to 10 before the first fight you use the script in).

    Version History
    1.0: Initial public release
    1.1: Change all printouts to WHAM, Lower the verbosity requirement for printing useful info to 3
    1.2: Add has_happened() to work around happened() being off by one turn if SmartStasis ended the fight before we got there
    1.3: Remove has_happened and use round > maxround instead.
    Make sure the script aborts if you acquire temporary amnesia.
    Make sure we don't automate queued skills longer than the user specified maxround (defaults to 50)
    1.3.1: Add a parenthesis so the script won't crash when it shouldn't...
    1.4: Set the unknown_ml for specific monsters in the Cyrpt in order to be able to handle them sanely in case of high
    1.5: Make sure to reset the unknown_ml-value no matter how we exit the script (unless the user aborts manually)
    You can always perform at least one attack/skill in a round, take advantage of this
    Fix some cases of the script not exiting properly when a fight ended suddenly
    Don't open the Bag O' Tricks since the script isn't aware that you can only use it once.
    1.6: Update to work with new version of BatBrain. Also fix some silly return values.
    Small adjustments for Avatar of Boris
    1.7: Don't use attack if an Avatar of Boris, fix error in OK().
    1.8: Yet another adaptation to Batbrain changing
    Start re-implementing HP/MP-restoring options
    1.9: Add some extra debug-printouts at verbosity 9
    Add a new zlib-variable WHAM_AlwaysContinue, default to false, that will try and execute a 5-skill combo even if it
    won't kill the monster
    Modify the useage of Broadside and Entangling Noodles as well as Intimidating Bellow to make them slightly less wasteful
    1.9.5: Fix the modifications for Broadside and Intimidating Bellow
    1.9.6: Don't try to use Mighty Axing as an attack-skill if we have temporary amnesia
    2.0: Refactor code to use BatBrain predictive abilities and thereby also to use items and gain an enormous speed boost (and
    also allow the script to plan 25-shots of monsters)
    Banish some foes in Boris-runs if we can, please suggest more potential banishes.
    Currently banishes: A.M.C Gremlin, Flaming Troll, Procrastination Giant, Sabre-Toothed Goat, Senile Lihc and Slick Lihc.
    2.0.1: Fix some small things, mainly with printouts
    2.0.2: Don't use Trusty-specific skills if you're not wielding Trusty
    2.0.3: Add missing ) and modify the attack-repeat-macro for a potential bug-fix
    2.1: Update to be up to date with latest SS also don't enqueue items as skills, it won't work.
    2.1.1: Add missing macro()-call from the SS-function
    2.2: Fix bug with using more items than we have (hopefully)
    2.3: Fix bug with failing to enqueue some things due to the script (and thus BatBrain) being out of sync with KoL
    2.4: Fix some bugs with attacking and hitchances
    2.5: Don't throw tower items at monsters (requires zlib version r36 or higher)
    Fix bug for banishing monsters in Boris-core
    Add logic to handle Bugbear-hunting and special killing
    2.6: Resolve infinite loop bug at low MP as well as crashing while trying to delevel
    Set guestimates for unknown_ml for the new bugbear monsters
    2.7: Fix some Temporary Amnesia related bugs (due to not rebuilding options during a fight)
    Fix bug where the script would really only saucesplash if you couldn't...
    2.8: Readd the WHAM_AlwaysContinue option as a way to tell if the script should try to fight as best as it can despite the odds
    Remove will_attack() since attack is considered among the other options anyway and the hitchance is taken into account when setting up options
    Significantly improve stunning logic
    Create the quit()-function to collect all exiting into one place
    Rudimentary handling of the Operation Patriot Shield
    2.8.1: Don't double-enqueue the stunning action
    2.8.2: Fix olfactioning of bugbear monsters
    Fix some errors with predictions
    Fix horrible bug that would make SC and TT attack skills be ok only if you were wearing Trusty...
    Start reworking the predictions to soon be able to use MP/HP restorers
    2.8.3: Don't use PADL phones or comunication windchimes against trendy bugbear chefs

    2.9: Don't olfact bugberas if we don't need more of that type
    Recalculate the killer option if we enqueue a stun
    Exit correctly if we banish a clingy pirate
    3.0: Don't use pool torpedoes unless under water
    Try to use another item if possible if we have funkslinging to take better advantage of that skill
    Fix generation of debug files
    3.0.1: Only use the gnomitronic thingamabob if it can kill the monster
    3.0.5: Include the stun even if we are going to saucesplash
    Goodfella contracts only work with a Penguin Goodfella active
    3.0.6: Lower some verbosities for better feedback at verbosity 3 when aborting
    Fix bug where the script thought it was enqueueing a stun while it in fact wasn't
    3.1: Adapt script a bit for changes in BatBrain 1.24
    Due to popular demand, add option to skip items and rely only on skills
    3.1.1: Tighten up some code
    Fix bug with WHAM_noitemsplease caused by extra semi-colon
    3.1.2: Fix another bug with WHAM_noitemsplease. Stupid thing...
    Also fix a bug with items being used when they shouldn't regardless of the setting.
    3.2: Forbid reusage of items and skills that can only be used once, in case Batbrain for some reason doesn't
    Don't stasis in the basement
    Add support for users to exclude items or skills based on their own wish via the relay_WHAM_dontuse-script
    Don't use Imp Airs and Bus Passes if the steel organ quest isn't finished

    3.3: Remove cludge to reset your hitchance for debug printing purposes by overloading allMyOptions instead
    Increase the hitchance limit by 0.25 when fighting Dr. Awkward sice he makes you fumble
    Make sure we abort if the unknown_ml-value is set to 0 (as is intended)
    Fix bug with dont_use-items where it never used an item you accepted usage of above a certain limit
    Redefine WHAM_maxround as number of turns to use after SS has finished

    Refactor some code
    3.3.1: Fix stupid compile error
    3.4 Make sure as many places as possible are under the control of dont_use and WHAM_noitemsplease
    Fix bug that prevented correct usage of once per battle items and skills. Thanks to all that helped with the debugging!

    3.5 Add support for Smash&Graagh
    3.6 Modify the script some for bear-skills and zombies
    Also, don't reuse once-items if we enqueue an item first

    3.6.1: Don't smash for things that cannot be pickpocketed
    3.7: Fix bug with Smash & Graaagh
    Add WHAM_happymediumglow setting to control the happy medium siphoning skill
    Attempt to allow for multi-usable items to be used more times than the amount of item we have

    3.7.1: Fix happy medium detection
    3.7.2: Fix for mafia updating Basement monster names
    3.8: Update to account for Mafia removing articles from some monster names
    Transfer Stasis and Custom actions over to WHAM from SmartStasis to bring them under the control of WHAM_dontuse

    3.8.1: Fix for Repeating of bearskill during stasis
    Fix for repeating once/battle options as stasis options
    Fix for not using olfaction as a custom options
    Merge special actions and custom options now that they are in the same script

    Gather all pickpocket actions in the same place
    3.9: Allow once per battle actions as stasis options with new innovative code to handle the stasis loop
    Fix bug with Consume Burrowgrub which can be used three times and no more per battle

    3.9.1: Fix multiusing of chefstaffs
    3.9.2: Stupid regexp...
    3.9.3: Fix pirate book not being used
    Fix, hopefully, the last stasis-issues
    4.0: Limit stasising with skills to the amount of turns of it we can actually cast
    Limit Squeeze Stress Ball to five times per day and fix detection of chef-staff jiggling

    4.1: Times happened should include performed actions as well as enqueued ones.
    Infect the opponent if the next skill is Plague Claws and we have not already infected
    Add WHAM_safetymargin setting to control any extra safety margin (in rounds) you may want for the stasising

    Do not use burrowgrub more than three times per day
    4.1.1: Add WHAM_safetymargin to one more place
    4.1.2: Modify the usage of WHAM_safetymargin slightly
    Forbid usage of Richard's Hobopolis skills due to a KoL-bug causing infite loops

    4.2: Update to be in line with the recent SmartStasis release
    Fix a burrowgrub bug
    4.2.1: Fix bug where the script would ignore your WHAM_AlwaysContinue setting.
    4.3: Do not use combat items worth more than your autoBuyPriceLimit
    Make the attacking part of the script adhere to WHAM_safetymargin as well and not just the stasising part
    4.3.1: Consider reusable expensive items as ok even if they are above autoBuyPriceLimit
    4.3.2: Use duskwalker syringes against oil-monsters
    4.3.3: Correctly insert infectious bite before plague claws
    4.3.4: Only infect if we can survive the onslaught afterwards
    4.3.5: Fix bugs with incorrect checks in ok()
    Correctly abort for unknown monsters if your unknown_ml is 0
    4.3.6: Update to align with SmartStasis 3.17
    Raise the verbosity for the chefstaff debug printout to 8

    4.3.7: Fix stuff not being as stuffy as they should be
    4.4: Fix potentially severe miss-counting bug in the stasis-portion
    4.5: SS 3.18, BB 1.31.1 compatibility fixes
    4.6: Start separating SS from WHAM again
    Fix some bugs with Summon Burrowgrub and the Haiku Katana

    4.6.1: FIx the rest of the Haiku Katana skills as well
    4.7: Adapt for Jarlsberg
    Refactor some code
    Fix bug (hopefully) with under-stunning due to overly optimistic spells

    4.7.1: Fix stun-code to work with all elements, not just those with a colour.
    Do not return the gnomitronic thingamabob if you cannot use it
    4.7.2: Fix version numbering

    4.8: Add workaround for attack_option going blank if called after a stun_option has been enqueued
    4.8.1: Don't use duskwalker syringes if it'll kill us

    4.8.2: Fix detection of don't-use-maps if the new format is being used
    Fix jarlsberg jiggling of limited staffs, also add banishing for Jarlsberg
    Don't loop eternally when verbosity > 9 and a valid combat strategy is unable to be found

    4.9: Update to be on par with the new BatBrain
    Fix some small issues with the ok()-function
    Don't stun with 1-round stunners unless we have funkslinging and is stunning for an item

    5.0: Fix stun-estimation to correctly account for monster resistances
    5.1: Modify the usage of Staff of the All-Steak, Staff of the Staff of life and start using the cream staff to olfact monsters in ftf_olfact
    5.2: Don't abort just because BatBrian says the fight is over, execute the plan instead.
    5.3: Remove fix for endscombat now that BatBrain allows up to three actions after an endscombat flag has been set
    If we plan to saucesplash don't bother finding other options first; significant speed boost
    You can only jiggle once per combat
    Add zlib setting WHAM_UseSeaLasso to toggle use of the Sea Lasso

    5.4: Make use of Mafia's seaLasso-tracking to decide when to stop throwing sea lassos
    Add option to toggle speed to kill as the most important factor (will ignore any savings that a "smarter" attack method may have), WHAM_killit, default false
    Don't get stuck in endless loops for deleveling, also make sure to actually perform the deleveling decided upon

    5.5: Fix bug where the script would abort due to no actions found after BatBrain sets endscombat to true
    5.6: Try to not fire the yellow ray unless we actually want the drops
    Force WHAM_killit to true if we are in Fernswarthy's Basement
    Add code to handle automating Yog-Urt and Jigguwatt
    Move to SVN for update

    r8: Don't try to stasis for so long that we cannot afford to kill the monster
    r9: Fix to_int-problem for the new stasis check

    r10: Matchers need to be found before being interacted with.
    r11: Add zlib as a dependency to get it automatically installed

    r13: Attempt to stasis with attack if we can hit, have a chance to crit and have one of the weapons for the Gladiator path equipped
    Skip custom options in our various _option functions since BatBrain will allow them in opts soon
    Add two new zlib-settings that control how much we are willing to pay to save a combat round, WHAM_roundcost_aftercore and WHAM_roundcost_ronin.
    Also, add that value to the stasis-property so that the higher roundcost-value we have, the more valuable an action need to be to be used in stasis
    Also, also, skip funkslinging if we either cannot find a second item to sling or said roundcost value is high enough that it is deemed unprofitable

    13-06-28:Specifically disallow useage of frosty's iceball until it can be figured out why it keeps using it
    13-06-27:Use the special skills in the Suburbs of Dis.
    Try to handle the special bosses in the Suburbs areas
    13-06-29:Attempt to abort stasising when we learn the last skill for the gladiator weapons, will still try to stasis even if you already know all skills
    Only do Gladiator training if the required skills are not known yet
    13-07-01:Fix WHAM_round to actually add the wanted thing and not just bulid an ever larger string and fix some to_int problems
    13-07-05:Fix warnings for incorrect typed constants
    Move removing of custom options to ok()
    Make the learning of Gladiator skills better by using Mafia's tracking
    Minor code refactoring for better readability
    13-08-19:Fix BatBrain breakage
    13-08-20:Always attempt to stun if my_location().kisses > 1
    13-08-21:Fix removal of items for notiemsplease
    Use BatBrain's new custom_action-function
    13-08-22:Fix item removal fully by reverting to the really old method...
    Print items when debug printing, but mark them red since they are disallowed
    13-08-25:Try to blacklist KOHLS-combat items
    13-09-03:Attempt to abort when we tame a sea horse
    13-10-22:Add basic handling of Procedurally Generated Skeletons as well as Video Game bosses.
    Don't use Noodles to stun with the revamped classes. It won't work.
    13-11-09:Try to steal accordions if we can. RFemove more classes from noodling.
    13-11-10:Fix steal accordion and remove most of the special handling for procedural skeletons
    13-11-21:Throw Pocket Crumbs at opponents because why not?
    13-11-28:WHen using Drunkula's Wineglass anything but attack is futile
    13-11-29:Remove code for saucesplashing as that is no longer a thing
    Entangling Noodles are only useful for Pastamancers, adapt stunning logic for the new class specific stun skills
    Last edited by Winterbay; 11-29-2013 at 07:04 PM.
    My scripts:
    Best sushi for Profit
    Winterbay's Helpful Automatic Monsterbasher (WHAM)

    Scripts maintained by me:

    A small programmer joke:
    Wife: Honey, please go to the market and buy 1 bottle of milk. If they have eggs, bring 6.
    The man came back with 6 bottles of milk.
    Wife: Why did you buy 6 bottles of milk.
    Man: Because they had eggs...

    The 6 Stages of Debugging: 1 )That can't happen. 2) That shouldn't happen. 3) Hmmm, weird. 4) Why does that happen? 5) Oh, I see. 6 )How did that ever work?

    All programs can be optimized, and all programs have bugs; therefore all programs can be optimized to one line that doesn’t work. /Bob Fitch, Blizzard

Similar Threads

  1. WHAM, Manual and 43 reasons to be confused.
    By fronobulax in forum Community Support
    Replies: 8
    Last Post: 02-22-2014, 03:48 PM
  2. autobasement, wham and coldform etc...
    By fronobulax in forum Community Support
    Replies: 13
    Last Post: 11-07-2012, 09:04 PM
  3. Bug - Fixed Scritp verification error less than helpful unless creating debug log
    By Winterbay in forum Bug Reports
    Replies: 3
    Last Post: 03-23-2012, 10:42 PM
  4. Replies: 0
    Last Post: 08-06-2011, 11:40 PM
  5. Replies: 0
    Last Post: 01-27-2011, 05:50 PM

Posting Permissions

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