TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

How to set the log file location?

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
hopefulnpc



Joined: 28 Aug 2016
Posts: 3

PostPosted: Mon Sep 12, 2016 1:41 pm    Post subject: How to set the log file location? Reply with quote

I want to log chat to a text file in my home directory. I have a folder ~/.tintin/ which contains my tintin scripts and i would like to also house my chat logs.

I tried using this command:
Quote:
#action {^[chatnet] %0} {#line {log} ~/.tintin/chatnet.txt}


I get the following error:
Quote:
#ERROR: #LINE LOG {~/.tintin/chatnet.txt} - COULDN'T OPEN FILE.


Do i need to specify an absolute path to the chatlog file?

EDIT: I tried using an absolute path and it fixed the error. However, is it possible to write the script without an absolute path?

Also can I {gag} and {log} the same line?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon Sep 12, 2016 7:39 pm    Post subject: Reply with quote

To log and gag you can use:
Code:

#action {^[chatnet] %0} {#line {log} ~/.tintin/chatnet.txt;#line gag}


You need an absolute path, but you can initialize a log file, following should work:

Code:

#script {tintindir} {cd ~/.tintin;pwd}
#var tintindir $tintindir[1];
#var chatlog $tintindir/chatnet.txt


~ is part of the bash shell I think, got too much going on in tintin already so I don't think I should implement ~ handling. Will add it to my todo list though.
Back to top
View user's profile Send private message Send e-mail
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Mon Sep 12, 2016 8:08 pm    Post subject: Reply with quote

I encountered issues with tilde expansion in a different project and I was told that the use of '~' to indicate the user's home directory (or ~otheruser for a different user's home directory) may be a bashism, i.e. a behaviour belonging specifically to that shell/command interpreter and not an OS feature. {I was going to link that to the Wikipedia page but there isn't one that covers it - yet} Wink
Back to top
View user's profile Send private message
hopefulnpc



Joined: 28 Aug 2016
Posts: 3

PostPosted: Tue Sep 13, 2016 12:57 pm    Post subject: Reply with quote

Thanks scandium!

I didn't realize ~ was so Bash specific.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group