Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   TPS Recorder (https://forums.graalonline.com/forums/showthread.php?t=66467)

Thallen 06-05-2006 01:29 AM

TPS Recorder
 
I think it would be very beneficial to servers with spar tournaments to have a script that recorded a player's tiles per second movement, or some variation of a movement counter. Speed hacking is still very controversial, and I think this, with a norm speed on hand, could help out a lot.

xshadx 06-05-2006 01:45 AM

I Agree.

ApothiX 06-05-2006 03:54 AM

Something like this:

PHP Code:

function onActionServerside() {
  if(
params[0] == "distcheck") {
    echo(
"Warning: Player \"" player.account "\" is moving at: " params[1] @ " Tiles/sec.  This is " server.max_tilespersecond params[1] @ " Tiles/sec faster than the defined maximum. (Speedhack?)");
  }
}

//#CLIENTSIDE
function onCreated() {
  
this.player_oldposition = { player.xplayer.}; 
  
setTimer(1);
}

function 
onTimeout() {
  
temp.dx this.player_oldposition[0] - player.x;
  
temp.dy this.player_oldposition[1] - player.y;
  
temp.distmoved = ((temp.dx^2)+(temp.dy^2))^0.05;

  if(
temp.distmoved server.max_tilespersecond) {
    
triggerserver("gui"this.name"distcheck"temp.distmoved);
  }

  
this.player_oldposition = { player.xplayer.};

  
setTimer(1);


?

contiga 06-05-2006 01:09 PM

I'd make the timer stop tho, if it has concluded that it is a possibly speedhacker. Else you get a message inside RC every second? Hmmm.. :P

Skyld 06-05-2006 01:30 PM

There is a speedhack tolerance serveroption already. I am not sure how it works, but it might be on the wiki.

xXziroXx 06-05-2006 03:11 PM

speedhacktolerance=value (default is 90)

Thallen 06-05-2006 05:09 PM

Quote:

Originally Posted by Skyld
There is a speedhack tolerance serveroption already. I am not sure how it works, but it might be on the wiki.

If you actually played Graal, you'd know that the speedhack tolerance tool is garbage, and sparrers who use speedhacks use minor, but significant enough, amounts of speed that speedhack tolerance sucks versus.

Warcaptain 06-05-2006 05:26 PM

Most people probably do not equip their speedhacktolerance properly to make it actually do anything at all.

I do not understand how people 'speedhack' anyways unless the movement is not scripted x-x

Skyld 06-05-2006 05:35 PM

Quote:

Originally Posted by Thallen
If you actually played Graal, you'd know that the speedhack tolerance tool is garbage, and sparrers who use speedhacks use minor, but significant enough, amounts of speed that speedhack tolerance sucks versus.

Most servers probably do not even realise that the speedhack tolerance exists, which probably explains why most servers are victims to it.

xXziroXx 06-05-2006 06:01 PM

The speedhack feature is kick-ass, even to minor, but significant enough, amounts of speed if you put the value low enough.

contiga 06-05-2006 07:05 PM

Actually.. Okies script is garbage.. since.. if you speed up the frame rating of the game, also the scripts will go faster (see movement scripts as a proof, players can speed that up also).. so the distance that's traveled every second will be the same for what the game thinks....

Since you are also speeding up the timeout, it will still calculate, and result regular distance that has been traveled...

Appologiez if any spelling is wrong in my little story :P I am dutch and don't talk that proper English all day.

ApothiX 06-05-2006 07:22 PM

Quote:

Originally Posted by contiga
Actually.. Okies script is garbage.. since.. if you speed up the frame rating of the game, also the scripts will go faster (see movement scripts as a proof, players can speed that up also).. so the distance that's traveled every second will be the same for what the game thinks....

Not all speedhacks speed up the frame rate. (I don't see you contributing a better script, either ;))

contiga 06-05-2006 07:26 PM

Well, you could do a serverside one.. but it might cause too much lag yeah.. an option would be: recording every player for 10 seconds, then skipping to another one (serverside).. and compare? If you'd do every single player serverside, it'd cause a lot of lag.. so I think skipping between players would be the best.

ps. If I wanted to make one, I'd already done it.. you just were at this thread earlier then me =p

ApothiX 06-06-2006 05:54 AM

Quote:

Originally Posted by contiga
Well, you could do a serverside one.. but it might cause too much lag yeah.. an option would be: recording every player for 10 seconds, then skipping to another one (serverside).. and compare? If you'd do every single player serverside, it'd cause a lot of lag.. so I think skipping between players would be the best.

Recording every player for 10 seconds would not work, because not everyone is going to be constantly moving for 10 seconds.

Quote:

Originally Posted by contiga
ps. If I wanted to make one, I'd already done it.. you just were at this thread earlier then me =p

Nah, you'd probably wait until someone else made one and then steal their idea.

xAndrewx 06-06-2006 09:55 AM

Quote:

Originally Posted by xXziroXx
speedhacktolerance=value (default is 90)

Era has it at 0 and we catch 100% of the hackers :)

excaliber7388 06-06-2006 02:20 PM

Quote:

Originally Posted by xAndrewx
Era has it at 0 and we catch 100% of the hackers :)

Quote:

Originally Posted by Wiki
Speedhack Tolerance
speedhacktolerance=number
This gives the percentage of data packages that clients may send above the expected over without being logged as Trainer users. On Graal Kingdoms, the rather conservative setting of 90 is used. If you set this too low, your server will crash.

Might want to change that?

excaliber7388 06-06-2006 02:47 PM

Made one with a serverside test, runs only 5 seconds, every 10 seconds, to make sure no one has their client going faster. I used a lot of the same ideas ApothiX had, would this work better?
PHP Code:

function onActionclientside()
{
  if(
params[0]=="serversidetest")
  {
    
settimer(1);
    function 
onTimeout()
  {
    
this.dist=(((this.oldx^2)+(this.oldy^2))^.5);
    
this.curent=(((playerx^2)+(playery^2))^.5);
    
this.dist_value=this.dist-this.current;
    if(
this.control2==5)
    {
      
this.control2==0;
      
settimer(0);
    }
    
this.control2++;
    if(!
playerx==this.oldx && !playery==this.oldy)
    {
      
triggeraction(0,0,"serverside","weaponname","report",this.dist_value);
    }
    
settimer(1);
  }

    
}
  if(
params[0]=="report")
  {
    if(
params[1]>server.speedmax)
    {
      echo(
"Warning: Player \"" player.account "\" is moving at: " params[1] @ " Tiles/sec. This is " server.max_tilespersecond params[1] @ " Tiles/sec faster than the defined maximum. (Speedhack?)"); 
      }
  }
}
//#CLIENTSIDE
function onCreated()
{
  
settmer(1);
  
this.oldx=playerx;
  
this.oldy=playery;
}
function 
onTimeout()
{
  
this.dist=(((this.oldx^2)+(this.oldy^2))^.5);
  
this.curent=(((playerx^2)+(playery^2))^.5);
  
this.dist_value=this.dist-this.current;
  if(
this.control==10)
  {
    
this.control==0;
    
triggeraction(0,0,"serverside","weaponname","serversidetest",this.dist_value);
  }
  
this.control++;
  if(!
playerx==this.oldx && !playery==this.oldy)
  {
    
triggeraction(0,0,"serverside","weaponname","report",this.dist_value);
  }
  
settimer(1);



ApothiX 06-06-2006 04:51 PM

Quote:

Originally Posted by excaliber7388
Made one with a serverside test, runs only 5 seconds, every 10 seconds, to make sure no one has their client going faster. I used a lot of the same ideas ApothiX had, would this work better?
PHP Code:

function onActionclientside()
{
  if(
params[0]=="serversidetest")
  {
    
settimer(1);
    function 
onTimeout()
  {
    
this.dist=(((this.oldx^2)+(this.oldy^2))^.5);
    
this.curent=(((playerx^2)+(playery^2))^.5);
    
this.dist_value=this.dist-this.current;
    if(
this.control2==5)
    {
      
this.control2==0;
      
settimer(0);
    }
    
this.control2++;
    if(!
playerx==this.oldx && !playery==this.oldy)
    {
      
triggeraction(0,0,"serverside","weaponname","report",this.dist_value);
    }
    
settimer(1);
  }

    
}
  if(
params[0]=="report")
  {
    if(
params[1]>server.speedmax)
    {
      echo(
"Warning: Player \"" player.account "\" is moving at: " params[1] @ " Tiles/sec. This is " server.max_tilespersecond params[1] @ " Tiles/sec faster than the defined maximum. (Speedhack?)"); 
      }
  }
}
//#CLIENTSIDE
function onCreated()
{
  
settmer(1);
  
this.oldx=playerx;
  
this.oldy=playery;
}
function 
onTimeout()
{
  
this.dist=(((this.oldx^2)+(this.oldy^2))^.5);
  
this.curent=(((playerx^2)+(playery^2))^.5);
  
this.dist_value=this.dist-this.current;
  if(
this.control==10)
  {
    
this.control==0;
    
triggeraction(0,0,"serverside","weaponname","serversidetest",this.dist_value);
  }
  
this.control++;
  if(!
playerx==this.oldx && !playery==this.oldy)
  {
    
triggeraction(0,0,"serverside","weaponname","report",this.dist_value);
  }
  
settimer(1);



:w-hat: I don't even know what to say about that code. Why the hell do you have a 'function onTimeout()' inside an 'onActionClientside' on the serverside?

Maniaman 06-06-2006 05:01 PM

Quote:

Originally Posted by excaliber7388
Made one with a serverside test, runs only 5 seconds, every 10 seconds, to make sure no one has their client going faster. I used a lot of the same ideas ApothiX had, would this work better?
PHP Code:

function onActionclientside()
{
  if(
params[0]=="serversidetest")
  {
    
settimer(1);
    function 
onTimeout()
  {
    
this.dist=(((this.oldx^2)+(this.oldy^2))^.5);
    
this.curent=(((playerx^2)+(playery^2))^.5);
    
this.dist_value=this.dist-this.current;
    if(
this.control2==5)
    {
      
this.control2==0;
      
settimer(0);
    }
    
this.control2++;
    if(!
playerx==this.oldx && !playery==this.oldy)
    {
      
triggeraction(0,0,"serverside","weaponname","report",this.dist_value);
    }
    
settimer(1);
  }

    
}
  if(
params[0]=="report")
  {
    if(
params[1]>server.speedmax)
    {
      echo(
"Warning: Player \"" player.account "\" is moving at: " params[1] @ " Tiles/sec. This is " server.max_tilespersecond params[1] @ " Tiles/sec faster than the defined maximum. (Speedhack?)"); 
      }
  }
}
//#CLIENTSIDE
function onCreated()
{
  
settmer(1);
  
this.oldx=playerx;
  
this.oldy=playery;
}
function 
onTimeout()
{
  
this.dist=(((this.oldx^2)+(this.oldy^2))^.5);
  
this.curent=(((playerx^2)+(playery^2))^.5);
  
this.dist_value=this.dist-this.current;
  if(
this.control==10)
  {
    
this.control==0;
    
triggeraction(0,0,"serverside","weaponname","serversidetest",this.dist_value);
  }
  
this.control++;
  if(!
playerx==this.oldx && !playery==this.oldy)
  {
    
triggeraction(0,0,"serverside","weaponname","report",this.dist_value);
  }
  
settimer(1);




excaliber7388 06-06-2006 05:09 PM

Well, okay, what did I do wrong? XD

ApothiX 06-06-2006 05:13 PM

Quote:

Originally Posted by excaliber7388
Well, okay, what did I do wrong? XD

Everything?

xXziroXx 06-06-2006 05:33 PM

Quote:

Originally Posted by excaliber7388
Made one with a serverside test, runs only 5 seconds, every 10 seconds, to make sure no one has their client going faster. I used a lot of the same ideas ApothiX had, would this work better?
PHP Code:

function onActionclientside()
{
  if(
params[0]=="serversidetest")
  {
    
settimer(1);
    function 
onTimeout()
  {
    
this.dist=(((this.oldx^2)+(this.oldy^2))^.5);
    
this.curent=(((playerx^2)+(playery^2))^.5);
    
this.dist_value=this.dist-this.current;
    if(
this.control2==5)
    {
      
this.control2==0;
      
settimer(0);
    }
    
this.control2++;
    if(!
playerx==this.oldx && !playery==this.oldy)
    {
      
triggeraction(0,0,"serverside","weaponname","report",this.dist_value);
    }
    
settimer(1);
  }

    
}
  if(
params[0]=="report")
  {
    if(
params[1]>server.speedmax)
    {
      echo(
"Warning: Player \"" player.account "\" is moving at: " params[1] @ " Tiles/sec. This is " server.max_tilespersecond params[1] @ " Tiles/sec faster than the defined maximum. (Speedhack?)"); 
      }
  }
}
//#CLIENTSIDE
function onCreated()
{
  
settmer(1);
  
this.oldx=playerx;
  
this.oldy=playery;
}
function 
onTimeout()
{
  
this.dist=(((this.oldx^2)+(this.oldy^2))^.5);
  
this.curent=(((playerx^2)+(playery^2))^.5);
  
this.dist_value=this.dist-this.current;
  if(
this.control==10)
  {
    
this.control==0;
    
triggeraction(0,0,"serverside","weaponname","serversidetest",this.dist_value);
  }
  
this.control++;
  if(!
playerx==this.oldx && !playery==this.oldy)
  {
    
triggeraction(0,0,"serverside","weaponname","report",this.dist_value);
  }
  
settimer(1);



Hillarious.


Quote:

Originally Posted by Maniaman

Haha, nice one!

Snakeandy7 06-07-2006 11:01 AM

Quote:

Originally Posted by excaliber7388
Might want to change that?

Nah, I don't think we should. =]


All times are GMT +2. The time now is 01:51 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.