ComputerCraft Archive

Auto Smelter with autobuild

computer networking unknown forum

Description

Hey There all,I am (still) fairly new to LUA and I created a auto smelter for wireless turtles.The turtle can build you the smelter up to 15 furnaces.The turtle will send everything he does to a serve...

Installation

Copy one of these commands into your ComputerCraft terminal:

Pastebin:pastebin get uEYDLq1n auto_smelter_with_autobuild
wget:wget https://pastebin.com/raw/uEYDLq1n auto_smelter_with_autobuild
Archive:wget https://cc.shobie.xyz/cc/get/pb-uEYDLq1n auto_smelter_with_autobuild
Quick Install: wget https://cc.shobie.xyz/cc/get/pb-uEYDLq1n Auto Smelter with autobuild

Usage

Run the program after downloading

Tags

networkingforumturtle-programs

Source

View Original Source

Code Preview

mon = peripheral.wrap("right")

for i, side in ipairs(rs.getSides()) do --#Loop for each side on the computer that redstone can be used, these can also be used by modems.
if peripheral.getType(side) == 'modem' then --#Did we find a modem... Or some other peripheral?
	mon.clear()
  --print('Found Modem On Side '..side.."!")
  rednet.open(side)
  wireless = peripheral.wrap(side)
  break --#Opened modem, dont open any others.
end
end

function waitForMessage(displayMessage)
	local sender, message, protocol = rednet.receive()
	if displayMessage then 
		mon.clear()
  	local w, h = term.getSize()
		mon.setCursorPos(1,1)
		mon.write(message) 
	else 
		return message 
	end
end

while true do
	waitForMessage(true)
end