Welcome to the Builder Academy

Question Trigger of the Day - Advanced

More
18 Jun 2020 17:47 #8785 by Parnassus
I'm not understanding the problem. You didn't want to be able to to look south?

Please Log in or Create an account to join the conversation.

More
18 Jun 2020 18:32 #8787 by zi
Replied by zi on topic Trigger of the Day - Advanced
look without an argument returns WIN

it SHOULD return the room desc, etc.

now, when i type look in a direction, at an object, at a character, etc. i see that description. but look, without any argument, returns WIN

_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_
Making 3M Great Again!
telnet://3m.funcity.org:3000
_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_

Please Log in or Create an account to join the conversation.

More
19 Jun 2020 15:20 #8789 by rhade
Replied by rhade on topic Trigger of the Day - Advanced
When %arg% is empty, then ' is still a substring of 'test, which is why your trigger is firing. Change your if condition to be:

if %cmd.mudcommand% == look && %arg% && 'test /= '%arg%

Please Log in or Create an account to join the conversation.

More
19 Jun 2020 15:32 #8790 by zi
Replied by zi on topic Trigger of the Day - Advanced
THIS works...

if %cmd.mudcommand% == look
switch %arg%
case compass
%echo% WIN!
break
default
return 0
halt
break
done
else
return 0
end



it allows a mortal to look at the object (magic compass) and get WIN, allows him to look without argument and just see the room, allows him to look at anything specific and see the description..


the IF with the %keyword.contains('%arg%)% still triggers the command (or mud command) without the argument... try this bad boy::

set compass 'compass
if %cmd.mudcommand% == look && %compass.contains('%arg%)%
%echo% WIN!
else
return 0
end


type look with your mortal and you'll get WIN! am I missing something in my if statement?

and no, i'm not using the /= %arg% logic, that stinks

_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_
Making 3M Great Again!
telnet://3m.funcity.org:3000
_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_

Please Log in or Create an account to join the conversation.

More
20 Jun 2020 15:32 #8791 by Parnassus
Sorry, I hadn't realized that Rhade's message hadn't gone through.

But, yes, this is one that catches me every time! I love what I call "Fizban's Fix" especially since I've been in a room with a mob looking for /=king. If you tried talking in this room, the mob would talk about the king if you mentioned asking, talking, walking, killing or many other things.

However, as Rhade says, when you change "look {noarg}" to "look '{noarg}", you've now changed that noarg to an arg that matches your criteria since "look ' " is part of "look 'compass".

For more info on this matter:
Trigger of the Day - Mob Command Example
and /= .

Please Log in or Create an account to join the conversation.

Time to create page: 0.240 seconds