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 ^__^
edit your post please and use [code] your lua code [/ code] just dont put the space after the /
Hello bastya_elvtars,
I don't understand, sorry... What I do?
Quote this to se how it works...
--Put Code Here
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 ^^