IRC admin

Started by MEGAMIND, Jun 29, 2018, 03:22 PM

Previous topic - Next topic

MEGAMIND

its been a long time or probably few years i havent touched irc so can i get some hints again that how would i make my self admin in irc

like if i say .hi so the text would display as [admin] username : sup ppl

kennedyarz

#1
Try something like this

function LevelTag(lvl)
{
    lvl = (lvl ? lvl:0);
    switch (lvl)
{
        case 2: return "IRC-User";
        case 3: return "IRC-MODERATOR";
case 4: return "IRC-ADMIN";
        case 5: return "IRC-MANAGER";
        case 6: return "IRC-DEVELOPER";
        default: return "IRC.User";
    }
}
 
function lLevelTag(lvl)
{
    lvl = (lvl ? lvl:0);
    switch (lvl)
{
        case 2: return "11";
        case 3: return "7";
        case 4: return "3";
        case 5: return "4";
        case 6: return "12";
        default: return "5";
    }
}

if (cmd)
{
    if (cmd.slice(0,1)  == "." && cmd.len() > 1)           
    {
        local msg = "" + user + ": " + cmd.slice(1);
        if (text) msg = msg + " " + text;
        EchoMessage(lLevelTag(level)+"["+LevelTag(level)+"]"+msg+"");
Message("[#0000CC]["+LevelTag(level)+"][#ffffff]"+msg);
print(LevelTag(level)+""+msg)
    }
}

MEGAMIND

Quote from: kennedyarz on Jun 29, 2018, 03:41 PMTry something like this

function LevelTag(lvl)
{
    lvl = (lvl ? lvl:0);
    switch (lvl)
{
        case 2: return "IRC-User";
        case 3: return "IRC-MODERATOR";
case 4: return "IRC-ADMIN";
        case 5: return "IRC-MANAGER";
        case 6: return "IRC-DEVELOPER";
        default: return "IRC.User";
    }
}
 
function lLevelTag(lvl)
{
    lvl = (lvl ? lvl:0);
    switch (lvl)
{
        case 2: return "11";
        case 3: return "7";
        case 4: return "3";
        case 5: return "4";
        case 6: return "12";
        default: return "5";
    }
}

if (cmd)
{
    if (cmd.slice(0,1)  == "." && cmd.len() > 1)           
    {
        local msg = "" + user + ": " + cmd.slice(1);
        if (text) msg = msg + " " + text;
        EchoMessage(lLevelTag(level)+"["+LevelTag(level)+"]"+msg+"");
Message("[#0000CC]["+LevelTag(level)+"][#ffffff]"+msg);
print(LevelTag(level)+""+msg)
    }
}
i have something like this function LevelTag1(lvl) {
lvl = (lvl ? lvl:0);
switch (lvl) {
case 2:
return "IRC Moderator>";
case 3:
return "IRC Admin>";
case 4:
return "IRC Manager>";
case 5:
return "IRC Helper>";
case 6:
return "IRC Owner>";
default:
return "IRC User>";
}
}
function lLevelTag(lvl) {
lvl = (lvl ? lvl:0);
switch (lvl) {
case 2:
return "11";
case 3:
return "7";
case 4:
return "3";
case 5:
return "4";
case 6:
return "12";
default:
return "5";
}
}
function FBSIrcCommand( user, cmd, text )
{
local NickInfo = FindNick( user ), level, tLevel, p;
if ( NickInfo ) level = NickInfo.Level.tointeger();
if (cmd)
{
if (cmd.slice(0,1)  == "." && cmd.len() > 1)
{
local msg = "" + LevelTag1(level) + " " + user + ": " + cmd.slice(1);
if (text) msg = msg + " " + text;
EchoMessage(lLevelTag(level) + msg);
Message("[#00FF15]"+msg+"");
print("(IRC)"+user+" :"+msg+"");
}
}

kennedyarz

is the same

function FBSIrcCommand( user, cmd, text )
{
    // none of this needs to be touched, it is to do with getting channel levels
    local NickInfo = FindNick( user ), level, tLevel;
    local s = 0, plr;
    if ( text ) { s = NumTok( text, " " ); plr = FindPlayer( text ); }
   
    if ( NickInfo ) level = NickInfo.Level.tointeger();
    //---------------------------------------------------------------------------
   
           if (cmd) {
        if (cmd.slice(0,1)  == "." && cmd.len() > 1)
               
        {
            local msg = "" + user + ": " + cmd.slice(1);
            if (text) msg = msg + " " + text;
            EchoMessage(lLevelTag(level)+"["+LevelTag(level)+"]"+msg+"");
            Message("[#0000CC]["+LevelTag(level)+"][#ffffff]"+msg);
print(LevelTag(level)+""+msg)
        }
    }