Welcome to the Builder Academy

Question Trigger of The Day %recho%

More
24 Feb 2018 00:24 #7624 by Fizban
This isn't a new command perse, but it was something added by Mordecai and never fully documented so I don't think it's gotten much use.

I originally had a script that looked like this:
Code:
Name: 'Mob Death Command', VNum: [40606], RNum: [ 1700] Trigger Intended Assignment: Rooms Trigger Type: Command , Numeric Arg: 100, Arg list: dead Commands: if %actor.vnum% == 40604 eval deadmouthers %deadmouthers% + 1 global deadmouthers if %deadmouthers% == 3 wait 60 s %at% 40610 %echo% A grating sound like metal sliding on stone echoes throughout the area. %at% 40610 %echo% A writhing mass of silver serpents slither out of the cracks in the walls, %at% 40610 %echo% their teeth gnashing and metallic scales ringing as they descend! %at% 40611 %echo% A grating sound like metal sliding on stone echoes throughout the area. %at% 40611 %echo% A writhing mass of silver serpents slither out of the cracks in the walls, %at% 40611 %echo% their teeth gnashing and metallic scales ringing as they descend! %at% 40612 %echo% A grating sound like metal sliding on stone echoes throughout the area. %at% 40612 %echo% A writhing mass of silver serpents slither out of the cracks in the walls, %at% 40612 %echo% their teeth gnashing and metallic scales ringing as they descend! %echo% A grating sound like metal sliding on stone echoes throughout the area. %echo% A writhing mass of silver serpents slither out of the cracks in the walls, %echo% their teeth gnashing and metallic scales ringing as they descend! %at% 40612 %load% mob 40606 %at% 40612 %load% mob 40606 %at% 40612 %load% mob 40606 unset deadmouthers end elseif %actor.vnum% == 40606 eval deadserpents %deadserpents% + 1 global deadserpents if %deadserpents% == 3 wait 5 s %load% obj 40605 %at% 40614 %load% obj 40605 %at% 40610 %echo% The wall to the south suddenly shatters in a shower of rubble and dust! %at% 40610 %echo% The ground quakes as a colossal, elephantine beast of rocky, armored plates %at% 40610 %echo% presses forward. Elaborate horns crown its head, and multiple rock-encrusted %at% 40610 %echo% tusks jut from its toothy maw. With a bellowing roar, the creature shakes its %at% 40610 %echo% massive head in challenge, then paws the ground and charges. %at% 40611 %echo% The wall to the south suddenly shatters in a shower of rubble and dust! %at% 40611 %echo% The ground quakes as a colossal, elephantine beast of rocky, armored plates %at% 40611 %echo% presses forward. Elaborate horns crown its head, and multiple rock-encrusted %at% 40611 %echo% tusks jut from its toothy maw. With a bellowing roar, the creature shakes its %at% 40611 %echo% massive head in challenge, then paws the ground and charges. %at% 40612 %echo% The wall to the south suddenly shatters in a shower of rubble and dust! %at% 40612 %echo% The ground quakes as a colossal, elephantine beast of rocky, armored plates %at% 40612 %echo% presses forward. Elaborate horns crown its head, and multiple rock-encrusted %at% 40612 %echo% tusks jut from its toothy maw. With a bellowing roar, the creature shakes its %at% 40612 %echo% massive head in challenge, then paws the ground and charges. %echo% The wall to the south suddenly shatters in a shower of rubble and dust! %echo% The ground quakes as a colossal, elephantine beast of rocky, armored plates %echo% presses forward. Elaborate horns crown its head, and multiple rock-encrusted %echo% tusks jut from its toothy maw. With a bellowing roar, the creature shakes its %echo% massive head in challenge, then paws the ground and charges. %load% mob 40605 %door% 40613 south room 40614 %door% 40614 north room 40613 unset deadserpents end end

