PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: TTB on 31 July, 2005, 23:56:27

Title: Userlevel profile (simple)
Post by: TTB on 31 July, 2005, 23:56:27
Hi,

was writing it for my own, and posted it for others... For the beginners ;-)


-- GetProfile (simple function) by TTB
-- 31-07-05
--------------------------------------

-- ## Settings ## --

-->> For the (prefix)isreg , a table for the reeel userlevels so users can understand :P
reeellevel = {
[0] = 6, -- Master
[1] = 4, -- Operator
[2] = 3, -- VIP
[3] = 2, -- Registered User
[4] = 5, -- Moderator
[5] = 7, -- NetFounder
}

bot = "RegInfo"
command = "#isreg"

-- ## Script // NO settings ## --

function ChatArrival(curUser,data)
data = string.sub(data,1,string.len(data)-1)
s,e,cmd = string.find(data,"%b<>%s+(%S+)")
if (string.lower(cmd) == (command)) then
IsReg(curUser,data)
return 1
end
end


function IsReg(curUser, data)
s,e,cmd,nick = string.find(data,"%b<>%s+(%S+)%s+(.+)")
if nick == nil then
curUser:SendData(bot, "*** Syntax error! Please use: "..command.." to get the profile of an user.")
else
if GetUserProfile(nick) ~= nil then
local level = GetUserProfile(nick)
curUser:SendData(bot, "User: "..nick.." is registered with userlevel: "..reeellevel[level])
else
curUser:SendData(bot, "User: "..nick.." is NOT registered")
end
end
return 1
end