Advertisement
Sir_Popsilots

Turtle remote control GUI

Sep 16th, 2023 (edited)
1,268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.36 KB | None | 0 0
  1. local choosenColor = colors.black
  2.  
  3. local function defultcolors()
  4.     term.setBackgroundColor(colors.black)
  5.     term.setTextColor(colors.white)
  6. end
  7.  
  8. local function drawArrows()--funnction to draw the horzontal movment arrows
  9.     term.setBackgroundColor(colors.lightBlue)
  10.     term.setTextColor(colors.black) --setting the colors for the movment buttons
  11.  
  12.  
  13.     local CenterCords = {x = 13, y = 13}
  14.     term.setCursorPos(CenterCords.x,CenterCords.y - 1)-- drawing the forwards arrow
  15.     term.write("^")
  16.     term.setCursorPos(CenterCords.x-1,CenterCords.y)-- drawing the turn left arrow
  17.     term.write("<")
  18.     term.setCursorPos(CenterCords.x,CenterCords.y + 1)--drawting the turn backgwards arrow
  19.     term.write("v")
  20.     term.setCursorPos(CenterCords.x + 1, CenterCords.y)--drawing the turn right arrow
  21.     term.write(">")
  22.  
  23.     defultcolors()
  24. end
  25.  
  26. local function drawConnectionStatus(goodORbad) --a function to draw the connection status green is good red is none
  27.     term.setCursorPos(1,1)
  28.     term.write("STATUS:")
  29.     if goodORbad then
  30.         term.setBackgroundColor(colors.lime)--EChu83q1
  31.     else
  32.         term.setBackgroundColor(colors.red)
  33.     end
  34.     term.write("   ")
  35.     defultcolors()
  36. end
  37.  
  38. local function drawUI()
  39.     drawArrows()
  40.     drawConnectionStatus(false)
  41. end
  42.  
  43. return {drawUI = drawUI(),drawConnectionStatus = drawConnectionStatus()}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement