Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mainFrame=24
- rednet.open("right")
- function checkForItems()
- turtle.suck()
- turtle.select(1)
- local detail=turtle.getItemDetail(1)
- if detail==nil then return end
- local id=detail.name
- repeat
- rednet.send(mainFrame,"getValue,"..id,"NanoShop")
- local i,value=rednet.receive()
- if i==mainFrame then
- if value=="false" then
- os.setComputerLabel("This item is worthless")
- else
- os.setComputerLabel("This item is worth "..value.." NanoCredits")
- end
- turtle.select(1)
- turtle.drop()
- sleep(5)
- os.setComputerLabel("Item Values")
- end
- until i==mainFrame
- end
- function setup()
- term.clear()
- term.setCursorPos(1,1)
- print([[Welcome to the NanoTech shop!
- I will assist you by telling you the values of items. This is the ammount of NanoCredit you get for selling this item at the terminal across from me.
- Place an item on the ground in front of me and I will analyse and value the item.]])
- end
- setup()
- while true do
- checkForItems()
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement