PtokaX forum

Archive => Archived 5.0 boards => Help with scripts => Topic started by: B@B? on 13 June, 2005, 10:51:44

Title: Lucifer-Error
Post by: B@B? on 13 June, 2005, 10:51:44
Hello again... ;)

I have a prob with "Lucifer"...

This appears:

Lucifer.lua:133: attempt to index local `nick' (a nil value)

Must i post the whole script for that or can someone tell
me, what?s the matter with it?

ToArrival = function(user, data)
local data = string.sub(data,1,-2)
if not user.bOperator then
local _, _, to, from, msg = string.find(data, "^%$To:%s+(%S+)%s+From:%s+(%S+)%s-%$%b<>%s+(.*)")
local nick = GetItemByName(to)
if to ~= BotName then
if not nick.bOperator then
local userdata = to.." "..from [COLOR=red]-- THIS IS LINE 133...[/COLOR]
if adCheck(msg) ~= nil and Verify(user.sName, msg) then
tabAdvert[userdata] = nil
local action = DoDisc(user,msg,line)
s,e,whoTo,from,mes = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")  
SendPmToOps (BotName, "User "..user.sName.." mit IP "..user.sIP.." >>> "..action.." wegen Werbung an "..whoTo.." >>> : "..mes.."")
return 1
end
for key, value in controltrigs do
if( string.find( string.lower(data), key) ) then
s,e,whoTo,from,mes = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")  
SendPmToOps (BotName, "Control: User "..user.sName.." mit IP "..user.sIP.." schrieb an "..whoTo.." >>> : "..mes.."")
end
end

Tha Hanks  :P
Title:
Post by: jiten on 13 June, 2005, 11:13:32
Hi there. I've already fixed it.
Change your ToArrival function to this or copy the whole script from the Lucifer 6.6.6 thread:
ToArrival = function(user, data)
local data = string.sub(data,1,-2)
if not user.bOperator then
local _, _, to, from, msg = string.find(data, "^%$To:%s+(%S+)%s+From:%s+(%S+)%s-%$%b<>%s+(.*)")
if GetItemByName(to) then
local nick = GetItemByName(to)
if not nick.bOperator then
local userdata = to.." "..from
if adCheck(msg) ~= nil and Verify(user.sName, msg) then
tabAdvert[userdata] = nil
local action = DoDisc(user,msg,line)
s,e,whoTo,from,mes = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")  
SendPmToOps (BotName, "User "..user.sName.." with IP "..user.sIP.." is "..action.." for advertising to "..whoTo.." this: "..mes.."")
return 1
end
for key, value in controltrigs do
if( string.find( string.lower(data), key) ) then
s,e,whoTo,from,mes = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")  
SendPmToOps (BotName, "Control: User "..user.sName.." with IP "..user.sIP.." said to "..whoTo.." this: "..mes.."")
end
end
spam=0
if( string.find( string.lower(data), "no",1,1) ) and ( string.find( string.lower(data), "ip.",1,1) ) then
if ( string.find( string.lower(data), "com",1,1) ) or ( string.find( string.lower(data), "org",1,1) ) or ( string.find( string.lower(data), "info",1,1) ) then
spam=spam+1;
end;
end;
if( string.find( string.lower(data), "dns",1,1) ) and ( string.find( string.lower(data), "2",1,1) ) and ( string.find( string.lower(data), "go",1,1) ) then
spam=spam+1;
end
if( string.find( string.lower(data), "dy",1,1) ) and ( string.find( string.lower(data), "nu",1,1) ) then
if( string.find( string.lower(data), ".net",1,1) ) or ( string.find( string.lower(data), ".com",1,1) ) then
spam=spam+1;
end;
end
if( string.find( string.lower(data), "d n s a",1,1) ) or ( string.find( string.lower(data), "d n s .",1,1) ) or ( string.find( string.lower(data), "d n s 2",1,1) ) or ( string.find( string.lower(data), "o d s .",1,1) ) or ( string.find( string.lower(data), "d y n",1,1) ) then
spam=spam+1;
end
end
end
end
end
Cheers
Title:
Post by: B@B? on 13 June, 2005, 11:23:48
Uiiiiiiiii!

I?ll copy this!  :D

Thank YOU! @ jiten 4 speed... :P

NOW integrated...seems fine workin...

If not, i tell it 2 U.  ;)
Title:
Post by: jiten on 13 June, 2005, 11:31:34
QuoteOriginally posted by B@B?
Uiiiiiiiii!

I?ll copy this!  :D

Thank YOU! @ jiten 4 speed... :P

NOW integrated...seems fine workin...

If not, i tell it 2 U.  ;)
No problem :]
Title:
Post by: B@B? on 13 June, 2005, 11:33:19
...and so i?m waitin 4 someone 2 KICK! *ggg*  :D

Uuuuuuuuuhhhh, i?m a lazybone...chrchr  :P