• AFK that takes into account +left/+right?
    4 replies, posted
I've found numerous AFK scripts but none that block/work around people using +left/+right/+foward in console. I've thought about making a timer to just run the - version of the commands but I figure there has to be a better way. Any recommendations?
Checking for KeyDown's on client and server would be my first guess.
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/CMoveData/GetButtons]CMoveData:GetButtons[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/CMoveData/GetOldButtons]CMoveData:GetOldButtons[/url] That should prevent every conventional means of AFKing. You can compare old buttons with new buttons over a period of time and check if they have changed. If someone has had the same buttons pressed non-stop for 5 minutes, you know they're AFK. Be sure to reset the time if the buttons have changed at any point, though. If you check that I'm moving left and then saw 5 minutes later that I am also moving left, that doesn't tell you I've used +left, that just tells you that at those two points in time I happened to be moving left. You need to check and see if the pattern was broken, and reset the time if it was. Sort of hard for me to explain, but I hope that makes sense.
I suppose if the client is running Windows you could also throw in [url]http://wiki.garrysmod.com/page/system/HasFocus[/url]
Thanks for the quick replies. I'm still learning lua, sorry for the numerous posts about seemingly simple questions. You guys are the best!
Sorry, you need to Log In to post a reply to this thread.