Page 1 of 1


Posted: Mon Mar 11, 2013 3:49 am
by Fo-Rum
So, I've been using these two functions for a while now, to retain the colour of maps in IRE games, which I redirect to a miniconsole.

There seems to be a small problem with one of the two. What happens is that Lua throws an error, something about a nil value, and then all of my game text is redirected into my map window instead of the game map. Also, parts of the game map do make it over at times. EDIT: I'd like to clarify that this isn't consistent. It does indeed copy and append perfectly fine, most of the time. I'd say over 95% of the time this works flawlessly.

Here is my trigger used to capture the map lines: ^.

I have also used .*, and begin of line substrings for each possible map character.

Here is my code:


I spent about 20 minutes just now trying to figure out what was happening. I noticed absolutely no pattern on what could be triggering this. If I changed the code over to just echoing the line instead, there were no problems. Eventually, my client crashed! No same map will do this consistently, so this is why it is hard to find a pattern, and it seems pretty uncommon for most areas I've seen in these games.

I'm using windows XP SP3, on Mudlet 2.1.

Re: copy()/appendBuffer()

Posted: Mon Mar 11, 2013 5:05 am
by Vadi
It sounds like the code you have to stop capturing the map bugs out, and the command to stop capturing doesn't go through due to an earlier bug and hence it keeps capturing.

Re: copy()/appendBuffer()

Posted: Tue Mar 12, 2013 3:20 am
by Fo-Rum

I forgot to specify that the game map is 24 lines long, so the trigger chain is also only 24 lines. No code required to close it!

The reason I tried begin of line substrings for all map characters is to rule out "all captures". Most of the possible map characters, such as: space [ ] \ / | _ < > ^ will not trigger off of every game line when being used as a begin of line substring, so this helped to rule out the all capture scenario as was seen being sent to my miniconsole, which still happened. This is why I think there is a problem with copy or appenderBuffer, but I can't know for sure!

As noted before, I have done...

echo("game_map", line)

and of course for the same results

echo("game_map", matches[2])

These have never had a problem, they just lack colour. :(

Re: copy()/appendBuffer()

Posted: Tue Mar 12, 2013 3:28 am
by Vadi
There are no known problems with them, and they work reliably in many map/chat/game capture scripts. I think your issue lies elsewhere.

Re: copy()/appendBuffer()

Posted: Tue Mar 12, 2013 3:46 am
by Lucky24
Note that when you use functions like selectLine(), it actually moves the mouse cursor and selects the line, so if you're doing anything else with selecting text in between it can get messed up. Also, when you delete lines it deletes the line the cursor is currently on, though I believe you can specify which line.

Re: copy()/appendBuffer()

Posted: Tue Mar 12, 2013 3:51 am
by Fo-Rum
Thanks for reassurance! I've had unfortunate crashing issues with Mudlet in the past, that thankfully have all been solved with updates (with the exception of testing expandAlias, fun stuff).

I went back and tested a bit more and found the problem, but first: I don't know where the nil error was coming from that I got the other day (consistent, matched timestamps), since I wasn't getting it just now. I don't have an idea why it crashed (totally unrelated).

I had an additional trigger that I completely forgot about packed in with my general set of IRE stuff, that should have been separate. It's for for capturing maps in aetherspace on Lusternia, I guess! Begin of line substring: Floating, and then it just captures all text and closes after 19 lines. So, any place that happens to have floating stuff at the very start on it's own line will mess my map up. Fixed, to say the least!

Thanks again, I appreciate the help and I still love this client!