Working with Multiple Variables
Posted: Fri Jul 22, 2016 9:31 pm
I'm playing a MUD where commodities have a short name such as "iron" and a long name such as "an iron ore". You can get these from infiltrating legions, and I have a basic alias/trigger combo set up to do this, but I have to manually change the commodity type in the trigger, which I'd rather streamline.
I don't know the best way to do this, maybe a variable table? I'm a newcommer to Mudlet and don't really know much about scripting, but if anyone has any ideas or can help that'd be great.
Here's what I have so far. The bolded parts are an example of the variance between the commodity/item labels. I'd like to somehow be able to set the commodity longname to a variable which can be used alongside the shortname, something where "some refined spice" and "spice" are equivalent and interchangeable?
Alias: ^i (dye|wood|salt|gold|silver|wool|iron|tin|bronze|marble|gem|leather|silk|flint|rope|yarriol|spice)$
send("infiltrate "..t.." "..matches[2] )
echo("Infiltrating for: "..matches[2])
Trigger: Your infiltration of the corps "(.*)" is successful and you pilfer some refined spice
send("open pack ")
send("put spice in pack ")
send("close pack ")
send("infiltrate "..t.." spice ")
send("who ")
I don't know the best way to do this, maybe a variable table? I'm a newcommer to Mudlet and don't really know much about scripting, but if anyone has any ideas or can help that'd be great.
Here's what I have so far. The bolded parts are an example of the variance between the commodity/item labels. I'd like to somehow be able to set the commodity longname to a variable which can be used alongside the shortname, something where "some refined spice" and "spice" are equivalent and interchangeable?
Alias: ^i (dye|wood|salt|gold|silver|wool|iron|tin|bronze|marble|gem|leather|silk|flint|rope|yarriol|spice)$
send("infiltrate "..t.." "..matches[2] )
echo("Infiltrating for: "..matches[2])
Trigger: Your infiltration of the corps "(.*)" is successful and you pilfer some refined spice
send("open pack ")
send("put spice in pack ")
send("close pack ")
send("infiltrate "..t.." spice ")
send("who ")