plugins/xkcd2.lua

changeset 123
ce671935f504
parent 122
f3a458479f9c
child 124
4530954f545a
equal deleted inserted replaced
122:f3a458479f9c 123:ce671935f504
19 if q then 19 if q then
20 local t, num = q:match("^([#\"]?)(%-?%d+)\"?$"); 20 local t, num = q:match("^([#\"]?)(%-?%d+)\"?$");
21 if t ~= '"' then 21 if t ~= '"' then
22 num = tonumber(num); 22 num = tonumber(num);
23 if num and num < 0 then 23 if num and num < 0 then
24 num = #strip + num; 24 num = table.maxn(strips) + num;
25 end 25 end
26 end 26 end
27 strip = strips[num or q:lower()]; 27 strip = strips[num or q:lower()];
28 if strip == "" or strip == 404 then 28 if strip == "" or strip == 404 then
29 strip = nil 29 strip = nil

mercurial