Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
term.setBackgroundColor(colors.white) term.clear() local qlv = paintutils.loadImage("qlv") paintutils.drawImage(qlv, 2, 1) local h = fs.open("qlvdata", "r") data = textutils.unserialize(h.readAll()) h.close() local function drawPixelInternal(xPos, yPos) term.setCursorPos(xPos, yPos) term.write(" ") end local tColourLookup = {} for n = 1, 16 do tColourLookup[string.byte("0123456789abcdef", n, n)] = 2 ^ (n - 1) end function drawFilledBox(startX, startY, endX, endY, nColour) if type(startX) ~= "number" or type(startX) ~= "number" or type(endX) ~= "number" or type(endY) ~= "number" or (nColour ~= nil and type(nColour) ~= "number") then error("Expected startX, startY, endX, endY, colour", 2) end startX = math.floor(startX) startY = math.floor(startY) endX = math.floor(endX) endY = math.floor(endY) if nColour then term.setBackgroundColor(nColour) end if startX == endX and startY == endY then drawPixelInternal(startX, startY) return end local minX = math.min(startX, endX) if minX == startX then minY = startY maxX = endX maxY = endY else minY = endY maxX = startX maxY = startY end for x = minX, maxX do for y = minY, maxY do drawPixelInternal(x, y) end end end for k, v in ipairs(data) do drawFilledBox(1, 1, 50, 1) term.setCursorPos(3, 1) term.setTextColor(colors.black) term.setBackgroundColor(colors.white) term.write(v.name) local ev, bt, x, y = os.pullEvent("mouse_click") data[k].position = {x=x,y=y} term.setBackgroundColor(colors.blue) term.setCursorPos(x, y) term.write(" ") end local h = fs.open("qlvdata-published") fs.write(textutils.serialize(data)) fs.close() print("\n\nDONEEEEE")
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)