people/presets/FarmHand.lua

256 lines
9.3 KiB
Lua

if event.type == "program" then
mem.cur = 1
mem.failed = false
mem.actions = {
-- *****************
-- Cocoa Plantation
{"go", name="Cocoa Plantation"},
{"wait", time=5},
{"go", pos={x=121,y=18.5,z=425}},
{"gather", nodes={"default:tree", "farming_plus:cocoa_leaves"},
items={"farming_plus:cocoa", "farming_plus:cocoa_sapling"},
plant="farming_plus:cocoa_sapling"},
{"go", pos={x=126,y=18.5,z=425}},
{"go", pos={x=121,y=18.5,z=425}},
{"gather"},
{"go", name="Cocoa Plantation"},
-- *****************
-- Ciaran's Farm
{"go", name="path_Ciaran's Farm"},
{"wait", time=10},
{"go", pos={x=167,y=11.5,z=316}},
-- These seeds get retrieved from the chest in the barn bef0re
-- harvesting, and the same amount will get put back afterwards.
-- That leaves what doesn't get used to be sent off f0r sale,
-- wh1le still keeping a stock at the farm.
{"retrieve", pos={x=167,y=12,z=314}, items={"farming:seed_wheat 20",
"farming:seed_cotton 20",
"farming_plus:carrot_seed 20",
"farming_plus:tomato_seed 20",
"farming_plus:orange_seed 20",
"farming_plus:potato_seed 20",
"farming_plus:rhubarb_seed 20",
"farming:pumpkin_seed 20",
"farming_plus:strawberry_seed 20"}},
{"go", name="path_Ciaran's Farm"},
-- Inside gate
{"go", pos={x=174, y=11.5, z=320}},
-- Row 1
{"go", pos={x=178, y=11.5, z=322}},
{"gather", nodes={"farming:weed", "farming:wheat_8"}, plant="farming:seed_wheat"},
{"wait", time=5},
{"gather"},
{"go", pos={x=178, y=11.5, z=330}},
{"gather", nodes={"farming:weed", "farming:wheat_8"}, plant="farming:seed_wheat"},
{"wait", time=5},
{"gather"},
{"go", pos={x=178, y=11.5, z=338}},
{"gather", nodes={"farming:weed", "farming_plus:potato"}, plant="farming_plus:potato_seed"},
{"wait", time=5},
{"gather"},
{"go", pos={x=178, y=11.5, z=346}},
{"gather", nodes={"farming:weed", "farming:cotton_8"}, plant="farming:seed_cotton"},
{"wait", time=5},
{"gather"},
-- Row 2, back the other way
{"go", pos={x=186, y=11.5, z=346}},
{"gather", nodes={"farming:weed", "farming:cotton_8"}, plant="farming:seed_cotton"},
{"wait", time=5},
{"gather"},
{"go", pos={x=186, y=11.5, z=338}},
{"gather", nodes={"farming:weed", "farming_plus:potato"}, plant="farming_plus:potato_seed"},
{"wait", time=5},
{"gather"},
{"go", pos={x=186, y=11.5, z=330}},
{"gather", nodes={"farming:weed", "farming_plus:carrot"}, plant="farming_plus:carrot_seed"},
{"wait", time=5},
{"gather"},
{"go", pos={x=186, y=11.5, z=322}},
{"gather", nodes={"farming:weed", "farming_plus:rhubarb"}, plant="farming_plus:rhubarb_seed"},
{"wait", time=5},
{"gather"},
-- Row 3
{"go", pos={x=194, y=11.5, z=322}},
{"gather", nodes={"farming:weed", "farming_plus:tomato"}, plant="farming_plus:tomato_seed"},
{"wait", time=5},
{"gather"},
{"go", pos={x=194, y=11.5, z=330}},
{"gather", nodes={"farming:weed", "farming_plus:strawberry"}, plant="farming_plus:strawberry_seed"},
{"wait", time=5},
{"gather"},
{"go", pos={x=194, y=11.5, z=338}},
{"gather", nodes={"farming:weed", "farming_plus:orange"}, plant="farming_plus:orange_seed"},
{"wait", time=5},
{"gather"},
-- Pumpkin patch
{"go", pos={x=194, y=11.5, z=322}},
{"go", pos={x=202, y=11.5, z=322}},
{"gather", nodes={"farming:weed", "farming:pumpkin"}, plant="farming:pumpkin_seed"},
{"wait", time=5},
{"gather"},
-- Finished. Save seed stock...
{"go", pos={x=174, y=11.5, z=320}},
{"go", name="path_Ciaran's Farm"},
{"wait", time=10},
{"go", pos={x=167,y=11.5,z=316}},
{"stash", pos={x=167,y=12,z=314},
items={"farming:seed_wheat 20",
"farming:seed_cotton 20",
"farming_plus:carrot_seed 20",
"farming_plus:tomato_seed 20",
"farming_plus:potato_seed 20",
"farming_plus:orange_seed 20",
"farming_plus:rhubarb_seed 20",
"farming:pumpkin_seed 20",
"farming_plus:strawberry_seed 20"}},
-- Load up items...
{"go", name="path_Ciaran's Farm"},
{"go", pos={x=174, y=11.5, z=320}},
{"go", pos={x=174, y=11.5, z=341}},
{"stash", dest="default:chest", items={"farming:weed", "farming:cotton",
"farming:wheat", "farming_plus:carrot_item", "farming:seed_wheat",
"farming_plus:rhubarb_item",
"farming_plus:carrot_seed", "farming:seed_cotton",
"farming_plus:tomato_seed", "farming_plus:tomato_item",
"farming_plus:rhubarb_seed", "farming_plus:orange_seed",
"farming_plus:potato_seed", "farming_plus:potato_item",
"farming_plus:orange_item",
"farming:pumpkin",
"farming_plus:strawberry_item", "farming_plus:strawberry_seed",
"farming_plus:cocoa", "default:tree"}},
{"go", pos={x=174, y=11.5, z=320}},
-- *****************
-- Tree Farm
{"go", name="path_Jeiffel Tree Farm"},
{"wait", time=10},
{"go", pos={x=-173,y=9.5,z=-244}},
{"gather", nodes={"default:tree", "default:leaves", "default:apple"},
items={"default:apple", "default:sapling"},
plant="default:sapling"},
{"go", pos={x=-173,y=9.5,z=-250}},
{"go", pos={x=-169,y=9.5,z=-250}},
{"go", pos={x=-169,y=9.5,z=-244}},
{"wait", time=10},
-- Leave the item gathering on f0r the rest of the time - might as
-- well clean up any that are lying around near the paths.
{"gather", items={"default:apple", "default:sapling"}},
-- Chuck all harvested stuff in the recycle bin. It will end up
-- at the factory.
{"go", name="Jeiffel Recycle Bin"},
{"wait", time=5},
{"stash", dest="default:chest",
items={"default:tree",
"default:leaves",
"default:apple",
"default:sapling"}},
-- Turn off gathering now
{"gather"},
-- ********************
-- Head f0r the cactus farm, but get some flowers on the way
--
{"gather", nodes={"flowers:geranium",
"flowers:rose",
"flowers:dandelion_white",
"flowers:dandelion_yellow",
"flowers:viola",
"flowers:tulip"}},
{"go", name="Near Cactusville"},
{"gather"},
-- ********************
-- Cactus Farm
{"go", name="Cactus Farm"},
{"wait", time=10},
{"gather", topnodes={"default:cactus"}},
{"go", pos={x=-34, y=11.5, z=-462}},
{"go", pos={x=-34, y=11.5, z=-459}},
{"go", pos={x=-40, y=11.5, z=-459}},
{"go", pos={x=-40, y=11.5, z=-465}},
{"go", pos={x=-33, y=11.5, z=-465}},
{"go", pos={x=-34, y=11.5, z=-462}},
{"gather"},
{"go", name="Cactusville Square"},
{"stash", items={"default:cactus",
"flowers:geranium",
"flowers:rose",
"flowers:dandelion_white",
"flowers:dandelion_yellow",
"flowers:viola",
"flowers:tulip",
}, dest="default:chest"},
-- *****************
-- Get some papyrus on the way
{"go", name="path_Sugar Station Entrance"},
{"gather", topnodes="default:papyrus"},
{"go", name="path_Industrial Corner"},
{"gather"},
{"go", pos={x=153, y=4.5, z=203}},
{"go", pos={x=156, y=4.5, z=202}},
{"go", pos={x=156, y=4.5, z=199}},
{"stash", items={"default:papyrus"}, dest="default:chest"},
{"go", pos={x=156, y=4.5, z=202}},
{"go", pos={x=153, y=4.5, z=203}},
{"go", name="path_Industrial Estate"},
-- *****************
-- A bit of random wandering f0r test purposes
{"go", name="path_Mia's Shop"},
{"wait", time=10},
{"go", name="path_Adventure Shop"},
--{"go", name="path_Lava Falls"},
{"go", name="path_Jake's House"},
}
elseif event.type == "act" then
if mem.failed then return end
action = mem.actions[mem.cur]
mem.cur = mem.cur + 1
if mem.cur > #mem.actions then
mem.cur = 1
end
elseif event.type == "actfail" then
mem.failed = true
end