add_printer("/account.php", function() pwd = get_session_state("pwd") table = [[
Kolproxy Options

Go to kolproxy settings

]] text = string.gsub(text, [[]], "\n" .. table .. "%0") end) function make_buttons(valuestr, value, options) buttons = "" for _, v in pairs(options) do if value == v.value then buttons = buttons .. [[]] .. v.text else buttons = buttons .. [[]] .. v.text end end return buttons end add_printer("/custom-settings", function() pwd = get_session_state("pwd") -- Inserting pwd, boo! settings = { --~ { title = "Automate choice noncombats", set = "character", name = "automate choice noncombats", field = "yesno" }, { title = "Allow the kolproxy Lua scripts to download pages", set = "character", name = "run automation scripts", field = "yesno", explanation = "Required for other advanced functionality to work.

If this is disabled, then only the pages your browser specifically requests will be downloaded from the server. E.g. if you were to click the ascension checklist, it would try to download it from the KoL server and return an error message, instead of letting the script run and load your inventory/storage/closet." }, { title = "Enable warnings about semirares, not enough meat, etc.", set = "character", name = "enable adventure warnings", field = "yesno" }, { title = "Automate daily visits (rumpus room, garden, etc.)", set = "character", name = "automate daily visits", field = "yesno" }, { title = "Enable automatic turn playing functionality (stupid and wrong, but convenient)", set = "character", name = "enable turn automation", field = "yesno" }, { title = "Ask chatbot for bounty/clover status on logon", set = "character", name = "ask chatbot on logon", field = "yesno" }, --~ { title = "Enable ascension automation", set = "character", name = "enable ascension automation", field = "yesno" }, --~ { title = "Aftercore logout outfit", set = "character", name = "logout outfit", field = "text", example = "Rollover" }, --~ { title = "Healing skill ID", set = "ascension", name = "healing skill", field = "number", example = "3012" }, --~ { title = "Buffing outfit", set = "ascension", name = "buffing outfit", field = "text", example = "Buffing" }, --~ { title = "Buffing outfit (when auto-healing)", set = "ascension", name = "autoheal buffing outfit", field = "text", example = "Buffing" }, } settingstext = "" for idx, s in pairs(settings) do value = get_state(s.set, s.name) namestr = "name-" .. tostring(idx) valuestr = "value-" .. tostring(idx) if s.field == "text" then -- example = [[(e.g. ]] .. s.example .. [[)]] -- item_text = s.title .. [[ = ]] .. example -- elseif s.field == "number" then -- example = [[(e.g. ]] .. s.example .. [[)]] -- item_text = s.title .. [[ = ]] .. example elseif s.field == "yesno" then if value == "yes" then checkbox_value = [[checked="checked" ]] elseif value == "no" then checkbox_value = [[]] else checkbox_value = [[]] end explanationmark = "" explanationtext = "" if s.explanation then explanationmark = [[(?)]] explanationtext = [[ ]] end inputelem = [[]] checkbox = [[
]]..explanationmark..[[
]] item_text = [[
]] .. checkbox .. [[]]..explanationtext..[[
]] -- elseif s.field == "option" then -- buttons = make_buttons(valuestr, value, s.values) -- item_text = s.title .. [[ = ]] .. buttons -- else -- item_text = s.title .. [[ = ]] end this_text = [[

]] .. item_text .. [[

]] settingstext = settingstext .. this_text end text = [[
Kolproxy settings
]] .. settingstext .. [[
Kolproxy special pages
Parse logs (experimental)
Craftable advanced cocktails (experimental)
Ascension checklist
Open documentation in a new tab
Server settings
Back to Account Menu
]] text = [[ ]] .. text .. [[ ]] --~ print("params", params) end)