Advertisement
Guest User

pim

a guest
Dec 14th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. local pimLocation = "left"
  2. local pimDepotLocation = "down" --Must be a direction
  3. local pim = peripheral.wrap(pimLocation)
  4. local ignoreWhitelist = true
  5. local whitelist = {"abc123mewot", "Liylya", "The_Atraedies"}
  6.  
  7. function isNameEnemy(name)
  8.   if name == "pim" then
  9.     return false
  10.   end
  11.   if ignoreWhitelist then
  12.     return true
  13.   end
  14.   for k, v in pairs(whitelist) do
  15.     if name == v then
  16.       return false
  17.     end
  18.   end
  19.   return true
  20. end
  21. function clearInventory(pim)
  22.   local c = pim.getInventorySize()
  23.   for i=1, c do
  24.     print(pim.getStackInSlot(i))
  25.     pim.pushItem(pimDepotLocation, i)
  26.   end
  27. end
  28.  
  29. while true do
  30.   invName = pim.getInventoryName()
  31.   if isNameEnemy(invName) then
  32.     print("Clearing inventory of" .. invName)
  33.     clearInventory(pim)
  34.   end
  35.   sleep(0.1)
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement