|
daemoan.vermillious Apprentice
Joined: 28 Feb 2009 Posts: 135 Location: Chico, Ca
|
Posted: Wed Nov 11, 2009 5:15 am
random trigger thing - make believe? |
if I had a variable with a value like this?
bagvar
Value:
{One|Two|Three|Four|Five}
I made this up, I seen something somewhere like that.....
and i had a trigger like this
Pattern:
It is not in the bag.
Value:
Get %random@bagvar
I made that up too , it prolly donsnt work...
What can I do ?
Thanks |
|
|
|
orphean Apprentice
Joined: 21 Oct 2008 Posts: 147 Location: Olympia, WA
|
Posted: Wed Nov 11, 2009 6:02 am |
First off, I'm not sure what you're asking.
If you're just trying to send a random item from a string list to the mud the way you are using just %random isn't going to work. From the documentation:
Quote: |
random
Syntax: %random(min,max)
return a random integer >= min and <= max. |
The script for the second pattern should be more like:
Quote: |
get %item(@bagvar, %random(1, %numitems(@bagvar))) |
If you could clarify what issue you're having that would help ensure you get help. |
|
|
|
daemoan.vermillious Apprentice
Joined: 28 Feb 2009 Posts: 135 Location: Chico, Ca
|
Posted: Wed Nov 11, 2009 6:41 am |
I carry a bag around with healing friuts I jsut wanted it to "randomly" take one out every 30 ticks and eat it
at each feeding it would randomly pull one from the list
I wasnt having an issue I just didnt know how to do it... and wanted to know what would work.
but I was just using the numbers as an example
{Grapefruit|Bannana|Pear|Apple|Orange}
if this is so like this, this will still work?
get %item(@bagvar, %random(1, %numitems(@bagvar)))
Sry Spent last 2 days slowly absorbing different scripting techniques. getting jummbled...
thanks |
|
|
|
orphean Apprentice
Joined: 21 Oct 2008 Posts: 147 Location: Olympia, WA
|
Posted: Wed Nov 11, 2009 6:59 am |
Yep that will work for that. Every time it gets called it will send 'get <random fruit from list>' to the mud.
|
|
|
|
orphean Apprentice
Joined: 21 Oct 2008 Posts: 147 Location: Olympia, WA
|
Posted: Wed Nov 11, 2009 7:01 am |
Also if @bagvar never changes you can replace %numitems(@bagvar) with the number of fruits in your list.
|
|
|
|
|
|