PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: Genius on 04 May, 2005, 02:34:10

Title: Gag script
Post by: Genius on 04 May, 2005, 02:34:10
Hi evryone

i need this script in lua 5 please
sory my bad inglish


-----------------------------

-- GagScript v1.1
-- Description: loOol
-- Made by guibs, 22/08/2003
-- Bugfix and optimizations by bonki 22/08/2003
-- Idea and newbie block change from Homem_do_Leme,, :)

BotName = "***Empregado-=P2P=-***"
UserLevel = {}

tSpecialChars = {
                  ["!help"] = 1,
                  ["!regme"] = 1,
        ["!rules"] = 1,
                };

tLevels = { -- Guibs, what is this? CB related conversions? ;-)
           
Title:
Post by: Dessamator on 04 May, 2005, 10:31:45
--Lua 5 by Dessamator
-- GagScript v1.1
-- Description: loOol
-- Made by guibs, 22/08/2003
-- Bugfix and optimizations by bonki 22/08/2003
-- Idea and newbie block change from Homem_do_Leme,, :)

BotName = "***Empregado-=P2P=-***"
UserLevel = {}

tSpecialChars = {
["!help"] = 1,
["!regme"] = 1,
["!rules"] = 1,
};

tLevels = { -- Guibs, what is this? CB related conversions? ;-)
[0] = 8,
[1] = 5,
[2] = 4,
[3] = 3,
[4] = 2,
[5] = 6,
[6] = 7,
[7] = 9,
};

function ChatArrival(user, data)
local data = string.sub(data,1, -2)
local _, _, cmd = string.find(data, "%b<>%s+(%S+)");
local check =nil
for pos,table in tSpecialChars do
if pos==cmd then
check = true
end
end
if (cmd and not(check) and CheckUserLevel(user) <= 2) then
user:SendPM(BotName, "Este hub est? protegido contra utilizadores mal intencionados, pelo que s? utilizadores registados podem falar, para te registares faz !regme password e espera que um op te registe.")
return 1;
end
return 0
end

ToArrival = ChatArrival

--------- Check User Level ---------

function CheckUserLevel(user)
local userlevel = nil
local allprofiles = GetProfiles()
local index, profile, index2, nick

for index, profile in allprofiles do
local users = GetUsersByProfile(profile)
for index2, nick in users do

if nick == user.sName then
userlevel = index
end
end
end

if (userlevel) then
return tLevels[userlevel];
else
return 1;
end
end



a small bug fix, :)
Title:
Post by: Genius on 04 May, 2005, 14:53:00
Hi again

   The script work fine. Tank You Dessamator :)
Title:
Post by: Dessamator on 04 May, 2005, 15:16:20
yw,:)