196 lines
7.1 KiB
Lua
196 lines
7.1 KiB
Lua
|
|
if event.type == "program" then
|
|
mem.cur = 1
|
|
mem.failed = false
|
|
mem.actions = {
|
|
|
|
-- *****************
|
|
-- Tree Farm
|
|
{"go", name="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 Tower"},
|
|
{"wait", time=5},
|
|
{"go", pos={x=-221,y=1.5,z=-187}},
|
|
{"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
|
|
--
|
|
{"go", name="Jeiffel Station"},
|
|
{"gather", nodes={"flowers:geranium",
|
|
"flowers:rose",
|
|
"flowers:dandelion_white",
|
|
"flowers:dandelion_yellow",
|
|
"flowers:viola",
|
|
"flowers:tulip"}},
|
|
{"go", name="Cactus Approach"},
|
|
{"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 paprus on the way
|
|
{"go", name="Sugar Station Entrance"},
|
|
{"gather", topnodes="default:papyrus"},
|
|
{"go", name="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="Industrial Estate"},
|
|
|
|
-- *****************
|
|
-- Ciaran's Farm
|
|
{"go", name="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:potato_seed 20",
|
|
"farming_plus:strawberry_seed 20"}},
|
|
{"go", name="Ciaran's Farm"},
|
|
|
|
|
|
{"go", pos={x=174, y=11.5, z=319}},
|
|
{"gather", nodes={"farming:weed", "farming:wheat_8"}, plant="farming:seed_wheat"},
|
|
{"go", pos={x=174, y=11.5, z=346}},
|
|
{"go", pos={x=178, y=11.5, z=346}},
|
|
{"go", pos={x=178, y=11.5, z=319}},
|
|
{"go", pos={x=182, y=11.5, z=319}},
|
|
{"gather", nodes={"farming:weed", "farming_plus:potato"}, plant="farming_plus:potato_seed"},
|
|
{"go", pos={x=182, y=11.5, z=346}},
|
|
{"wait", time=5},
|
|
{"gather"},
|
|
|
|
{"go", pos={x=191, y=11.5, z=347}},
|
|
{"gather", nodes={"farming:weed", "farming:cotton_8"}, plant="farming:seed_cotton"},
|
|
{"go", pos={x=191, y=11.5, z=341}},
|
|
{"wait", time=5},
|
|
{"gather"},
|
|
|
|
{"go", pos={x=191, y=11.5, z=332}},
|
|
{"gather", nodes={"farming:weed", "farming_plus:carrot"}, plant="farming_plus:carrot_seed"},
|
|
{"go", pos={x=191, y=11.5, z=330}},
|
|
{"wait", time=5},
|
|
{"gather"},
|
|
|
|
{"go", pos={x=191, y=11.5, z=323}},
|
|
{"gather", nodes={"farming:weed", "farming_plus:strawberry"}, plant="farming_plus:strawberry_seed"},
|
|
{"go", pos={x=191, y=11.5, z=321}},
|
|
{"wait", time=5},
|
|
{"gather"},
|
|
|
|
{"go", pos={x=199, y=11.5, z=321}},
|
|
{"gather", nodes={"farming:weed", "farming_plus:tomato"}, plant="farming_plus:tomato_seed"},
|
|
{"go", pos={x=199, y=11.5, z=323}},
|
|
{"wait", time=5},
|
|
{"gather"},
|
|
|
|
{"go", name="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:strawberry_seed 20"}},
|
|
{"go", name="Ciaran's Farm"},
|
|
{"go", pos={x=174, y=11.5, z=319}},
|
|
|
|
{"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:carrot_seed", "*farming:seed_cotton",
|
|
"*farming_plus:tomato_seed", "*farming_plus:tomato_item",
|
|
"*farming_plus:potato_seed", "*farming_plus:potato_item",
|
|
"*farming_plus:strawberry_item", "*farming_plus:strawberry_seed"}},
|
|
|
|
{"go", pos={x=174, y=11.5, z=319}},
|
|
|
|
-- *****************
|
|
-- A bit of random wandering f0r test purposes
|
|
{"go", name="Building Supplies Shop"},
|
|
{"wait", time=10},
|
|
{"go", name="Mia's Shop"},
|
|
{"wait", time=10},
|
|
{"go", name="Adventure Shop"},
|
|
--{"go", name="Lava Falls"},
|
|
{"go", name="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
|