PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Intel on 27 December, 2003, 01:26:12

Title: helpful script needed
Post by: Intel on 27 December, 2003, 01:26:12
I need a script w hich gvies each users when entering a hub a random number as a password, and they have to enter that password to enter the hub..this is to keep away unwanted monkies/donkies & Silly Bots aways...
is that possible ?
i dont want this script with a whole package...need it as a standalone :)
Title:
Post by: pHaTTy on 27 December, 2003, 01:42:06
to use number as such, it will have to be a whole package all in one, otherwise it cant block the command in the other script
Title:
Post by: Intel on 27 December, 2003, 06:11:36
well i guess it should just have a number login check + discon or allow

but as said 10245 times, i dont know anything about scripting...and u guys seems to be the expert..are u able to share that script package with me ? (uk-kingdom)pH?tt? ? :) danku
Title:
Post by: BlazeXxX on 28 December, 2003, 16:52:32
I got a script which generates a number for the users who wants to chat or search in hub and make them type it out..

Its a good way to block automated clients searching/chatting/flooding..

If u want to block unwanted monkies/donkies & Silly Bots , just use Only DC++ allowing script..
Title:
Post by: raz on 28 December, 2003, 18:08:49
This is wat ur probably after. with this u have to type in a 4 digit number 2 access help etc.. :D


BotName = "{C2TM}?"  
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
Title:
Post by: Intel on 01 January, 2004, 15:26:22
this was not the one i asked for but this is as cool as the one i asked for , danku :)