Last edit: @jkrause in #[IM @jkrause] 2 years ago - Slack Archive

{lua} local result = "" local endidx = 999
-- Again, don't touch this following line, please.
-- Or else I will find you
-- and I will kill you
-- -Liam Neeson
if channel.type == "public" then return "" end
-- find the --, construct initial args
for i=1,#argv do if endidx < i then result = result .. ' ' .. argv[i] elseif argv[i] == "--" then endidx = i - 1 end end
if endidx > #argv then endidx = #argv end
-- run the factoids
for i = 1, endidx do if not factoid[argv[i]].exists then return ("[ERROR: No such factoid '" .. argv[i] .. "']") end result = factoid[argv[i]](result) end return result

History

Revision: 2313 by @jkrause in #[IM @jkrause] 2 years agoSlack Archive

{lua} local result = "" local endidx = 999
-- Again, don't touch this following line, please.
-- Or else I will find you
-- and I will kill you
-- -Liam Neeson
if channel.type == "public" then return "" end
-- find the --, construct initial args
for i=1,#argv do if endidx < i then result = result .. ' ' .. argv[i] elseif argv[i] == "--" then endidx = i - 1 end end
if endidx > #argv then endidx = #argv end
-- run the factoids
for i = 1, endidx do if not factoid[argv[i]].exists then return ("[ERROR: No such factoid '" .. argv[i] .. "']") end result = factoid[argv[i]](result) end return result

Revision: 620 by @kyork in #random 2 years agoSlack Archive

{lua} local result = "" local endidx = 999
-- find the --, construct initial args
for i=1,#argv do if endidx < i then result = result .. ' ' .. argv[i] elseif argv[i] == "--" then endidx = i - 1 end end
if endidx > #argv then endidx = #argv end
-- run the factoids
for i = 1, endidx do if not factoid[argv[i]].exists then return ("[ERROR: No such factoid '" .. argv[i] .. "']") end result = factoid[argv[i]](result) end return result

Revision: 619 by @kyork in #random 2 years agoSlack Archive

{lua} local result = "" local endidx = 999
-- find the --, construct initial args
for i=1,#argv do if endidx < i then result = result .. ' ' .. argv[i] elseif argv[i] == "--" then endidx = i - 1 end end
if endidx > #argv then endidx = #argv end
-- run the factoids
for i = 1, endidx do if not factoid[argv[i]].exists then error("No such factoid '" .. argv[i] .. "'") end result = factoid[argv[i]](result) end return result

Revision: 618 by @kyork in #random 2 years agoSlack Archive

{lua} local result = "" local endidx = 999
-- find the --, construct initial args
for i=1,#argv do if endidx < i then result = result .. ' ' .. argv[i] elseif argv[i] == "--" then endidx = i - 1 end end
if endidx > #argv then endidx = #argv end
-- run the factoids
for i = 1, endidx do result = factoid[argv[i]](result) end return result

Revision: 617 by @kyork in #random 2 years agoSlack Archive

{lua} local result = "" for i = 1, #argv do result = factoid[argv[i]](result) end return result