Jump to content

Draw (Program): Difference between revisions

From Tekkit Lite Server
No edit summary
No edit summary
Line 1: Line 1:
[[File:TLS AD Monkey Business.png|thumb|Image Drawn using the Draw Program]]
'''Draw''' is a custom ComputerCraft program used to display table image information (for example from the Paint program) on an Advanced Monitor.
'''Draw''' is a custom ComputerCraft program used to display table image information (for example from the Paint program) on an Advanced Monitor.



Revision as of 11:40, 17 May 2026

Image Drawn using the Draw Program

Draw is a custom ComputerCraft program used to display table image information (for example from the Paint program) on an Advanced Monitor.

Lua Code

local defaultTerm = term.native

local function printUsage()
    print("draw <monitorSide> <pathToImage> <scale>")
end

local tArgs = { ... }
if #tArgs < 3 then
    printUsage()
    return
end

local monitor = peripheral.wrap(tArgs[1])
local image = paintutils.loadImage(tArgs[2])

local function draw()
    term.redirect(monitor)
    if image then
        term.setBackgroundColor(colors.white)
        monitor.setTextScale(tonumber(tArgs[3]))
        term.clear()
        paintutils.drawImage(image, 1, 1)
    else
        print("Image not found")
    end

    term.redirect(defaultTerm)
end

draw()