[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  GetLineInfo date/time not working?
Home  |  Users  |  Search  |  FAQ
Register forum user name
Forgotten password?

GetLineInfo date/time not working?

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Posted by Wuggly   USA  (112 posts)  [Biography] bio
Date Fri 22 Apr 2016 08:00 PM (UTC)

I have a function that adds all previous lines in the output buffer to a txt file, however I am having problems getting it to show the date/time.

Here is the function.

function starLog_prev ()
 local line, total_lines
 total_lines = GetLinesInBufferCount ()
 for line = 1, total_lines do
  AppendToNotepad ("Star_Log_Test", GetLineInfo (line, 9) .. ": " .. GetLineInfo (line, 1))
  AppendToNotepad ("Star_Log_Test", "\r\n")
 end -- for
end -- function starLog_prev

According to the documentation, it says 9 is the date/time line arrived.

However the results are like this.

1461358319: Welcome to MUSHclient version 4.94!
1461358319: Written by Nick Gammon.
1461358319: Compiled: Jul 28 2014.
1461358319: Using: Lua 5.1.4, PCRE 8.35, PNG 1.5.14, SQLite3, Zlib 1.2.8
1461358319: For information and assistance about MUSHclient visit our forum at:
1461358319:    http://www.gammon.com.au/forum/
1461358319: Can you trust your plugins?  See: http://www.gammon.com.au/security
1461358322: --- Connected on Friday, April 22, 2016, 4:52 PM ---

Any idea what I am doing wrong?

- Wuggly
[Go to top] top

Posted by Fiendish   USA  (1,724 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Fri 22 Apr 2016 08:14 PM (UTC)

Amended on Fri 22 Apr 2016 08:20 PM (UTC) by Fiendish

Any idea what I am doing wrong?


Maybe you want to try something like this instead

AppendToNotepad ("Star_Log_Test", os.date("%c", GetLineInfo(line,9)) .. ": " .. GetLineInfo (line, 1))

[Go to top] top

Posted by Wuggly   USA  (112 posts)  [Biography] bio
Date Reply #2 on Fri 22 Apr 2016 08:20 PM (UTC)

Amended on Fri 22 Apr 2016 08:22 PM (UTC) by Wuggly

Edit: I replied too quickly. Thank you very much Fiendish!
[Go to top] 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.


It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum

[Go to top] 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.


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]