trigger builing problem

Posted by Dragonlord on Wed 25 Mar 2015 08:39 PM — 5 posts, 21,269 views.

#0
You take 3 of a silver runestone from Vandemaar's Reagent Bag.
You take 3 of a browning mandrake leaf from Vandemaar's Reagent Bag.
You take 3 of a feather from a roc from Vandemaar's Reagent Bag.
You take 5 of a shimmering white fish scale from Vandemaar's Reagent Bag.
You take 2 of a sunstone from Vandemaar's Reagent Bag.
You take 3 of a pinch of sulfur from Vandemaar's Reagent Bag.

[839, 335]
[***][-/][safe]<2241hp 2255sp 1976st>
You need to reword your request - type 'commands' for a full list.

[839, 335]
[***][-/][safe]<2241hp 2255sp 1976st>
You drop a shimmering white fish scale.
A shimmering white fish scale vanishes in a puff of smoke.
You drop a shimmering white fish scale.
A shimmering white fish scale vanishes in a puff of smoke.
You drop a shimmering white fish scale.
A shimmering white fish scale vanishes in a puff of smoke.
You drop a shimmering white fish scale.
A shimmering white fish scale vanishes in a puff of smoke.
You drop a shimmering white fish scale.
A shimmering white fish scale vanishes in a puff of smoke.

[839, 335]
[***][-/][safe]<2241hp 2255sp 1976st>
There is no command 'else'. You may have meant: se, nose, cls, use, eye, east, rose, flee, clue
Type 'commands' for a list of commands.

[839, 335]
[***][-/][safe]<2241hp 2255sp 1976st>
There is no command 'end'. You may have meant: n, e, d, ne, nw, ni, ten, nod, eat
[***][-/][safe]<2241hp 2255sp 1976st>
You close Vandemaar's Reagent Bag.


<triggers>
<trigger
enabled="y"
group="(reagents)"
ignore_case="y"
keep_evaluating="y"
match="Your Vandemaar's Reagent Bag glows white as it accumulates possessions from the ether."
regexp="y"
send_to="10"
sequence="100"
>
<send>open itemg
get all itemg

if (You aren't carrying anything that will fit into a blue silk bag) then
drop all.reagent-water
else (put all.reagent-water waterreagents)
end -- if

if (You aren't carrying anything that will fit into a red silk bag) then
drop all.reagent-fire
else (put all.reagent-fire firereagents)
end -- if

if (You aren't carrying anything that will fit into a yellow silk bag) then
drop all.reagent-air&#9;
else (put all.reagent-air airreagents)
end

if (You aren't carrying anything that will fit into a black silk bag) then
drop all.reagent-earth
else (put all.reagent-earth earthreagents)
end -- if

if (You aren't carrying anything that will fit into a woven silver bag) then
drop all.gem
else (put all.gem gemreagents)
end -- if

if (You aren't carrying anything that will fit into a woven gold bag) then
drop all.reagent-ethereal
else (put all.reagent-ethereal ethrealreagent)
end -- if

close itemg
</send>
</trigger>
</triggers>

what this meant to do was to fill the reagent bags but if they was full then drop the reagents items
Australia Forum Administrator #1

 if (You aren't carrying anything that will fit into a blue silk bag) then


I'm not sure what this is. Is this some kind of pseudo-code for what you want to achieve?
USA #2
Part of the problem is you're sending the code you're attempting to process for your trigger to the mud. You can't send conditional statements to the mud like that, the command parser on the server has absolutely no idea what you're attempting to do.

That said, giving us actual output from the mud is a good start. The trigger is going to have to be completely rewritten though and possibly converted into several triggers based on which items are in play.

Nick, I'm pretty sure that's the response he's getting from the mud if the bag is full and wants to drop a reagent group in response to.
#3
Ok, the first part of the trigger receives,
"Your Vandemaar's Reagent Bag glows white as it accumulates possessions from the ether."

The Vandemaar's Reagent Bag has a keyword of itemg <-- itemg = itemgenerator

The second part of the trigger goes into opening the bag and getting the reagents from the itemgenerator

1) checks if my water reagent can be added to the bag, and if it gets a response, "You aren't carrying anything that will fit into a blue silk bag" it drops all the water reagents

if (You aren't carrying anything that will fit into a blue silk bag) then
drop all.reagent-water

2) If does get the first response then if proceeds with putting all water reagents into the blue silk bag.

else (put all.reagent-water waterreagents)

It looks like I am not proceeding to the second part of the trigger because it is dropping all my reagents

end -- if

<triggers>
<trigger
enabled="y"
group="(reagents)"
ignore_case="y"
keep_evaluating="y"
match="Your Vandemaar's Reagent Bag glows white as it accumulates possessions from the ether."
regexp="y"
send_to="10"
sequence="100"
>
<send>open itemg
get all itemg

if (You aren't carrying anything that will fit into a blue silk bag) then
drop all.reagent-water
else (put all.reagent-water waterreagents)
end -- if

if (You aren't carrying anything that will fit into a red silk bag) then
drop all.reagent-fire
else (put all.reagent-fire firereagents)
end -- if

if (You aren't carrying anything that will fit into a yellow silk bag) then
drop all.reagent-air&#9;
else (put all.reagent-air airreagents)
end

if (You aren't carrying anything that will fit into a black silk bag) then
drop all.reagent-earth
else (put all.reagent-earth earthreagents)
end -- if

if (You aren't carrying anything that will fit into a woven silver bag) then
drop all.gem
else (put all.gem gemreagents)
end -- if

if (You aren't carrying anything that will fit into a woven gold bag) then
drop all.reagent-ethereal
else (put all.reagent-ethereal ethrealreagent)
end -- if

close itemg
</send>
</trigger>
</triggers>
USA #4
The problem is you can't send that directly to the mud because the mud command parser has no idea what you're doing. Those invalid command messages you got were the mud failing to recognize if else or end as legitimate input and it processed the only command it recognized dropping your reagents.

You're going to need to either create separate triggers for each of the full bags (quick and simple but lots of triggers) or do some advanced scripting work to process the results of opening the first bag in one pass.