here's another custom command to make a secret door work. again, there are probably things i could have done better/different.
@arguments is the stuff you type after the 'command' - which is 'slide'.
the #@input stuff converts the '@arguments' into useable words, that are put into a numbered order for later use ( via 'stringToWords' ) and then strips off extraneous, useless words like is, an, a...( via 'filterActionWords' )....
so...typing 'slide the panel' would mean @input->1 is panel, due to the stripping of the 'the'.
this may be clearer in the 'bet' command, as i use the same structure to extract 'the amount bet', and 'game bet on' from a command such as 'bet 5000 on big'. @input->1 is the 'amount' and @input->2 is the 'game type'....on is stripped in the filterActionWords function.
this all makes sense to ME, but if i have terribley buggered the explanation, please correct me blob!
Code:
custom_command_act
slide
Code:
if %isNpc( @actor )
return
endif
@input = @arguments
@input = %stringToWords( @input )
@input = %filterActionWords( @input )
@exit = %getRoomExits( @roomNumber )->north
@otherSide = %getExitStat( @exit, otherSide )
if %( @input->1 ) == panel
%setExitStat( @exit, isClosed, 0 )
%setExitStat( @otherSide, isClosed, 0 )
echoto room all The panel slides open.
at 10000 echoto room all The panel slides open.
wait 5 secs
%setExitStat( @exit, isClosed, 1 )
%setExitStat( @otherSide, isClosed, 1 )
echoto room all The panel slides shut.
at 10000 echoto room all The panel slides shut.
endif