Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- serverComputer = 16
- function OpenAll()
- for _,side in ipairs(rs.getSides()) do
- rednet.open(side)
- end
- end
- function split(str, pat)
- local t = { }
- local fpat = "(.-)"..pat
- local last_end = 1
- local s, e, cap = str:find(fpat, 1)
- while s do
- if s ~= 1 or cap ~= "" then
- table.insert(t,cap)
- end
- last_end = e+1
- s, e, cap = str:find(fpat, last_end)
- end
- if last_end <= #str then
- cap = str:sub(last_end)
- table.insert(t, cap)
- end
- return t
- end
- function runActivate()
- shell.run("clear")
- while true do
- event, param1 = os.pullEvent()
- shell.run("clear")
- if event == "disk" then
- term.write("Enter Card ID: ")
- cardId = tonenumber(read())
- path = disk.getMountPath(param1)
- rPath = path.."/card"
- l = fs.open(rPath, "w")
- l.write(cardId)
- l.close()
- sleep(1)
- shell.run("clear")
- msg = cardId.."!SP!Activate"
- rednet.send(serverComputer, msg)
- print("CARD ACTIVATED")
- disk.eject(param1)
- end
- end
- end
- runActivate()
Add Comment
Please, Sign In to add comment