Guest User

Untitled

a guest
Jul 16th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. Script - Harvester
  2.  
  3. RoomEnv = {
  4. ["Forest"] = {"echinacea", "elm", "ginger", "ginseng", "lobelia", "myrrh"},
  5. ["Garden"] = {"echinacea", "elm", "ginger", "ginseng", "lobelia", "myrrh"},
  6. ["Desert"] = {"pear", "weed"},
  7. ["Grasslands"] = {"goldenseal", "slipper"},
  8. ["Mountains"] = {"valerian"},
  9. ["Jungle"] = {"kuzu", "kola", "skullcap"},
  10. ["Natural underground"] = {"moss", "bloodroot"},
  11. ["Hills"] = {"bayberry", "hawthorn"},
  12. ["Swamp"] = {"ash", "cohosh", "bellwort"},
  13. ["Valley"] = {"sileris"},
  14. ["Freshwater"] = {"kelp"},
  15. ["River"] = {"kelp"},
  16. ["Water"] = {"kelp"},
  17. ["Ocean"] = {"kelp"},
  18. };
  19. CurrentEnv = ""
  20. HarvestQueue = {
  21. };
  22.  
  23. function harvestBegin(env)
  24. for i = 1,table.maxn(RoomEnv[env]) do
  25. table.insert(HarvestQueue, RoomEnv[env][i])
  26. end
  27. cecho("\n<white>[<blue>Harvesting<white>]<grey>: Commencing Plant Snatching!")
  28. enableTrigger("HarvestBal")
  29. pickPlants()
  30. end
  31.  
  32. function pickPlants()
  33. if HarvestQueue[1] == nil then
  34. cecho("\n<white>[<blue>Harvesting<white>]<grey>: Finished Snatching Plants!")
  35. disableTrigger("HarvestBal")
  36. else
  37. send("harvest " .. HarvestQueue[1])
  38. table.remove(HarvestQueue,1)
  39. end
  40. end
  41.  
  42. Trigger - Bal
  43.  
  44. Match Lines -
  45.  
  46. That plant has been fully harvested.
  47. You have already harvested from this plant recently.
  48. You have recovered balance on all limbs.
  49. You find that you don't know how to harvest that. How odd.
  50. What do you wish to harvest?
  51.  
  52. Body -
  53.  
  54. pickPlants()
  55.  
  56. Trigger - HarvestRift
  57.  
  58. ^You reach out and carefully harvest(?: \d+| a| an| some|\s+)(.+)s?\.$
  59.  
  60.  
  61. if not string.find(matches[2],"pear") then
  62. send("inr all "..matches[2])
  63. else
  64. send("inr all pear")
  65. end
  66.  
  67.  
  68. Trigger - harvestNewRoom
  69.  
  70. You see exits leading
  71. You see a single exit
  72. There are no obvious exits.
  73.  
  74. if autoHarvest then
  75. echo("\n")
  76. harvestBegin(CurrentEnv)
  77. end
  78.  
  79. ALIAS -
  80.  
  81. autoHarvest
  82.  
  83. ^aharv$
  84.  
  85. if not autoHarvest then
  86. autoHarvest=true
  87. else
  88. autoHarvest=false
  89. end
  90.  
  91. if not autoHarvest then
  92. omni.echo("Auto Harvesting is Paused!")
  93. else
  94. omni.echo("Auto Harvesting is unPaused!")
  95. end
  96.  
  97. if autoHarvest then
  98. harvestBegin(CurrentEnv)
  99. end
Add Comment
Please, Sign In to add comment