You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.4 KiB

  1. local etlua = require "etlua"
  2. local utils = require "utils"
  3. local yqtemplateform = utils.readfile("yqform.etlua")
  4. local form = etlua.compile(yqtemplateform)
  5. return {
  6. desc = "Creates Yokoka’s quest-style personal status page",
  7. run = function(fcgi)
  8. fcgi.print("Content-Type: text/html; charset=utf-8\r\n\r\n")
  9. local data = ""
  10. --[[if fcgi.getenv("REQUEST_METHOD") == "POST" then
  11. local content_type = fcgi.getenv("CONTENT_TYPE")
  12. local boundary = content_type:match("; boundary=(.*)$")
  13. local post_data = fcgi.post()
  14. data = "Content type:" .. content_type .. "\n Boundary: " .. boundary .. "\n"
  15. local args = {}
  16. for w in string.gmatch(post_data, "(.-)" .. boundary) do
  17. local dataheaders, _ = utils.parse_form_entry(w)
  18. args[#args + 1] = dataheaders
  19. end
  20. data = table.concat(args, "\n\n")
  21. end ]]
  22. fcgi.print(
  23. form {
  24. data = data,
  25. classes = {
  26. "Beast",
  27. "Swordsman",
  28. "Spirit Bird",
  29. "Twin Blades",
  30. "Healer",
  31. "Summoner",
  32. "Tamer",
  33. "Pugilist",
  34. "Mounted Fighter",
  35. "Fruit Animal",
  36. "Spellcaster"
  37. },
  38. elements = {
  39. "Fire", "Water", "Earth", "Air",
  40. "Wood", "Electricity", "Metals", "Dreams",
  41. "Light", "Darkness", "Sun", "Moon",
  42. "Smoke", "Ice", "Crystal", "Sound",
  43. "Poison", "Lightning", "Weapons", "Fortune",
  44. "Healing", "Curses", "Day", "Night"
  45. }
  46. }
  47. )
  48. end
  49. }