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

sub help

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



Joined: 08 Nov 2005
Posts: 3

PostPosted: Tue Nov 08, 2005 2:34 pm    Post subject: sub help Reply with quote

I have always got by with very basic triggers, so I don't really know much. Trying to figure something out.

I want to make any damage I inflict green, and any damaga that I take bright red. I got it to work, but I'm sure there is a better way to do this. What I did is just made a #sub for each damage type, actually 2 for each damage type. 1 for green, 1 for bright red.

So this is what I did....

#### my damage #####

#sub {^Your%0scratches%1} {Your%0<129>scratches<088>%1}
#sub {^Your%0grazes%1} {Your%0<129>grazes<088>%1}
#sub {^Your%0hits%1} {Your%0<129>hits<088>%1}
#sub {^Your%0injures%1} {Your%0<129>injures<088>%1}
#sub {^Your%0wounds%1} {Your%0<129>wounds<088>%1}

#### damage I am taking ######

#sub {%0scratches you%1} {%0<119>scratches<088> you%1}
#sub {%0grazes you%1} {%0<119>grazes<088> you%1}
#sub {%0hits you%1} {%0<119>hits<088> you%1}
#sub {%0injures you%1} {%0<119>injures<088> you%1}
#sub {%0wounds you%1} {%0<119>wounds<088> you%1}

Those are just a few from each one, but I have one for each of the damage types. It works so far, but wish to find a better way. Maybe using some other options in the client to help me learn.

One thing I was thinking (again, I have little knowledge of what I am doing so this may sound wrong) is to have all the damage types in a list of variables. Then 2 triggers. I looked at the script page at the spell bot script for an idea. It of course doesnt work, but here it is. Just made a part of it to check if it would work.

#var damagetypes scratches grazes hits injures
#sub {^Your%0${damagetypes}%1} {Your%0<129>${damagetypes}<088>%1}

Hopefully you can see what I was attempting to try. Another problem is some of the higher damages have *'s and spaces in them. *** OBLITERATES *** So that would probably present another problem in this even if the beginning part worked.

The idea of all this is that I wish to learn. So any ideas, reading material, etc would be great. Thanks in advance.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Tue Nov 08, 2005 8:12 pm    Post subject: Reply with quote

Possibly you can make more accurate triggers by turning them into color triggers and matching color codes as well. You can do this by starting them with a ~.

Use #config convert on, to see color codes.


There's currently not a good way to deal with this, Zmud allows using {he|she|it} but I haven't gotten around to adding this, and you can sort of work around this with actions, though substitutions are difficult.

You can use the following though:

#var damagetypes {{scratches} {*** OBLITERATES ***} {injures}}

#forall {$damagetypes} {#sub {^Your%0&0%1} {Your%0<129>&0<088>%1}}
Back to top
View user's profile Send private message Send e-mail
unlock



Joined: 08 Nov 2005
Posts: 3

PostPosted: Tue Nov 08, 2005 9:48 pm    Post subject: Reply with quote

Can you tell me what the &0 does? I see somewhat what it does, but cant seem to find a help file on what it really does. Seems to be used alot in the script files and would be good to know.

Pretty much, how does it know where to get the value from. %0 became everything after ^Your and before &0. &0 became a certain value from $damagetypes which #forall controlled. But how did &0 decide to look at $damagetypes when it wasnt even a part of it. It was part of #sub and completely separate.

Hope you can understand my question. Smile

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


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Wed Nov 09, 2005 3:36 am    Post subject: Reply with quote

&0 is the same as the $forall variable. It's not well documented atm. The #sub is within the body of the #forall command.
Back to top
View user's profile Send private message Send e-mail
moebius



Joined: 27 Jan 2005
Posts: 96

PostPosted: Thu Dec 08, 2005 1:58 am    Post subject: Reply with quote

If your main goal is to color the message, it might be simpler to use #highlight instead of #sub.

i.e.

#highlight {^Your%0scratches%1} {green}

#highlight {^%0scatches you%1} {bold red}
_________________
StrangeMUD - strangemud.net:9332
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 -> 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