Newbie Doubt | Running a Program onto a Monitor

Started by Equality, Feb 15, 2019, 01:52 AM

Previous topic - Next topic

Equality

Hi!

I'm a newbie programmer whose trying to improve my programming skills but I get confused with lua language.

The thing is, I'm trying to run the program "A" in an advanced monitor which is connected to the advanced computer via wired modem on back side.

Here is the program "start", which SHOULD run "A" on monitor:

"
shell.run("monitor", "back", "A")
"



Here is the program "A" (the program is meant to be an infinite loop which sents a redstone output and waits 2 min, it also counts the number of times the loop has run):

"
local aux, i
aux = tonumber(1)
i = tonumber(0)
while aux == 1 do
term.clear()
term.setCursorPos(1,1)
redstone.setOutput("right",true)
sleep(1)
redstone.setOutput("right",false)
i = i+1
print("Value of I: ")
print(i)
sleep(120)
end
"


Im actually stuck, when I run the program "start" it only appears "No monitor named back" on screen.

Hope u can help me.
Sincerely, Equa ^^

KingofGamesYami

#1
You need to use the name of the monitor, which is given when you enabled it's wired modem.

"back" cannot be used because it is possible to connect multiple monitors to the same wired network.
I'm a ComputerCraft veteran with over 3k posts on the old ComputerCraft Forum.  I'm mostly inactive in CC having moved on to bigger, more interesting projects but still contribute to the community.