mcbot/cmds/wtf.lua
changeset 16 064a50911e05
parent 0 89add07d6fe4
child 66 d9c00a9fe9d5
equal deleted inserted replaced
15:203b49c24dde 16:064a50911e05
     1 
     1 
     2 local wtfdbfile = "/home/mikael/.mcabber/lua/mcbot/wtfdb.txt"
     2 local wtfdbfile = "/home/mikael/.mcabber/lua/mcbot/wtfdb.txt"
     3 
     3 
     4 local function wtf (args)
     4 local wtf = { ["desc"] = "Acronym dictionary" }
       
     5 
       
     6 function wtf.cmd (args)
     5     local r = {}
     7     local r = {}
     6     if not args then return nil, "WTH do you want?" end
     8     if not args then return nil, "WTH do you want?" end
     7     args = args:gsub("[%s%?%.%!]+$", ""):upper()
     9     args = args:gsub("[%s%?%.%!]+$", ""):upper()
     8     for line in io.lines(wtfdbfile) do
    10     for line in io.lines(wtfdbfile) do
     9         if line:starts(args.."\t") then
    11         if line:starts(args.."\t") then