Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   GS3 Speedhack Detector (https://forums.graalonline.com/forums/showthread.php?t=134268354)

Gunderak 06-24-2013 10:02 AM

GS3 Speedhack Detector
 
Just got bored and decided to play around with GS3.
It's really quite simple, but it works effectively.
PHP Code:

//#GS3
//#CLIENTSIDE
var op:number;
function 
onCreated():void{
  
op = {player.xplayer.yplayer.level};
  
this.onTimeout();
}
function 
onTimeout():void{
  
//Check the distance between the players last position
  //and their current position.
  
var d:number this.Dist(op[0], player.xop[1], player.y);
  
//d is the distance traveled in the last second
  //if(player.level == op[2] && d > 30){   
  //Set the old position
  
op = {player.xplayer.yplayer.level};
  
this.settimer(1);
}
//Pythagoras, get the distance between two points
function Dist(x1:numberx2:numbery1:numbery2:number):number{
  return (((
x1-x2)^2)+((y1-y2)^2))^0.5;



Tricxta 06-24-2013 10:50 AM

Since d is as constant as op, isn't it more efficient to declare d over the scope of the entire script as well?

Gunderak 06-24-2013 11:07 AM

But d is only used once, where as op needs to be stored? It's like doing temp. When it's inside a method, but possibly.

BlueMelon 06-24-2013 11:54 AM

This doesn't take into account if I enter a new level

Also, now days stuff like speed hacking gets insta-reported

Gunderak 06-24-2013 11:56 AM

Oh wow, I completely missed that o_o
Added it in.

Fulg0reSama 06-24-2013 12:02 PM

Quote:

Originally Posted by BlueMelon (Post 1719652)
Also, now days stuff like speed hacking gets insta-reported

Still doesn't hurt if there's detection, sometimes a player won't catch it quickly enough.

scriptless 06-24-2013 01:28 PM

What if a player is summoned?? either by staff, or script.. nice to see people trying to adpoted GS3 so early. I plan on learning it myself and have enabled it on my server for testing.

fowlplay4 06-24-2013 02:47 PM

Just use vectordist({ox, oy, oz}, {fx, fy, fz}) instead of re-creating your own.

Gunderak 06-24-2013 11:14 PM

Re-created it to be more efficient though, no need to do extra operations on z.

cbk1994 06-25-2013 01:48 AM

Quote:

Originally Posted by Gunderak (Post 1719641)
PHP Code:

var op:number;
// ...
op = {player.xplayer.yplayer.level}; 


How is this legal...?

Gunderak 06-25-2013 02:37 AM

I don't even know, I tried var op:number[]; but it errored.

cbk1994 06-25-2013 03:16 AM

Quote:

Originally Posted by Gunderak (Post 1719725)
I don't even know, I tried var op:number[]; but it errored.

player.level is a TServerLevel, not a number. Does the client even implement GS3 yet? I very much doubt it since they're still pushing very basic updates to the server with regularity. My guess is it's just ignoring that syntax (as it has been for years in GS2), meaning that your script is not actually valid GS3 (but instead valid GS2). Not positive on that though.


All times are GMT +2. The time now is 12:09 AM.

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