Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ locating patterns

locating patterns

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Gohan_TheDragonball   USA  (183 posts)  Bio
Date Thu 12 Apr 2007 02:05 AM (UTC)
Message
i've been wanting to write a function that would help in identifying potential botters on my mud. basically what i want to do is store the last x amount of commands in an array and then go through and find a pattern. what i was thinking is storing just the command name as to save space, and the specific time it was entered. now doing all that is the easy part, what i am unsure of is how to write a function to determine patterns, both in the commands used and possibly in the amount of time it took from beginning of the pattern to the end of the pattern. has anyone done something like this or maybe seen something like this to which they could point me to, as i have never tried doing anything like this before and cannot even begin to think of an idea as to how to do this.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Thu 12 Apr 2007 02:36 AM (UTC)
Message
I would think the easy part is recognizing patterns; the hard part is figuring out what patterns to recognize. :-)

One thing you could do would be to make a giant string containing all the commands that have been run and then do normal regex matching on it (with a regex library) and see how long the result is. That isn't sensitive to time, though, although you could fix that by marking up the commands in the string with times and adjusting your regex appropriately.

If what you want to do is find the longest sequence of repetitions of shorter sequences, then that is a fairly expensive operation to compute. I can think of a few methods off the top of my head, all of which are very nasty in terms of complexity. Here's one:
- for every position, generate all possible sequences starting at that position
- for all sequences you generated, see if they repeat
- find the sequence that gives the largest number of repetitions
- find the position that has the largest number of sequence repetitions

The problem here is that with N words, at position i, you are generating N-i possible sequences, and you do this for all positions. It's not the world's worst algorithm, but still.

I imagine there are quite clever ways of doing this with dynamic programming techniques or other algorithmic tricks but I'd have to think a bit to come up with some.

Still, I think the real task here is to define what exactly a pattern means, before trying to recognize them.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #2 on Thu 12 Apr 2007 03:05 AM (UTC)
Message
Here's some patterns I would look for:


  • Players that are "too good" - impossibly good. That is, players that level (of gain xp) much faster than average.

  • Players whose gold increases at a higher than average rate.

  • Players who seem to be playing very long sessions.

  • Players who don't seem to take a break every hour or so (bio break).

  • If a group of characters are going around always doing things together but never seem to use ingame chat.

  • Characters that seem to "robotically" always move from room to room at the same rate.


None of these are really definite, but they could "flag" you to attempt a chat with them, just ask how they are going etc.

If there is no response, but they keep moving around killing things, you probably have a bot.

It is possible such a player might have a trigger set up to play a sound if someone tries to chat to them, so they quickly get back to the keyboard and respond.

In that case, if they seem to be operating a whole group (from one player), try getting a couple of admins to chat to the whole group at once, it will be hard for them to respond simultaneously to multiple questions.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #3 on Thu 12 Apr 2007 07:12 AM (UTC)
Message
Nick, I think you've presented some great "red flag" behaviours to watch for, but I think the ultimate queston here comes down to "What is it that Gohan is trying to find?"

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by Gohan_TheDragonball   USA  (183 posts)  Bio
Date Reply #4 on Thu 12 Apr 2007 07:31 AM (UTC)
Message
well i know many many tricks in catching bots as i have been doing it for quite some time now. however my schedule is very strict and i cannot be on the mud that much and when i am on i would prefer to be coding new things for my players rather than watching every player for potential bots. of course i will still do this, but if i can make a system that can flag potential botters, and lets say i switch back over to the screen and see the alert, i can switch gears and go check them out really quick. obviously this system will not be perfect and will not necessarily catch all or hell maybe any botters, but it is something i feel couldn't hurt. therefore if you have any suggestions as to how to get this done that would be very appreciated.

as to what a pattern is i cannot define the pattern, as there could be multiple different patterns the player could create to make it seem as if they are at the computer, but eventually a pattern must be made, except for the really good botters, but i am not worried about catching em all, just any that i can.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #5 on Thu 12 Apr 2007 07:35 AM (UTC)
Message
Yes, nobody is calling into question the advantages of having a pattern system. However if you don't know what you want to match on, trying to write a program to match patterns is an exercise in futility.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


18,297 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.