Author Topic: own commands  (Read 4064 times)

0 Members and 1 Guest are viewing this topic.

Offline ?Tr??T_????

  • Triple Ace
  • **
  • Posts: 213
  • Karma: +0/-1
own commands
« on: 21 July, 2005, 00:32:24 »
hello
how do i do my own commands like:
!about
« Last Edit: 26 February, 2006, 23:53:26 by bastya_elvtars »

PtokaX forum

own commands
« on: 21 July, 2005, 00:32:24 »

Offline ?Tr??T_????

  • Triple Ace
  • **
  • Posts: 213
  • Karma: +0/-1
thanx
« Reply #1 on: 21 July, 2005, 01:04:48 »
I know how to..... :D

Offline Tw?sT?d-d?v

  • Lord
  • ***
  • Posts: 436
  • Karma: +79/-2
    • EURO-OP
(No subject)
« Reply #2 on: 21 July, 2005, 07:15:45 »
ok thx Mutor :D

Offline Stravides

  • Triple Ace
  • **
  • Posts: 171
  • Karma: +0/-0
(No subject)
« Reply #3 on: 18 August, 2005, 23:46:36 »
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...
Code: [Select]
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

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 752
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
(No subject)
« Reply #4 on: 19 August, 2005, 00:24:22 »
s,e,cmd=strfind(data,"%b<>%s+(%S+)")
« Last Edit: 19 August, 2005, 00:25:05 by bastya_elvtars »
Everything could have been anything else and it would have just as much meaning.

Offline Dessamator

  • Scripter
  • Emperor
  • ******
  • Posts: 1 262
  • Karma: +13/-9
(No subject)
« Reply #5 on: 19 August, 2005, 09:33:24 »
Well, that seems like zrightclicker in lua4, that said, just have a look at it, maybe it can help you .
Ignorance is Bliss.

PtokaX forum

(No subject)
« Reply #5 on: 19 August, 2005, 09:33:24 »