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

functions in prompts?

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



Joined: 22 Mar 2008
Posts: 31

PostPosted: Thu Apr 03, 2008 7:51 am    Post subject: functions in prompts? Reply with quote

Code:
#var {lowhp} {600}
#function {hpalert} {
  #if {%1 < $lowhp} {#var {result} {<119>%1} {%1}}
}
#prompt {^<%1/%2hp %3> } {@hpalert{%1}/%2hp %3: }


Calling a function from within the #prompt command makes the %2 argument disappear. If I change the order of the arguments, it's always %2 that gets displayed as empty.

Also, the "<119>" returned by the function doesn't get displayed as a color code in the prompt line.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Thu Apr 03, 2008 9:51 am    Post subject: Reply with quote

Definitely a bug, I'll have it fixed for the next release.

btw,

#if {%1 < $lowhp} {#var {result} {<119>%1} {%1}}

should be:

#if {%1 < $lowhp} {#var {result} {<119>%1} {#var result %1}}
Back to top
View user's profile Send private message Send e-mail
Quackers



Joined: 22 Mar 2008
Posts: 31

PostPosted: Thu Apr 03, 2008 10:16 am    Post subject: Reply with quote

#if {%1 < $lowhp} {#var {result} {<119>%1}} {#var result %1}
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 -> 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