Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x, y = 14,9
- local x2, y2 = 12,10
- local x3, y3 = 16,10
- local x4, y4 = 14,11
- local x5, y5 = 2,15
- local x6, y6 = 2,16
- local x7, y7 = 2,17
- local x8, y8 = 18,15
- local x9, y9 = 18,16
- local x10, y10 = 18,17
- local x11, y11 = 9,13
- local x12, y12 = 20,2
- local x13, y13 = 24,2
- local x14, y14 = 5,6
- local x15, y15 = 5,20
- local x16, y16 = 7,20
- local x17, y17 = 9,20
- local x18, y18 = 11,20
- local x19, y19 = 13,20
- local x21, y21 = 15,20
- local x22, y22 = 17,20
- local x23, y23 = 19,20
- local x24, y24 = 4,9
- local x25, y25 = 4,10
- local x25, y26 = 2,4
- local choice1 = "^"
- local choice2 = "<"
- local choice3 = ">"
- local choice4 = "v"
- local choice5 = "[ ]Place"
- local choice6 = "[^]Place"
- local choice7 = "[v]Place"
- local choice8 = "[ ]Dig"
- local choice9 = "[^]Dig"
- local choice10 = "[v]Dig"
- local choice11 = "[x]Attack"
- local choice12 = "+ |"
- local choice13 = " -"
- local choice14 = "[ ]Fuel:"
- local choice15 = "|1"
- local choice16 = "|2"
- local choice17 = "|3"
- local choice18 = "|4"
- local choice19 = "|5"
- local choice20 = "|6"
- local choice21 = "|7"
- local choice22 = "|8"
- local choice23 = "|9|"
- local choice24 = "[^]"
- local choice25 = "[v]"
- local choice26 = "[-]Dig"
- local function drawMenu()
- term.setCursorPos(x, y)
- term.setTextColor(colors.white)
- write(choice1)
- term.setCursorPos(x2, y2)
- write(choice2)
- term.setCursorPos(x3, y3)
- write(choice3)
- term.setCursorPos(x4, y4)
- write(choice4)
- term.setCursorPos(x5, y5)
- write(choice5)
- term.setCursorPos(x6, y6)
- write(choice6)
- term.setCursorPos(x7, y7)
- write(choice7)
- term.setCursorPos(x8, y8)
- write(choice8)
- term.setCursorPos(x9, y9)
- write(choice9)
- term.setCursorPos(x10, y10)
- write(choice10)
- term.setCursorPos(x11, y11)
- write(choice11)
- term.setCursorPos(x12, y12)
- write(choice12)
- term.setCursorPos(x13, y13)
- write(choice13)
- term.setCursorPos(x14, y14)
- write(choice14)
- term.setCursorPos(x15, y15)
- write(choice15)
- term.setCursorPos(x16, y16)
- write(choice16)
- term.setCursorPos(x17, y17)
- write(choice17)
- term.setCursorPos(x18, y18)
- write(choice18)
- term.setCursorPos(x19, y19)
- write(choice19)
- term.setCursorPos(x20, y20)
- write(choice20)
- term.setCursorPos(x21, y21)
- write(choice21)
- term.setCursorPos(x22, y22)
- write(choice23)
- term.setCursorPos(x23, y23)
- write(choice23)
- term.setCursorPos(x24, y24)
- write(choice24)
- term.setCursorPos(x25, y25)
- write(choice25)
- term.setCursorPos(x26, y26)
- write(choice26)
- end
- drawMenu()
- while true do
- local event, button, cx, cy = os.pullEvent()
- if event == "mouse_click" then
- if cx >= x and cx < choice1:len() and cy == y and button == 1 then
- rednet.broadcast("TS Forward")
- elseif cx >= x2 and cx < choice2:len() and cy == y2 and button == 1 then
- rednet.broadcas("TS TurnLeft")
- elseif cx >= x3 and cx < choice3:len() and cy == y3 and button == 1 then
- rednet.broadcast("TS TurnRight")
- elseif cx >= x4 and cx < choice4:len() and cy == y4 and button == 1 then
- rednet.broadcast("TS Back")
- elseif cx >= x5 and cx < choice5:len() and cy == y5 and button == 1 then
- rednet.broadcast("TS PlaceBlock")
- elseif cx >= x6 and cx < choice6:len() and cy == y6 and button == 1 then
- rednet.broadcast("TS PlaceUp")
- elseif cx >= x7 and cx < choice7:len() and cy == y7 and button == 1 then
- rednet.broadcast("TS PlaceDown")
- elseif cx >= x8 and cx < choice8:len() and cy == y8 and button == 1 then
- rednet.broadcast("TS Dig")
- elseif cx >= x9 and cx < choice9:len() and cy == y9 and button == 1 then
- rednet.broadcast("TS DigUp")
- elseif cx >= x10 and cx < choice10:len() and cy == y10 and button == 1 then
- rednet.broadcast("TS DigDown")
- elseif cx >= x11 and cx < choice11:len() and cy == y11 and button == 1 then
- rednet.broadcast("TS Attack")
- elseif cx >= x12 and cx < choice12:len() and cy == y12 and button == 1 then
- rednet.broadcast("TS Redstone FWD: On")
- elseif cx >= x13 and cx < choice13:len() and cy == y13 and button == 1 then
- rednet.broadcast("TS Redstone FWD: Off")
- elseif cx >= x14 and cx < choice14:len() and cy == y14 and button == 1 then
- rednet.broadcast("TS Refuel")
- local scrap, message = rednet.receive()
- term.setCursorPos(14, 6)
- term.setTextColor(colors.white)
- print(message)
- elseif cx >= x15 and cx < choice15:len() and cy == y15 and button == 1 then
- rednet.broadcast("1")
- term.setCursorPos(5, 20)
- term.setTextColor(colors.white)
- print("|")
- term.setCursorPos(6, 20)
- term.setTextColor(colors.green)
- print("1")
- term.setCursorPos(8, 20)
- term.setTextColor(colors.white)
- print("|2|3|4|5|6|7|8|9|")
- elseif cx >= x16 and cx < choice16:len() and cy == y16 and button == 1 then
- rednet.broadcast("2")
- term.setCursorPos(5, 20)
- term.setTextColor(colors.white)
- print("|1|")
- term.setCursorPos(9, 20)
- term.setTextColor(colors.green)
- print("2")
- term.setCursorPos(11, 20)
- term.setTextColor(colors.white)
- print("|3|4|5|6|7|8|9|")
- elseif cx >= x17 and cx < choice17:len() and cy == y17 and button == 1 then
- rednet.broadcast("3")
- term.setCursorPos(5, 20)
- term.setTextColor(colors.white)
- print("|1|2|")
- term.setCursorPos(11, 20)
- term.setTextColor(colors.green)
- print("3")
- term.setCursorPos(13, 20)
- term.setTextColor(colors.white)
- print("|4|5|6|7|8|9|")
- elseif cx >= x18 and cx < choice18:len() and cy == y18 and button == 1 then
- rednet.broadcast("4")
- term.setCursorPos(5, 20)
- term.setTextColor(colors.white)
- print("|1|2|3|")
- term.setCursorPos(13, 20)
- term.setTextColor(colors.green)
- print("4")
- term.setCursorPos(15, 20)
- term.setTextColor(colors.white)
- print("|5|6|7|8|9|")
- elseif cx >= x19 and cx < choice19:len() and cy == y19 and button == 1 then
- rednet.broadcast("5")
- term.setCursorPos(5, 20)
- term.setTextColor(colors.white)
- print("|1|2|3|4|")
- term.setCursorPos(15, 20)
- term.setTextColor(colors.green)
- print("5")
- term.setCursorPos(17, 20)
- term.setTextColor(colors.white)
- print("|6|7|8|9|")
- elseif cx >= x20 and cx < choice20:len() and cy == y20 and button == 1 then
- rednet.broadcast("6")
- term.setCursorPos(5, 20)
- term.setTextColor(colors.white)
- print("|1|2|3|4|5|")
- term.setCursorPos(17, 20)
- term.setTextColor(colors.green)
- print("6")
- term.setCursorPos(19, 20)
- term.setTextColor(colors.white)
- print("|7|8|9|")
- elseif cx >= x21 and cx < choice21:len() and cy == y21 and button == 1 then
- rednet.broadcast("7")
- term.setCursorPos(5, 20)
- term.setTextColor(colors.white)
- print("|1|2|3|4|5|6|")
- term.setCursorPos(19, 20)
- term.setTextColor(colors.green)
- print("7")
- term.setCursorPos(21, 20)
- term.setTextColor(colors.white)
- print("|8|9|")
- elseif cx >= x22 and cx < choice22:len() and cy == y22 and button == 1 then
- rednet.broadcast("8")
- term.setCursorPos(5, 20)
- term.setTextColor(colors.white)
- print("|1|2|3|4|5|6|7|")
- term.setCursorPos(23, 20)
- term.setTextColor(colors.green)
- print("8")
- term.setCursorPos(25, 20)
- term.setTextColor(colors.white)
- print("|9|")
- elseif cx >= x23 and cx < choice23:len() and cy == y23 and button == 1 then
- rednet.broadcast("9")
- term.setCursorPos(5, 20)
- term.setTextColor(colors.white)
- print("|1|2|3|4|5|6|7|8|")
- term.setCursorPos(27, 20)
- term.setTextColor(colors.green)
- print("9")
- term.setCursorPos(29, 20)
- term.setTextColor(colors.white)
- print("|")
- elseif cx >= x24 and cx < choice24:len() and cy == y24 and button == 1 then
- rednet.broadcast("TS Up")
- elseif cx >= x25 and cx < choice25:len() and cy == y25 and button == 1 then
- rednet.braodcast("TS Down")
- elseif cx >= x26 and cx < choice26:len() and cy == y26 and button == 1 then
- shell.run("remote2")
- end
- end
- end
Add Comment
Please, Sign In to add comment