Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This script is now dead
- local next = 0;
- local last = "";
- local function Save(invited,next)
- local tbl = {};
- tbl.name = invited;
- tbl.next = next;
- MOD.SetVar("betatimer",JSONEncode(tbl));
- end
- local function CheckAndGet()
- MOD.Timer("betatimer",1,CheckAndGet);
- local t = os.time();
- if t > next then
- local raw,code = MOD.HTTPGet("https://www.pathofexile.com/scripts/beta-invite-query.php?mode=next");
- if code==200 then
- local data = JSONDecode(raw);
- local p1 = data.p1;
- local next_s = p1.next_s;
- local invited = p1.last.name;
- if invited == last then
- return;
- end
- print(invited.." has been invited to the closed beta!");
- last = invited;
- next = t+next_s+1;
- Save(invited,t+next_s);
- else
- next = t+30;
- end
- end
- end
- --[[local raw = MOD.GetVar("betatimer","#pathofexile");
- if raw == nil then
- MOD.Timer("betatimer",1,CheckAndGet);
- else
- local data = JSONDecode(raw);
- last = data.name;
- next = data.next;
- MOD.Timer("betatimer",1,CheckAndGet);
- end
- return function(msg,usr,chan)
- if last==nil or last=="" then
- return;
- end
- local coming = next-os.time();
- if coming <= 0 then
- coming = "Any moment now!";
- else
- coming = MOD.SecondToSpan(coming);
- end
- print("Last invite: "..last.." next invite: " .. coming);
- end]]
- MOD.DelVar("betatimer");
- return nil;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement