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

Merge 2 lines on 1

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
Helden



Joined: 02 Jan 2015
Posts: 13

PostPosted: Wed Jan 07, 2015 7:37 am    Post subject: Merge 2 lines on 1 Reply with quote

Hello,
The mud I play on is quite verbose so I would like to compress some output in order to reduce the number of rows.

Example to explain my idea:

NOW:
Code:
You hit foo.
Your hit stun foo.
You hit foo.
You hit foo.
Your hit stun foo.


WISH:
Code:
You hit foo. (stun)
You hit foo. ()
You hit foo. (stun)


I tryed to find a way with actual script power but I've not found a good solution.
Is it feasable right now? How?
Otherwise can you think about a new feature to cover this situation?

Thanks,
Matteo
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Wed Jan 07, 2015 12:30 pm    Post subject: Reply with quote

This should be improved, but it will show only one time the same lines:

Code:
#action {^You%* hit %+} {#if {"${oldhit}" == "%0"} {#line gag} {#var oldhit {%0}}}


Using your lines the result will be this:
Code:

You hit foo.
Your hit stun foo.
You hit foo.
Your hit stun foo.


Another example:
Code:
With this:

You hit foo.
You hit foo.
Your hit stun foo.
Your hit stun foo.
Your hit stun foo.
You hit foo.
Your hit stun foo.

You will get:

You hit foo.
Your hit stun foo.
You hit foo.
Your hit stun foo.
Back to top
View user's profile Send private message
Helden



Joined: 02 Jan 2015
Posts: 13

PostPosted: Wed Jan 07, 2015 2:58 pm    Post subject: Reply with quote

Interesting solution. I need to study you script better but your solution is not what I need.

You remove duplicates. I need them. If I hit 3 times I need to recognize it but if in addition to the hit the server tells me some other effect I would like to put it on the same line, not on a separate one.

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



Joined: 04 Aug 2014
Posts: 339

PostPosted: Wed Jan 07, 2015 3:38 pm    Post subject: Reply with quote

Oh, now I understand, I thought that the "stun" and the "hit" lines were 2 different hits, but the stun is actually just a "bonus" of a hit.

Then this should work:
Code:

#action {^You hit %+} {#if {"${oldhit}" != "%0"} {#line gag;#var oldhit {%0}}}

#action {^Your hit stun %+} {#line gag;#echo {$oldhit (stun)};#var oldhit {%0};}


If the last hit of a battle has no attributes will not be printed, so you should "#echo $oldhit" with some other action like "You killed foo".
Also, the "oldhit" variable should be deleted at the end of a battle.

The result should be near what you want:
Code:

You hit foo. (stun)
You hit foo.
You hit foo. (stun)
Back to top
View user's profile Send private message
Helden



Joined: 02 Jan 2015
Posts: 13

PostPosted: Wed Jan 07, 2015 4:50 pm    Post subject: Reply with quote

Thanks. Need to study and test it now.
Maybe can be moved to script section and not in feature request so.
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 -> Feature Requests 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