Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Strakc
Apprentice


Joined: 31 Jan 2006
Posts: 106
Location: Virginia Beach, Virginia

PostPosted: Mon Feb 20, 2006 10:33 pm   

Interesting setup
 
alright i've got a trigger

Trigger line: * ~(&herb~) * * left.+
what it does: #IF (%ismember( @herb, @herbshere)) {#say %2} {#additem herbshere @herb}

now what I want to do is make a system or a single trigger add all these herbs to a list slowly pick them to 10, store them while it picks, and then moves to the next one down the list. I've got a setup to do a single plant at a time, but I'm not sure how to do the rest heh.
Reply with quote
Strakc
Apprentice


Joined: 31 Jan 2006
Posts: 106
Location: Virginia Beach, Virginia

PostPosted: Wed Feb 22, 2006 7:35 pm   
 
ok see this is what I get after using the command: plants

The following plants are growing in this room:
A plug of coltsfoot (coltsfoot) 18 left.
A sprig of chervil (chervil) 25 left.
A stem of galingale (galingale) 21 left.
A sprig of marjoram (marjoram) 21 left.
what I want to do is capture all the names in the "( )" and then start at the top and try to pick that herb to 10 then move to the next one. and if i dont have the skill to pick it, just remove it from the list.
Reply with quote
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: Wed Feb 22, 2006 8:59 pm   
 
We'll need a little more MUD output to get the aliases/triggers right. Please post a log showing (1) the 'plants' command and output, (2) a successful 'pick', (3) an unsuccessful 'pick'. Be sure to include your prompt at both ends, blank lines, etc. exactly as they come from the MUD, and put the whole thing in a [code] tag to preserve formatting.
_________________
Come visit Mozart Mud...and tell an imm that Aerith sent you!
Reply with quote
Strakc
Apprentice


Joined: 31 Jan 2006
Posts: 106
Location: Virginia Beach, Virginia

PostPosted: Wed Feb 22, 2006 10:21 pm   
 
#CLASS {Autoharvest}
#VAR amount {10}
#VAR herb {galingale}
#TRIGGER {You have recovered balance on all limbs.} {plants;#gag}
#TRIGGER {* ~(@herb~) * &amount left.} {#gag;#IF {@amount>10} {#say @herb:%eval( @amount-10) is left;harvest @herb;inr @herb;#trigger {Hmm, that wasn't the herb you thought after all. It was some rare spices!} {inr spices;#gag}} {#say No more;#Alarm +5 {#T- Autoharvest}};#gag}
#TRIGGER {The following plants are growing in this room:} {#gag}
#TRIGGER {* ~(*~) * * left.} {#gag}
#TRIGGER {Sargassum seaweed ~(sargassum~) * &amount left.} {#gag;#IF {@amount>10} {#say @herb:%eval( @amount-10) is left;harvest @herb;inr @herb;#trigger {Hmm, that wasn't the herb you thought after all. It was some rare spices!} {inr spices;#gag}} {#say No more;#wa 500;#T- Autoharvest};#gag} "" {disable}
#CLASS 0

This is a system I made which will pick one herb at a time, and have been trying to use this as the basis of the new system. Now I thought it would be easiest to use plants... which is this...

The following plants are growing in this room:
A plug of coltsfoot (coltsfoot) 18 left.
A sprig of chervil (chervil) 25 left. -- this is the output from the plants command used in the game.
A stem of galingale (galingale) 21 left.
A sprig of marjoram (marjoram) 21 left.

a failure message would be i guess the race spices trigger I use, but in this system the only triggers I use you can see.
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Thu Feb 23, 2006 1:15 am   
 
I think if you do a search for herb on here you will find MORE than enuf scripts to help you.
_________________
http://www.Aardwolf.com
Reply with quote
Strakc
Apprentice


Joined: 31 Jan 2006
Posts: 106
Location: Virginia Beach, Virginia

PostPosted: Thu Feb 23, 2006 2:50 am   
 
Most of the others rely on the one time amount couting, from one view then going down. and that wouldn't work here cause it could go up or down while your picking.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Feb 23, 2006 4:39 am   
 
After each pick, do plants again and pick the next in line that is >10?

Begin to develop a spice string list that you can use to remove spices from the plants to pick
Reply with quote
Strakc
Apprentice


Joined: 31 Jan 2006
Posts: 106
Location: Virginia Beach, Virginia

PostPosted: Thu Feb 23, 2006 5:03 am   
 
but if they are all above 10 then it would pick them all thats above 10 at one time and thats just not good cause I cant pick some of the herbs
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Feb 23, 2006 9:34 pm   
 
This is all on the fly code and is subject to errors.

Code:

#ALIAS Autoharvest 2{#T+ Autoharvest2;plants;#NOOP This starts the process}
#CLASS Autoharvest2
#TRIGGER PlantState {^The following plants are growing in this room: $} {
#VAR PlantStateItems  ""
  #TEMP PlantStateEnd {^$} {
    #STATE PlantState 0;
    #NOOP Lets remove all the things we cant "harvest / inr @herb" or "inr spices"
    #FORALL @PlantUnharvestable {#DELITEM PlantStateItems %i}
    #IF (!%null(@PlantStateItems) {DoHarvest %pop(PlantStateItems)} {#T- Autoharvest2;#ECHO Nothing left to harvest}
  }
}
#COND {^A*~((%w)~) (%d) left. } {#IF (%2 > 10) {#ADDITEM PlantStateItems %1} {#NOOP 10 or less!}} "" {loopat=99}

#VAR PlantSpices ""
#VAR PlantHerbs ""
#VAR PlantUnharvestable ""

#ALIAS DoHarvest {
  #IF (!%null(%1)) {
    #VAR herb %1
    #IF (%ismember(@herb ,@PlantHerbs)) {harvest @herb ;inr @herb}
    #IF (%ismember(@herb ,@PlantSpices)) {inr #herb;#NOOP Is this right for spices?}
  } {#ECHO Finished?  Tried to harvest nothing.;#T- AutoHarvest2}
}

//Case of trying to harvest a spice
#trigger {Hmm, that wasn't the herb you thought after all. It was some rare spices!} {#ADDITEM PlantSpices @herb;DoHarvest @herb;#NOOP Now it will try and harvest it as a spice}

//Case of trying to harvest or spice something that you can not.  Might need a trigger for trying to harvest a spice that is not
#trigger {Hmm, that wasn't the herb you thought after all. It was something that isnt harvestable or a rare spice your message here!} {#ADDITEM PlantUnharvestable @herb;#TEMP Balance {You have recovered balance on all limbs.} {plants}}

//Case where we succeed and want to relook for changes to the plants
#TRIGGER {{You pick a|You get the rare spice or whatever is seen}} {#TEMP Balance {You have recovered balance on all limbs.} {plants};#NOOP Check again to see if anything withered or grew before re-harvesting}
#CLASS 0
Reply with quote
Strakc
Apprentice


Joined: 31 Jan 2006
Posts: 106
Location: Virginia Beach, Virginia

PostPosted: Fri Feb 24, 2006 8:47 pm   
 
Hrm as I look at this, I am confused to what it does
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net