This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
theeboris's profile picture

How can I fix this

Started by theeboris, 11 November 2012 - 05:32 AM
theeboris #1
Posted 11 November 2012 - 06:32 AM
This is the code

local paintgui = paintutils.loadImage("/gui/paint")
paintutils.drawImage(paintgui, 0, 0)
term.setCursorPos(24,7)
print("Path")
term.setCursorPos(1,8)
input = io.read()
shell.run("/programs/paint/paint, input")
The error: No such program
/programs/paint/paint exist
Kingdaro #2
Posted 11 November 2012 - 07:06 AM
Two things. The program is actually in /rom/programs/color/paint, and that you haven't separated your arguments for shell.run. Also, you can just run 'paint' without having to type it's full, actual path. The last line should go something like this:
shell.run("paint", "input")
Lyqyd #3
Posted 11 November 2012 - 07:19 AM
Is it? I seem to recall it being in rom/programs/color/paint for some reason.
Kingdaro #4
Posted 11 November 2012 - 07:23 AM
Is it? I seem to recall it being in rom/programs/color/paint for some reason.
Yep, it's /color/paint, my mistake.
theeboris #5
Posted 12 November 2012 - 02:42 AM
I have now but i get this error: paintstart:7: attempt to index ? (a nil value)

local paintgui = paintutils.loadImage("/gui/paint")
paintutils.drawImage(paintgui, 0, 0)
term.setCursorPos(24,7)
print("Path")
term.setCursorPos(1,8)
input = io.read()
shell.run("paint", "input")
Kingdaro #6
Posted 12 November 2012 - 04:22 AM
I'm not sure if this is it, but you should probably remove the quotes around "input" on the last line.
theeboris #7
Posted 12 November 2012 - 05:07 AM
If I have this I only see 7 when i give a input.

local paintgui = paintutils.loadImage("/gui/paint")
paintutils.drawImage(paintgui, 0, 0)
term.setCursorPos(24,7)
print("Path")
term.setCursorPos(1,8)
input = io.read()
print("7")
shell.run("paint", input)
print("9")