Hi,
What's the best way to get the previous line?
GetRecentLines(2) gives me the previous line, but it also gives me the current line as well.
GetLineInfo(GetLinesInBufferCount()-1, 1) gives me the previous line from the output window, not the actually line received from the mud. If the line is wrapped around, it gives me only part of the line.
Thanks for your help,
Quote:
GetRecentLines(2) gives me the previous line, but it also gives me the current line as well.
So split at newline?
Or try
http://www.gammon.com.au/scripts/doc.php?function=GetLineInfo
GetLineInfo(GetLinesInBufferCount()-1, 1) gives me the previous line from the output window, not the actually line received from the mud. If the line is
wrapped around, it gives me only part of the line.
Is there way to specify the actual line, not the line from output window?
Thanks,
All it really saves is the line in the output window. However some people use the plugin callback OnPluginScreendraw which is called as lines are drawn.
You could use OnPluginPacketReceived to find the actual text arriving, as it arrives, complete with ANSI code sequences, etc.
Why do you want to do this?
I need to create a trigger, but that trigger only needs to fire depending on the previous line received.
The previous line is sometimes long, so it gets wrapped, and sometimes short.
Just make a catch-all trigger (ie. match on "*") with "keep evaluating" set). Save whatever it matched on in a variable.
Then when the "other" trigger matches you can check this variable.