PtokaX forum

PtokaX => Support => Topic started by: Themaster on 22 September, 2004, 19:59:56

Title: i need help with the script
Post by: Themaster on 22 September, 2004, 19:59:56
i got this error on the hub

No syntax errors in script file Blade?.lua
Syntax error: table index is nil
stack traceback:
   1:  function `DataArrival' at line 70 [file `...Blade?.lua']


and my data is


function DataArrival(user,data)
      local data = strsub(data,1,strlen(data)-1)
      local s,e,prefix = strfind(data, "%b<>%s*(%S)")
      if Tprefix[prefix] then
         local s,e,cmd=strfind(data, "%b<>%s*%S(%S+)")
         if cmd == "myip" then
            user:SendData(BotName, "Your IP is *** "..user.sIP)
            return 0
         else
            user:SendData("wrong use read help menu you fool!")
            return 1
         end
      end


plz help me with that.

Title:
Post by: Herodes on 22 September, 2004, 20:30:25
it says that the index of the table is nil...
In other words the index of the table you tried to access does not exist ....
maybe it is because you havent really grabbed the "prefix" ...
try this ...
local s,e,prefix = strfind(data, "%b<>%s*(%S)") user:SendData("the prefix should be "..prefix)if this doesnt say anything in the main there should be an error waiting for u in your PtokaX...

if the error attempt to concat a nil value ( prefix ) appears then try using this .. local s,e,prefix = strfind(data, "%b<>%s+(%S)") hope it works ;)
Title:
Post by: Themaster on 22 September, 2004, 21:24:48
yes it work now