SHOW:
|
|
- or go back to the newest paste.
1 | - | -- monstercleanup |
1 | + | -- killaround |
2 | - | -- sweeps a (MAX_X+1) x (MAX_Y+1) area, kills monsters and plants torches (chunks must be loaded!) |
2 | + | -- doesn't move, just rotates and kills all around and drops any items down |
3 | - | -- plant turtle ONE BLOCK ABOVE ground/floor so that torches could be placed under the turtle !!! |
3 | + | |
4 | - | -- plant turtle to the left bottom corner of the desired cleaning area (this will be the 0,0 position) |
4 | + | while true do |
5 | - | -- X coordinate increases to the right, Y coordinate increases to the front |
5 | + | for i=1, 16 do |
6 | - | -- turtle will need to be refueled to minimum of approx. (MAX_X+2)*(MAX_Y+2) (1 coal=80) |
6 | + | |
7 | - | -- load slots with torches (or whatever you want to be placed under the turtle as it sweeps the area) |
7 | + | turtle.attack() |
8 | - | -- you will need about 2 torches per 100m^2 (+borders) |
8 | + | turtle.attackUp() |
9 | turtle.attackDown() | |
10 | - | local MAX_X = 58 |
10 | + | |
11 | - | local MAX_Y = 58 |
11 | + | |
12 | - | local posX = 0 |
12 | + | for i = 1, 16 do |
13 | - | local posY = 0 |
13 | + | turtle.select(i) |
14 | - | local orient = 0 -- orientation relative to original placement: 0 = front, 1 = right, 2 = back, 3 = left |
14 | + | turtle.dropDown() |
15 | - | local slotIndex = 1 |
15 | + | |
16 | end |