PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: slick on 08 August, 2005, 14:50:53

Title: error ?
Post by: slick on 08 August, 2005, 14:50:53
I got this error after i put this script in my hub could somebody please fix it please



Syntax Error: `}' expected (to close `{' at line 12);
  last token read: `[' at line 26 in file `C:\Program Files\PtokaX-0.326.TestDrive4\scripts\illegalist.lua'




here is the entire script:




-- Simple Illegalist v0.1
-- Created by Ptaczek, Jan-3, 2003
-- Searches for specified patterns. Useful for illegal share checking
-- some changes by Skippy and RabidWombat and OpiumVolage and trucker

BotName = "Illegalist"

function Main()
frmHub:EnableSearchData(1)
end

Files = {
["rape"]="Do not share sick porn!",
["incest"]="NO incest movies-pictures here!",
["childsex"]="NO sick Porn inhere!",
["childporn"]="NO sick orn inhere!",
["underage"]="NO sick Porn inhere!",
["nazi"]="NO nazi related material here!",
["animalsex"]="NO Animalsex files here!",
["svastika"]="NO Nazi/white power music HERE!!!",
[".temp.mp3"]="NO sharing of incomplete downloads",
["_INCOMPLETE_"]="NO sharing of incomplete downloads",
["download123456789.dat"]="NO sharing of incomplete downloads",
["part.met"]="NO sharing of incomplete downloads",
[".getright"]="NO sharing of incomplete downloads"
[".vob"]="NO sharing of incomplete downloads"
}

Kicked = {}

function NewUserConnected(user)
if( Kicked[user.sName] == 1 ) then
Kicked[user.sName] = nil
end
for i,v in Files do
user:SendData("$Search Hub:"..BotName.." F?F?0?1?"..i)
end
end

function DataArrival(user, data)
if( strsub(data, 1, 3) == "$SR" ) then
_,_,nick = strfind( data, "\05(%S*)|$" )
if( nick == BotName and Kicked[user.sName] == nil ) then
Kicked[user.sName] = 1
Reason = FindWhat(data)
SendPmToNick("[NL[DSNHO]trucker", BotName, "*** User "..user.sName.." kicked. Reason: "..Reason)
user:SendPM(BotName, "You were kicked. "..Reason)
user:Disconnect()
end
end
end

function FindWhat(data)
for i,v in Files do
if( strfind(strlower(data), i) ) then
return v
end
end
return "Other files"
end
Title: not tested
Post by: ?Tr??T_???? on 08 August, 2005, 15:10:54
-- Simple Illegalist v0.1
-- Created by Ptaczek, Jan-3, 2003
-- Searches for specified patterns. Useful for illegal share checking
-- some changes by Skippy and RabidWombat and OpiumVolage and trucker

BotName = "Illegalist"

function Main()
frmHub:EnableSearchData(1)
end

Files = {
["rape"]="Do not share sick porn!",
["incest"]="NO incest movies-pictures here!",
["childsex"]="NO sick Porn inhere!",
["childporn"]="NO sick orn inhere!",
["underage"]="NO sick Porn inhere!",
["nazi"]="NO nazi related material here!",
["animalsex"]="NO Animalsex files here!",
["svastika"]="NO Nazi/white power music HERE!!!",
[".temp.mp3"]="NO sharing of incomplete downloads",
["_INCOMPLETE_"]="NO sharing of incomplete downloads",
["download123456789.dat"]="NO sharing of incomplete downloads",
["part.met"]="NO sharing of incomplete downloads",
[".getright"]="NO sharing of incomplete downloads",
[".vob"]="NO sharing of incomplete downloads",
}

Kicked = {}

function NewUserConnected(user)
if( Kicked[user.sName] == 1 ) then
Kicked[user.sName] = nil
end
for i,v in Files do
user:SendData("$Search Hub:"..BotName.." F?F?0?1?"..i)
end
end

function DataArrival(user, data)
if( strsub(data, 1, 3) == "$SR" ) then
_,_,nick = strfind( data, "\05(%S*)|$" )
if( nick == BotName and Kicked[user.sName] == nil ) then
Kicked[user.sName] = 1
Reason = FindWhat(data)
SendPmToNick("[NL[DSNHO]trucker", BotName, "*** User "..user.sName.." kicked. Reason: "..Reason)
user:SendPM(BotName, "You were kicked. "..Reason)
user:Disconnect()
end
end
end

function FindWhat(data)
for i,v in Files do
if( strfind(strlower(data), i) ) then
return v
end
end
return "Other files"
end
Title:
Post by: slick on 08 August, 2005, 15:14:27
t/y ;)
Title: hehe
Post by: ?Tr??T_???? on 08 August, 2005, 15:18:16
i dont know nothing about lua but i just saw that :

this:
_____________
["incest"]="NO incest movies-pictures here!",      
____________



was differente then this:
______________________
[".getright"]="NO sharing of incomplete downloads"
[".vob"]="NO sharing of incomplete downloads"
____________________


try to c the difference....
Title:
Post by: slick on 09 August, 2005, 15:55:40
ahhh   ,     was missing i shold,ve sen that myself 8o
Title:
Post by: slick on 09 August, 2005, 15:57:26
i know nothing about scripting could somebody add to this script to send a pm to a specific op
Title:
Post by: slick on 09 August, 2005, 16:17:34
actually a pm to all ops with the user name ,ip and what they was looking for would be nice if this script already exists what is it called