PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Finished Scripts => Topic started by: Tw?sT?d-d?v on 27 March, 2008, 23:19:56

Title: Silly Random Nick Tags 1.0A {API 2}
Post by: Tw?sT?d-d?v on 27 March, 2008, 23:19:56

-- Mutors Country Code script Modified
-- Silly Random Nick Tags 1.0A {API 2}
-- Added Profile tables
-- Thx Ceno for local ip fix ( cc2 )
-- Warning for users about silly tags
-- ToDo Add r/c for turning tags on/off

cConfig = {
           Tags = {
                    "I am an idiot",
                    "Euro",
                    "Alien",
                    "Master",
                    "Tester",
                    "Rubber Chicken",
                    "GOD",
                    "Twisted",
                   },
           Profile = {
                      [0] = false,     -- Master
                      [1] = false,    -- Operator
                      [2] = false,    -- VIP
                      [3] = false,    -- RegisteredUser
                     },
           ["Bot"] = SetMan.GetString(21),            ---- Bot name or "Custom name "
           cc2 = "GB"     --Put your country country code here  --  GB,FR,FI ect
}

ChatArrival = function(user,data)
local cc = Core.GetUserValue(user,26)
        if cConfig.Profile[user.iProfile] then
if cc and not data:lower():find("^%b<> ["..SetMan.GetString(29).."](%a+)") then
                tag = cConfig.Tags[math.random(1,#cConfig.Tags)]
local d,c = data:gsub("^%<","[ "..tag.." ] <")
if c then return Core.SendToAll(d),true end
                end
else    if cc and not data:lower():find("^%b<> ["..SetMan.GetString(29).."](%a+)") then
                if cc ~= "??" then cc = cc else cc = cConfig.cc2 end
local d,c = data:gsub("^%<","[ "..cc.." ] <")
if c then return Core.SendToAll(d),true end
                end
end
end

UserConnected = function(user)
        if cConfig.Profile[user.iProfile] then
Core.SendToNick(user.sNick,"<"..cConfig.Bot.."> Silly tags are running Please BEWARE :P.|")
        end
end
OpConnected,RegConnected = UserConnected,UserConnected


Tested a little and has worked without error so far.