Advertisement
johnnic431

Untitled

Jun 24th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.51 KB | None | 0 0
  1. local modem=peripheral.wrap("bottom")
  2. local wmod=peripheral.wrap("back")
  3.  
  4. os.loadAPI("fevAPI")
  5.  
  6. function clear()
  7.     term.clear()
  8.     term.setCursorPos(1,1)
  9. end
  10.  
  11. function printInfo()
  12.     print()
  13.     print("N&N corp. and computers will make programs for you")
  14.     print("or install computer systems for shops and more")
  15.     print("Press 2 or 3 for more info on what you would like.")
  16.     print()
  17. end
  18.  
  19. function printOrder()
  20.     clear()
  21.     print("Pricing is a f25 fee to be paid right now, ")
  22.     print("and a f10 fee for 50 lines of code.")
  23.     print("Some APIs may be used in writing your program and will add an f50 fee for each")
  24.     write("Please enter a brief description of the program you would like made: ")
  25.     str=read();
  26.     print("Reservation fee: f25. Please enter your username and PIN")
  27.     write("Username: ")
  28.     unm=read()
  29.     write("PIN: ")
  30.     pin=read("*")
  31.     if fevAPI.sendFunds(unm,pin,"THEMAULER431",25,wmod)=="GOOD_PURCHASE" then
  32.         write("Your payment has been accepted, your program will be created.")
  33.         modem.transmit(8833,8833,str);
  34.     else
  35.         print("Fund transfer failed. please try again.")
  36.     end
  37.     sleep(10)
  38.     clear()
  39. end
  40.  
  41. function printTalkMauler()
  42.     print("Please talk to THEMAULER431 for an estimate on your system.")
  43. end
  44.  
  45. while true do
  46.     print("Press 1 for info, 2 for ordering a program, and 3 for ordering a computer network (e.g. shops, web server)")
  47.     e={os.pullEvent("key")}
  48.     if e[2]==keys.one then
  49.         printInfo()
  50.     elseif e[2]==keys.two then
  51.         printOrder()
  52.     elseif e[2]==keys.three then
  53.         printTalkMauler()
  54.     end
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement