Advertisement
guitarplayer616

DoctorWhoStoryGen

Jun 23rd, 2015
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.21 KB | None | 0 0
  1. if not fs.exists(shell.resolve("XMLua")) then
  2.     local h = fs.open("XMLua","w")
  3.     local code = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode('SDvxiBJc')).readAll()
  4.     h.write(code)
  5.     h.close()
  6. end
  7.  
  8. function draw(words,col,back)
  9.     col = col or colors.lightGray
  10.     back = back or colors.black
  11.     term.setTextColor(col)
  12.     term.setBackgroundColor(back)
  13.     write(words)
  14. end
  15.  
  16. shell.run("clr")
  17. draw("doctorwho",colors.lightBlue)
  18. draw(" , ")
  19. draw("starwars",colors.orange)
  20. draw(" , ")
  21. draw("simpsons",colors.yellow)
  22. draw(" , ")
  23. draw("futurama",colors.lime)
  24. draw(" , ")
  25. draw("holygrail",colors.purple)
  26. draw(" , ")
  27. draw("dexter",colors.brown)
  28. draw(" , ")
  29. draw("arresteddevelopment",colors.magenta)
  30. draw(" or ")
  31. draw("loremipsum?\n",colors.pink)
  32. draw("> ",colors.green)
  33. local choice = read()
  34. term.setTextColor(colors.white)
  35.  
  36. local link = 'http://api.chrisvalleskey.com/fillerama/get.php?count=100&format=xml&show='..textutils.urlEncode(choice)
  37. local server = http.post(link)
  38. local res = server.readAll()
  39. server.close()
  40. local h = fs.open("response",'w')
  41. h.write(res)
  42. h.close()
  43.  
  44. local mon = peripheral.find("monitor")
  45. if mon then
  46.     term.redirect(mon)
  47. end
  48. shell.run("XMLua response")
  49. shell.run("edit txt2")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement