 |
Ambelghan Novice
Joined: 04 Apr 2010 Posts: 49
|
Posted: Tue Apr 06, 2010 10:10 pm
Help: Sending variables to Dragon Realms that have %item() in them. |
Hi, I am in Dragon Realms, and I was trying to make create a way to braid items. Here is the entire class code:
| Code: |
<class name="GrassBraiding" id="188">
<trigger priority="1890" id="189">
<pattern>{GrassBraidingStart|You need to have more material in your other hand to continue braiding}</pattern>
<value>rt = 1
l
igrassBraidingVar = 1
#T+ GrassBraidingAlarm</value>
</trigger>
<trigger name="GrassBraidingAlarm" type="Expression" priority="1910" id="191">
<pattern>@rt=0</pattern>
<value>%item(@grassBraidingVar,@igrassBraidingVar)</value>
</trigger>
<var name="grassBraidingVar" type="StringList" id="200">for grass|braid my grass|pull my grass|app my rope careful|put my rope in bin</var>
<var name="igrassBraidingVar" usedef="true" id="201">
<value>5</value>
<default>1</default>
</var>
<trigger priority="2020" id="202">
<pattern>You manage to find some grass</pattern>
<value>igrassBraidingVar = 2</value>
</trigger>
<trigger priority="2030" id="203">
<pattern>{You tug and pull on your|the bundling rope is worth|could become a good quality piece of bundling rope}</pattern>
<value>igrassBraidingVar = @igrassBraidingVar + 1</value>
</trigger>
<trigger priority="2040" id="204">
<pattern>You drop a braided bundling rope in a waste bin</pattern>
<value>#T- GrassBraidingAlarm
#T- GrassBraiding
#ECHO GrassBraidingDone</value>
</trigger>
</class>
|
It works well for what I want, but I decided to get a little fancy for when I happen to be some place where the disposal bin is not a bin itself but an urn or bucket. So I made this
| Code: |
<class name="TrashBins" id="207">
<var name="trashBinList" type="StringList" id="208">bin|crate|urn|bucket</var>
<var name="itrashBinList" usedef="true" id="209">
<value>1</value>
<default>1</default>
</var>
<trigger priority="2100" id="210">
<pattern>You also see * and * (%w).</pattern>
<value>itrashBinList = %ismember(%1,@trashBinList)</value>
</trigger>
</class>
|
Which also works well and selects the proper bin in the list. However, when I try to sub out, "put my rope in bin," in the grassBraidingVar's 5th position with, "put my rope in (%item(@trashBinList,@itrashBinList))" knowing that (%item(@trashBinList,@itrashBinList)) = bin. I get this as an output.
| Quote: |
>put my rope in (%item(@trashBinList,@itrashBinList))
What were you referring to?
|
There must be a way to make it evaluate the (%item(@trashBinList,@itrashBinList)) to bin. Ty for responses.[/quote] |
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Apr 06, 2010 11:13 pm |
In your trigger, you use an %item() call as though it's a game command or alias call. You can do this, but you can't cause function calls contained therein to be evaluated.
The proper way to send stuff to the mud that you want processed is via the #SEND command, but you might be better served by simply rethinking your script a bit. |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|