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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Wed Oct 29, 2008 4:15 pm   

Achaea Harvest Script
 
Quick AutoHarvest I wrote for Achaea.
NOTE: This is for the new harvest system.

Code:
#CLASS {Harvest}
#ALIAS HarvestHelp {#ECHO %cr;#ECHO {Harvest Script Version: @HarvestVers};#ECHO {Authored by Ralgith of Zuggsoft Forums};#ECHO {Commands:};#ECHO {plants - this is the MUD command that shows you the plant list, and populates the variable.};#ECHO {doharvest - Initiates the harvesting command in your room};%cr}
#ALIAS doharvest {harvest %item( @PToH, 1);#T+ PerformHarvest}
#TRIGGER {^The following plants are growing in this room:$} {#CLASS {Harvest|Vars};#VAR PToH {};#CLASS 0;#T+ AddPlants;#T+ PromptCheck}
#TRIGGER "PromptCheck" {@Prompt} {#T- AddPlants;#T- PromptCheck;#ECHO {%numitems( @PToH) Plants Added For Harvesting}} "" {nocr|prompt}
#TRIGGER {You reach out and carefully harvest} {inr all %item( @PToH, 1)}
#CLASS 0
#CLASS {Harvest|Vars}
#VAR HarvestVers {1.8}
#VAR Prompt {%dh, %dm ex-}
#VAR PToH {}
#CLASS 0
#CLASS {Harvest|AddPlants} {disable}
#TRIGGER {^*~(%w (%w)~)%s%w$} {#CLASS {Harvest|Vars};#ADDITEM PToH %1;#CLASS 0}
#TRIGGER {^*~((%w)*~)%s%w$} {#CLASS {Harvest|Vars};#ADDITEM PToH %1;#CLASS 0}
#CLASS 0
#CLASS {Harvest|PerformHarvest} {disable}
#TRIGGER {{You have already harvested from this plant recently|That plant has been fully harvested.|What do you wish to harvest?}} {#DELNITEM PToH 1;#IF (@PToH) {harvest %item( @PToH, 1);#ECHO {Moving On To Next Plant. %numitems( @PToH) Remaining.}} {#ECHO {Harvesting Complete};#T- PerformHarvest}}
#TRIGGER {You have recovered balance on all limbs} {harvest %item( @PToH, 1)}
#CLASS 0
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Oct 29, 2008 5:38 pm   
 
As an aside, this brings back some great memories. The first script I ever wrote was a harvest script based on one written by someone else; I basically just stole their idea and changed it around a bit to work how I wanted. Happy times :)
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Wed Oct 29, 2008 6:44 pm   
 
Yes, and I seem to have accidentally placed this in the wrong forum... this was supposed to be in Finished Scripts if some GURU wants to move it.

I should note I don't play Achaea, so this was written for others. :)
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Fri Oct 31, 2008 5:09 pm   Version 1.9 Bugfix Update
 
I updated some trigger patterns to correct a bug reported to me dealing with the usage of punctuation where I was only reading for a single word.

Code:
#CLASS {Harvest}
#ALIAS HarvestHelp {#ECHO %cr;#ECHO {Harvest Script Version: @HarvestVers};#ECHO {Authored by Ralgith of Zuggsoft Forums};#ECHO {Commands:};#ECHO {plants - this is the MUD command that shows you the plant list, and populates the variable.};#ECHO {doharvest - Initiates the harvesting command in your room};%cr}
#ALIAS doharvest {harvest %item( @PToH, 1);#T+ PerformHarvest}
#TRIGGER {^The following plants are growing in this room:$} {#CLASS {Harvest|Vars};#VAR PToH {};#CLASS 0;#T+ AddPlants;#T+ PromptCheck}
#TRIGGER "PromptCheck" {@Prompt} {#T- AddPlants;#T- PromptCheck;#ECHO {%numitems( @PToH) Plants Added For Harvesting}} "" {nocr|prompt}
#TRIGGER {You reach out and carefully harvest} {inr all %item( @PToH, 1)}
#CLASS 0
#CLASS {Harvest|Vars}
#VAR HarvestVers {1.9}
#VAR Prompt {%dh, %dm ex-}
#VAR PToH {}
#CLASS 0
#CLASS {Harvest|AddPlants} {disable}
#TRIGGER {^*~(%x (%x)~)%s%w$} {#CLASS {Harvest|Vars};#ADDITEM PToH %1;#CLASS 0}
#TRIGGER {^*~((%x)*~)%s%w$} {#CLASS {Harvest|Vars};#ADDITEM PToH %1;#CLASS 0}
#CLASS 0
#CLASS {Harvest|PerformHarvest} {disable}
#TRIGGER {{You have already harvested from this plant recently|That plant has been fully harvested.|What do you wish to harvest?}} {#DELNITEM PToH 1;#IF (@PToH) {harvest %item( @PToH, 1);#ECHO {Moving On To Next Plant. %numitems( @PToH) Remaining.}} {#ECHO {Harvesting Complete};#T- PerformHarvest}}
#TRIGGER {You have recovered balance on all limbs} {harvest %item( @PToH, 1)}
#CLASS 0
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts 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