copy()/appendBuffer()
Posted: Mon Mar 11, 2013 3:49 am
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:
selectCurrentLine()
copy()
appendBuffer("game_map")
deleteLine()
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.
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:
selectCurrentLine()
copy()
appendBuffer("game_map")
deleteLine()
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.