That's 55 lines. I knew I could also write it this way and save a few lines:
Code:
Name: 'Mob Death Command', VNum: [40606], RNum: [ 1700] Trigger Intended Assignment: Rooms Trigger Type: Command , Numeric Arg: 100, Arg list: dead Commands: if %actor.vnum% == 40604 eval deadmouthers %deadmouthers% + 1 global deadmouthers if %deadmouthers% == 3 wait 60 s set num 40610 while %num% < 40614 %at% %num% %echo% A grating sound like metal sliding on stone echoes throughout the area. %at% %num% %echo% A writhing mass of silver serpents slither out of the cracks in the walls, %at% %num% %echo% their teeth gnashing and metallic scales ringing as they descend! eval num %num% + 1 done %at% 40612 %load% mob 40606 %at% 40612 %load% mob 40606 %at% 40612 %load% mob 40606 unset deadmouthers end elseif %actor.vnum% == 40606 eval deadserpents %deadserpents% + 1 global deadserpents if %deadserpents% == 3 wait 5 s %load% obj 40605 %at% 40614 %load% obj 40605 set num 40610 while %num% < 40614 %at %num% %echo% The wall to the south suddenly shatters in a shower of rubble and dust! %at %num% %echo% The ground quakes as a colossal, elephantine beast of rocky, armored plates %at %num% %echo% presses forward. Elaborate horns crown its head, and multiple rock-encrusted %at %num% %echo% tusks jut from its toothy maw. With a bellowing roar, the creature shakes its %at %num% %echo% massive head in challenge, then paws the ground and charges. eval num %num% + 1 done %load% mob 40605 %door% 40613 south room 40614 %door% 40614 north room 40613 unset deadserpents end end

That's 39 lines.

What I didn't know till digging in the code is that there's a third way to write it to make it even shorter:
Code:
Name: 'Mob Death Command', VNum: [40606], RNum: [ 1700] Trigger Intended Assignment: Rooms Trigger Type: Command , Numeric Arg: 100, Arg list: dead Commands: if %actor.vnum% == 40604 eval deadmouthers %deadmouthers% + 1 global deadmouthers if %deadmouthers% == 3 wait 60 s %recho% 40610 40613 A grating sound like metal sliding on stone echoes throughout the area. %recho% 40610 40613 A writhing mass of silver serpents slither out of the cracks in the walls, %recho% 40610 40613 their teeth gnashing and metallic scales ringing as they descend! %at% 40612 %load% mob 40606 %at% 40612 %load% mob 40606 %at% 40612 %load% mob 40606 unset deadmouthers end elseif %actor.vnum% == 40606 eval deadserpents %deadserpents% + 1 global deadserpents if %deadserpents% == 3 wait 5 s %load% obj 40605 %at% 40614 %load% obj 40605 %recho% 40610 40613 The wall to the south suddenly shatters in a shower of rubble and dust! %recho% 40610 40613 The ground quakes as a colossal, elephantine beast of rocky, armored plates %recho% 40610 40613 presses forward. Elaborate horns crown its head, and multiple rock-encrusted %recho% 40610 40613 tusks jut from its toothy maw. With a bellowing roar, the creature shakes its %recho% 40610 40613 massive head in challenge, then paws the ground and charges. %load% mob 40605 %door% 40613 south room 40614 %door% 40614 north room 40613 unset deadserpents end end

That's 31 lines.

%recho% # # <message>

echoes the message to every room in the range of #-#.

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

More
27 Feb 2018 20:35 #7634 by thomas
Replied by thomas on topic Trigger of The Day %recho%
W00T - a feature even I didn't remember :)

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

More
02 Mar 2018 00:56 #7644 by Sascha
Replied by Sascha on topic Trigger of The Day %recho%
I've been playing with this and just to clarify, you do need to put in a range of rooms. It does not work if you only %recho% in one room. For example, if something happens in one location and you want something to recho in another room entirely, and only that one room, you can't put '%recho% (room vnum) (message)' and have it work. You get this error:
Code:
[ Mob (Sahra, VNum 22017):: mrecho called with too few args ]

However, if you do '%recho% (room vnum) (room vnum) (message)', where both of the room vnums are the same, it works just fine.

Will you stand against the coming Storm? After the Breaking: STORMRIDERS MUD - atbmud.dune.net port 4000

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

More
02 Mar 2018 09:24 - 02 Mar 2018 09:25 #7646 by JTP
Replied by JTP on topic Trigger of The Day %recho%
It just doesnt make sense to do %recho% 1000 1000 message

Might as Well just to %echo% message


But Im glad to hear about recho, i Can surely use it instead of having to attach to several rooms
Last edit: 02 Mar 2018 09:25 by JTP.

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

More
02 Mar 2018 13:28 #7647 by Sascha
Replied by Sascha on topic Trigger of The Day %recho%
The %recho% 100 100 message format is something I'm using when in room A, upon a certain action, I want there to be an echo in room B, but only if conditions C and D are met. It works. *shrug*

Will you stand against the coming Storm? After the Breaking: STORMRIDERS MUD - atbmud.dune.net port 4000

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

Time to create page: 0.204 seconds