Skip to content

Commit

Permalink
Datafile fixes and Ed improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
houeland committed Feb 25, 2015
1 parent 64601d3 commit 529c650
Show file tree
Hide file tree
Showing 8 changed files with 188 additions and 259 deletions.
111 changes: 15 additions & 96 deletions scripts/automation/ascension.lua
Original file line number Diff line number Diff line change
Expand Up @@ -592,16 +592,6 @@ endif
end
end

local DD_keys = countif("Boris's key") + countif("Jarlsberg's key") + countif("Sneaky Pete's key") + count_item("fat loot token")
local real_DD_keys = DD_keys
if cached_stuff.completed_daily_dungeon then
DD_keys = 100
elseif script_want_2_day_SCHR() then
elseif level() >= 6 and estimate_max_fullness() - fullness() < 4 then
elseif not ascensionstatus("Hardcore") then
DD_keys = 100
end

mmj_available = cached_stuff.mox_guild_is_open and (playerclass("Pastamancer") or playerclass("Sauceror") or (playerclass("Accordion Thief") and level() >= 9)) -- TODO: fix

reset_macro_target()
Expand Down Expand Up @@ -1807,7 +1797,7 @@ endif
end

add_task {
when = not have_item("digital key") and count_item("white pixel") + math.min(count_item("red pixel"), count_item("green pixel"), count_item("blue pixel")) >= 30,
when = want_digital_key() and count_item("white pixel") + math.min(count_item("red pixel"), count_item("green pixel"), count_item("blue pixel")) >= 30,
task = tasks.make_digital_key,
}

Expand Down Expand Up @@ -2954,7 +2944,7 @@ endif
end

add_task {
when = not have_item("digital key") and trailed == "Blooper",
when = want_digital_key() and trailed == "Blooper",
task = tasks.do_8bit_realm,
}

Expand Down Expand Up @@ -3884,7 +3874,7 @@ endif
}

add_task {
when = not have_item("digital key") and
when = want_digital_key() and
ascensionstatus("Hardcore") and
not script.have_familiar("Angry Jung Man") and
have_skill("Transcendent Olfaction") and
Expand Down Expand Up @@ -3923,7 +3913,7 @@ endif
}

