|
hkduck Newbie
Joined: 09 Feb 2009 Posts: 5
|
|
|
|
hkduck Newbie
Joined: 09 Feb 2009 Posts: 5
|
Posted: Mon Feb 09, 2009 5:00 am |
The pattern is composed of 4 digits, we need to answer the number which color is different from other 3. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Feb 09, 2009 5:10 am |
I haven't got the time to write code for this now, but your first port of call is going to be an ANSI trigger. I would use a #debug log to find out the character number of that box they're sending - I can't remember it - and have the trigger look for lines that contain only that box and spaces.
What you need to do next depends on whether or not they vary the amount of padding between the numbers. I suspect the simplest method in either case will probably involve capturing all four lines and comparing the number of characters on the line until you reach a white box. The number of the leftmost white box across all four lines is the cutoff point where you'll trim all the lines to. You do a similar thing from the rightmost box, trimming off the end of all the strings.
Now you have just the white number in your strings. Luckily there're only 9 possible numbers, so it should be easy to compare the number of boxes on each line and work out which number is being displayed - in the unlikely event that a number has the same number of boxes on each line, you can compare their locations as well.
Of course, a much easier method would simply be to move to a MUD that isn't so anal about anti-bot code. |
|
|
|
hkduck Newbie
Joined: 09 Feb 2009 Posts: 5
|
Posted: Tue Feb 10, 2009 1:55 am |
Thank for you help, fang. But I just found that the code is more complicate that I imagine
It looks like this
but when I try to copy it, it look like this
I really don't know how to figure it out.... |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Feb 10, 2009 3:32 am |
Interesting. I suggest you use the #debug command to log it like I suggested above, so we can take a closer look at what exactly it's sending.
But remember the much easier option I suggested above. There're hundreds of MUDs, and most of them aren't this bot-frenzied. |
|
|
|
|
|