Gammon Forum
Entire forum
MUSHclient
General
Getting the Previous Line
Getting the Previous Line
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Chik
(10 posts) bio
|
Date
| Sun 29 Jul 2012 09:47 PM (UTC) |
Message
| 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, | top |
|
Posted by
| Fiendish
USA (2,514 posts) bio
Global Moderator |
Date
| Reply #1 on Sun 29 Jul 2012 11:29 PM (UTC) |
Message
| |
Posted by
| Chik
(10 posts) bio
|
Date
| Reply #2 on Sun 29 Jul 2012 11:51 PM (UTC) |
Message
| 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, | top |
|
Posted by
| Nick Gammon
Australia (22,982 posts) bio
Forum Administrator |
Date
| Reply #3 on Tue 31 Jul 2012 05:50 AM (UTC) |
Message
| 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? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Chik
(10 posts) bio
|
Date
| Reply #4 on Fri 10 Aug 2012 07:20 PM (UTC) |
Message
| 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. | top |
|
Posted by
| Nick Gammon
Australia (22,982 posts) bio
Forum Administrator |
Date
| Reply #5 on Sat 11 Aug 2012 12:23 PM (UTC) |
Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | 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.
13,989 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.