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.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ GetLineInfo date/time not working?
|
GetLineInfo date/time not working?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Wuggly
USA (112 posts) Bio
|
| Date
| Fri 22 Apr 2016 08:00 PM (UTC) |
| Message
| Hello!
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.
http://www.gammon.com.au/scripts/doc.php?function=GetLineInfo
However the results are like this.
1461358319:
1461358319: Welcome to MUSHclient version 4.94!
1461358319: Written by Nick Gammon.
1461358319:
1461358319: Compiled: Jul 28 2014.
1461358319: Using: Lua 5.1.4, PCRE 8.35, PNG 1.5.14, SQLite3 3.8.4.3, Zlib 1.2.8
1461358319:
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
1461358319:
1461358322:
1461358322: --- Connected on Friday, April 22, 2016, 4:52 PM ---
1461358322:
Any idea what I am doing wrong?
Thanks
- Wuggly | | Top |
|
| Posted by
| Fiendish
USA (2,541 posts) 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
|
| Message
|
Quote: Any idea what I am doing wrong?
See
https://en.wikipedia.org/wiki/Unix_time
and
https://www.lua.org/pil/22.1.html
Maybe you want to try something like this instead
AppendToNotepad ("Star_Log_Test", os.date("%c", GetLineInfo(line,9)) .. ": " .. GetLineInfo (line, 1))
|
https://github.com/fiendish/aardwolfclientpackage | | Top |
|
| Posted by
| Wuggly
USA (112 posts) 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
|
| Message
| | Edit: I replied too quickly. Thank you very much Fiendish! | | 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.
14,171 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top