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

Gag a line plust the line that follows

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help
View previous topic :: View next topic  
Author Message
elminster



Joined: 13 Jul 2009
Posts: 46

PostPosted: Wed Apr 05, 2017 12:28 pm    Post subject: Gag a line plust the line that follows Reply with quote

I've not been able to figure this out looking through the help files. Just wondering, if a particular command outputs 2 or more lines of text, how do I tell it to say, gag that plus the next # lines?

Also, just for curiosity, could you say, let the first line through, but gag the next two?

Thanks!
Back to top
View user's profile Send private message AIM Address
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Thu Apr 06, 2017 4:20 am    Post subject: Reply with quote

I suppose there isn't a direct way to do this...

This is an example to remove every line from "the first line to gag", stopping when the "prompt line >" is reached :

Code:

#action {the first line to gag}
{
    #action {%*} {#line gag};
    #line gag;
}

#action {prompt line>}
{
    #unaction {%*};
}


To select how many lines or what lines to keep or remove you'll need to use counters too, for example this will remove everything after the first line:

Code:

#var {cnt} {0}

#action {%*}
{
    #math cnt {$cnt + 1};
    #if { $cnt > 1 } {#line gag} {};
}
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 -> Script Help 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