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

Paint on Monitor

Started by Alexander0507, 31 December 2012 - 07:35 AM
Alexander0507 #1
Posted 31 December 2012 - 08:35 AM
Minecraft 1.4.6
I want to use the program Paint on a Monitor but when i try do start it i get the message that there is no path.
I had tried it without a monitor and it works.
Does anyone know how to use it on it ?

Sorry for my bad english i`m german
Cloudy #2
Posted 31 December 2012 - 09:13 AM
You need to specify the path to the file you're editing. E.g. "monitor paint lol".
Alexander0507 #3
Posted 31 December 2012 - 09:19 AM
I write a path. I think the problem is that the computer think that the path is the argument
Cloudy #4
Posted 31 December 2012 - 09:39 AM
Please tell me the exact command you are using and the exact error.
Alexander0507 #5
Posted 31 December 2012 - 09:42 AM
I type in :

monitor back paint C:
But on the monitor I see Ussage: paint <path>
Leo Verto #6
Posted 31 December 2012 - 10:26 AM
C: is not a valid filen ame, you need to specify the path and the file name e. g. "paint somedir/paint/logo"
huettner94 #7
Posted 31 December 2012 - 10:56 AM
Does not work for a valid path either:

monitor right paint test

creates the same Problem
Cloudy #8
Posted 31 December 2012 - 11:00 AM
Just typed the exact same thing and had no issue. I have no idea where your issues are coming from.
gngz #9
Posted 31 December 2012 - 11:16 AM
Can be a problem in ARGS of monitor program… I have the same problem here.
Cloudy #10
Posted 31 December 2012 - 11:29 AM
I'm using the exact same program as you, typing the exact same things, and I am not getting any issue. So how can it be a problem with the args of the monitor program? As a test, go into the Lua program and type shell.run("monitor", "right", "paint", "lol") and see if that works.
huettner94 #11
Posted 31 December 2012 - 11:29 AM
I did a little bit of testing with the FTB DW20 Modpack
It seams to be an error in the select function. It returns nothing if the first parameter is greater than 1.

Same problem with the MindCrack Modpack

See spoiler for my test.
Spoiler
Cloudy #12
Posted 31 December 2012 - 11:36 AM
Huh… That's strange. The same thing which works in my dev environment doesn't work in FTB. Will have to investigate further.

Edit:
See the problem. I'm a derp. I somehow thought that coroutine.create accepted varargs after the function to use. D'oh!

Will be fixed in next version of CC - but for the mean time, you can use this replacement monitor program:



function printUsage()
print( "Usage: monitor <side> <program> <arguments>" )
return
end

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

local sSide = tArgs[1]
if peripheral.getType( sSide ) ~= "monitor" then
print( "No monitor on "..sSide.." side" )
return
end

local sProgram = tArgs[2]
local sPath = shell.resolveProgram( sProgram )
if sPath == nil then
print( "No such program: "..sProgram )
return
end

print( "Running "..sProgram.." on "..sSide.." monitor" )

local monitor = peripheral.wrap( sSide )
term.redirect( monitor )

local args = {...}

local function runProgram()
    shell.run( sProgram, select( 3, unpack( args ) ) )
end

local co = coroutine.create(runProgram)

local event = {}
local tFilter = {}

while true do
    if event[1] == "monitor_touch" and event[2] == sSide then
        os.queueEvent( "mouse_click", 1, unpack( event, 3 ) )
    end
    local ok, param = coroutine.resume( co, unpack(event) )
    if not ok then
        term.restore()
        error(param)
    else
        tFilter = param
    end

    if coroutine.status(co) == "dead" then
        break
    end

    event = { os.pullEventRaw() }
end

term.restore()

Either shove it in the zip in place of the monitor program, or create these new folders in your mod folder - "ComputerCraft/lua/rom/programs" - and then create a file called monitor with those contents. It will then take precedence over the one in the zip.
huettner94 #13
Posted 31 December 2012 - 11:50 AM
I tried it again with the MindCrack Pack, but every mod except MCForge and CC were disabled. But it was the same Problem
Cloudy #14
Posted 31 December 2012 - 11:54 AM
See above - edited with a solution!
Alexander0507 #15
Posted 31 December 2012 - 11:57 AM
So there is no fast fix for that problem or ?
Lyqyd #16
Posted 31 December 2012 - 12:01 PM
That is the fast fix.
huettner94 #17
Posted 31 December 2012 - 12:03 PM
YAY it works.
Thanks for the quick fix :)/>
Alexander0507 #18
Posted 31 December 2012 - 12:13 PM
For me it doesn`t work O.o.
it says [string "monitor"] :3: `<eof>` expected
Cloudy #19
Posted 31 December 2012 - 12:41 PM
Then you copied it wrong.
dan200 #20
Posted 31 December 2012 - 10:13 PM
Did you test this change when you made it Cloudy? (the one that caused the bug reported here)
Cloudy #21
Posted 01 January 2013 - 12:51 AM
Did you test this change when you made it Cloudy? (the one that caused the bug reported here)

I did, but either I was working on an old version of the code (which would have been weird as I'd only just changed it) or my test wasn't thorough enough.

Regardless, sorry everyone!