Created
February 18, 2013 00:18
-
-
Save bortels/4974340 to your computer and use it in GitHub Desktop.
Startup Script for Computercraft Turtles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- startup script for melee turtle | |
-- grabs a fresh copy of melee script on startup, then executes it | |
-- install with "pastebin get YBWf4qsN startup" | |
pastebinid = "UYwardhQ" | |
payload = "melee" | |
backup = payload .. ".bak" | |
print("Fetching " .. payload .. " program from pastebin") | |
if (fs.exists(backup)) then | |
fs.delete(backup) | |
end | |
fs.move(payload, backup) | |
ok = shell.run("pastebin", "get " .. pastebinid .. " " .. payload) | |
print("pastebin results: " .. ok) | |
print("Executing " .. payload .. " program") | |
if (not fs.exists(payload)) then | |
print("Error: '" .. payload .. "' does not exist. Using old version.") | |
fs.copy(backup, payload) | |
end | |
shell.run(payload) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment