own commands
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

own commands

Started by ?Tr??T_????, 21 July, 2005, 00:32:24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

?Tr??T_????

hello
how do i do my own commands like:
!about

?Tr??T_????

I know how to..... :D

Tw?sT?d-d?v


Stravides

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
Stravides
For RPG Books, Mp3 & Videos
We host trivia  and the ever failing Smeagolbot

bastya_elvtars

#4
s,e,cmd=strfind(data,"%b<>%s+(%S+)")
Everything could have been anything else and it would have just as much meaning.

Dessamator

Well, that seems like zrightclicker in lua4, that said, just have a look at it, maybe it can help you .
Ignorance is Bliss.

SMF spam blocked by CleanTalk