SHOW:
|
|
- or go back to the newest paste.
1 | - | --[[ |
1 | + | local function testprt(tbl) |
2 | ||
3 | - | Available standard functions: |
3 | + | for k,v in pairs(tbl)do |
4 | print(tostring(k)..": " ..tostring(v)); | |
5 | - | _VERSION |
5 | + | |
6 | - | assert |
6 | + | |
7 | - | error |
7 | + | |
8 | - | ipairs |
8 | + | local function Merge(tbl,tbl2) |
9 | - | next |
9 | + | testprt(tbl2); |
10 | - | pairs |
10 | + | |
11 | - | pcall |
11 | + | |
12 | - | select |
12 | + | local function RawLadderRequest(leaguename,entries) |
13 | - | tonumber |
13 | + | |
14 | - | tostring |
14 | + | local cnt = 0; |
15 | - | type |
15 | + | local request = entries; |
16 | - | unpack |
16 | + | local ladder = false; |
17 | - | xpcall |
17 | + | local current = false; |
18 | - | coroutine.create |
18 | + | local actual = entries; |
19 | - | coroutine.resume |
19 | + | |
20 | - | coroutine.running |
20 | + | while(entries>=cnt)do |
21 | - | coroutine.status |
21 | + | |
22 | - | coroutine.wrap |
22 | + | if actual> 200 then |
23 | - | coroutine.yield |
23 | + | actual= 200; |
24 | - | math.abs |
24 | + | |
25 | - | math.acos |
25 | + | |
26 | - | math.asin |
26 | + | local req = "http://api.pathofexile.com/ladders/"..leaguename:gsub("/","%%2F").."?offset="..tostring(cnt).."&limit="..tostring(actual); |
27 | - | math.atan |
27 | + | |
28 | - | math.atan2 |
28 | + | print(req); |
29 | - | math.ceil |
29 | + | |
30 | - | math.cos |
30 | + | cnt = cnt + actual; |
31 | - | math.cosh |
31 | + | request = request - actual; |
32 | - | math.deg |
32 | + | actual = request; |
33 | - | math.exp |
33 | + | |
34 | - | math.fmod |
34 | + | current = JSONDecode(MOD.HTTPGet(req)); |
35 | - | math.floor |
35 | + | |
36 | - | math.frexp |
36 | + | if not current then |
37 | - | math.huge |
37 | + | return nil; |
38 | - | math.ldexp |
38 | + | |
39 | - | math.log |
39 | + | |
40 | - | math.log10 |
40 | + | if(not ladder)then |
41 | - | math.max |
41 | + | ladder = current; |
42 | - | math.min |
42 | + | testprt(ladder.entries); |
43 | - | math.modf |
43 | + | |
44 | - | math.pi |
44 | + | Merge(ladder,current); |
45 | - | math.pow |
45 | + | |
46 | - | math.rad |
46 | + | |
47 | - | math.random |
47 | + | if(entries>=ladder.total)then |
48 | - | math.sin |
48 | + | return ladder; |
49 | - | math.sinh |
49 | + | end |
50 | - | math.sqrt |
50 | + | |
51 | - | math.tan |
51 | + | return ladder; |
52 | - | math.tanh |
52 | + | |
53 | - | os.clock |
53 | + | |
54 | - | os.difftime |
54 | + | return RawLadderRequest("One Week HC Rampage/Beyond",300); |