Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local jenisis = require("jenisis")
- local component = require("component")
- local textutils = require("serialization")
- local modem = component.getPrimary("modem")
- local event = require("event")
- local static = {
- "SRA Bank Admin Software",
- "Property of Horyzon"
- }
- local menu = {
- "Do Order",
- "Flag Account",
- "Exit"
- }
- local function broadcast(packet)
- modem.broadcast(1024, textutils.serialize(packet))
- end
- local function receive()
- event_ = {event.pull(5, "modem_message")}
- return textutils.unserialize(event_[6])
- end
- local function doOrder()
- target = jenisis.inputBar("Enter the target account:")
- amount = tonumber(jenisis.inputBar("Enter amount:"))
- pass = jenisis.inputBar("Master Password:", true)
- local packet = {
- type = "doorder",
- target = target,
- amount = amount,
- masterpass = pass
- }
- broadcast(packet)
- local result = receive()
- if result then
- jenisis.errorMes("Sucess", "green")
- else
- jenisis.errorMes("Failure")
- end
- end
- local function flag()
- local target = jenisis.inputBar("Enter target:")
- local packet = {
- type = "flag",
- target = target
- }
- broadcast(packet)
- local result = receive()
- if result then
- jenisis.errorMes("Success", "green")
- else
- jenisis.errorMes("Failure")
- end
- end
- while true do
- local cselected = jenisis.drawScreen(static, menu)
- if cselected == 1 then
- doOrder()
- elseif cselected == 2 then
- flag()
- else
- break
- end
- end
Add Comment
Please, Sign In to add comment