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

Broken #math command in 2.00.7?

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
R23DR



Joined: 18 Apr 2011
Posts: 14

PostPosted: Sun Jul 10, 2011 4:56 pm    Post subject: Broken #math command in 2.00.7? Reply with quote

Is this how things are supposed to work?

The following doesn't work:

Code:

#action {%i has arrived.$} {#if  {"%1" == "$target"} {kill $target}}


The following works:

Code:

#action {%i has arrived.$} {#if  {'%1' == '$target'} {kill $target}}


The following works:

Code:

#action {%1 has arrived.$} {#if  {'%1' == '$target'} {kill $target}}


The following works:

Code:

#action {%1 has arrived.$} {#if  {"%1" == "$target"} {kill $target}}


#help math shows:

Strings must be enclosed in " " and use regex with == and !=,
in the case of <= and >= the alphabetic order is compared.

and

Example: #action {%0 tells %1}
{#if {"%0" == "Bubba" && $afk} {reply I'm away, my friend.}}
When you are away from keyboard, it will only reply to your friend.

So I figured using "%1" == "$target" to compare strings in a #if would work. It looks like using %i or %1 in the action is affecting whether I need to use '%1' == '$target' or "%1" == "$target"

Is this how it's supposed to work or is there a bug?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun Jul 10, 2011 6:09 pm    Post subject: Re: Broken #math command in 2.00.7? Reply with quote

Code:

#action {%i has arrived.$} {#if  {"%1" == "$target"} {kill $target}}

%1 is never set in this trigger, as %i only enables ignore case for the remainder of the trigger. %I can be used to disable ignore.

Code:

#action {%i has arrived.$} {#if  {'%1' == '$target'} {kill $target}}

In 2.00.7 this results in: 0 == 0 which happens to be true, but it doesn't work as it triggers for anything.

Code:

#action {%1 has arrived.$} {#if  {'%1' == '$target'} {kill $target}}

Same as before, always true.

Code:

#action {%1 has arrived.$} {#if  {"%1" == "$target"} {kill $target}}

That's the only valid one of the bunch. You'd probably want to use:
Code:

#action {%1 has arrived.$} {#if  {"%1" == "%i$target"} {kill $target}}

That'll make the match case insensitive.
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 -> Bug Reports 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