ZNZNCOOP

3d1

Nov 28th, 2014
195
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI('vr')
  2. cx,cy,cz=-423,6,-182
  3. vr.CreateWorld('monitor_0','monitor_1','monitor_2','monitor_3')
  4. p=peripheral.wrap('bottom')
  5. user=p.getPlayerByName(({...})[1])
  6. if not user then return end
  7. ent=user.asEntity()
  8. ent.setPosition(cx,cy,cz)
  9.  
  10. function tree(self)
  11.   local h=2
  12.   vr.vline(0,h/4,0,0,colors.brown)
  13.   vr.wall(-1,0,   h/4,1.5*h,h/4,  0,0,self.col)
  14.   vr.wall(0,0,    h/4,1.5*h,h/4, -1,0,self.col)
  15.   vr.wall(1,0,    h/4,1.5*h,h/4,  0,0,self.col)
  16.   vr.wall(0,0,    h/4,1.5*h,h/4,  1,0,self.col)
  17.   vr.wall(-0.75,0,h,2*h,h,        0,0,self.col)
  18.   vr.wall(0,0,    h,2*h,h,        -0.75,0,self.col)
  19.   vr.wall(0.75,0, h,2*h,h,        0,0,    self.col)
  20.   vr.wall(0,0,    h,2*h,h,        0.75,0, self.col)
  21. end
  22.  
  23. vr.CreateObj(-2,0,4,tree,{col=colors.lime})
  24. vr.CreateObj( 2,0,4,tree,{col=colors.yellow})
  25.  
  26. while true do
  27. --[[  vr.wall(-1.5,1.5,1,1,0,5.99,5.99,colors.red,colors.yellow)
  28.   vr.wall(-1.5,-0.5,2,2,1,5.99,5.99,colors.red,colors.yellow)
  29.   vr.wall(0.5,1.5,2,2,1,5.99,5.99,colors.red,colors.yellow)
  30.   vr.wall(-2,0,2,3.5,2,5.99,5.99,colors.red,colors.yellow)
  31.   vr.wall(0,2,3.5,2,2,5.99,5.99,colors.red,colors.yellow)
  32.   vr.wall(1.5,-1.5,2,2,0,10,10,colors.red,colors.yellow)
  33.   vr.wall(0,-2,3.5,2,2,10,10,colors.red,colors.yellow)
  34.   vr.wall(2,0,2,3.5,2,10,10,colors.red,colors.yellow)
  35.   vr.wall(-1.5,-1.5,2,2,0,10,6,colors.red,colors.yellow)
  36.   vr.wall(1.5,1.5,2,2,0,6,10,colors.red,colors.yellow)
  37.   for z=5.9,10.1,0.1 do
  38.     vr.line(-2,0,2,3.5,z,z,colors.brown)
  39.     vr.line( 2,0,2,3.5,z,z,colors.brown)
  40.   end]]
  41.   vr.draw()
  42.  
  43.   repeat
  44.     sleep(0)
  45.     x,y,z=ent.getPosition()
  46.     if not x or math.abs(x-cx)>3 or math.abs(z-cz)>3 then return end
  47.     if y>cy+0.5 then ent.setPosition(cx,cy,cz+6) return end
  48.   until math.abs(x-cx)>0.1 or math.abs(z-cz)>0.1
  49.   vr.movePlayer(x-cx,0,cz-z)
  50.   ent.setPosition(cx,cy,cz)
  51. end
RAW Paste Data