Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print "doorInstall v0.1"
- tArgs = ...
- for k,v in pairs(tArgs) do
- print(k, " | ", v)
- end
- if tArgs[1] == "update" then
- shell.run("rm", "doorInstall")
- shell.run("pastebin", "get", "7U2dgmLC", "doorInstall")
- elseif tArgs[1] == "delete" then
- shell.run("rm", "doorInstall")
- else
- print("direction to sensor: ")
- posSensor = read()
- print("direction to piston: ")
- posPiston = read()
- shell.run("pastebin", "get", "Ev40Tvgc", "doorOpen")
- shell.run("pastebin", "get", "CunRkRRu", "doorClose")
- shell.run("pastebin", "get", "nkxdwYhK", "doorSensor_temp")
- shell.run("pastebin", "get", "mJgPiC25", "startup")
- temp = io.open("doorSensor_temp", "r")
- file = io.open("doorSensor", "w")
- for line in io.lines(temp) do
- if line == 1 then
- io.output(file):write("local posSensor = \"" .. posSensor .. "\"\n")
- elseif line == 2 then
- io.output(file):write("local posPiston = \"" .. posPiston .. "\"\n")
- else
- io.output(file):write(line .. "\n")
- end
- end
- file:close()
- temp:close()
- fs.delete("doorSensor_temp")
- fs.delete("doorInstall")
- end
Advertisement
Add Comment
Please, Sign In to add comment