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

Variables and filenames

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
techman246



Joined: 27 May 2013
Posts: 46

PostPosted: Sun Sep 27, 2015 10:16 pm    Post subject: Variables and filenames Reply with quote

Hi everyone in a previous version I was able to do filenames with random numbers such as file$rnum15.wav. But that seems to no longer work, any suggestions?
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Mon Sep 28, 2015 3:24 am    Post subject: Reply with quote

You should initialize the variable with #math first:
Code:

#nop For 1 dice with 4 faces
#math {result} {1d4}
#echo {$result}
3


also you should escape the "."
Code:

file$rnum15\.wav
Back to top
View user's profile Send private message
techman246



Joined: 27 May 2013
Posts: 46

PostPosted: Mon Sep 28, 2015 11:34 am    Post subject: worked like a charm Reply with quote

I just had to escape the variable with the "\" character. thanks a lot. now one more question I have a date variable that is suposed to log the time that the user connected to a server and write ./logs/$DateVar.log . this is not quite working correctly. here's the code

Code:
#format DateVar {%t} {%Y-%m-%d-%T}
and
Code:
#log {o} {./logs/$DateVar.log}

this gives an error saying could not create file. but if I put a "\" character at the end i get the log name with a \.log at the end

any suggestions?
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Mon Sep 28, 2015 12:16 pm    Post subject: Reply with quote

This was asked before but I can't find the thread now...

if I remember correctly, you should create the entire path+filename with #format, and use the resulting var for log


edit: found the thread

http://tintin.sourceforge.net/board/viewtopic.php?p=8781#8781
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 -> General Discussion 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