Skip to content

Instantly share code, notes, and snippets.

--auto_updater
gist_id = "2b62c39644f9bd1c18128a12688c6386"
current_name = "auto_update"
check_counter = 100
--small change
print("small change")
os.sleep(1)
function readAll(file)
while(true) do
if(fs.exists("turtlegist")) then
print("great, found gist")
else
shell.run("pastebin get RMkd2KhU turtlegist")
end
rednet.open("back") --runs on a pocket computer
id, message = rednet.receive()
print("message from " .. id .. " message: " .. message)
end
--attack droid
gist_id = "da41d449af56d4bf5000ddf32afb8542"
current_name = "attack"
check_counter = 1000
function my_print(message)
print(message)
rednet.open("right")
rednet.send(61,message)
if(turtle.down()) then
print("went down")
else
print("digging down was ")
print(turtle.digDown())
turtle.down()
end
function correctfacing()
if (facingnum == 5) then
facingnum = 1
elseif (facingnum == 0) then
facingnum = 4
end
end
function facedir(dir)
if (dir == "n") then
while(true) do
if(fs.exists("turtlegist")) then
print("great, found gist")
else
shell.run("pastebin get RMkd2KhU turtlegist")
end
rednet.open("left")
id, message = rednet.receive()
print("message found")
if(message ~= nil) then
if(turtle.up()) then
print("went up")
else
print("digging up was ")
print(turtle.digUp())
turtle.up()
end
@mightystoosh
mightystoosh / turtlegist
Last active August 1, 2016 17:00
turtle gist
local tArgs = { ... }
if (#tArgs ~= 3) then
print( "USAGE: gist get GIST_ID PROGRAM_NAME" )
return
end
local action = tArgs[1]
local gist_id = tArgs[2]
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# base box