Kingdom of Loathing Junkyard combat macro


SUBMITTED BY: Guest

DATE: Dec. 2, 2012, 10:34 a.m.

FORMAT: PHP

SIZE: 4.5 kB

HITS: 1666

  1. #Written by Cheese (#1759414)
  2. #Changelog:
  3. #Further editors: New edits get new GUIDS, move very old changes (and GUIDS) below script
  4. #For information about GUIDs, see the end of the script.
  5. #Version 1283e714-d027-4a34-a7cf-91cfbdbe1f33 - DanielH (#2157786)
  6. # Refactoring, Potential bugfixes, and additional abort messages
  7. #Version 6f97a73c-9181-435a-8d0c-2f40be7465fc - Cheese (#1759414)
  8. # Initial version; untested because no account in war
  9. #It is VERY important that before using this macro and going on the sidequest, you set 3 timers:
  10. #You must set them in the following order, and they must be your only timers running at the time.
  11. #Set your first timer to be "wrench", your second to be "pliers", and your third to be "screwdriver"
  12. #All timers should be set for 99 turns, which should be more than enough time to complete the side quest.
  13. #Each time you find a tool and are sent to find the next, shrug the effect of the tool you are searching to find
  14. #For instance, if you find the hammer, and are sent to find the wrench, shrug the effect "wrench"
  15. #Change the subroutine kill to be your prefered method of disposing of a monster.
  16. #change noted point to be your preferred method of stalling a monster
  17. #Check if this might be your gremlin
  18. if monstername batwinged gremlin
  19. if haseffect timer 1
  20. call might
  21. endif
  22. endif
  23. if monstername erudite gremlin
  24. if (haseffect timer 2) && (!haseffect timer 1)
  25. call might
  26. endif
  27. endif
  28. if monstername spider gremlin
  29. if (haseffect timer 3) && (!haseffect timer 2)
  30. call might
  31. endif
  32. endif
  33. if monstername vegetable gremlin
  34. if !haseffect timer 3
  35. call might
  36. endif
  37. endif
  38. if !monstername * gremlin
  39. abort This macro is meant for the junkyard.
  40. endif
  41. #If we're here, we don't care about this gremlin
  42. call kill
  43. #This subroutine steals the tool if it's there, returns if the tool isn't there, or quits if we
  44. #are too injured to continue.
  45. sub might
  46. #These messages would prove that it is not our gremlin
  47. while !(match "It does a bombing run over your head" || match "He uses the random junk around him to make an automatic eyeball-peeler" || match "It bites you in the fibula with its mandibles" || match "It picks a beet off of itself and beats you" || match "It picks a radish off of itself and tosses it")
  48. #These messages prove it is your gremlin
  49. if match "It whips out a hammer (you're not sure from where), and hammers on your head with it. Dude, you're so hammered." || match "He whips out a crescent wrench from somewhere, places it on your finger, and carefully calibrates how tightly he has to adjust it to make you scream bloody murder." || match "It whips out a pair of pliers and fastens them firmly on your" || match "It whips out a screwdriver and stabs you with it. Where did it get the vodka and orange juice? Oh, wait, it was just the regular, metal, stabby kind of screwdriver."
  50. call steal
  51. endif
  52. #Check to see if we're too injured. We abort instead of kill so the player knows.
  53. if hppercentbelow 30
  54. abort 'Ouch; that hurt too much to continue.'
  55. endif
  56. #Change this to be your non-stunning and non-damaging stalling tactic of choice
  57. use facsimile
  58. endwhile
  59. #At this point, we know it's not our gremlin and we don't care about it.
  60. endsub
  61. #This subroutine steals the tool if it's present and aborts if it isn't.
  62. sub steal
  63. use molybdenum
  64. abort 'We just tried to steal but we are still in combat.'
  65. endsub
  66. #Change this one so you can completely kill a monster. Or maybe use a runaway.
  67. sub kill
  68. use rain-doh blue
  69. skill throw shield
  70. attack
  71. attack
  72. #At this point, we give up on killing automatically. You should probably keep this line.
  73. abort 'Unable to kill the gremlin'
  74. endsub
  75. #1 = wrench
  76. #2 = pliers
  77. #3 = screwdriver
  78. #GUIDs (aka UUIDs) are almost surely unique (you're more likely to win the lottery than to find
  79. #a duplicate one) so are very easy to Google. Any search for the changelog GUIDs will almost certainly
  80. #be concerned with this script. To generate a new GUID, you can go to
  81. # http://www.famkruithof.net/uuid/uuidgen

comments powered by Disqus