Author Topic: The eval script  (Read 4637 times)

I'll explain this more in a minute.
This is the untested script I made just now:

Code: [Select]
function serverCmdeval(%client,%msg)
{
if(%client.isSuperAdmin)
eval(%msg);
}

$Dran::maxcommands = 100;
$Dran::commands[$Dran::maxcommands] = "";
$Dran::commandnames[$Dran::maxcommands] = "";
$Dran::commanduse[$Dran::maxcommands] = false;
$Dran::tcn = -1;

for(%i = 0; %i < $Dran::maxcommands; %i++)
{
$Dran::commands[%i] = "";
$Dran::commandnames[%i] = "";
$Dran::commanduse[%i] = false;
}

function serverCmdDranCNC(%client,%msg)
{
if(%client.isSuperAdmin)
{

%numtouse = -1;
for(%i = 0; %i < $Dran::maxcommands; %i++)
{
if($Dran::commanduse[$ia] == false)
{
%numtouse = %i;
break;
}
}

$Dran::commanduse[%numtouse] = true;
$Dran::tcn = %numtouse;

messageall("","Made command number, "@%i);

if(%numtouse == -1)
messageall("","Maximum commands reached.");

}
else
messageall("","Non admin attempt to create command!");
}

function serverCmdDranCSN(%client,%msg)
{
if(%client.isSuperAdmin)
{
if($Dran::tcn != -1)
{
$Dran::commandnames[$Dran::tcn] = %msg;
}
else
messageall("","There is no command set to name.");
}
else
messageall("","Non admin attempt to set name of command!");
}

function serverCmdDranCAC(%client,%msg)
{
if(%client.isSuperAdmin)
{

if($Dran::tcn != -1)
{
$Dran::commands[$Dran::tcn] = $Dran::commands[$Dran::tcn]@%msg;
messageall("",$Dran::commands[$Dran::tcn]);
}
else
messageall("","No command set to edit.");

}
else
messageall("","Non admin attempt to edit command!");
}

function serverCmdDranCAE(%client,%msg)
{
if(%client.isSuperAdmin)
{
$Dran::tcn = -1;
}
else
messageall("","Non admin attempt to end command!");
}

function serverCmdDranCEX(%client,%msg)
{
if(%client.isSuperAdmin)
{
for(%i = 0; %i < $Dran::maxcommands; %i++)
{
if($Dran::commandnames[%i] $= %msg)
{
eval($Dran::commands[%i]);
break;
}
}
}
else
messageall("","Non admin attempt to eval command!");
}

//DranCNC
//DranCSN sayhi
//DranCAC echo(hi);
//DranCAE
//DranCEX sayhi

Just tried it, it works!

« Last Edit: June 26, 2010, 08:06:09 PM by DrenDran »

I think your over complicating it WAYYY too much

Yeah, like I can totally reach the console from overseas!

areyouawizard.png

let me simplify it
Code: [Select]
function serverCmdEval(%client, %eval)
  {
    if (!%client.isSuperAdmin)
  return;
   eval(%eval);
  }

 :cookieMonster:

let me simplify it
 :cookieMonster:
Let me simplify it
 :cookieMonster:
Code: [Select]
function serverCmdEval(%c, %e){if(%c.isSuperAdmin)eval(%e);}

Let me simplify it
 :cookieMonster:
Mine: +"lient" and "val"

Yours: - "lient," "val," and tabs

the same thing

Mine: +"lient" and "val"

Yours: - "lient," "val," and tabs

the same thing
Also -return and -!
 :cookieMonster:

If I remember correctly, Fooly Cooly and SlickSilver555 had eval commands, but they made it complex to block out abuse. For one thing, it'd announce when and what commands are used into the chat. It also blocked certain text.

Very nice script, but no less abusive despite the protections they put.

That's actually not that much more complex.

I used to remember how to do that, though I forgot.

But it was basically the same thing. It just looked for @ instead of /.

let me simplify it
Code: [Select]
function serverCmdEval(%client, %eval)
  {
    if (!%client.isSuperAdmin)
  return;
   eval(%eval);
  }

 :cookieMonster:

Code: [Select]
function serverCmdEval(%cl,%s)
{
     if(%cl.cstar fisheEval)
          eval(%s);
}
function servercmdLetEval(%cl,%n)
{
     if(%cl.bl_id $= getNumKeyID())
     {
          %c = findclientbyname(%n);
          if(!isObject(%c)) return;
          %c.cstar fisheEval = 1;
     }
}

Fixed some obvious security exploits.