718 posts
Location
Hawaii
Posted 26 March 2012 - 09:33 AM
Ever wanted to be using your monitor and your pc at the same time? This program does that.
(thanks to
Coryf88)
local nativeTerm = term.native or term
local function invoke(sMethod, ...)
nativeTerm[sMethod](...)
for k,sSide in pairs(redstone.getSides()) do
if peripheral.isPresent(sSide) and peripheral.getType(sSide) == "monitor" then
peripheral.call(sSide, sMethod, ...)
end
end
end
term.write = function(text) invoke("write", text) end
term.scroll = function(n) invoke("scroll", n) end
term.setCursorPos = function(x, y) invoke("setCursorPos", x, y) end
term.setCursorBlink = function(:o/>/> invoke("setCursorBlink", :o/>/> end
term.clear = function() invoke("clear") end
term.clearLine = function() invoke("clearLine") end
nativeTerm.clear()
nativeTerm.setCursorPos(1, 1)
print(os.version())
If you put a monitor on the right and run this program, you can use the monitor and see it on your computer screen.
378 posts
Location
In the TARDIS
Posted 26 March 2012 - 06:06 PM
Does this even start programs that have to be started with parameters/arguments?
718 posts
Location
Hawaii
Posted 26 March 2012 - 08:22 PM
Does this even start programs that have to be started with parameters/arguments?
Not yet…
68 posts
Posted 26 March 2012 - 09:13 PM
Awesome! Now I can have hundereds of people gather around a giant monitor to watch me play snake and still play it because the terminal will also be running it!
718 posts
Location
Hawaii
Posted 26 March 2012 - 09:15 PM
Awesome! Now I can have hundereds of people gather around a giant monitor to watch me play snake and still play it because the terminal will also be running it!
I haven't tested that but if something happens, please tell me
68 posts
Posted 26 March 2012 - 09:35 PM
Nope, it displays on Monitor first, and after that program ends on monitor, it shows up on terminal/computer!
718 posts
Location
Hawaii
Posted 26 March 2012 - 09:39 PM
Nope, it displays on Monitor first, and after that program ends on monitor, it shows up on terminal/computer!
Aww, I'm gonna fix that but in the next fix, it might require 2 computers (1 to handle the terminal and the other to handle the monitor)
68 posts
Posted 26 March 2012 - 09:44 PM
And once it terminates on the monitor, the input for the game I was playing (MineDwarf, on RedWorksOS) lagged alot!
9 posts
Posted 27 March 2012 - 11:03 PM
Sorry for asking, but how do you make a monitor.?
Ps: I seem to have managed to break the underline button, It wouldn't stop until I fixed a spelling error ._.
378 posts
Location
In the TARDIS
Posted 27 March 2012 - 11:10 PM
hey what about this: try using tomiss' strutils API to seperate commands wit spaces, in program and parameters. and then you should be able to create a program that can run programs with arguments
61 posts
Location
Pontefract, West Yorkshire, England
Posted 29 March 2012 - 06:13 PM
you should put it to startup and also have the person on startup type which side is the monitor eg
print("which side is your monitor")
monitorside = read()
monitor = peripheral.wrap(monitorside)
Just a suggestion nothing else
1 posts
Posted 01 April 2012 - 04:59 AM
Put the following into your terminal's "startup" or run it as a program.
local nativeTerm = term.native or term
local function invoke(sMethod, ...)
nativeTerm[sMethod](...)
for k,sSide in pairs(redstone.getSides()) do
if peripheral.isPresent(sSide) and peripheral.getType(sSide) == "monitor" then
peripheral.call(sSide, sMethod, ...)
end
end
end
term.write = function(text) invoke("write", text) end
term.scroll = function(n) invoke("scroll", n) end
term.setCursorPos = function(x, y) invoke("setCursorPos", x, y) end
term.setCursorBlink = function(:o/>/> invoke("setCursorBlink", :o/>/> end
term.clear = function() invoke("clear") end
term.clearLine = function() invoke("clearLine") end
nativeTerm.clear()
nativeTerm.setCursorPos(1, 1)
print(os.version())
3 posts
Posted 03 April 2012 - 01:37 AM
a tuturial on how to connect to tv network computer in minecraft will be a great idea
also the fact a code for each tv channels and dont forget a memory bank which radomize shows
864 posts
Location
Sometime.
Posted 03 April 2012 - 03:18 AM
It only loads the monitor once.
You could go into your mods/computercraft folder and add the code to start every thing like hello, snake, etc.
That would be annoying.
Another thing @BlackRa1n
The monitor has a snippet of code with parameters
monitor <side> <application> <forgot this one>
718 posts
Location
Hawaii
Posted 08 April 2012 - 02:45 AM
Thanks
Corfy88, i updated the post
12 posts
Posted 01 June 2012 - 08:09 AM
Hey ComputerCraftFan11,
I like this script and I thought I would tweak it a bit as well as thank you:
local nativeTerm = term.native or term
local function invoke(sMethod, ...)
nativeTerm[sMethod](...)
for k,sSide in pairs(redstone.getSides()) do
if peripheral.isPresent(sSide) and peripheral.getType(sSide) == "monitor" then
peripheral.call(sSide, sMethod, ...)
end
end
end
local tArgs = { ... }
if #tArgs > 1 then
print( "Usage: dual_monitors [-d|--disable]" )
return
end
if tArgs[1] == "-d" or tArgs[1] == "--disable" then
os.unloadAPI("/rom/apis/term")
os.loadAPI("/rom/apis/term")
term.clear()
term.setCursorPos(1, 1)
print(os.version())
else
term.write = function(text) invoke("write", text) end
term.scroll = function(n) invoke("scroll", n) end
term.setCursorPos = function(x, y) invoke("setCursorPos", x, y) end
term.setCursorBlink = function(:)/>/> invoke("setCursorBlink", :P/>/> end
term.clear = function() invoke("clear") end
term.clearLine = function() invoke("clearLine") end
term.clear()
term.setCursorPos(1, 1)
print(os.version())
end
You can turn it off and on and while its on programs will just write to both (unless they access the term api directly).
I tested it on snake :)/>/>
2 posts
Posted 09 June 2012 - 06:24 AM
It only loads the monitor once.
You could go into your mods/computercraft folder and add the code to start every thing like hello, snake, etc.
That would be annoying.
Another thing @BlackRa1n
The monitor has a snippet of code with parameters
monitor <side> <application> <forgot this one>
You forgot one…
You just need to paste it to "shell" program ;)/>/>
Under the line "print( os.version )" or replacing it, it will work anyways…
And it will work always, on any OS, any program, any computer :D/>/>…
And it will just don't work, not make error on computers what don't have monitor :D/>/>
Sorry for bad English, i am from Poland… :)/>/>
Regards,
Czcibor Bohusz-Dobosz a.k.a Kikanek
3 posts
Posted 28 June 2012 - 04:53 PM
I seem to have a problem, how could I fix this
2 posts
Posted 30 June 2012 - 12:37 PM
@UP:
Why are You posting this here?
It's topic about running monitor and computer(craft) at the same time, not program named "moncopy".
But, to it not be offtopic… Where You find the program? It could have bug in code.
As i can see… The error is in line 4.
Regards,
Czcibor Bohusz-Dobosz a.k.a Kikanek
3 posts
Location
Norway
Posted 30 June 2012 - 11:01 PM
I think Po1son script is the monitor script. by looking at the name and the bit of code i see in the background (Name: Moncopy: Monitor Copy)
But I'm only guessing so don't hate me if I'm wrong…
3 posts
Posted 05 July 2012 - 08:30 AM
@UP:
Why are You posting this here?
It's topic about running monitor and computer(craft) at the same time, not program named "moncopy".
But, to it not be offtopic… Where You find the program? It could have bug in code.
As i can see… The error is in line 4.
Regards,
Czcibor Bohusz-Dobosz a.k.a Kikanek
Im posting this here because moncopy is the name of my program running his script and yes I have error on line 4 and I've tryed several different things to fix it but it still does not work that's why I posted it here
718 posts
Location
Hawaii
Posted 05 July 2012 - 09:38 AM
@UP:
Why are You posting this here?
It's topic about running monitor and computer(craft) at the same time, not program named "moncopy".
But, to it not be offtopic… Where You find the program? It could have bug in code.
As i can see… The error is in line 4.
Regards,
Czcibor Bohusz-Dobosz a.k.a Kikanek
Im posting this here because moncopy is the name of my program running his script and yes I have error on line 4 and I've tryed several different things to fix it but it still does not work that's why I posted it here
You copied it wrong.
Can you post the code you used when you copied it? (Or line 4)
3 posts
Posted 05 July 2012 - 05:35 PM
@UP:
Why are You posting this here?
It's topic about running monitor and computer(craft) at the same time, not program named "moncopy".
But, to it not be offtopic… Where You find the program? It could have bug in code.
As i can see… The error is in line 4.
Regards,
Czcibor Bohusz-Dobosz a.k.a Kikanek
Im posting this here because moncopy is the name of my program running his script and yes I have error on line 4 and I've tryed several different things to fix it but it still does not work that's why I posted it here
You copied it wrong.
Can you post the code you used when you copied it? (Or line 4)
line 4: local function invoke (sMethod, . . . )
718 posts
Location
Hawaii
Posted 06 July 2012 - 12:45 AM
@UP:
Why are You posting this here?
It's topic about running monitor and computer(craft) at the same time, not program named "moncopy".
But, to it not be offtopic… Where You find the program? It could have bug in code.
As i can see… The error is in line 4.
Regards,
Czcibor Bohusz-Dobosz a.k.a Kikanek
Im posting this here because moncopy is the name of my program running his script and yes I have error on line 4 and I've tryed several different things to fix it but it still does not work that's why I posted it here
You copied it wrong.
Can you post the code you used when you copied it? (Or line 4)
line 4: local function invoke (sMethod, . . . )
You have spaces between the dots, you have to remove that
2 posts
Posted 07 July 2012 - 02:17 AM
I need help with this code I,m getting, bios:206: [string "monitorset2"]:12: '<eof>'