I wanted to circle back to this - here's an instance where I'd like to have responses to my BUY command trigger that cover three instances:
1 if the player types the correct argument (life or lives)
2 an incorrect argument (whatever)
3 an empty argument.
This is what I could come up with - measuring the first word in the argument and if it's less than 1 (no text was inputted after the buy command) give that third option of "Okay, is there something you'd like to buy?" But after all of this argument logic talk I wanted to ask... is there a better (KISS) way?
Name: 'Life Saleswoman', VNum: [ 143], RNum: [ 21]
Trigger Intended Assignment: Mobiles
Trigger Type: Command , Numeric Arg: 100, Arg list: buy
Commands:
*TRIGGER 143*
set cost-1000
set word %arg.car%
if %actor.is_pc%
set length %word.strlen%
if lives == %arg% || life == %arg%
if %actor.lives% >=30
tell %actor.name% You already have plenty of lives. Go out there and make bad decisions!
elseif %actor.gold% < 1000
tell %actor.name% Sorry, but you just don't have the credits...
else
tell %actor.name% That will be 1,000 credits. Thank you!
nop %actor.gold(%cost%)%
nop %actor.lives(1)%
end
elseif %length% < 1
tell %actor.name% Okay, but what would you like to buy? A life, perhaps?
else
tell %actor.name% You can't buy %arg% from me, only a life.
end
end
_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_
Making 3M Great Again!
telnet://3m.funcity.org:3000
_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_