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

Optimization tips

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



Joined: 27 Dec 2012
Posts: 22

PostPosted: Sun Jul 26, 2015 9:58 am    Post subject: Optimization tips Reply with quote

After months of heavy playing on Tintin I decided to clean up and optimize my scripts. So, I would like to ask which commands/constructions are faster than others? For example is "switch-case" better than "if-elseif"? Is there any optimal way than #alias to execute this same script from different triggers without returning any data to mud(like in #function)?
What are the most common scripting mistakes? How to avoid them and keep client in good shape?
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Mon Jul 27, 2015 12:16 pm    Post subject: Reply with quote

My only advice is to use #SEND everywhere you can, so aliases are not checked.
This will fasten things especially if you have a lot of aliases.
Back to top
View user's profile Send private message
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Wed Jul 29, 2015 3:02 pm    Post subject: Reply with quote

One scripting error is to use #SHOWME instead of #ECHO, the output from the former is run through the trigger system and can trigger #ACTIONs - which can be fatally recursive if you have not allowed for it! #ECHO is not processed in that way - but does have it's own gotcha if putting stuff on a particular screen line... Smirk
Back to top
View user's profile Send private message
wstopek



Joined: 27 Dec 2012
Posts: 22

PostPosted: Sun Aug 02, 2015 1:35 pm    Post subject: Reply with quote

Thank so much. Now, I'm wondering how to trigger my enemies in the fastest way. They are described in last paragraph before prompt character(>). There are no key words like: "stand here, sleep here etc.", just only something like: "Name1, name2 and name3." Can I avoid somehow checking all output by #action {% } or #event {received line} in this case?
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Sun Aug 02, 2015 1:54 pm    Post subject: Reply with quote

I suppose your only choice is to use an action with a list of names...

Have a look here for a way to use a LIST to create a dynamic ACTION
http://tintin.sourceforge.net/board/viewtopic.php?p=8902#8902
Back to top
View user's profile Send private message
wstopek



Joined: 27 Dec 2012
Posts: 22

PostPosted: Sun Aug 16, 2015 4:14 am    Post subject: Reply with quote

Yup, it seems be the best solution. Hope, trigger like this "#action {%i{enemy1|enemy2|enemy3}{,|.| and}} {...}" will do the trick.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Tue Aug 23, 2016 9:29 pm    Post subject: Reply with quote

Another optimization is to keep the number of variables under 100.

One way to do this is to nest variables where possible. Like using #var {enemy} {{1}{x}{2}{y} rather than using #var enemy1 x, #var enemy 2 y.
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