Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Almir
Newbie


Joined: 08 Dec 2005
Posts: 5

PostPosted: Thu Dec 08, 2005 6:22 pm   

btnenable help
 
So I've been trying to create a direction pad thing that will show the exits in a room using buttons, and am trying to make them enable and disable depending on if that direction is available. So far I have it working for all the compass points, just not up down and in, this is the script so far:

#TR {^You see exits leading (*).} {
#var validDirs %replace( %replace( %replace( "%1", ",", ""), "and ", ""), " ", "|")
%if( %ismember( "north", @validDirs), %btnenable( n, true), %btnenable( n, false))
%if( %ismember( "south", @validDirs), %btnenable( s, true), %btnenable( s, false))
%if( %ismember( "west", @validDirs), %btnenable( w, true), %btnenable( w, false))
%if( %ismember( "east", @validDirs), %btnenable( e, true), %btnenable( e, false))
%if( %ismember( "northwest", @validDirs), %btnenable( nw, true), %btnenable( nw, false))
%if( %ismember( "southeast", @validDirs), %btnenable( se, true), %btnenable( se, false))
%if( %ismember( "southwest", @validDirs), %btnenable( sw, true), %btnenable( sw, false))
%if( %ismember( "northeast", @validDirs), %btnenable( ne, true), %btnenable( ne, false))
}

This is working well so far, however the %btnenable function seems to be returning its state and sending it to the game. As a result, a mixture of eight 1s or 0s is sent to the game, causing the game to give me eight "I don't understand" message every time the script runs. Is there any way to stop the function doing this? Sorry if I'm doing something stupid here :P

Thanks a lot!
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Dec 08, 2005 7:46 pm   
 
#CALL will eat the result and you should be using #IF's instead of %ifs

#IF (%ismember( "north", @validDirs)) {#CALL %btnenable( n, true)} {#CALL %btnenable( n, false)}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
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

© 2009 Zugg Software. Hosted by Wolfpaw.net