Ok - so, in the mud i play, one of the many things you can do is take goods from one 'tradepost' to another - and of course can check values before running so you can pick and choose more profitable runs.
i currently have an array of the goods that can be valued, and a script that runs through that array and does the value command for each (eg. "value pearls") - unfortunately, i'm having trouble actually storing the value per item via a trigger. i think the problem is, the script outputs all of the value statements before the mud processes them, so i lose the current index in the array , and the mud response does not include the good's name, but the container it's packed in, so i can't go through the array and compare by that.
having said all that - here's what i have so far, forgive the junky code please :P
first i have:
public tradeArr(87,4) - this holds, among other things, the goods names (col 0), the maximum number that will fit in a wagon (col 1), the trade post they are located (col 3), and in theory, the value per item (col 2) and the product of columns 1 and 2 (held in column 4). as far as i can tell, the columns that are static (0,1,and 3) are just fine, so i don't think my problem stems directly from an array problem.
after this, i have code that runs through the array, pulls the goods name from it and sends the trade command to the mud. this is just a simple loop that works quite well :P
i also have a trigger that is set to respond to the mud's output when it recieves the value command:
the output: We will pay you 1234 gold for each case.
note that the 1234 and 'case' vary from good to good
my trigger:
<trigger
enabled="y"
match="We will pay you * gold for each *."
send_to="10"
sequence="100"
other_text_colour="black"
other_back_colour="black"
>
<send>/setVal %1</send>
</trigger>
the setval script is well, an attempt to make use of a global counter and write to the array. it failed. i just have the script reporting the gold to world.note at the moment, which it does quite well...
basically what i need is a way to write the gold to the array in the proper place. any input is of course welcome, let me know if you need to see some/all of my code, i don't want to spam the message after such a lengthy explanation :P
-ans |