Advertisement
Guest User

doorController

a guest
Feb 1st, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.19 KB | None | 0 0
  1. component = require("component")
  2. computer = require("computer")
  3. os = require("os")
  4. sides = require("sides")
  5. event = require("event")
  6. red = component.redstone
  7. ms = component.motion_sensor
  8. ic = component.inventory_controller
  9. cb = component.command_block
  10. --frontDoor = sides.bottom
  11. --innerDoor = sides.right
  12. trash = sides.top
  13. reqItems = {"hiemal", "depone", "belloc", "recool", "remake", "lierne", "curage", "elohim", "staves", "kabyle"}
  14. bools = {false, false, false, false, false, false, false, false, false, false}
  15. artCoin = "Artifice:item.artifice.coin"
  16. artDmg = 3
  17. artSize = 1
  18.  
  19. --[[
  20. function frontOpen()
  21.   red.setOutput(frontDoor, 255)
  22. end
  23.  
  24. function frontClose()
  25.   red.setOutput(frontDoor, 0)
  26. end
  27.  
  28. function innerOpen()
  29.   red.setOutput(innerDoor, 255)
  30. end
  31.  
  32. function innerClose()
  33.   red.setOutput(innerDoor, 0)
  34. end
  35. --]]
  36.  
  37. function emptyChest()
  38.   red.setOutput(trash, 255)
  39.   sleep(10)
  40.   red.setOutput(trash, 0)
  41. end
  42.  
  43. function checkItems()
  44.   local name = {}
  45.   local label = {}
  46.   local size = {}
  47.   local dmg = {}
  48.   for i=1, 27 do
  49.     local item = ic.getStackInSlot(sides.top,i)
  50.     if item == nil then
  51.       item = {"Empty slot"}
  52.     else
  53.       --name[i] = item.name
  54.       label[i] = item.label
  55.       dmg[i] = item.damage
  56.       size[i] = item.size
  57.       --print(name[i], label[i], dmg[i], size[i])
  58.       if dmg[i] == artDmg and size[i] == artSize  then
  59.         if label[i] == reqItems[1] then
  60.           bools[1] = true
  61.         elseif label[i] == reqItems[2] then
  62.           bools[2] = true
  63.         elseif label[i] == reqItems[3] then
  64.           bools[3] = true
  65.         elseif label[i] == reqItems[4] then
  66.           bools[4] = true
  67.         elseif label[i] == reqItems[5] then
  68.           bools[5] = true
  69.         elseif label[i] == reqItems[6] then
  70.           bools[6] = true
  71.         elseif label[i] == reqItems[7] then
  72.           bools[7] = true
  73.         elseif label[i] == reqItems[8] then
  74.           bools[8] = true
  75.         elseif label[i] == reqItems[9] then
  76.           bools[9] = true
  77.         elseif label[i] == reqItems[10] then
  78.           bools[10] = true
  79.         end
  80.       end
  81.     end
  82.   end
  83. end
  84.  
  85. function telePlayer(name)
  86.  
  87. end
  88.  
  89. function reward()
  90.  
  91. end
  92.  
  93. function reset()
  94.  
  95. end
  96.  
  97. function instructions()
  98.  
  99. end
  100.  
  101. function gratsMsg()
  102.  
  103. end
  104.  
  105. function wrongMsg()
  106.  
  107. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement