Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --fixes monitor and rednet
- monitor = peripheral.wrap("left")
- monitor.setTextScale(1)
- monitor.setCursorBlink(false)
- monitor.setBackgroundColor(1)
- monitor.clear()
- modemside = "top"
- rednet.open(modemside)
- --variables
- turtles = {"[T1]","[T2]","[T3]","[T4]","[T5]","[T6]", "[All]"}
- selectedTurtle = {false, false, false, false, false, false, true}
- commands = {"[F]", "[B]", "[L]", "[R]", "[U]", "[D]", "[Dig]", "[DD]", "[DigHole]", "[Build]", "[BuildD]", "[Home]", "[Goto]", "[GetCoords]"}
- commandLength = {commands[1]:len(), commands[2]:len(), commands[3]:len(), commands[4]:len(), commands[5]:len(), commands[6]:len(), commands[7]:len(), commands[8]:len(), commands[9]:len(), commands[10]:len(), commands[11]:len(), commands[12]:len(), commands[13]:len(), commands[14]:len()}
- selectedCommands = {false, false, true, false, false, false, false, false, false, false, false, false, false, false}
- turtleColor = {2,4,8,16,32,64,512,1024,2048,4096,8192,16384,0}
- textColor = 128
- selectedColor = colors.black
- --selects turtle (x)
- function selectTurtle(x)
- if selectedTurtle[x] == true then
- selectedTurtle[x] = false
- else
- selectedTurtle[x] = true
- end
- end
- --selects command (x)
- function selectCommand(x)
- for i=0,#commands do
- selectedCommand[i] = false
- end
- selectedCommand[x] = true
- end
- --draws all turtles
- function drawTurtles()
- monitor.setCursorPos(1,1)
- monitor.setBackgroundColor(8)
- monitor.clearLine()
- print("Drawing turtles")
- x = 3
- y = 1
- for i=1,#turtles+1,1 do
- if selectedTurtle[i] == true then
- monitor.setTextColor(selectedColor)
- monitor.setCursorPos(x,y)
- monitor.write(turtles[i])
- else
- monitor.setTextColor(1)
- monitor.setCursorPos(x,y)
- monitor.write(turtles[i])
- end
- x=x+5
- end
- end
- --draws all commands
- function drawCommands()
- print("Drawing commands...")
- x = 2
- y = 3
- ox = x
- for i=1, #commands+1 do
- if selectedCommands[i] == true then
- monitor.setTextColor(selectedColor)
- monitor.setCursorPos(x,y)
- monitor.write(commands[i])
- else
- monitor.setTextColor(128)
- monitor.setCursorPos(x,y)
- monitor.write(commands[i])
- end
- xl,yh = monitor.getSize()
- if x+commandLength[i]>xl-1 then
- y=y+1
- x=ox
- else
- x=x+11
- end
- end
- end
- drawTurtles()
- drawCommands()
Advertisement
Add Comment
Please, Sign In to add comment