Skip to content

Commit

Permalink
Add daily automation support for bag of park garbage + nemesis automa…
Browse files Browse the repository at this point in the history
…tion improvements
  • Loading branch information
houeland committed Jun 21, 2015
1 parent 10a7670 commit 9432c91
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 89 deletions.
10 changes: 5 additions & 5 deletions scripts/automation/ascension.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4581,6 +4581,11 @@ endif
}
}

add_task {
prereq = want_star_key(),
f = script.make_star_key,
}

add_task {
when = want_digital_key() and
ascensionstatus("Softcore") and
Expand Down Expand Up @@ -4887,11 +4892,6 @@ endif
f = script.do_sonofa,
}

add_task {
prereq = want_star_key(),
f = script.make_star_key,
}

add_task {
prereq = quest("Am I My Trapper's Keeper?"),
f = function()
Expand Down
15 changes: 14 additions & 1 deletion scripts/automation/daily-visits.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,20 @@ function do_daily_visits()
dopage("/choice.php", { whichchoice = 585, pwd = pwd, option = 1, action = "treasure" })
dopage("/choice.php", { whichchoice = 585, pwd = pwd, option = 1, action = "leave" })

if setting_enabled("automate daily visits/do lazy aftercore daily tasks") and ascensionstatus("Aftercore") then
if setting_enabled("automate daily visits/do lazy aftercore daily tasks") and have_mall_access() then
if have_dinseylandfill() then
if not have_item("bag of park garbage") and could_have_item_in_storage("bag of park garbage") then
pull_storage_item("bag of park garbage")()
end

if have_item("bag of park garbage") then
get_place("airport_stench", "airport3_tunnels")
async_get_page("/choice.php", { forceoption = 0 })
queue_page_result(async_post_page("/choice.php", { pwd = session.pwd, whichchoice = 1067, option = 6 }))
async_post_page("/choice.php", { pwd = session.pwd, whichchoice = 1067, option = 7 })
end
end

dopage("/campground.php", { preaction = "summonsnowcone", quantity = 3 })
dopage("/campground.php", { preaction = "summonstickers", quantity = 3 })
dopage("/campground.php", { preaction = "summonsugarsheets", quantity = 3 })
Expand Down
154 changes: 95 additions & 59 deletions scripts/automation/nemesis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,51 +62,51 @@ setup_turnplaying_script {
end
dorefresh()

if scg:match([[How goes your quest to restore the Legendary Epic Weapon]]) or scg:match([[acquire the Legendary Epic Weapon soon]]) or scg:match([[going with that Legendary Epic Weapon]]) then
if quest_text("for the Tomb of the Unknown") then
script.wear {}
script.ensure_mp(50)
result, resulturl, advagain = autoadventure { zoneid = get_zoneid("The Unquiet Garves") }
elseif quest_text("Find Beelzebozo in") then
inform "make LEW"
result = "make LEW"
if quest_text("you must defeat Beelzebozo") then
-- TODO: make robust
-- wear stuff
equip_item("clown whip")
equip_item("clownskin buckler")
equip_item("ring of conflict", 3)
-- TODO: check that we're wearing them
-- adventure repeatedly
for i = 1, 100 do
-- buff up
if not have_buff("The Sonata of Sneakiness") then
cast_skillid(6015, 2) -- sonata of sneakiness
end
if not have_buff("Smooth Movements") then
cast_skillid(5017, 2) -- smooth moves
end
script.ensure_mp(50)
result, resulturl, advagain = autoadventure { zoneid = 20, noncombatchoices = {
["Adventurer, $1.99"] = "Push the nose",
["Lurking at the Threshold"] = "Open the door",
} }
if result:contains("Clownlord Beelzebozo") then
result, resulturl = cast_autoattack_macro()
end
if not advagain then
break
end
-- TODO: make robust
-- wear stuff
equip_item("clown whip")
equip_item("clownskin buckler")
equip_item("ring of conflict", 3)
-- TODO: check that we're wearing them
-- adventure repeatedly
for i = 1, 100 do
-- buff up
if not have_buff("The Sonata of Sneakiness") then
cast_skillid(6015, 2) -- sonata of sneakiness
end
refresh_quest()
advagain = not quest_text("you must defeat Beelzebozo")
elseif not have_item(required_items.lew) and have_item(required_items.ew) and have_item(required_items.extra) then
set_result(smith_items(required_items.ew, required_items.extra))
if not have_item(required_items.lew) then
smith_items(required_items.ew, required_items.extra)
if not have_buff("Smooth Movements") then
cast_skillid(5017, 2) -- smooth moves
end
if have_item(required_items.lew) then
advagain = true
else
critical "Failed to smith Legendary Epic Weapon."
script.ensure_mp(50)
result, resulturl, advagain = autoadventure { zoneid = 20, noncombatchoices = {
["Adventurer, $1.99"] = "Push the nose",
["Lurking at the Threshold"] = "Open the door",
} }
if result:contains("Clownlord Beelzebozo") then
result, resulturl = cast_autoattack_macro()
end
if not advagain then
break
end
end
refresh_quest()
advagain = not quest_text("Find Beelzebozo in")
elseif not have_item(required_items.lew) and have_item(required_items.ew) and have_item(required_items.extra) then
set_result(smith_items(required_items.ew, required_items.extra))
if not have_item(required_items.lew) then
smith_items(required_items.ew, required_items.extra)
end
if have_item(required_items.lew) then
advagain = true
else
critical "Failed to make Legendary Epic Weapon."
critical "Failed to smith Legendary Epic Weapon."
end
elseif scg:match([[Have you defeated your Nemesis yet]]) or scg:match([[We need you to defeat your Nemesis]]) or scg:match([[Haven't beat your Nemesis yet]]) then
inform "do nemesis cave"
Expand Down Expand Up @@ -233,7 +233,10 @@ setup_turnplaying_script {
advagain = not quest_text("found a map to the secret tropical island")
elseif quest_text("put a stop to this Nemesis nonsense") or (quest("Me and My Nemesis") and have_item("secret tropical island volcano lair map")) then
if playerclass("Seal Clubber") then
stop "TODO: Automate seal clubber island"
if not have_item("hellseal disguise") then
stop "TODO: Automate seal clubber island"
end
try_killing_SC_nemesis()
elseif playerclass("Turtle Tamer") then
automate_TT_nemesis_island()
elseif playerclass("Pastamancer") then
Expand Down Expand Up @@ -303,6 +306,54 @@ function nemesis_try_sauceror_potions()
return false
end

local function check_volcanomaze()
if result:contains([[value="Continue"]]) then
result, resulturl = get_page("/volcanomaze.php", { start = 1 })
automate_volcanomaze()
script.ensure_buffs {}
script.heal_up()
script.ensure_mp(100)
result, resulturl = get_page("/volcanomaze.php")
advagain = false
end
end

function try_killing_SC_nemesis()
script.bonus_target { "easy combat" }
script.ensure_buffs {}
script.wear { weapon = "Hammer of Smiting" }
script.heal_up()
script.ensure_mp(50)
local fought = false
result, resulturl = get_page("/volcanoisland.php", { pwd = session.pwd, action = "tniat" })
print("DEBUG: lock url cont", locked(), resulturl, result:contains([[value="Continue"]]))
if locked() or not resulturl:contains("volcanoisland.php") or result:contains([[value="Continue"]]) then
fought = true
end
result, resulturl, advagain = handle_adventure_result(result, resulturl, "?", macro_noodleserpent)
print("DEBUG: lock url advagain", locked(), resulturl, advagain)
check_volcanomaze()
return fought
end

function try_killing_TT_nemesis()
script.bonus_target { "easy combat" }
script.ensure_buffs {}
script.wear { weapon = "Chelonian Morningstar" }
script.heal_up()
script.ensure_mp(50)
local fought = false
result, resulturl = get_page("/volcanoisland.php", { pwd = session.pwd, action = "tniat" })
print("DEBUG: lock url cont", locked(), resulturl, result:contains([[value="Continue"]]))
if locked() or not resulturl:contains("volcanoisland.php") or result:contains([[value="Continue"]]) then
fought = true
end
result, resulturl, advagain = handle_adventure_result(result, resulturl, "?", macro_noodleserpent)
print("DEBUG: lock url advagain", locked(), resulturl, advagain)
check_volcanomaze()
return fought
end

function automate_TT_nemesis_island()
if not have_item("fouet de tortue-dressage") then
get_page("/volcanoisland.php", { pwd = session.pwd, action = "npc" })
Expand All @@ -311,7 +362,8 @@ function automate_TT_nemesis_island()
async_get_page("/volcanoisland.php", { pwd = session.pwd, action = "npc" })
local ptnpc = get_page("/volcanoisland.php", { pwd = session.pwd, action = "npc" })
if ptnpc:contains("watch his turtles practice their backflips") then
stop "Finish quest."
try_killing_TT_nemesis()
return
end

script.bonus_target { "easy combat" }
Expand Down Expand Up @@ -363,15 +415,7 @@ function try_killing_P_nemesis()
end
result, resulturl, advagain = handle_adventure_result(result, resulturl, "?", macro_noodleserpent)
print("DEBUG: lock url advagain", locked(), resulturl, advagain)
if result:contains([[value="Continue"]]) then
result, resulturl = get_page("/volcanomaze.php", { start = 1 })
automate_volcanomaze()
script.ensure_buffs {}
script.heal_up()
script.ensure_mp(100)
result, resulturl = get_page("/volcanomaze.php")
advagain = false
end
check_volcanomaze()
return fought
end

Expand Down Expand Up @@ -517,15 +561,7 @@ function automate_DB_nemesis_island()
end
result, resulturl, advagain = handle_adventure_result(result, resulturl, "?", macro_noodleserpent)
print("DEBUG: lock url advagain", locked(), resulturl, advagain)
if result:contains([[value="Continue"]]) then
result, resulturl = get_page("/volcanomaze.php", { start = 1 })
automate_volcanomaze()
script.ensure_buffs {}
script.heal_up()
script.ensure_mp(100)
result, resulturl = get_page("/volcanomaze.php")
advagain = false
end
check_volcanomaze()
text = result
return
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/automation/scripts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3482,7 +3482,7 @@ endif
if not have_item("dinghy plans") then
if count_item("Shore Inc. Ship Trip Scrip") >= 3 then
inform "buy dinghy plans"
buy_shore_inc_item("dinghy plans")
set_result(buy_shore_inc_item("dinghy plans"))
did_action = have_item("dinghy plans")
else
inform "shore for dinghy plans"
Expand Down
46 changes: 27 additions & 19 deletions scripts/automation/settings.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
function get_ascension_automation_settings(want_bonus)
local function want_statgain()
return level() < 13
end
local tbl = {
should_wear_weapons = not ascensionpath("Way of the Surprising Fist"),
ignore_buffs = {},
Expand Down Expand Up @@ -110,12 +113,12 @@ function get_ascension_automation_settings(want_bonus)
{ name = "silent beret", check = function() return want_bonus.noncombat end },
"Crown of Thrones",
"The Crown of Ed the Undying",
{ name = "Boris's Helm (askew)", check = function() return (level() < 13) end },
{ name = "Spooky Putty mitre", check = function() return (level() < 13) end },
{ name = "Boris's Helm (askew)", check = want_statgain },
{ name = "Spooky Putty mitre", check = want_statgain },
"Boris's Helm",
"Brimstone Beret",
"astral chapeau",
{ name = "spangly sombrero", check = function() return (mainstat_type("Moxie") and level() < 13) end },
{ name = "spangly sombrero", check = function() return mainstat_type("Moxie") and want_statgain() end },
"Hairpiece On Fire",
{ name = "miner's helmet", check = function() return want_bonus.extraplusitems end },
"double-ice cap",
Expand Down Expand Up @@ -154,19 +157,20 @@ function get_ascension_automation_settings(want_bonus)
"giant gym membership card",
},
shirt = {
{ name = "sea salt scrubs", check = function() return want_bonus.easy_combat end },
{ name = "Sneaky Pete's leather jacket", check = function() return want_bonus.rollover_adventures end },
"fishbone corset",
{ name = "flaming pink shirt", check = function() return want_bonus.plusitems end },
"Sneaky Pete's leather jacket (collar popped)",
"Sneaky Pete's leather jacket",
{ name = "cane-mail shirt", check = function() return (level() < 13) end },
{ name = "cane-mail shirt", check = want_statgain },
"astral shirt",
"flaming pink shirt",
"famous blue raincoat",
{ name = "sugar shirt", check = function() return (level() < 13) end },
{ name = "hipposkin poncho", check = function() return (level() < 13) end },
{ name = "sugar shirt", check = want_statgain },
{ name = "hipposkin poncho", check = want_statgain },
"yak anorak",
{ name = "goth kid t-shirt", check = function() return (level() < 13) end },
{ name = "goth kid t-shirt", check = want_statgain },
"Grateful Undead T-shirt",
"punk rock jacket",
"souvenir ski t-shirt",
Expand All @@ -185,7 +189,7 @@ function get_ascension_automation_settings(want_bonus)
"astral shorts",
"astral trousers",
"Vicar's Tutu",
{ name = "buoybottoms", check = function() return (level() < 13) end },
{ name = "buoybottoms", check = want_statgain },
"Greatest American Pants",
{ name = "Whoompa Fur Pants", check = function() return want_bonus.elemental_weapon_damage end },
{ name = "giant discarded torn-up glove", check = function() return want_bonus.elemental_weapon_damage end },
Expand Down Expand Up @@ -213,32 +217,32 @@ function get_ascension_automation_settings(want_bonus)
{ name = "Space Trip safety headphones", check = function() return want_bonus.noncombat end },
{ name = "duonoculars", check = function() return want_bonus.noncombat end },
{ name = "ring of conflict", check = function() return want_bonus.noncombat end },
{ name = "Juju Mojo Mask", check = function() return (level() < 13 and not want_bonus.extraplusitems) end },
{ name = "Juju Mojo Mask", check = function() return want_statgain() and not want_bonus.extraplusitems end },
{ name = "plastic vampire fangs", check = function() return (level() < 6 and not want_bonus.extraplusitems) end },
{ name = "Jekyllin hide belt", check = function() return want_bonus.plusitems end },
{ name = "Mr. Accessory Jr.", check = function() return want_bonus.plusitems end },
{ name = "astral mask", check = function() return want_bonus.plusitems end },
{ name = "stinky cheese eye", check = function() return want_bonus.plusitems end },
{ name = "Baron von Ratsworth's monocle", check = function() return want_bonus.plusitems end },
{ name = "Loathing Legion rollerblades", check = function() return want_bonus.plusinitiative end },
{ name = "Juju Mojo Mask", check = function() return level() < 13 end },
{ name = "Juju Mojo Mask", check = want_statgain },
{ name = "Brimstone Brooch", check = function() return not ascensionstatus("Aftercore") end },
{ name = "Brimstone Bracelet", check = function() return not ascensionstatus("Aftercore") end },
{ name = "plastic vampire fangs", check = function() return (mp() < 60 or level() < 9) end },
{ name = "hockey stick of furious angry rage", check = function() return not want_bonus.easy_combat and level() < 13 end },
{ name = "Hand in Glove", check = function() return not want_bonus.easy_combat and level() < 13 end },
{ name = "hockey stick of furious angry rage", check = function() return not want_bonus.easy_combat and want_statgain() end },
{ name = "Hand in Glove", check = function() return not want_bonus.easy_combat and want_statgain() end },
"over-the-shoulder Folder Holder",
"astral ring",
"astral mask",
{ name = "astral belt", check = function() return (level() >= 7 or (challenge == "fist" and fist_level > 0) or not ascensionstatus("Hardcore")) and not want_bonus.easy_combat and level() < 13 end }, -- How early should we wear this?
{ name = "Loathing Legion necktie", check = function() return level() < 13 end },
{ name = "C.A.R.N.I.V.O.R.E. button", check = function() return level() < 13 end },
{ name = "astral belt", check = function() return (level() >= 7 or (challenge == "fist" and fist_level > 0) or not ascensionstatus("Hardcore")) and not want_bonus.easy_combat and want_statgain() end }, -- How early should we wear this?
{ name = "Loathing Legion necktie", check = want_statgain },
{ name = "C.A.R.N.I.V.O.R.E. button", check = want_statgain },
{ name = "frosty halo", check = function() return want_bonus.plusitems and not equipment().weapon end },
{ name = "furry halo", check = function() return want_bonus.plusitems and not equipment().weapon end },
{ name = "shining halo", check = function() return level() < 13 and not equipment().weapon end },
{ name = "shining halo", check = function() return want_statgain() and not equipment().weapon end },
{ name = "imp unity ring", check = function() return want_bonus.elemental_weapon_damage end },
{ name = "badge of authority", check = function() return level() < 13 end },
{ name = "ring of aggravate monster", check = function() return level() < 13 end },
{ name = "badge of authority", check = want_statgain },
{ name = "ring of aggravate monster", check = want_statgain },
"Juju Mojo Mask",
"plastic vampire fangs",
"Jekyllin hide belt",
Expand Down Expand Up @@ -321,11 +325,15 @@ function get_ascension_automation_settings(want_bonus)
"turtle totem",
}
tbl.default_equipment.offhand = {
{ name = "Operation Patriot Shield", check = function() return want_bonus.easy_combat end },
{ name = "Brimstone Bunker", check = function() return want_bonus.easy_combat end },
{ name = "wicker shield", check = function() return want_bonus.easy_combat end },
{ name = "black shield", check = function() return want_bonus.easy_combat end },
"Bag o' Tricks",
{ name = "A Light that Never Goes Out", check = function() return want_bonus.plusitems end },
"Jarlsberg's pan",
"Jarlsberg's pan (Cosmic portal mode)",
{ name = "Operation Patriot Shield", check = function() return level() < 13 end },
{ name = "Operation Patriot Shield", check = want_statgain },
{ name = "Rain-Doh green lantern", check = function() return want_bonus.easy_combat end },
"pool skimmer",
{ name = "Rain-Doh green lantern", check = function() return not want_bonus.not_casting_spells end },
Expand Down
2 changes: 1 addition & 1 deletion scripts/automation/spaaace.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local function adv_space_zone(zoneid)
script.ensure_buffs { "Fat Leon's Phat Loot Lyric", "Leash of Linguini", "Empathy" }
script.heal_up()
script.ensure_mp(100)
script.ensure_mp(70)
result, resulturl, advagain = autoadventure {
zoneid = zoneid,
noncombatchoices = {
Expand Down
Loading

0 comments on commit 9432c91

Please sign in to comment.