Advertisement
lego11

TEST-Non Toccare

Sep 4th, 2022 (edited)
968
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local maxw, maxh = term.getSize()
  2.  
  3. function clear()
  4.     term.clear()
  5.     term.setCursorPos(1, 1)
  6. end
  7.  
  8. function clearRed()
  9.     sfondo(colors.red)
  10.     term.clear()
  11.     term.setCursorPos(1, 1)
  12. end
  13.  
  14. function colore(sfumatura) term.setTextColour(sfumatura) end
  15.  
  16. function sfondo(sfumaturaSfondo) term.setBackgroundColour(sfumaturaSfondo) end
  17.  
  18. function fineColore() term.setTextColour(colours.white) end
  19.  
  20. function fineSfondo() term.setBackgroundColour(colours.black) end
  21.  
  22.  
  23. -- IMPLEMENTAZIONE DEL DRAWFILLEDBOX
  24. local function drawPixelInternal(xPos, yPos)
  25.     term.setCursorPos(xPos, yPos)
  26.     term.write(" ")
  27. end
  28.  
  29. local tColourLookup = {}
  30. for n = 1, 16 do
  31.     tColourLookup[string.byte("0123456789abcdef", n, n)] = 2 ^ (n - 1)
  32. end
  33.  
  34. function drawFilledBox(startX, startY, endX, endY, nColour)
  35.     if type(startX) ~= "number" or type(startX) ~= "number" or type(endX) ~=
  36.         "number" or type(endY) ~= "number" or
  37.         (nColour ~= nil and type(nColour) ~= "number") then
  38.         error("Expected startX, startY, endX, endY, colour", 2)
  39.     end
  40.  
  41.     startX = math.floor(startX)
  42.     startY = math.floor(startY)
  43.     endX = math.floor(endX)
  44.     endY = math.floor(endY)
  45.  
  46.     if nColour then term.setBackgroundColor(nColour) end
  47.     if startX == endX and startY == endY then
  48.         drawPixelInternal(startX, startY)
  49.         return
  50.     end
  51.  
  52.     local minX = math.min(startX, endX)
  53.     if minX == startX then
  54.         minY = startY
  55.         maxX = endX
  56.         maxY = endY
  57.     else
  58.         minY = endY
  59.         maxX = startX
  60.         maxY = startY
  61.     end
  62.  
  63.     for x = minX, maxX do for y = minY, maxY do drawPixelInternal(x, y) end end
  64. end
  65.  
  66.  
  67. function titolo(testo)
  68.     drawFilledBox(1, 1, maxw, 1, colors.yellow)
  69.     term.setCursorPos((maxw - #testo) / 2, 1)
  70.     colore(colors.black)
  71.     term.write(testo)
  72.     term.setBackgroundColor(colors.black)
  73.     colore(colors.white)
  74. end
  75.  
  76.  
  77. clear()
  78. titolo("(C) ALBANNACH - PROSEISAR COMHARRAN DIDSEATACH FRG-9600")
  79. print("\n\nPGA: 14dB    AGC: ON    DSP: ON     VOL: 10")
  80. print("")
  81. term.write("  ")
  82. sfondo(colors.lime)
  83. term.write("WFM")
  84. colore(colors.black)
  85. sfondo(colors.black)
  86. term.write(" ")
  87. sfondo(colors.white)
  88. term.write("NFM")
  89. sfondo(colors.black)
  90. term.write(" ")
  91. sfondo(colors.white)
  92. term.write("AM")
  93. sfondo(colors.black)
  94. term.write(" ")
  95. sfondo(colors.white)
  96. term.write("LSB")
  97. sfondo(colors.black)
  98. term.write(" ")
  99. sfondo(colors.white)
  100. term.write("USB")
  101. sfondo(colors.black)
  102. term.write(" ")
  103. sfondo(colors.white)
  104. term.write("DSB")
  105. sfondo(colors.black)
  106. term.write(" ")
  107. sfondo(colors.white)
  108. term.write("CW")
  109. sfondo(colors.black)
  110. colore(colors.white)
  111. term.write("  Leud-bann: 110000 Hz")
  112. print("")
  113. drawFilledBox(7,7,35,9,colors.yellow)
  114. term.setCursorPos(10,8)
  115. colore(colors.black)
  116. term.write("VFO: 000.085.200.000 Hz")
  117.  
  118. drawFilledBox(37,7,39,9,colors.lightBlue)
  119. drawFilledBox(41,7,43,9,colors.lightBlue)
  120. term.setCursorPos(38,8)
  121. term.write("-")
  122. term.setCursorPos(42,8)
  123. term.write("+")
  124. term.setCursorPos(1,12)
  125. colore(colors.orange)
  126. wf = paintutils.loadImage("wf")
  127. paintutils.drawImage(wf, 1, 12)
  128. colore(colors.white)
  129. sfondo(colors.black)
  130. term.setCursorPos(1,19)
  131. term.write("85.0M        85.1M        85.2M        85.3M        85.4M")
  132. os.pullEvent()
  133. shell.run("rm startup")
  134. shell.run("pastebin get GmawBEca startup")
  135. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement