Advertisement
DanielLaby99

LabyOS [XP] Browser

Feb 11th, 2014
49,521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.06 KB | None | 0 0
  1. -- ########################## -- Funktionen -- ############################ --
  2. local function s(...) return sleep(...) end
  3. local function w(...) return write(...) end
  4. local function p(...) return print(...) end
  5. local function tw(...) return term.write(...) end
  6. local function scp(...) return term.setCursorPos(...) end
  7. local function sbc(...) return term.setBackgroundColor(...) end
  8. local function stc(...) return term.setTextColor(...) end
  9. local function tc(...) return term.clear(...) end
  10. local function tcl(...) return term.clearLine() end
  11. local function scb(...) return term.setCursorBlink(...) end
  12. local function ts(...) return term.scroll(...) end
  13. local function r(...) return shell.run(...) end
  14. local function para(...) return parallel.waitForAny(...) end
  15. local function sw(...) return textutils.slowWrite(...) end
  16. local function sp(...) return textutils.slowPrint(...) end
  17. -- ########################## -- Einstellungen -- ############################ --
  18. browsepath = "http://"
  19. version = "1.1"
  20. Pname = "Browser"
  21. -- ########################################################################### --
  22. sbc(1)
  23. r("clear")
  24. sbc(2048)
  25. scp(1,1)
  26. write(" ")
  27. scp(1,2)
  28. sbc(256)
  29. write(" ")
  30. sbc(2048)
  31. scp(1,1)
  32. stc(1)
  33. write(Pname.." "..version)
  34. sbc(256)
  35. scp(1,2)
  36. stc(32768)
  37. write(browsepath)
  38. scp(51,1)
  39. stc(1)
  40. sbc(16384)
  41. write("X")
  42. stc(1)
  43. sbc(8192)
  44. scp(1,19)
  45. w([[ Start ]])
  46. sbc(2048)
  47. w([[ ]])
  48. function browsetab()
  49. timeprint1()
  50. scp(8,19)
  51. sbc(8)
  52. r("LabyOS/Task/task")
  53. sbc(256)
  54. stc(32768)
  55. scp(8,2)
  56. w(" ")
  57. sbc(1)
  58. for LoadpageE=3,10 do
  59. scp(1,LoadpageE)
  60. write(" ")
  61. end
  62. -- ######################## Update Log #################### --
  63. scp(2,6)
  64. w("URLs:")
  65. scp(2,7)
  66. w("- YouTube.com [Subsviewer]")
  67. scp(2,8)
  68. w("- LabyStudio.de [LabyStore]")
  69. scp(1,9)
  70. p(" ")
  71. p(" NEW APPS -> LabyStore ")
  72. p(" ")
  73. p(" ")
  74. p(" ")
  75. p(" ")
  76. p(" ")
  77. p(" ")
  78. p(" ")
  79. scp(1,18)
  80. w("More coming soon!")
  81. -- ######################################################## --
  82. sbc(256)
  83. scp(8,2)
  84. browsepath = read()
  85. scp(20,4)
  86. sbc(1)
  87.  
  88. for LoadpageE=3,10 do
  89. scp(1,LoadpageE)
  90. write(" ")
  91. end
  92. sbc(32)
  93. scp(1,3)
  94. for LoadpageT=0,5 do
  95. w(" ")
  96. sleep(0,1)
  97. end
  98. sbc(1)
  99. scp(1,3)
  100. write(" ")
  101. -- ############################### Links ################################ --
  102. -- #################### YouTube #################### --
  103. if browsepath == "youtube.com" or browsepath == "youtube.de" or browsepath == "YouTube.com" or browsepath == "Youtube.com" then
  104. scp(8,2)
  105. sbc(256)
  106. w("youtube.com/user/")
  107. YouTubeNameURL = read()
  108. sbc(1)
  109. if YouTubeNameURL == "LabyStudio" or YouTubeNameURL == "Labystudio" or YouTubeNameURL == "labystudio" then
  110. YouTubeNameURL = "DanielLaby99"
  111. end
  112. function loadback2()
  113. sbc(32)
  114. scp(1,3)
  115. for LoadpageT=0,16 do
  116. w(" ")
  117. sleep(0,1)
  118. end
  119. sleep(5)
  120. scp(2,5)
  121. stc(32768)
  122. sbc(1)
  123. w("The connection was interrupted!")
  124. scp(2,7)
  125. write("The connection to")
  126. scp(2,8)
  127. write("http://youtube.com/user/"..YouTubeNameURL)
  128. scp(1,3)
  129. sbc(1)
  130. w(" ")
  131. scp(2,9)
  132. write("was interrupted while the page was loading.")
  133. scp(2,11)
  134. write("The site could be temporarily unavailable")
  135. scp(2,12)
  136. write("or too busy. Try again in a few moments.")
  137.  
  138. scp(2,14)
  139. write("If you are unable to load any pages,")
  140. scp(2,15)
  141. write("check your computer's network connection.")
  142. end
  143. function loadback1()
  144. local page = http.get("http://www.youtube.com/user/"..YouTubeNameURL)
  145. sbc(1)
  146. scp(1,3)
  147. local text = page.readAll()
  148.  
  149. scp(1,3)
  150. write(" ")
  151. scp(2,4)
  152. w("You")
  153. sbc(16384)
  154. stc(1)
  155. w("Tube")
  156. sbc(1)
  157. stc(32768)
  158. scp(2,6)
  159. w(YouTubeNameURL)
  160. scp(30,6)
  161. write("Subscriber>")
  162. write(" "..text:match([[subscribed"%s->([^<]*)]]))
  163. scp(1,5)
  164. w("---------------------------------------------------")
  165. scp(1,3)
  166. browsepath = browsepath.."/user/"..YouTubeNameURL
  167. end
  168. para(loadback1, loadback2)
  169. -- #################### LabyStore #################### --
  170. elseif browsepath == "LabyStudio.de" or browsepath == "labystudio.de" or browsepath == "Labystudio.de" then
  171. scp(20,4)
  172. w("LabyStore BETA")
  173. scp(1,5)
  174. w("---------------------------------------------------")
  175. scp(1,6)
  176. w("> Skype [Download]")
  177. scp(1,7)
  178. w("")
  179.  
  180. while true do
  181. event, button, X, Y = os.pullEvent("mouse_click")
  182. if X >= 1 and X <= 51 and Y == 6 then
  183. scp(1,6)
  184. if not fs.exists("Skype") then
  185. write("Downloading.. ")
  186. fs.copy("LabyOS/Documents/admin/labystudio/apps/Skype", "Skype")
  187. sleep(1)
  188. scp(1,6)
  189. write("Downloaded! ")
  190. sleep(1)
  191. scp(1,6)
  192. write("Saved as 'Skype'")
  193. scp(1,7)
  194. write("Go to your documents, click on a free slot and enter 'Skype' or you can run the program with Run/CraftOS")
  195. sleep(5)
  196. else
  197. write("File already downloaded.")
  198. sleep(1)
  199. end
  200. sleep(1)
  201. browsetab()
  202. error("Terminated")
  203. break
  204. end
  205. if X >= 1 and X <= 51 and Y == 2 then
  206. browsetab()
  207. error("Terminated")
  208. break
  209. end
  210. if X >= 1 and X <= 7 and Y == 19 then
  211. startmenu()
  212. error("Terminated")
  213. break
  214. end
  215. if X >= 51 and X <= 51 and Y == 1 then
  216. resetDesktop()
  217. error("Terminated")
  218. break
  219. end
  220. end
  221.  
  222. -- #################### Localhost #################### --
  223. elseif browsepath == "localhost" or browsepath == "0.0.0.0" or browsepath == "*.*.*.*" then
  224. scp(20,4)
  225. w("Localhost")
  226. scp(1,5)
  227. w("This is a test")
  228. scp(1,6)
  229. w("In the next update:")
  230. scp(1,7)
  231. w("A own Internet page! You can create a design and custom content on your webiste. Im working for a http conection. You can upload this content on my server and other guys can go on your webiste!")
  232. print("But I need a server for uploading this stuff :/")
  233. print("Can you help?")
  234. print("")
  235. print("'This is a easter egg :D'")
  236. -- ################################################ --
  237. end
  238.  
  239.  
  240. while true do
  241. event, button, X, Y = os.pullEvent("mouse_click")
  242. if X >= 1 and X <= 51 and Y == 2 then
  243. browsetab()
  244. error("Terminated")
  245. break
  246. end
  247. if X >= 1 and X <= 7 and Y == 19 then
  248. startmenu()
  249. error("Terminated")
  250. break
  251. end
  252. if X >= 51 and X <= 51 and Y == 1 then
  253. resetDesktop()
  254. error("Terminated")
  255. break
  256. end
  257.  
  258.  
  259. end
  260. end
  261. browsetab()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement