SHOW:
|
|
- or go back to the newest paste.
| 1 | --[[ | |
| 2 | - | Sending portion of wireless safari nets manager in auto-spawners (minefactory reloaded) |
| 2 | + | Turtle that receives wireless signals from sender |
| 3 | and deposits/withdraws safari nets from auto-spawner (minefactory reloaded) | |
| 4 | --]] | |
| 5 | - | -- declared variables |
| 5 | + | |
| 6 | - | defaultColorText = colors.black |
| 6 | + | local function clear() |
| 7 | - | defaultColorBg = colors.lightBlue |
| 7 | + | term.clear() |
| 8 | - | rednet.open("front")
|
| 8 | + | term.setCursorPos(1,1) |
| 9 | - | mon = peripheral.wrap("back")
|
| 9 | + | |
| 10 | - | term.redirect(mon) |
| 10 | + | |
| 11 | - | mon.setTextScale(1.5) |
| 11 | + | clear() |
| 12 | - | colorOn = colors.lime |
| 12 | + | |
| 13 | - | colorOff = colors.red |
| 13 | + | print("Auto Spawner Control")
|
| 14 | - | update = 1 |
| 14 | + | print("by: Luckdemon")
|
| 15 | - | powerStatus = false |
| 15 | + | rednet.open("right")
|
| 16 | - | mName = {}
|
| 16 | + | sleep(1) |
| 17 | - | mName[1] = "PigZombie" |
| 17 | + | |
| 18 | - | mName[2] = "Witch" |
| 18 | + | |
| 19 | - | mName[3] = "Villager" |
| 19 | + | clear() |
| 20 | - | mName[4] = "Cow" |
| 20 | + | print("Waiting for command")
|
| 21 | - | mName[5] = "Enderman" |
| 21 | + | local id, msg, dist = rednet.receive() |
| 22 | - | mName[6] = "Skeleton" |
| 22 | + | if msg == true then |
| 23 | - | mName[7] = "Creeper" |
| 23 | + | print("on")
|
| 24 | - | mName[8] = "---------" |
| 24 | + | redstone.setOutput("front", true)
|
| 25 | - | mStatus = {}
|
| 25 | + | elseif msg == false then |
| 26 | - | mStatus[1] = colorOff |
| 26 | + | print("off")
|
| 27 | - | mStatus[2] = colorOff |
| 27 | + | redstone.setOutput("front", false)
|
| 28 | - | mStatus[3] = colorOff |
| 28 | + | |
| 29 | - | mStatus[4] = colorOff |
| 29 | + | print(msg) |
| 30 | - | mStatus[5] = colorOff |
| 30 | + | turtle.suck() |
| 31 | - | mStatus[6] = colorOff |
| 31 | + | turtle.select(msg) |
| 32 | - | mStatus[7] = colorOff |
| 32 | + | turtle.drop() |
| 33 | - | mStatus[8] = colorOff |
| 33 | + | sleep(0.5) |
| 34 | end | |
| 35 | - | function printBox(x0,y0,x1,y1,BgColor) |
| 35 | + | |
| 36 | - | term.setBackgroundColor(BgColor) |
| 36 | + | |
| 37 | - | x0 = tonumber(x0) |
| 37 | + | |
| 38 | - | y0 = tonumber(y0) |
| 38 | + |