Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1.  
  2. function downloaded_file(_, filename)
  3. if string.find(filename,"thonours") ~= nil then
  4. io.input(filename)
  5. local s = io.read("*all")
  6. local plinfo = yajl.to_value(s)
  7. --display(plinfo)
  8. if plinfo.name then
  9. i = 0
  10. string.gsub(plinfo.description, "(%a+)", function (w)
  11. i = i + 1
  12. if i == 4 then plinfo.statpack = w return end
  13. end)
  14. --cecho("<orange>(<white>Truehonours-><gray>" .. plinfo.name .. "<white> Done!<orange>)")
  15. cecho("\n<pale_turquoise>"..plinfo.name.."<white>: <tomato>"..plinfo.profession:title().."<white>::<light_sea_green>"..plinfo.statpack:title().."<white>::<violet>"..plinfo.city:title().."\n")
  16. if players then
  17. players[plinfo.name] = plinfo
  18. table.save(getMudletHomeDir() .. "/players.lua",players)
  19. else
  20. players = {}
  21. players[plinfo.name] = plinfo
  22. table.save(getMudletHomeDir() .. "/players.lua",players)
  23. end
  24. if RingReportClass == true then
  25. send("rt "..plinfo.name..": "..plinfo.profession:title().."::"..plinfo.statpack:title().."::"..plinfo.city:title())
  26. end
  27. end
  28. io.close()
  29. os.remove(filename)
  30. elseif filename:match("votePage", 1, true) then
  31. cecho("<white>.")
  32. io.input(filename)
  33. local s = io.read("*all")
  34. local oldhash = string.match(s,'<input name="oldhash" type="hidden" value="(%x+)">')
  35. cecho("<white>.")
  36. local testid = string.match(s,'<input name="testid" type="hidden" value="(%x+)">')
  37. cecho("<white>.")
  38. local mudid = string.match(s,'<input type="hidden" name="mudid" value="(%d+)">')
  39. cecho("<white>.")
  40. local votehash = string.match(s,'<input type="hidden" name="votehash" value="(%x+)">')
  41. cecho("<white>.")
  42. local votestring = "http://www.topmudsites.com/vote.php?" .. "&do=in" .. "&oldhash=" .. oldhash .. "&testid=" .. testid .. "&mudid=" .. mudid .. "&votehash=" .. votehash
  43. cecho("<white>.")
  44. downloadFile(getMudletHomeDir().."/voteDone.html", votestring)
  45. elseif filename:match("voteDone", 1, true) then
  46. cecho("<lime_green>Successful!<white>)\n")
  47. send("voted", false)
  48. end
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement