Help with anti-cheat code

Subscribe to Help with anti-cheat code 16 posts, 6 voices

Sign in to reply


 
avatar for Mascimo Mascimo 15 posts
Flag Post

http://www.kongregate.com/games/Mascimo/precision-click

I had it with a highscore board, but I had to delete it because I found out that you could hack it with the tab key.

The game has several frames with the stop(); action on them. I tried using the following code:

onEnterFrame = function () {
if (Key.isDown(“<tab>”)) {
gotoAndStop(3);
}
};

But apparently, it made the stop() action invalid, and the frame goes right away, doesn’t stop.

Any ideas?

 
avatar for Mascimo Mascimo 15 posts
Flag Post

And, sorry, it is AS 2.0.

 
avatar for skyboy skyboy 1230 posts
Flag Post
_root.tabEnabled = false;
 
avatar for Mascimo Mascimo 15 posts
Flag Post

What about the alt key?

 
avatar for skyboy skyboy 1230 posts
Flag Post

uhh… the alt key doesn’t do anything unless you program an action for when it’s pressed?

 
avatar for kinglynx kinglynx 342 posts
Flag Post

dnt use go to and stop if you have stop actions on frames… either take the stop actions away or change it to gotoand play

 
avatar for skyboy skyboy 1230 posts
Flag Post

stop + stop = stop, stop + play = stop; i don’t see an issue, unless there’s a play(); below the stop();

 
avatar for kinglynx kinglynx 342 posts
Flag Post

IM SAAARYY lol..

 
avatar for Mascimo Mascimo 15 posts
Flag Post

Using alt you can cheat in ths game:
http://www.kongregate.com/games/Mascimo/particle-escape

 
avatar for Nabb Nabb 987 posts
Flag Post

If don’t want anything complicated, you can’t stop that :P

 
avatar for Mascimo Mascimo 15 posts
Flag Post

Stop what?
What are you guys talking about?

 
avatar for Pimgd Pimgd 725 posts
Flag Post

If you don`t want complicated code, then it’s gonna be hard to stop them.

 
avatar for Mascimo Mascimo 15 posts
Flag Post

That sucks.

skyboy said;
uhh… the alt key doesn’t do anything unless you program an action for when it’s pressed?

I couldn’t program an action for alt because I haven’t find it’s keycode in any list. Isn’t the alt key reserved to the compiler, for security matters?

 
avatar for Pimgd Pimgd 725 posts
Flag Post

I don`t know. There ought to be a keycode chart somewhere. Found it. 18 is the keycode. I believe.

 
avatar for Cervello Cervello 76 posts
Flag Post

A good catch-all anti-cheat method for a mouse game like that would be to test to see how far the mouse moved from its last position.

I coded up an an example that catches all mouse movements of more than 50 pixels. Tested and works like a charm – get the working .fla here. (You may want to raise/lower the threshold, since it may have false positives for really fast movements – but then again, who would flick the mouse around that fast in a precision game?)

This way, it doesn’t matter if they use right click, alt, move outside the screen, or do whatever other mouse movement cheat – if the mouse moves too fast or too far, this’ll catch it. Oh, and you can let players use the right click menu and stuff or accidentally hit alt without fear of mouse jumping.

Oh, and for future reference, you can find all the key codes here (there’s a table at the bottom)

 
avatar for Mascimo Mascimo 15 posts
Flag Post

Thanks everyone.

I used the alt keycode, though Cervello’s Idea is the best. Check out the game now, I revised it, and please check the credits ;)

Sign in to reply


Click Here