Syntax Error
 

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

Syntax Error

Started by 6Marilyn6Manson6, 24 November, 2004, 07:19:32

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

6Marilyn6Manson6

Hello, I have in my hub bot NXS 3.9a and when iDC++ or DCDM++ make a kick in auto, I have three sintax error:

first in this functions:

function DataArrival(curUser, data)
   SMPM(curUser)
   if RemovePassiveUsers==1 then
   if strsub(data, 1, 12) == "$Search Hub:" then OnSearch(curUser) end
   end
   if (SPC==1) then
      if strfind(data,"$To:") and not curUser.bOperator then
         if PMCount[curUser.sIP] ~= nil then
            PMCount[curUser.sIP] = PMCount[curUser.sIP] +1
            if PMCount[curUser.sIP] > MaxPM then
               FloodDetected (curUser, data)
               PMCount[curUser.sIP] = -100
               Counter["Spammed"] = Counter["Spammed"]+1
            end
         else
            PMCount[curUser.sIP] = 1
         end
      elseif strfind(data,curUser.sName,1,plain) == 2 and not curUser.bOperator then
         if MainCount[curUser.sIP] ~= nil then
            MainCount[curUser.sIP] = MainCount[curUser.sIP] +1
            if MainCount[curUser.sIP] > MaxMain then
               FloodDetected (curUser, data)
               MainCount[curUser.sIP] = -100
               Counter["Spammed"] = Counter["Spammed"]+1
            end
         else
            MainCount[curUser.sIP] = 1
         end
      end
   end
   if (strsub(data,1,7) == "$MyINFO") then
      local vClient, vTag, vSpeed, vShare = ParseMyInfo(data)
      AllowClients(curUser,vClient,vTag)
      CheckShare(curUser,vShare)
      if SpeedCheck(vSpeed) ~= 0 and not curUser.bOperator then
         curUser:SD(BotName,SpeedLine)
         curUser:Disconnect()
      end
   elseif( strsub(data, 1, 3) == "$SR" ) then
      if ABFS==1 then
         _,_,nick = strfind( data, "\05(%S*)|$" )
         if( nick == BotName) then
            Reason = FindWhat(data)
            if( Reason ~= "Other files") then
               SendToOps(BotName, "*** User "..curUser.sName.." kicked. Reason: "..Reason)
               curUser:SD(BotName, "You were kicked. "..Reason)
               SaveKickBanInfo(BotName,curUser.sName,Reason,KickTable,KickFile,"KickTable")
               curUser:TempBan()
            end
         end
      end
   elseif ( strsub(data, 1, 1) == "<" ) then
      local _, _, from, message = strfind(data, "<(%S+)>%s+(.*)%|")
      if message then
         if strlen(message) > MaxLen and not curUser.bOperator then
            curUser:SD(BotName, MXLine)
            return 1
         end
      end
      if TBC==1 then
         for key, value in TRIGGERBOT do
            if( strfind( strlower(message), key) ) and not strfind(strlower(message),Prefix1.."%a+") then
               answer, x = gsub(value, "%b[]", curUser.sName)
               SendToAll( data )
               SendToAll( BotName, answer )
               return 1
            end
         end
      end
      if AdverCheck(curUser,data)==1 then
         return 1
      end
      data = strsub(data,1,strlen(data)-1)
      if (GetCom(curUser,data) == 1) then
         return 1
      else
         return 0
      end
   elseif strsub(data, 1, 5) == "$To: " then
      ToKickMsg(curUser, data)
      local s,e,to,from,text = strfind(data,    "%$To:%s(%S+)%sFrom:%s(%S+)%s$(.*)$")
      --// Away Engine
         if (awayArray[to] == nil) then
         else
            curUser:SendPM(to,AWM1.." "..awayArray[to])
         end
         if (awayArray[from] == nil) then
         else
            awayArray[from] = nil
            saveTableToFile(AwayFile,awayArray)
            SendPmToNick(from,BotName,AWM2)
         end
         --// Away Ends..
      if to == BotName then
            data = text
            data = strsub(data,1,strlen(data)-1)
         if (GetCom(curUser,data) == 1) then
            return 0
         else
            return 0
         end
      elseif to == VipChatName then
         if curUser.iProfile == 0 or curUser.iProfile == 4 or curUser.iProfile == 1 or curUser.iProfile == 2 then
            s,e,whoTo,from,msg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.+)")
            VipChatRoom(curUser,msg)
         else      
            curUser:SendPM(VipChatName,VIPLINE)
         end
      else
         data = text
         to = GetItemByName(to)
         if AdverCheck(curUser,data)==1 then
            return 1
         end
      end
   elseif strsub(data,1,6) == "$Kick " then
      ExecuteKick(curUser, data)
      return 1
   elseif (strsub(data, 1, 15) == "$RevConnectToMe" and curUser.iProfile == -1) then
      if OnlyRegFromOps==1 then
         local _,_,towho = strfind(data, "$RevConnectToMe%s+%S+%s+(%S+)|")
         if GetItemByName(towho) and GetItemByName(towho).bOperator then
            curUser:SD(BotName,DLL1)
            curUser:SD(BotName,DLL2)
            return 1
         end
      end
   elseif (strsub(data, 1, 12) == "$ConnectToMe" and curUser.iProfile == -1) then
      if OnlyRegFromOps==1 then
         local _,_,towho = strfind(data, "$ConnectToMe%s+(%S+)%s+.*|")
         if GetItemByName(towho) and GetItemByName(towho).bOperator then
            curUser:SD(BotName,DLL1)
            curUser:SD(BotName,DLL2)
            return 1
         end
      end
   elseif (strsub(data, 1, 1) == "$" and curUser.iProfile==-1 and strfind(data, "ConnectToMe")) then
      if OnlyRegFromOps==1 then
         curUser:SD(BotName,DLL1)
         curUser:SD(BotName,DLL2)
         return 1
      end
   elseif strsub(data, 1, 13) == "$ValidateNick" then
      nick = strsub(data, 15, -2);
      if strfind(strlower(nick), "search", 1) then
         Counter["BadClient"] = Counter["BadClient"]+1
         curUser:Disconnect()
      end return 1
   elseif strsub(data, 1, 7) == "$UserIP" then
      local s, e, nick = strfind(data, "^%$UserIP (%S+)%|$" )
      if nick == user.sName then
         curUser:SendData( "$UserIP "..nick.." "..user.sIP)
      elseif curUser.bOperator then
         local tmp = GetItemByName(nick)
         if tmp then curUser:SendData( "$UserIP "..nick.." "..tmp.sIP) end
      end return 1
   end
