Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fs.makeDir("SpawnControl")
- local function istable(t) return type(t) == 'table' end
- function save_config(a,b,c)
- sw = fs.open("config.txt", "w")
- sw.writeLine(a)
- sw.writeLine(b)
- sw.writeLine(c)
- sw.close()
- end
- local Connecting = true
- local Port = 6572
- local Modem = peripheral.wrap("top")
- Modem.open(Port)
- Modem.transmit(6571, Port, "Connect")
- while Connecting == true do
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- if istable(message) then
- local info = message
- local port = info.Port
- local mtype = info.MobType
- local bl = 0
- save_config(port,mobtype,bl)
- Modem.transmit(port, Port, "Success")
- print("saved "..mtype)
- end
- print("more Modems? y/n")
- if read() == "n" then
- Connecting = false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement