Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("back")
- local cords = {}
- local id = 0
- local conf = false
- local loc = "here"
- function location()
- term.clear()
- term.setCursorPos(2, 6)
- write(">here< other ")
- while conf == false do
- term.setCursorPos(2, 6)
- local event, key, isHeld = os.pullEvent("key")
- if key == keys.left then
- write(">here< other ")
- loc = "here"
- elseif key == keys.right then
- write(" here >other<")
- loc = "other"
- end
- if key == keys.enter then
- conf = true
- end
- end
- end
- function question(text)
- term.clear()
- term.setCursorPos(1, 1)
- print(text)
- end
- while true do
- question("what's the pincode?")
- table.insert(cords, 1, read("*"))
- question("what turtle do you want to send?")
- id = tonumber(read())
- location()
- if loc == "here" then
- cords[2], cords[3], cords[4] = gps.locate()
- elseif loc == "other" then
- question("what's the x cord?")
- cords[2] = read()
- question("what's the y cord the turtle should bomb on?")
- cords[3] = read()
- question("what's the z cord?")
- cords[4] = read()
- end
- question("how much tnt should be dropped?")
- cords[5] = read()
- local message = textutils.serialise(cords)
- rednet.send(id, message, "airstrike")
- local id, feedback = rednet.receive("airstrike")
- print(feedback)
- print("press backspace to exit and press a key to continiue")
- local event, key, isHeld = os.pullEvent("key")
- if key == keys.backspace then
- os.reboot()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement