This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
how do i modify the terminal
Started by gummiebrain7134, 30 October 2014 - 09:50 PMPosted 30 October 2014 - 10:50 PM
okay so i am trying to make it so that the terminal(the program that runs on startup by default and on the completion or failure of a program) will also run on the monitor simultaneously. this is to allow the convenience of a larger screen while still not having to swap between the computer and monitor every time i want to use and/or edit another program. anyway the reason why is cause i want to program a game that takes use of a larger screen and be able to edit it easily if i find a problem or just straight up want to tweak something please reply soon; thanks in advance.
Posted 31 October 2014 - 12:11 AM
So… you want to term.redirect while still writing to the default terminal? Easiest way is to make a custom window api, which calls things on both.
Here's the source code of the 1.6 window api, which you can most likely modify to fit your purposes.
Here's the source code of the 1.6 window api, which you can most likely modify to fit your purposes.
Edited on 30 October 2014 - 11:11 PM
Posted 31 October 2014 - 05:58 AM
With MoarPeripherals, I find the easiest way is to just run:
… then use a keyboard to continue controlling the system.
monitor <side> shell
… then use a keyboard to continue controlling the system.
Edited on 31 October 2014 - 04:59 AM
Posted 02 November 2014 - 04:51 AM
thx this helped a lot…
but i have a new problem. i am trying to create a series of apis to help with making simple games; here are the two in question:
the first has to do with the loading saving importing and exporting maps
http://pastebin.com/7tuprjed
(yes i know i stole some code from nitrogen fingers goldrunner)
the second has to do with the ability to have a player controlled sprite on the screen that is still bound by map tiles
http://pastebin.com/zyE07RCM
(please note that main.detKey() simply waits for a key to be pressed and returns the value of that key)
but when i try to use them it throws this error:
maputils(which btw is what i named the first one);41: Expected string, string
but i have a new problem. i am trying to create a series of apis to help with making simple games; here are the two in question:
the first has to do with the loading saving importing and exporting maps
http://pastebin.com/7tuprjed
(yes i know i stole some code from nitrogen fingers goldrunner)
the second has to do with the ability to have a player controlled sprite on the screen that is still bound by map tiles
http://pastebin.com/zyE07RCM
(please note that main.detKey() simply waits for a key to be pressed and returns the value of that key)
but when i try to use them it throws this error:
maputils(which btw is what i named the first one);41: Expected string, string
Posted 02 November 2014 - 06:33 AM
Did the file you were trying to open actually have data?
Posted 03 November 2014 - 01:08 AM
yes it is meant to import an image file created with paint and use the data to create a map within which the player can move
Posted 03 November 2014 - 01:24 AM
local file = fs.open(sPath, "r")
local data = file.readAll()
file.close()
return textutils.unserialize(data)
There's your problem, unserilize only works on serialized tables… and paint doesn't save it's files in that format. Paint saves it's files like this:
(this is a square)
111111111
1 1
1 1
1 1
111111111
Posted 03 November 2014 - 02:15 AM
Indeed, better to use paintutils.loadImage() in that case (given that it converts the file contents to a table for you).