Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export = peripheral.wrap("right")
- itemstack = {id=4,qty=1}
- bridge = peripheral.wrap("left")
- while true do
- herp = 0
- derp = 0
- dmgvar = 0
- amount = 0
- itemstack = {id=4,qty=1}
- e, msg, d, b, c = os.pullEvent("chat_command")
- for word in msg:gmatch('[^%-]+') do
- value = tonumber(word)
- print(textutils.serialize(itemstack))
- itemstack.id = value
- if string.find(word, ":") then
- itemstack = {id=4,dmg=0,qty=1}
- print(word)
- for whut in word:gmatch('[^%:]+') do
- derp = herp
- herp = whut
- end
- itemstack = {id=4,dmg=0,qty=1}
- if string.find(herp, "~") then
- for nope in herp:gmatch('[^%~]+') do
- dmgvar = amount
- amount = nope
- end
- itemstack.qty = tonumber(amount)
- itemstack.dmg = tonumber(dmgvar)
- itemstack.id = tonumber(derp)
- else
- print(derp)
- print(herp)
- itemstack.dmg = tonumber(herp)
- itemstack.id = tonumber(derp)
- end
- elseif string.find(word, "~") then
- itemstack = {id=4,qty=1}
- for nope in word:gmatch('[^%~]+') do
- dmgvar = amount
- amount = nope
- end
- print(amount)
- print(textutils.serialize(itemstack))
- itemstack.qty = tonumber(amount)
- print(textutils.serialize(itemstack))
- itemstack.id = tonumber(dmgvar)
- end
- print(textutils.serialize(itemstack))
- export.extractItem(itemstack,"down")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement