Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ General ➜ scroll back while displaying recent text

scroll back while displaying recent text

Posting of new messages is disabled at present.

Refresh page


Pages: 1  2  3 

Posted by LupusFatalis   (154 posts)  Bio
Date Reply #30 on Tue 28 Apr 2009 02:30 AM (UTC)
Message
Ah, that works much better. I haven't rigorously tested to find where it doesn't work as desired. It seems like when getting and mud mail I have to disable it. No big deal there. If I get any glaring errors I'll give a post about it. But so far so good, thanks a lot bud.
Top

Posted by LupusFatalis   (154 posts)  Bio
Date Reply #31 on Thu 30 Apr 2009 08:52 PM (UTC)
Message
Ok, this is just the relevant parts of the packets I believe but here is what happens, I log in, and get my room desc. I send anything to the mud and get the response beginning with > .... Now i'm not sure if this error will crop up in other situations, but if possible I want to eliminate it.

50 33 36 6d 77 65 73 74 1b 5b 30 6d 2e 0d 0a 35 30
2 iron weights.. 32 20 69 72 6f 6e 20 77 65 69 67 68 74 73 2e 0d
.ÿü.ÿü.> 0a ff fc 01 ff fc 03 3e 20

Sent packet: 3 (3 bytes) at Thursday, April 30, 2009, 4:43:16 PM

l.. 6c 0d 0a

Incoming packet: 4 (409 bytes) at Thursday, April 30, 2009, 4:43:17 PM

.[1mA garden.[0m 1b 5b 31 6d 41 20 67 61 72 64 65 6e 1b 5b 30 6d
..A small garden 0d 0a 41 20 73 6d 61 6c 6c 20 67 61 72 64 65 6e
looks very well 20 6c 6f 6f 6b 73 20 76 65 72 79 20 77 65 6c 6c
tended.

...502 iron weights.
> A garden
A small garden looks very well tended.

At the moment, I've modified the code a little... it is as follows:
partial = ""

function OnPluginPacketReceived (s)

  local t = {}  -- table of reassembled lines

  if s == "> " then
    s = ""
  end

  -- get rid of carriage-returns, add new packet to existing partial one

  partial = partial .. string.gsub (s, "\r", "")

  -- turn finished lines into table t
  
  partial = string.gsub (partial, "(.-)\n", 
    function (line) 
      
      -- remove prompt as we add to the table
      
      line = string.gsub (line, "^\027%[0m> ", "\027[0m", 1)
      line = string.gsub (line, "^> ", "", 1)
         
      if line ~= "" then
        table.insert (t, line) 
      end -- if not empty
      
      return ""
    end) -- function
  
  if #t > 0 then
    table.insert (t, "")  -- to get final linefeed
  end -- if
    
  -- return table of lines, concatenated with newlines between each one
  return table.concat (t, "\n")

end
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #32 on Sun 03 May 2009 03:42 AM (UTC)
Message
It looks like you are getting telnet sequences. This stuff:


0a ff fc 01 ff fc 03 3e 20


is:


  • newline (oa)
  • IAC WONT 01 (I won't echo)
  • IAC WONT 03 (I won't suppress go-ahead)


The extras stuff before the prompt (who knows why it is there exactly?) is what is stopping the plugin suppress the prompt. I'm not sure if we should completely eliminate it, but probably changing the order is OK. eg.

Change:


-- get rid of carriage-returns, add new packet to existing partial one

  partial = partial .. string.gsub (s, "\r", "")



to:


-- get rid of carriage-returns, add new packet to existing partial one

  partial = partial .. string.gsub (s, "\r", "")

  partial = string.gsub (partial, "\n\255\252\001", "\255\252\001\n")
  partial = string.gsub (partial, "\n\255\252\003", "\255\252\003\n")


This is moving the telnet stuff to before the newline, so it will still be processed by MUSHclient, however now the tests further down will notice the prompt following the newline.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by LupusFatalis   (154 posts)  Bio
Date Reply #33 on Sun 03 May 2009 06:49 AM (UTC)
Message
So far so good! Thanks again nick.
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #34 on Sun 24 May 2009 04:50 AM (UTC)
Message
Quote:

Basically, what I want to happen is have the most recent lines (perhaps 10) still displayed at the bottom whenever I scroll back. This way I'm able to react to current events while looking back in time.


See: http://www.gammon.com.au/forum/?id=9454

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by LupusFatalis   (154 posts)  Bio
Date Reply #35 on Mon 25 May 2009 06:34 AM (UTC)
Message
Checked it out. That is exactly that I imagining at the beginning of this (except matching colors, but no big deal there).

Much thanks!
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.


89,767 views.

This is page 3, subject is 3 pages long:  [Previous page]  1  2  3 

Posting of new messages is disabled at present.

Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.