hello
how do i do my own commands like:
!about
I know how to..... :D
ok thx Mutor :D
Ok, using ptokax 0.3.3.0 as I need to allow RMDC++ clients --- :)
I would like to be able to change my scripts to follow the following methodology...
function CheckBanIP(user,data)
end
function FilterCommand(user,data)
end
tblCommands = {
["!ban"] = function(user,data) CheckBanIP(user,data) end,
["!banip"] = function(user,data) CheckBanIP(user,data) end,
["!addreguser"] = function(user,data) FilterCommand(user,data) end,
["!delreguser"] = function(user,data) FilterCommand(user,data) end
}
function DataArrival(user, data)
local s, e, sCommand = strfind(data, "^(%S+)";
if sCommand and tblCommands[sCommand] then
local returndata = tblCommands[sCommand](user,data);
end
end
problem being is that the script does not run (even if I change toe strfind to a string.find
also want to be able to specify tblCommands[sCommand] (optional variables here)
how do I do that ???
many thanks
s,e,cmd=strfind(data,"%b<>%s+(%S+)")
Well, that seems like zrightclicker in lua4, that said, just have a look at it, maybe it can help you .