Hello, I'm really new to Lua and I've tried to figure things out by myself but it's a lot more complicated then I expected at first so any help is greatly appreciated!
FIRST REQUEST Okay so here's my setup and what I want to achieve in my first request
I have Essence Berry bushes from Tinker's Construct (the xp one) and I want to have a robot water the plant with the Watering Can (Reinforced) from Extra Utilities. In my testing, the Watering Can will only work if you are close enough to a block (3 blocks max distance).
So from what I understand, this is the function I have to use :
I tried running robot.use() through the lua console but it will only use the Watering Can once and it's not very helpful for me I tried robot.use(3, 100) next and that didn't work either.... I thought that would mean "Use Watering Can on sides.front for duration:100" but I was mistaken...
Can someone help me write a simple program to loop the use of the Watering Can on a block the robot is facing or below it (Both are fine for me).
I think it goes something like this....
while true do robot.use(3) end
Is that right? Never created a program before so I don't know if there's anything else I need to add to it. This program is pretty simple..
SECOND REQUEST Okay for the second request, here's the idea.
Whiles the other robots are watering the essences bushes, I want to have a second robot to break the Concentrated Essence Berry pumped inside his inventory by right-clicking them as a player would do (again the simple robot.use() command works for that, I already tested it)
The Robots would be auto-filed with Concentrated Essence Berry by Item Conduits (Pumped in) and the robots would use; A) All the slots and cycle though them will using the robot.use() function until the slot is empty I would fill the other slots with cobblestones and the robots would only use the first slot for Input and right-click from this slot.
Again, as for the above program, I would love to have this constantly running. If possible, have this program hook to a redstone signal to switch it On an Off but that's not necessary but would be pretty cool since I could hook the redstone signal to Mob Essence system.
CONCLUSION
As I said above, I really appreciate any help, even if you can't create a program that would do exactly what I want,
any help given will give me more knowledge of Lua and it's usage.
Both of the my requested programs should be "loop" or able to be turned On/Off via redstone signal.
Please provide the full program as I should paste it in the "edit name.lua" file that I will create. I'm really new to this whole thing!
Thank you! And Have a Good Day if you read this
EXTRA
If possible for a last request, this one is not really that important for now, mostly because I might be able to figure it out after you help me with the above but anyway here's the idea!
I want to have robot to collect the Concentrated Essence Berry from the bushes, instead of the MFR Harvester. Reason behind that is I want to use something new and unique. And robots are freaking cool!
The robot would be place over a chest, planted into the ground and a charger would be behind it. The robot would be facing air blocks and on the left and right side of it, a bush. It would look left, right-click the bush, turn right twice to face the right bush and right-click it then turn left again and move foward once to the next bushes. When it reaches the end of a row of bushes it would do a turn-around (180 degree) and go up once to collect another row..... after collecting the essences it would go back to the chest and charger and drop his inventory into the chest while being recharged.
Here's a text graphic example where D represent the chest and is placed one block lower and C is the Charger block, O is the Robot, and X are the bushes and they are all on the same height levels. (except for the stack of bushes but the robot would start over the chest next to the charger)
XXXXX <--- Stacked 4 times in height D(OC) <--- Robot over the chest with a charger behind it, nothing above or in front of it, bushes on each sides, stacked 4 high.
XXXXX <--- Stacked 4 times in height
It would collect in a row of 5 for this example so it would go 4 times forward in theory and those bushes would be superposed 4 times so It would go up once repeat the collections method from above go up again, repeat collect, go up again and repeat collection on the last row, that would make the robot on the exact position for the chest and the charger, so it could just drop down 3 blocks and turn around to face the air block path, drop his content in the inventory below it and recharge a little.
To make sure the robot always got inventory space left on it, it should check if the Inventory is Empty before it repeat the program.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Hello, I'm really new to Lua and I've tried to figure things out by myself but it's a lot more complicated then I expected at first so any help is greatly appreciated!
FIRST REQUEST
Okay so here's my setup and what I want to achieve in my first request
I have Essence Berry bushes from Tinker's Construct (the xp one) and I want to have a robot water the plant with the Watering Can (Reinforced) from Extra Utilities. In my testing, the Watering Can will only work if you are close enough to a block (3 blocks max distance).
So from what I understand, this is the function I have to use :
robot.use([side: number[, sneaky: boolean[, duration: number]]]): boolean[, string
I tried running robot.use() through the lua console but it will only use the Watering Can once and it's not very helpful for me
I tried robot.use(3, 100) next and that didn't work either.... I thought that would mean "Use Watering Can on sides.front for duration:100" but I was mistaken...
Can someone help me write a simple program to loop the use of the Watering Can on a block the robot is facing or below it (Both are fine for me).
I think it goes something like this....
while true do
robot.use(3)
end
Is that right? Never created a program before so I don't know if there's anything else I need to add to it.
This program is pretty simple..
SECOND REQUEST
Okay for the second request, here's the idea.
Whiles the other robots are watering the essences bushes,
I want to have a second robot to break the Concentrated Essence Berry pumped inside his inventory by right-clicking them
as a player would do (again the simple robot.use() command works for that, I already tested it)
The Robots would be auto-filed with Concentrated Essence Berry by Item Conduits (Pumped in) and the robots would
use;
A) All the slots and cycle though them will using the robot.use() function until the slot is empty
I would fill the other slots with cobblestones and the robots would only use the first slot for Input and right-click from this slot.
Again, as for the above program, I would love to have this constantly running.
If possible, have this program hook to a redstone signal to switch it On an Off but that's not necessary but would be pretty cool since I could hook the redstone signal to Mob Essence system.
CONCLUSION
As I said above, I really appreciate any help, even if you can't create a program that would do exactly what I want,
any help given will give me more knowledge of Lua and it's usage.
Both of the my requested programs should be "loop" or able to be turned On/Off via redstone signal.
Please provide the full program as I should paste it in the "edit name.lua" file that I will create.
I'm really new to this whole thing!
Thank you! And Have a Good Day if you read this
EXTRA
If possible for a last request, this one is not really that important for now, mostly because I might be able to figure it out after you help me with the above but anyway here's the idea!
I want to have robot to collect the Concentrated Essence Berry from the bushes, instead of the MFR Harvester.
Reason behind that is I want to use something new and unique. And robots are freaking cool!
The robot would be place over a chest, planted into the ground and a charger would be behind it.
The robot would be facing air blocks and on the left and right side of it, a bush.
It would look left, right-click the bush, turn right twice to face the right bush and right-click it then turn left again and move foward once to the next bushes. When it reaches the end of a row of bushes it would do a turn-around (180 degree) and go up once to collect another row..... after collecting the essences it would go back to the chest and charger and drop his inventory into the chest while being recharged.
Here's a text graphic example where D represent the chest and is placed one block lower and C is the Charger block, O is the Robot, and X are the bushes and they are all on the same height levels. (except for the stack of bushes but the robot would start over the chest next to the charger)
XXXXX <--- Stacked 4 times in height
D(OC) <--- Robot over the chest with a charger behind it, nothing above or in front of it, bushes on each sides, stacked 4 high.
XXXXX <--- Stacked 4 times in height
It would collect in a row of 5 for this example so it would go 4 times forward in theory and those bushes would be superposed 4 times so It would go up once repeat the collections method from above go up again, repeat collect, go up again and repeat collection on the last row, that would make the robot on the exact position for the chest and the charger, so it could just drop down 3 blocks and turn around to face the air block path, drop his content in the inventory below it and recharge a little.
To make sure the robot always got inventory space left on it, it should check if the Inventory is Empty before it repeat the program.
Thanks again!
Link to post
Share on other sites