Advertisement
1vannn

Setup for a prank on a friend. :)

Jun 18th, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. os.unloadAPI("sensors")
  2. os.loadAPI("/rom/apis/sensors")
  3. targets = sensors.getAvailableTargetsforProbe(controller,sensorName,probeName)
  4. while true do
  5. -- Loop through this list of targets getting the info about each one
  6. for i=1,# targets do
  7.   -- Get the target data, i.e. x,y,z coods and type
  8.   targetData = sensors.getSensorReadingAsDict(controller,sensorName,targets[i],probeName)
  9.   -- If the target is a player, i.e. has the name "vq" then check if it is close
  10.   if targetData["name"] == "hosscat"  then
  11.     rs.setOutput("bottom",true)
  12.   elseif targetData["name"]
  13.     os.reboot()
  14.   end
  15. end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement