PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Savage-XP on 30 November, 2003, 00:54:15

Title: X-Mas request
Post by: Savage-XP on 30 November, 2003, 00:54:15
Please can someone gimme a Search Spam script to put in my hub? I cant find no one... please...
Title:
Post by: kepp on 30 November, 2003, 01:06:50
for main, or for search function?
Title:
Post by: Savage-XP on 30 November, 2003, 03:57:24
er....  both
Title:
Post by: pHaTTy on 30 November, 2003, 10:34:54
hmmm got this one if it helps i think it shud do the job



-- Spam King (spam blocker) (for PtokaX 0.3.2.6TD3)
-- by: gg3k
-- file: SpamKing.lua

-- This script stops spammers using automessaging software.
-- It blocks all traffic that is passed through DataArrival until the user has sent the validation code.
-- This effectively prevents searchbots from getting any results from the hub too.

BotName = "Hub-Security" -- Name of the bot.
TestReggedUsers = 0 -- Set to 1 if you want to require validation from registered users.
TestOperators = 0 -- Set to 1 if you want to require validation from operators.
NoChatUsers = { }

--// This function is fired at the serving start
function Main()
end

--// This function is fired when a new data arrives
function DataArrival(curUser, sData)
sData = strsub(sData, 1, strlen(sData)-1)
if curUser.iProfile == -1 or TestReggedUsers == 1 then
if NoChatUsers[curUser.sName] ~= nil then
if NoChatUsers[curUser.sName] == 1 then
NoChatUsers[curUser.sName] = random(1000, 9999)
SendToNick(curUser.sName, "<"..BotName.."> Spam protect: To enable full hub functionality, reply with the following key: "..NoChatUsers[curUser.sName] )
return 1
else
_,_,keystring = strfind(sData, "%b<>%s+(%S+)")
if tostring(keystring) == tostring(NoChatUsers[curUser.sName]) then
NoChatUsers[curUser.sName] = nil
SendToNick(curUser.sName, "<"..BotName.."> Spam protect: Hub Unlocked")
else
SendToNick(curUser.sName, "<"..BotName.."> Spam protect: To enable full hub functionality, reply with the following key: "..NoChatUsers[curUser.sName] )
end
return 1
end
end
end
end


--// This function is fired when a new user finishes the login
function NewUserConnected(curUser)
NoChatUsers[curUser.sName] = 1
end


--// This function is fired when an operator enters the hub
function OpConnected(curUser)
if TestOperators == 1 then
NoChatUsers[curUser.sName] = 1
end
end

--// This function is fired when an user disconnects
function UserDisconnected(curUser)
NoChatUsers[curUser.sName] = nil
end

--// This function is fired when an operator disconnects
function OpDisconnected(curUser)
NoChatUsers[curUser.sName] = nil
end




nice one by gg3k