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

Reading a text file

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



Joined: 05 Feb 2006
Posts: 14

PostPosted: Wed Jun 07, 2006 5:11 pm    Post subject: Reading a text file Reply with quote

I want to be able to read a text file and prefix each line with something. Like gossip, tell, or say

For example - I havea text file with 4-5 lines in it
I want to read it in saying each line.

I don't want to send it to an email or a message board.

A unix command that would allow me to prefix each line with say - then a way to read that in would also work as well.

Help
James
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Wed Jun 07, 2006 9:01 pm    Post subject: Reply with quote

The following more or less works:

#config verbose on

#alias test {#alias {%%90} {say %%90};#read %0;#unalias {%%90}}

The file that is read however must start with #nop since tintin sets the command character # to the first character that is read.
Back to top
View user's profile Send private message Send e-mail
jroper73



Joined: 05 Feb 2006
Posts: 14

PostPosted: Thu Jun 08, 2006 12:18 pm    Post subject: Question Reply with quote

Do you mean action/unaction? or alias?

And if you do a #config verbos on - how will it run the alias test?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Thu Jun 08, 2006 1:11 pm    Post subject: Reply with quote

Without verbose enabled tintin will echo messages when reading files.

Depending on the script you might not want to enable it.

And yes, I meant alias. The code I posted should work if you for example type: test tmp
Back to top
View user's profile Send private message Send e-mail
jroper73



Joined: 05 Feb 2006
Posts: 14

PostPosted: Thu Jun 08, 2006 1:35 pm    Post subject: RE Config Ver Reply with quote

with #config Ver On aliases do not work

With it off - it tries to read the file in - but it does not trigger the temp trigger in the alias.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Jun 09, 2006 7:17 am    Post subject: Reply with quote

It probably loops, with a \ it ought to work:

Code:

#alias test {#alias {%%90} {\say %%90};#read %0;#unalias {%%90}}
Back to top
View user's profile Send private message Send e-mail
jroper73



Joined: 05 Feb 2006
Posts: 14

PostPosted: Fri Jun 09, 2006 9:44 pm    Post subject: Same Thing Reply with quote

It tries to read in the file directally. sending each line to the mud.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sat Jun 10, 2006 6:23 am    Post subject: Reply with quote

If you want to mix in tintin commands you can use something like:

Code:

#alias test
{
    #alias {%%90}
    {
        #send {say %%90};
        #math cnt $cnt + 1;
    };
    #read %0;
    #unalias {%%90}
}
Back to top
View user's profile Send private message Send e-mail
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