end


in line:
ToKickMsg(curUser, data)


second error in this function:

function ToKickMsg(curUser, data)
   if strfind(data,"You are being kicked because:") then
      local _,_, Name,Op,Reason = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$<%S+> You are being kicked because:%s+(.*)|")
      OpCheck = GetItemByName(Op)
      if OpCheck~=nil and OpCheck.bOperator then
         vUser = GetItemByName(Name)
         if KicksRegVipOp(vUser)==0 then
            return 1
         end
         if vUser~=nil then
            SaveKickBanInfo(curUser.sName,vUser.sName,Reason,KickTable,KickFile, "KickTable")
         end
      end
   end
end


in line:
if KicksRegVipOp(vUser)==0 then


thirth in this function:

function KicksRegVipOp(vUser)
   local Status = ""
   if vUser.bOperator then
      if KickOP==1 then
         return 1
      else
         Status = "Operator"
         return 0, Status
      end
   elseif vUser.iProfile==2 then
      if KickVIP==1 then
         return 1
      else
         Status = "VIP User"
         return 0, Status
      end
   elseif vUser.iProfile==3 then
      if KickREG==1 then
         return 1
      else
         Status = "REG User"
         return 0, Status
      end
   end
end

at line:
if vUser.bOperator then


What I can resolve this problem? Thanks a lot ^__^


bastya_elvtars

edit your post please and use [code] your lua code [/ code] just dont put the space after the /
Everything could have been anything else and it would have just as much meaning.

6Marilyn6Manson6

Hello bastya_elvtars,
I don't understand, sorry... What I do?

Madman

Quote this to se how it works...

--Put Code Here
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

6Marilyn6Manson6

#4
Hi, here you see my main lua:

http://www.upload4free.com/upload/nxs3.lua

When iDC++ or DCDM++ made auto-kick... I have this error:

   1:  function `ToKickMsg' at line 1036 [file `... HUB =-\planetarium.no-ip.org\scripts\NXS-3.lua']
   2:  function `DataArrival' at line 552 [file `... HUB =-\planetarium.no-ip.org\scripts\NXS-3.lua']

How I resolve? Very thanks at all ^^

SMF spam blocked by CleanTalk