add_task {
when = not have_item("digital key") and
when = want_digital_key() and
ascensionstatus("Hardcore") and
not script.have_familiar("Angry Jung Man") and
have_item("Staff of the Standalone Cheese") and
Expand Down Expand Up @@ -3993,7 +3983,7 @@ endif

local pixel_count = count_item("white pixel") + math.min(count_item("red pixel"), count_item("green pixel"), count_item("blue pixel"))
add_task {
when = not have_item("digital key") and
when = want_digital_key() and
cached_stuff.campground_psychoses == "mystic" and
pixel_count < 30,
task = {
Expand Down Expand Up @@ -4026,7 +4016,7 @@ endif
}

add_task {
when = not have_item("digital key") and
when = want_digital_key() and
(have_item("psychoanalytic jar") or have_item("jar of psychoses (The Crackpot Mystic)")) and
advs() >= 40 and
not trailed,
Expand Down Expand Up @@ -4114,7 +4104,7 @@ endif
}

add_task {
when = DD_keys < 3 and (have_gelatinous_cubeling_items() or not script.have_familiar("Gelatinous Cubeling")) and not cached_stuff.done_daily_dungeon,
when = want_legend_keys() and (have_gelatinous_cubeling_items() or not script.have_familiar("Gelatinous Cubeling")) and not cached_stuff.done_daily_dungeon,
task = tasks.do_daily_dungeon,
}

Expand Down Expand Up @@ -4467,12 +4457,12 @@ endif
add_task(tasks.unlock_hidden_temple)

add_task {
when = DD_keys < 3 and not cached_stuff.done_daily_dungeon,
when = want_legend_keys() and not cached_stuff.done_daily_dungeon,
task = tasks.do_daily_dungeon,
}

add_task {
when = not have_item("digital key") and
when = want_digital_key() and
ascensionstatus("Hardcore") and
not script.have_familiar("Angry Jung Man") and
not trailed,
Expand Down Expand Up @@ -4539,21 +4529,6 @@ endif
message = "get steam-powered model rocketship",
}

add_task {
prereq =
count_item("star chart") < 3 and
(can_wear_weapons() or count_item("star chart") < 2) and
not have_item("Richard's star key") and
(not trailed or trailed == "Astronomer") and
have_item("steam-powered model rocketship") and ascensionstatus() == "Hardcore",
f = function()
if have_item("BitterSweetTarts") and not have_buff("Full of Wist") then
use_item("BitterSweetTarts")
end
script.go("do hits astronomers", 83, make_cannonsniff_macro("Astronomer"), nil, { "Spirit of Peppermint", "Fat Leon's Phat Loot Lyric", "Heavy Petting", "Peeled Eyeballs", "Leash of Linguini", "Empathy" }, "Slimeling", 60, { olfact = "Astronomer" })
end,
}

add_task {
when = not ascensionstatus("Aftercore") and
level() >= 10 and
Expand Down Expand Up @@ -4589,7 +4564,7 @@ endif
}

add_task {
when = not have_item("digital key") and
when = want_digital_key() and
ascensionstatus("Softcore") and
not script.have_familiar("Angry Jung Man") and
not cached_stuff.tried_pulling_mystic_jar and
Expand All @@ -4613,49 +4588,6 @@ endif
}
}

add_task {
when = ascensionstatus("Softcore") and
not ascensionpath("Bees Hate You") and
not cached_stuff.tried_pulling_large_box and
level() >= 10 and
turnsthisrun() >= 300 and
real_DD_keys >= 2 and
can_ensure_clover(),
task = {
message = "considering pulling large box",
nobuffing = true,
action = function()
cached_stuff.tried_pulling_large_box = true
local want = true
local dodstatus = get_dod_potion_status()
if next(dodstatus) then
want = false
end
for _, x in ipairs(dod_potion_types) do
if have_item(x) then
want = false
end
end
if have_item("small box") or have_item("large box") or have_item("blessed large box") then
want = false
end
if want and (pullsleft() or 0) >= 5 and ensure_clover() then
pull_in_softcore("large box")
meatpaste_items("large box", "ten-leaf clover")
use_item("blessed large box")
for _, x in ipairs(dod_potion_types) do
if have_item(x) then
did_action = true
end
end
else
print(" skipping attempt")
did_action = true
end
end
}
}

add_task {
prereq = level() < 11,
f = do_powerleveling,
Expand Down Expand Up @@ -4907,28 +4839,15 @@ endif
}

add_task {
prereq = not have_item("Richard's star key") and
trailed ~= "Astronomer" and
prereq = want_star_key() and
ascensionstatus("Hardcore"),
f = script.make_star_key,
}

-- add_task {
-- prereq = not (
-- have_item("pine wand") or
-- have_item("ebony wand") or
-- have_item("hexagonal wand") or
-- have_item("aluminum wand") or
-- have_item("marble wand")
-- ) and meat() >= 5000 and challenge ~= "fist",
-- f = script.get_dod_wand,
-- }

add_task {
prereq = not have_item("Richard's star key") and
have_item("steam-powered model rocketship") and
ascensionstatus("Softcore"),
f = script.make_star_key_only,
prereq = want_star_key() and
have_item("steam-powered model rocketship"),
f = script.make_star_key,
}

add_task {
Expand Down Expand Up @@ -5767,7 +5686,7 @@ ascension_automation_setup_href = add_automation_script("setup-ascension-automat
return get_page("/main.php")
end

local ok_paths = { [0] = true, ["Avatar of Boris"] = true, [10] = true, ["Avatar of Jarlsberg"] = true, ["BIG!"] = true, ["Avatar of Sneaky Pete"] = true, ["Heavy Rains"] = true }
local ok_paths = { [0] = true, ["Avatar of Boris"] = true, [10] = true, ["Avatar of Jarlsberg"] = true, ["BIG!"] = true, ["Avatar of Sneaky Pete"] = true, ["Heavy Rains"] = true, ["Actually Ed the Undying"] = false }
-- ["Way of the Surprising Fist"] = true -- needs updates
local path_support_text = ""
local pathdesc = string.format([[%s %s]], ascensionstatus(), ascensionpathname())
Expand Down
2 changes: 2 additions & 0 deletions scripts/automation/delete-spookyraven-kmail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ local function should_delete(x)
return true
elseif tonumber(x.fromid) == 0 and x.fromname == "The Loathing Postal Service" and x.message:contains("We found this telegram at the bottom of an old bin of mail.") then
return true
elseif tonumber(x.fromid) == 0 and x.fromname == "The Loathing Postal Service" and x.message:contains("One of my agents found a copy of a telegram in the Council's fileroom") then
return true
else
return false
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/automation/macros.lua
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ endif
elseif ascensionpath("Avatar of Sneaky Pete") and estimate_elemental_weapon_damage_sum() >= 10 then
return attack_action()
end
return macro_cast_skill { pastathrall() and "Cannelloni Cannon" or "???", "Saucestorm", "Cannelloni Cannon", "Bawdy Refrain" }
return macro_cast_skill { pastathrall() and "Cannelloni Cannon" or "???", "Saucestorm", "Cannelloni Cannon", "Bawdy Refrain", "Fist of the Mummy" }
end

function serpent_action()
Expand Down
84 changes: 32 additions & 52 deletions scripts/automation/scripts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ function get_automation_scripts(cached_stuff)
if famname == "Reassembled Blackbird" and not script.have_familiar("Reassembled Blackbird") then famname = "Reconstituted Crow" end
if famname == "Reconstituted Crow" and not script.have_familiar("Reconstituted Crow") then famname = "auto" end
if famname == "fairy" then
if daysthisrun() >= 2 and not have_item("digital key") and not have_item("psychoanalytic jar") and get_daily_counter("familiar.jungman.jar") == 0 and script.have_familiar("Angry Jung Man") then
if daysthisrun() >= 2 and want_digital_key() and not have_item("psychoanalytic jar") and get_daily_counter("familiar.jungman.jar") == 0 and script.have_familiar("Angry Jung Man") then
famname = "Angry Jung Man"
elseif not have_gelatinous_cubeling_items() and script.have_familiar("Gelatinous Cubeling") then
famname = "Gelatinous Cubeling"
Expand Down Expand Up @@ -958,7 +958,7 @@ function get_automation_scripts(cached_stuff)
if hp() < maxhp() and not have_apartment_building_cursed_buff() then
use_hottub()
end
if hp() < maxhp() and challenge ~= "zombie" then
if hp() < maxhp() and challenge ~= "zombie" and not ascensionpath("Actually Ed the Undying") then
post_page("/galaktik.php", { action = "curehp", pwd = get_pwd(), quantity = maxhp() - hp() })
if hp() < maxhp() then
stop("Failed to reach full HP")
Expand Down Expand Up @@ -3573,54 +3573,7 @@ endif
end

function f.make_star_key()
local got_enough = false
if count_item("star chart") >= 3 or ((challenge == "fist" or challenge == "boris") and count_item("star chart") >= 2) then
if count_item("star") >= 8+5 and count_item("line") >= 7+3 then
sparestars = count_item("star") - 8 - 5
sparelines = count_item("line") - 7 - 3
if sparestars >= 5 and sparelines >= 6 then
got_enough = true
elseif sparestars >= 6 and sparelines >= 5 then
got_enough = true
elseif sparestars >= 7 and sparelines >= 4 then
got_enough = true
elseif challenge == "fist" then
got_enough = true
end
end
end
if got_enough then
inform "make star stuff"
if not have_item("Richard's star key") then
shop_buy_item("Richard's star key", "starchart")
end
if not have_item("star hat") then
shop_buy_item("star hat", "starchart")
end
if not have_item("star crossbow") and not have_item("star staff") and not have_item("star sword") and can_wear_weapons() then
if count_item("star") >= 5 and count_item("line") >= 6 then
shop_buy_item("star crossbow", "starchart")
elseif count_item("star") >= 6 and count_item("line") >= 5 then
shop_buy_item("star staff", "starchart")
elseif count_item("star") >= 7 and count_item("line") >= 4 then
shop_buy_item("star sword", "starchart")
end
end
if have_item("Richard's star key") and have_item("star hat") and (have_item("star crossbow") or have_item("star staff") or have_item("star sword") or not can_wear_weapons()) then
did_action = true
end
else
if trailed and trailed == "Astronomer" then
stop("Trailing " .. trailed .. " when finishing hits")
end
script.bonus_target { "item", "extraitem" }
go("finish hits", 83, macro_noodlecannon, {}, { "Spirit of Peppermint", "Fat Leon's Phat Loot Lyric", "Leash of Linguini", "Empathy" }, "Slimeling", 40)
end
return result, resulturl, did_action
end

function f.make_star_key_only()
if count_item("star") >= 8 and count_item("line") >= 7 then
if count_item("star") >= 8 and count_item("line") >= 7 and (have_item("star chart") or not ascenstatus("Hardcore")) then
inform "buying star key"
if not have_item("star chart") then
pull_in_softcore("star chart")
Expand All @@ -3630,7 +3583,7 @@ endif
return
end
script.bonus_target { "item", "extraitem" }
go("collect stars and lines", 83, macro_noodlecannon, {}, { "Spirit of Peppermint", "Fat Leon's Phat Loot Lyric", "Leash of Linguini", "Empathy" }, "Slimeling", 40)
go("farm star key", 83, macro_noodlecannon, {}, { "Spirit of Peppermint", "Fat Leon's Phat Loot Lyric", "Leash of Linguini", "Empathy" }, "Slimeling", 40)
return result, resulturl, did_action
end

Expand Down Expand Up @@ -4835,7 +4788,7 @@ function vamp_out(targetstat)
end

function can_change_familiar()
return not ascensionpath("Avatar of Boris") and not ascensionpath("Avatar of Jarlsberg") and not ascensionpath("Avatar of Sneaky Pete")
return not ascensionpath("Avatar of Boris") and not ascensionpath("Avatar of Jarlsberg") and not ascensionpath("Avatar of Sneaky Pete") and not ascensionpath("Actually Ed the Undying")
end

function have_gelatinous_cubeling_items()
Expand Down Expand Up @@ -4909,6 +4862,9 @@ function handle_adventure_result(pt, url, zoneid, macro, noncombatchoices, speci
elseif noncombatchoices then
optname = noncombatchoices[adventure_title]
end
if not optname and adventure_title == "Like a Bat Into Hell" then
optname = "Go right back to the fight!"
end
if optname and not pickchoice then
for nr, title in pt:gmatch([[<input type=hidden name=option value=([0-9])><input class=button type=submit value="([^>]+)">]]) do
if title == optname then
Expand Down Expand Up @@ -5132,3 +5088,27 @@ function have_chateau_mantegna()
return pt:contains("Chateau Mantegna")
end

local function path_does_not_have_lair()
return ascensionpath("Bugbear Invasion") and ascensionpath("Actually Ed the Undying")
end

function want_digital_key()
if path_does_not_have_lair() then return false end
return not have_item("digital key")
end

function want_star_key()
if path_does_not_have_lair() then return false end
return not have_item("Richard's star key")
end

function want_legend_keys()
if path_does_not_have_lair() then return false end
local available = count_item("fat loot token")
for _, x in ipairs { "Boris's key", "Jarlsberg's key", "Sneaky Pete's key" } do
if have_item(x) then
available = available + 1
end
end
return available < 3
end
3 changes: 1 addition & 2 deletions scripts/base/other.lua
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,7 @@ add_use_item_ascension_assistance("carton of astral energy drinks")

add_use_item_ascension_assistance("telegram from Lady Spookyraven")
add_use_item_ascension_assistance("Letter for Melvign the Gnome")
--add_use_item_ascension_assistance("letter to Ed the Undying")
add_use_item_ascension_assistance(7959)
add_use_item_ascension_assistance("letter to Ed the Undying")

add_use_item_ascension_assistance("evil eye")

Expand Down
Loading

0 comments on commit 529c650

Please sign in to comment.