Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --script for back server rack
- local component = require("component");
- local event = require("event");
- local shell= require("shell");
- local gpu = component.gpu;
- local unicode = require("unicode");
- local camera = component.camera;
- local distanceCamera=camera.distance;
- local term = require("term")
- local leftScreen = component.get("cd6");
- --gpu.bind(leftScreen);
- local rightScreen = component.get("575");
- --gpu.bind(rightScreen);
- gpu.bind(leftScreen);
- local leftW, leftH = gpu.getResolution()
- gpu.fill(1, 1, leftW,leftH, " ") -- clears the screen
- gpu.bind(rightScreen);
- local rightW, rightH= gpu.getResolution()
- gpu.fill(1, 1, rightW,rightH, " ") -- clears the screen
- local debugEvent=false;
- local eventToBeListening={"touch","walk","chat","motion","component_added","scroll"};
- local function eventListener_example(eve)
- gpu.bind(rightScreen);
- print(eve);
- end
- for eventName= 1, #eventToBeListening do
- event.listen(eventToBeListening[eventName],eventListener_example);
- end
- local array = " .,-=+xX#";
- local charBlock=unicode.char(9608);
- local function camera_draw ()
- local yp = 1;
- gpu.bind(leftScreen);
- gpu.setBackground(0xFFFFFF)
- for j = -0.75,0.25,0.025 do
- local xPos=1;
- for i = -1,1,0.025 do
- local d = distanceCamera(i, 0-j)
- local a = 1
- if d > 0 then a = 2 + (8 - math.min(8, (d/1.2))) end
- gpu.setForeground(0xffffff*a)
- gpu.fill(xPos,yp,1,1,charBlock)
- xPos=xPos+1;
- --term.write(string.sub(array, a, a)) -- works
- --print("test"); prints fine.
- end
- yp=yp+1
- --term.setCursor(1,yp) -- works
- end
- os.sleep(1)
- camera_draw();
- end
- event.timer(1,camera_draw , 1);
- while debugEvent do
- print(event.pull())
- os.sleep(0.05);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement