jakendrick3

Horyzon Bank Admin Client

Jun 17th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local jenisis = require("jenisis")
  2. local component = require("component")
  3. local textutils = require("serialization")
  4. local modem = component.getPrimary("modem")
  5. local event = require("event")
  6.  
  7. local static = {
  8.   "SRA Bank Admin Software",
  9.   "Property of Horyzon"
  10. }
  11.  
  12. local menu = {
  13.   "Do Order",
  14.   "Flag Account",
  15.   "Exit"
  16. }
  17.  
  18. local function broadcast(packet)
  19.   modem.broadcast(1024, textutils.serialize(packet))
  20. end
  21.  
  22. local function receive()
  23.   event_ = {event.pull(5, "modem_message")}
  24.  
  25.   return textutils.unserialize(event_[6])
  26. end
  27.  
  28. local function doOrder()
  29.   target = jenisis.inputBar("Enter the target account:")
  30.   amount = tonumber(jenisis.inputBar("Enter amount:"))
  31.   pass = jenisis.inputBar("Master Password:", true)
  32.  
  33.   local packet = {
  34.     type = "doorder",
  35.     target = target,
  36.     amount = amount,
  37.     masterpass = pass
  38.   }
  39.  
  40.   broadcast(packet)
  41.   local result = receive()
  42.  
  43.   if result then
  44.     jenisis.errorMes("Sucess", "green")
  45.   else
  46.     jenisis.errorMes("Failure")
  47.   end
  48. end
  49.  
  50. local function flag()
  51.   local target = jenisis.inputBar("Enter target:")
  52.  
  53.   local packet = {
  54.     type = "flag",
  55.     target = target
  56.   }
  57.  
  58.   broadcast(packet)
  59.   local result = receive()
  60.  
  61.   if result then
  62.     jenisis.errorMes("Success", "green")
  63.   else
  64.     jenisis.errorMes("Failure")
  65.   end
  66. end
  67.  
  68. while true do
  69.   local cselected = jenisis.drawScreen(static, menu)
  70.  
  71.   if cselected == 1 then
  72.     doOrder()
  73.   elseif cselected == 2 then
  74.     flag()
  75.   else
  76.     break
  77.   end
  78. end
Add Comment
Please, Sign In to add comment