SHARE
TWEET

startup.lua

a guest Mar 26th, 2020 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local sensor = peripheral.wrap("left")
  2. local laser = peripheral.wrap("right")
  3. sleep(1)
  4. while true do
  5.     for _, entity in pairs(sensor.sense()) do
  6.        name = entity.name
  7.        x = entity.x
  8.        y = entity.y
  9.        z = entity.z
  10.    
  11.        pitch= -math.atan2(y, math.sqrt(x * x + z * z))
  12.        yaw = math.atan2(-x, z)
  13.        if name ~= 'Item' and name~='Arrow' and name~= 'XPOrb' and name~='plethora:laser' and name~='bluesnow418' then
  14.            print(name)    
  15.            laser.fire(math.deg(yaw),math.deg(pitch),5)
  16.       end
  17.    end
  18. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top