own commands


29 December 2022 - PtokaX (20th anniversary edition) released...
11 April 2017 - PtokaX released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX for Windows 10 IoT released...
3 September 2015 - PtokaX released...
16 August 2015 - PtokaX released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX released...
13 April 2014 - PtokaX released...
23 March 2014 - PtokaX testing version 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.


how do i do my own commands like:


I know how to..... :D



Ok, using ptokax 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)


function FilterCommand(user,data)


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);

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


Everything could have been anything else and it would have just as much meaning.


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