Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chest = peripheral.wrap("front")
- local node = peripheral.wrap("back")
- local size = chest.getInventorySize()
- local jetpack = false
- local payment = false
- local shardPayment = {}
- local shardSlot = {}
- local jetpackSlot = 0
- for x = 1,6 do
- shardPayment[x] = false
- shardSlot[x] = 0
- end
- local function getJetpack()
- for x = 1,size do
- local slot = chest.getStackInSlot(x)
- if slot.id == "simplyjetpacks:jetpacks" then
- if slot.dmg == 2 or slot.dmg == 3 or slot.dmg == 4 or slot.dmg == 5 then -- Check Regular
- jetpackSlot = x
- return true
- break
- elseif slot.dmg == 102 or slot.dmg == 103 or slot.dmg == 104 or slot.dmg == 105 then -- Check Armored
- jetpackSlot = x
- return true
- break
- end
- elseif slot.id == "simplyjetpacks:jetpacksEIO" then
- if slot.dmg == 2 or slot.dmg == 3 or slot.dmg == 4 or slot.dmg == 5 then -- Check Regular
- jetpackSlot = x
- return true
- break
- elseif slot.dmg == 102 or slot.dmg == 103 or slot.dmg == 104 or slot.dmg == 105 then -- Armored
- jetpackSlot = x
- return true
- break
- end
- elseif slot.id == "IC2:itemArmorJetpackElectric" then
- jetpackSlot = x
- return true
- break
- elseif slot.id == "GraviSuite:advNanoChestPlate" or slot.id == "GraviSuite:advJetpack" then
- jetpackSlot = x
- return true
- break
- else
- return false
- end
- end
- end
- local function getPayment()
- for shard = 1,6 do
- for x = 1,size do
- local slot = chest.getStackInSlot(x)
- if slot.id == "Thaumcraft:ItemShard" then
- if slot.dmg == shard - 1 then
- shardPaymet[shard] = true
- shardSlot[shard] = x
- end
- end
- if shardPayment[1] and shardPayment[2] and shardPayment[3] and shardPayment[4] and shardPayment[5] and shardPayment[6]then
- return true
- break
- else
- return false
- end
- end
- end
- end
- while true do
- if redstone.getInput("right") then
- jetpack = getJetpack()
- if jetpack then
- payment = getPayment()
- if payment then
- for x = 1,6 do
- chest.pushItem(DOWN,x,1)
- end
- end
- chest.pullItem(EAST,1,1)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment