Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- DementedChicken_'s DSU Client
- Remember to make:
- 1) value.txt to store the item price
- 2) item.txt to store the item name
- --]]
- component = require("component")
- event = require("event")
- dsu = component.deep_storage_unit
- --vars
- channel = 0
- file = io.open("item.txt","r")
- item = file:read("*all")
- file:close()
- file2 = io.open("value.txt","r")
- value = file2:read("*all")
- value = tonumber(value)
- file2:close()
- --modem connection
- print "Connecting to Server..."
- os.sleep(1)
- print "LOADING...27%"
- os.sleep(1)
- print "LOADING...74%"
- os.sleep(1)
- print "LOADING...98%"
- component.modem.open(channel)
- print "Connection Established"
- --calculate
- while (1==1) do
- store1 = dsu.getStoredCount()
- os.sleep(1)
- store2 = dsu.getStoredCount()
- if store1 == store2 then
- buffer = 0
- end
- if (store1 == store2) == false then
- total = store2 * value
- component.modem.broadcast(channel,item,total)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement