Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --v 1.1 -- this is untested but it is supposed to make it so that you can start at a higher monitor than monitor_0 please post on the forums if there is a problem
- --this is a program made by columna1 please do not claim as your own
- --You have permission to edit and use this code as you please just make sure to credit me
- --How to use
- --make a bunch of monitors THEY ALL HAVE TO BE THE SAME SIZE all next to eachother
- --make sure you make a rectangle
- --connect each one with a wired modem and connect them all to the computer on the left side
- --NOW LISTEN UP THIS IS IMPORTANT*********!!!!!!!!!!!!!!
- --you have to connect all the monitors in a certain way
- --facing the frot you need to connect each monitor from left to right starting from the first row
- --then you need to go down to the second row and add from left to right one by one
- --and continue one by one etc
- --some tips if you mess up or already have monitors connected with modems in a world
- --you can change the startmonitor variable below to specfy the first monitor
- --if you accidentaly clicked one and connected it in the wrong order you can use some nbt editor to go
- --to that block and set the value "peripheral id" to -1 and go to the save folder and into the computer folder
- --and open the file: lastid_monitor and change it to -1 or whichever was the last correct connection
- --if you already placed some:
- --go to the save folder and into the computer folder
- --and open the file: lastid_monitor and change it to -1
- -- limitations:
- --all monitors have to be the same size!
- --there cant be uneven edges (it cant have a layer that is 3 wide when the rest is 4)
- startmonitor = 0 -- change this is your monitors dont start at monitor_0
- sm = startmonitor
- modem = peripheral.wrap("left")
- xmons = 8
- ymons = 6
- scale = 0.5
- modem.callRemote("monitor_"..sm,"setTextScale",scale)
- xchars,ychars = modem.callRemote("monitor_"..sm,"getSize")
- arg = {...}
- if fs.exists(arg[1]) == false then
- error("no such file")
- end
- dataa = ""
- line = {}
- rum = 1
- l = 0
- file = fs.open(arg[1],"r")
- while rum do
- rum = file.readLine()
- l = l + 1
- if rum then line[#line+1] = rum end
- end
- print(l)
- lines = l
- file.close()
- for i = 0,xmons*ymons - 1 do
- modem.callRemote("monitor_"..i+sm,"setTextScale",scale)
- modem.callRemote("monitor_"..i+sm,"clear")
- end
- function str(sn,stri)
- if split > 1 then
- stt = stri:sub((sn-1)*xchars,sn*xchars)
- return stt
- end
- end
- function printLine(line,strings)
- mon = 0
- for d = 1,ymons-1 do
- if line > ychars*d then mon = xmons*d end
- end
- split = 1
- for c = 1,xmons - 1 do
- if #strings > xchars*c then split = c+1 end
- end
- monadd = 0
- for s = 1,split do
- modem.callRemote("monitor_"..mon+monadd+sm,"setCursorPos",1,line-((mon/xmons)*ychars))
- modem.callRemote("monitor_"..mon+monadd+sm,"write",str(s,strings))
- monadd = monadd + 1
- end
- end
- fi = fs.open(arg[1],"r")
- if ychars*ymons > lines then
- for i = 1,lines-1 do
- printLine(i,fi.readLine())
- end
- else
- for i = 1,ychars*ymons do
- printLine(i,fi.readLine())
- end
- end
- fi.close()
Advertisement
Add Comment
Please, Sign In to add comment