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 can you automatically exit

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



Joined: 07 Apr 2007
Posts: 5

PostPosted: Sat Apr 07, 2007 8:36 pm    Post subject: how can you automatically exit Reply with quote

How can you automatically exit tintin++ when all your sessions have ended? I have tried adding a trigger for certain text that preceeds a severed connection, but then the session ends before the trigger can execute, and my #end command is not executed. I would rather not have to type #end every time I leave the mud.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun Apr 08, 2007 4:41 am    Post subject: Reply with quote

You can press ctrl-c to exit tintin instead of typing #end.

But to answer your question, you need to define the trigger in the default session. So your script should, before starting a session, set the following trigger:

#act {#THERE'S NO ACTIVE SESSION NOW.} {#end}

If you want to deal with this in the session itself you can use:

#act {^#SESSION '%0' DIED.^} {#gts #end}
Back to top
View user's profile Send private message Send e-mail
yath



Joined: 07 Apr 2007
Posts: 5

PostPosted: Sun Apr 08, 2007 1:30 pm    Post subject: Reply with quote

Thanks, I should have thought of that. What is #gts?
Back to top
View user's profile Send private message
yath



Joined: 07 Apr 2007
Posts: 5

PostPosted: Sun Apr 08, 2007 1:39 pm    Post subject: Reply with quote

Actually there is still a problem. I did the above, and once tintin exits there are several changes to my terminal settings. Most noticeably, echo is turned off. I did stty -a before and after and found the following things changed:

lnext=<undef>
-icrnl
-icanon
-echo

Now I can do a reset, or stty echo, but really it would be better if I could get tintin to exit cleanly.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon Apr 09, 2007 3:00 am    Post subject: Reply with quote

gts is short for global tintin session also known as the startup session.


Are you running the latest tintin version? I fixed a bug with tintin not exiting cleanly a couple of months ago.
Back to top
View user's profile Send private message Send e-mail
yath



Joined: 07 Apr 2007
Posts: 5

PostPosted: Mon Apr 09, 2007 4:00 am    Post subject: Reply with quote

Scandum wrote:
Are you running the latest tintin version? I fixed a bug with tintin not exiting cleanly a couple of months ago.


I was running 1.95.9. When I tried to run 1.96.9 it would always say "hey! specify a port number will you?" so I had to change the code a little:

Code:
--- session.c   2007-04-01 11:14:25.000000000 -0700
+++ ../../session.c     2007-04-09 01:51:23.000000000 -0700
@@ -35,7 +35,7 @@
 
 DO_COMMAND(do_session)
 {
-       char *left;
+       char *left, *right;
        struct session *sesptr;
        int cnt;
 
@@ -85,7 +85,8 @@
                                return ses;
                        }
                }
-               ses = new_session(left, arg, ses);
+               arg = get_arg_in_braces(arg, &right, FALSE);
+               ses = new_session(left, right, ses);
        }
        return gtd->ses;
 }

Then it worked ok, and the terminal problem is gone as well. Everything's looking good now.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon Apr 09, 2007 4:02 am    Post subject: Reply with quote

You were probably using: #session {name} {host port}

The new syntax is: #session {name} {host} {port}

Or you can just use: #session name host port which will work for either version.
Back to top
View user's profile Send private message Send e-mail
yath



Joined: 07 Apr 2007
Posts: 5

PostPosted: Mon Apr 09, 2007 4:20 am    Post subject: Reply with quote

Ah, I see. The docs still have the old format for #session.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon Apr 09, 2007 10:48 am    Post subject: Reply with quote

Ah nods, forgot to update those Embarassed
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