|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 167
|
Posted: Wed May 06, 2020 5:20 am
Multi-part question each part depending on previous... |
Looking to potentially write an alias to set specific parameters and initalize a #FORALL
skill "recipe <name> <GI> <TH> <NI> <TI> <HE> <SA> <WO>"
*herb list "ginseng|thyme|nightshade|tigerroot|hemlock|sage|wolfsbane"
*name "1|5|10|15|20|25|30|35|40|45|50"
example "recipe GI_1 1 0 0 0 0 0 0"|"recipe GI_5 5 0 0 0 0 0 0"|"recipe GI_10 10 0 0 0 0 0 0"...
I feel like nesting FORALL is not something I want to do as I want to try and have it do the Name list for each Herb list, and "test GI_1" to log results. |
|
|
|
hpoonis2010 Adept
Joined: 18 Jun 2019 Posts: 279
|
Posted: Thu May 07, 2020 8:11 am |
You can nest SWITCH commands.
#SW (test1a) {}
(test1b) {
#SW (test2a {}
(test2b) {}
}
(test1c) {} |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4662 Location: Pensacola, FL, USA
|
Posted: Thu May 07, 2020 12:01 pm |
If this is supposed to be a recipe book of sorts, why bother to include the 0 of ingredients not being used?
It seems like superfluous data and unnecessary work.
It CAN be done, but to what end?
I feel like I need more information to give you your desired results. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 167
|
Posted: Thu May 07, 2020 12:38 pm |
You had previously helped on the same subject a year or two back, but they changed some things and the old method was moot.
I was able to adapt the previous stuff (**sorta**) to work, just not how it was originally intended.
Code: |
// Create recipe
$name=%prompt("", "Enter the name of the recipe.")
$recipe=%db(@RecipeResearch, $name)
$type=Recipe
$this=%db($recipe, $type)
#ADDKEY $this GI %prompt("0", "How many GINSENG are used in this recipe?")
#ADDKEY $this TH %prompt("0", "How many THYME are used in this recipe?")
#ADDKEY $this NI %prompt("0", "How many NIGHTSHADE are used in this recipe?")
#ADDKEY $this TI %prompt("0", "How many TIGERROOT are used in this recipe?")
#ADDKEY $this HE %prompt("0", "How many HEMLOCK are used in this recipe?")
#ADDKEY $this SA %prompt("0", "How many SAGE are used in this recipe?")
#ADDKEY $this WO %prompt("0", "How many WOLFSBANE are used in this recipe?")
#ADDKEY $recipe $type $this
#ADDKEY RecipeResearch $name $recipe
recipe $name $this.GI $this.TH $this.NI $this.TI $this.HE $this.SA $this.WO
// test sample, record results
test $name
|
https://tinyurl.com/y8dyedlq just copy/pasted the results to this.
the combination of herbs have a potential to +all stat but I wanted to know what each herb did on it's on and to what strength.
discovered the cap bonus increases with level. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4662 Location: Pensacola, FL, USA
|
Posted: Fri May 08, 2020 1:50 am |
So the game actually requires you to send a bunch of zeros when making a given recipe?
If not, I think i would be doing:
$gi=%prompt("0", "How many GINSENG are used in this recipe?")
#IF ($gi) {#ADDKEY $this GI $gi}
Otherwise, I'm still not sure what part of this you are actually having trouble with. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 167
|
Posted: Fri May 08, 2020 4:30 am |
Yea its dumb for the extra 0's. As for what I want to do it's changed slightly... I have a pair of #C+ #C- to capture and send the test results to file,
I would like to potentially turn that into the database but it's not super imperative as I just did the copy pasted tinyurl above for each result...ugh |
|
|
|
hpoonis2010 Adept
Joined: 18 Jun 2019 Posts: 279
|
Posted: Fri May 08, 2020 6:34 am |
I don't think imperative uses an extra superlative.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4662 Location: Pensacola, FL, USA
|
Posted: Fri May 08, 2020 5:36 pm |
Well, it seems like the stronger versions of the potion are the same exact recipe just in larger portions.
But it seems the effects do not scale linearly, leaving quite a few holes in your database.
Can you only increase potency by a factor of 5?
Do you care about more than the highest potency you can make at a given level?
Seems to me you need another key in your recipe database:
$pot=%db($this, Potency)
$power=%db($pot, @myLevel)
Then by referencing this, you would know what numbers to multiply the base recipe for at any given time. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 167
|
Posted: Fri May 08, 2020 6:12 pm |
No I can use any given amount between 0-max possible (which is based on level. my current is 101... )
**side note that it's not a simple equation, I have yet to figure it out. only that it increases by 1 every 6 levels.
I was only using a factor of 5 to try to see a decernable value for potency scale but haven't done the math on that yet.
If I used a GI_0 TH_24 NI_0 TI_40 HE_0 SA_0 WO_0 I get a concoction that is +12 for all stats except con +0 HP 55 CP 5
@hpoonis2010 Intelligence is not my stongpoint, neither is proper english... I am a high school drop out after all. |
|
|
|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 167
|
Posted: Fri May 15, 2020 6:39 am |
Ended up re-writing the original alias entirely as the mud changed things to invalidate the data I was trying to record from my previous thread concerning this topic.
new alias (and far from eligant)
Code: |
//-- New testing method
$herbType = %1
$herbMin = %2
$herbMax = %3
$Factor = %4
$herbCount = $herbMin
#SWITCH ($herbType = GI) {#WHILE ($herbCount <= $herbMax) {$name = %concat($herbType,"_",$herbCount);#SENDRAW {recipe $name $herbCount 0 0 0 0 0 0};#WA 2000;test $name; $herbCount = ($herbCount + $Factor)}}
($herbType = TH) {#WHILE ($herbCount <= $herbMax) {$name = %concat($herbType,"_",$herbCount);#SENDRAW {recipe $name 0 $herbCount 0 0 0 0 0};#WA 2000;test $name; $herbCount = ($herbCount + $Factor)}}
($herbType = NI) {#WHILE ($herbCount <= $herbMax) {$name = %concat($herbType,"_",$herbCount);#SENDRAW {recipe $name 0 0 $herbCount 0 0 0 0};#WA 2000;test $name; $herbCount = ($herbCount + $Factor)}}
($herbType = TI) {#WHILE ($herbCount <= $herbMax) {$name = %concat($herbType,"_",$herbCount);#SENDRAW {recipe $name 0 0 0 $herbCount 0 0 0};#WA 2000;test $name; $herbCount = ($herbCount + $Factor)}}
($herbType = HE) {#WHILE ($herbCount <= $herbMax) {$name = %concat($herbType,"_",$herbCount);#SENDRAW {recipe $name 0 0 0 0 $herbCount 0 0};#WA 2000;test $name; $herbCount = ($herbCount + $Factor)}}
($herbType = SA) {#WHILE ($herbCount <= $herbMax) {$name = %concat($herbType,"_",$herbCount);#SENDRAW {recipe $name 0 0 0 0 0 $herbCount 0};#WA 2000;test $name; $herbCount = ($herbCount + $Factor)}}
($herbType = WO) {#WHILE ($herbCount <= $herbMax) {$name = %concat($herbType,"_",$herbCount);#SENDRAW {recipe $name 0 0 0 0 0 0 $herbCount};#WA 2000;test $name; $herbCount = ($herbCount + $Factor)}}
#IF ($herbCount >= $herbMax) {#SENDRAW {herbs}}
|
|
|
|
|
|
|