Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print([[Welcome to the GTech Network Stress-Testing Utility, which hopefully does not contain much code at all from the evil Terrariolan one.]])
- local modem = peripheral.find "modem"
- local function prompt(question, default, conversion)
- local text = question
- if default then text = text .. " (" .. tostring(default) .. ")" end
- text = text .. ": "
- while true do
- write(text)
- local input = read()
- if input == "" then return default end
- if conversion then
- local value = conversion(input)
- if value == nil then printError("Failed to parse input.") end
- return value
- else
- return input
- end
- end
- end
- local channel = prompt("Select channel", rednet.CHANNEL_BROADCAST, tonumber)
- local reply_channel = prompt("Select reply channel", rednet.CHANNEL_BROADCAST, tonumber)
- local message = prompt("Input thing to send (random numbers)")
- while true do
- local to_send = message or math.random(0, 0xFFFFFFF)
- modem.transmit(channel, reply_channel, to_send)
- sleep()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement