Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function downloaded_file(_, filename)
- if string.find(filename,"thonours") ~= nil then
- io.input(filename)
- local s = io.read("*all")
- local plinfo = yajl.to_value(s)
- --display(plinfo)
- if plinfo.name then
- i = 0
- string.gsub(plinfo.description, "(%a+)", function (w)
- i = i + 1
- if i == 4 then plinfo.statpack = w return end
- end)
- --cecho("<orange>(<white>Truehonours-><gray>" .. plinfo.name .. "<white> Done!<orange>)")
- cecho("\n<pale_turquoise>"..plinfo.name.."<white>: <tomato>"..plinfo.profession:title().."<white>::<light_sea_green>"..plinfo.statpack:title().."<white>::<violet>"..plinfo.city:title().."\n")
- if players then
- players[plinfo.name] = plinfo
- table.save(getMudletHomeDir() .. "/players.lua",players)
- else
- players = {}
- players[plinfo.name] = plinfo
- table.save(getMudletHomeDir() .. "/players.lua",players)
- end
- if RingReportClass == true then
- send("rt "..plinfo.name..": "..plinfo.profession:title().."::"..plinfo.statpack:title().."::"..plinfo.city:title())
- end
- end
- io.close()
- os.remove(filename)
- elseif filename:match("votePage", 1, true) then
- cecho("<white>.")
- io.input(filename)
- local s = io.read("*all")
- local oldhash = string.match(s,'<input name="oldhash" type="hidden" value="(%x+)">')
- cecho("<white>.")
- local testid = string.match(s,'<input name="testid" type="hidden" value="(%x+)">')
- cecho("<white>.")
- local mudid = string.match(s,'<input type="hidden" name="mudid" value="(%d+)">')
- cecho("<white>.")
- local votehash = string.match(s,'<input type="hidden" name="votehash" value="(%x+)">')
- cecho("<white>.")
- local votestring = "http://www.topmudsites.com/vote.php?" .. "&do=in" .. "&oldhash=" .. oldhash .. "&testid=" .. testid .. "&mudid=" .. mudid .. "&votehash=" .. votehash
- cecho("<white>.")
- downloadFile(getMudletHomeDir().."/voteDone.html", votestring)
- elseif filename:match("voteDone", 1, true) then
- cecho("<lime_green>Successful!<white>)\n")
- send("voted", false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement