Advertisement
wirthe16

Wirthe16 2d rpg game v28 launcher

Jul 15th, 2016
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.04 KB | None | 0 0
  1. local component = require "component"
  2. local fs = require "filesystem"
  3. local internet = require "internet"
  4. local shell = require "shell"
  5. local term = require "term"
  6. local gpu = require("component").gpu
  7.  
  8. for f = 1, 25 do
  9. gpu.setBackground(3500+f*1270)
  10. gpu.fill(1,f*2-2,159,2," ")
  11. end
  12. gpu.setBackground(0x000000)
  13. gpu.setForeground(0xffffff)
  14.  
  15. local CURRENTFOLDER = "/games/testgame/"
  16.  
  17. local libsData = {
  18.     {"http://pastebin.com/raw/BNWqP6Yd","doubleBuffering.lua"},
  19.     {"http://pastebin.com/raw/j0BQDsWb","image.lua"},
  20.     {"http://pastebin.com/raw/pudcaXMD","colorlib.lua"},
  21.     {"http://pastebin.com/raw.php?i=E0SzJcCx","thread.lua"},
  22. }
  23.  
  24. local dData = {
  25.     {["paste"]="q2Emp.pic",["path"]="/image/slg.pic",["dtype"]=1}, -- image
  26.     {["paste"]="sfS1d.pic",["path"]="/image/gigd1.pic",["dtype"]=1},
  27.     {["paste"]="sfRYi.pic",["path"]="/image/gigd2.pic",["dtype"]=1},
  28.     {["paste"]="sfRZ0.pic",["path"]="/image/gigd3.pic",["dtype"]=1},
  29.     {["paste"]="sfRZS.pic",["path"]="/image/gigd4.pic",["dtype"]=1},
  30.     {["paste"]="sfS0H.pic",["path"]="/image/gigd5.pic",["dtype"]=1},
  31.     {["paste"]="sfS1d.pic",["path"]="/image/gigd6.pic",["dtype"]=1},
  32.     {["paste"]="sfSaW.pic",["path"]="/image/gigd7.pic",["dtype"]=1},
  33.     {["paste"]="sfSbn.pic",["path"]="/image/gigd8.pic",["dtype"]=1},
  34.     {["paste"]="sfSbt.pic",["path"]="/image/itemnotex.pic",["dtype"]=1},
  35.     {["paste"]="q2FnI.pic",["path"]="/sprpic/bush.pic",["dtype"]=1}, -- sprpic
  36.     {["paste"]="q2Fo3.pic",["path"]="/sprpic/ghost.pic",["dtype"]=1},
  37.     {["paste"]="q2Foi.pic",["path"]="/sprpic/greenslug.pic",["dtype"]=1},
  38.     {["paste"]="q2FBf.pic",["path"]="/sprpic/guardian1.pic",["dtype"]=1},
  39.     {["paste"]="q2FDO.pic",["path"]="/sprpic/nv_ghost.pic",["dtype"]=1},
  40.     {["paste"]="sfTDg.pic",["path"]="/sprpic/player.pic",["dtype"]=1},
  41.     {["paste"]="qaHhE.pic",["path"]="/sprpic/skelet1.pic",["dtype"]=1},
  42.     {["paste"]="q2Gjk.pic",["path"]="/sprpic/spiritofplace.pic",["dtype"]=1},
  43.     {["paste"]="q2GmU.pic",["path"]="/sprpic/stne_wall.pic",["dtype"]=1},
  44.     {["paste"]="q2Go2.pic",["path"]="/sprpic/stoneturtle.pic",["dtype"]=1},
  45.     {["paste"]="q2Gqi.pic",["path"]="/sprpic/swamptree.pic",["dtype"]=1},
  46.     {["paste"]="q2GsF.pic",["path"]="/sprpic/tlp1.pic",["dtype"]=1},
  47.     {["paste"]="q2GxV.pic",["path"]="/sprpic/venomous_ghoul.pic",["dtype"]=1},
  48.     {["paste"]="q2GEW.pic",["path"]="/sprpic/vil1.pic",["dtype"]=1},
  49.     {["paste"]="q2GGq.pic",["path"]="/sprpic/vil2.pic",["dtype"]=1},
  50.     {["paste"]="q2GJv.pic",["path"]="/sprpic/vil3.pic",["dtype"]=1},
  51.     {["paste"]="q2GN5.pic",["path"]="/sprpic/vil4.pic",["dtype"]=1},
  52.     {["paste"]="sfStx.pic",["path"]="/sprpic/vil5.pic",["dtype"]=1},
  53.     {["paste"]="sfSCm.pic",["path"]="/sprpic/vil6.pic",["dtype"]=1},
  54.     {["paste"]="sfSUt.pic",["path"]="/sprpic/vil7.pic",["dtype"]=1},
  55.     {["paste"]="sfTki.pic",["path"]="/sprpic/vil8.pic",["dtype"]=1},
  56.     {["paste"]="sfTxS.pic",["path"]="/sprpic/vil9.pic",["dtype"]=1},
  57.     {["paste"]="sfU4b.pic",["path"]="/sprpic/vil10.pic",["dtype"]=1},
  58.     {["paste"]="qaH6O.pic",["path"]="/sprpic/gravel.pic",["dtype"]=1},
  59.     {["paste"]="qaHbf.pic",["path"]="sprpic/iron_ore.pic",["dtype"]=1},
  60.     {["paste"]="qaHdt.pic",["path"]="sprpic/copper_ore.pic",["dtype"]=1},
  61.     {["paste"]="qaHeD.pic",["path"]="sprpic/wooden.pic",["dtype"]=1},
  62.     {["paste"]="qaHfn.pic",["path"]="sprpic/wcoal.pic",["dtype"]=1},
  63.     {["paste"]="sfSu8.pic",["path"]="sprpic/player_pck.pic",["dtype"]=1},
  64.     {["paste"]="sfSsJ.pic",["path"]="/sprpic/zombie1.pic",["dtype"]=1},
  65.     {["paste"]="sfSyA.pic",["path"]="/sprpic/dungeonexit.pic",["dtype"]=1},
  66.     {["paste"]="sfSE2.pic",["path"]="/sprpic/sgolem.pic",["dtype"]=1},
  67.     {["paste"]="sfSHL.pic",["path"]="/sprpic/vangen1.pic",["dtype"]=1},
  68.     {["paste"]="sfSIU.pic",["path"]="/sprpic/zombie2.pic",["dtype"]=1},
  69.     {["paste"]="sfSK4.pic",["path"]="/sprpic/graver.pic",["dtype"]=1},
  70.     {["paste"]="sfSNu.pic",["path"]="/sprpic/dec_ghoul.pic",["dtype"]=1},
  71.     {["paste"]="sfSOJ.pic",["path"]="/sprpic/skelet2.pic",["dtype"]=1},
  72.     {["paste"]="sfSPW.pic",["path"]="/sprpic/skelet3.pic",["dtype"]=1},
  73.     {["paste"]="sfSQG.pic",["path"]="/sprpic/skelet5.pic",["dtype"]=1},
  74.     {["paste"]="sfSTr.pic",["path"]="/sprpic/vangen2.pic",["dtype"]=1},
  75.     {["paste"]="sfSX3.pic",["path"]="/sprpic/zombie3.pic",["dtype"]=1},
  76.     {["paste"]="sfSXN.pic",["path"]="/sprpic/zombie4.pic",["dtype"]=1},
  77.     {["paste"]="sfT0k.pic",["path"]="/sprpic/phantom.pic",["dtype"]=1},
  78.     {["paste"]="sfT4W.pic",["path"]="/sprpic/tportal_1.pic",["dtype"]=1},
  79.     {["paste"]="sfT6D.pic",["path"]="/sprpic/tlpstone.pic",["dtype"]=1},
  80.     {["paste"]="sfT96.pic",["path"]="/sprpic/skelet4.pic",["dtype"]=1},
  81.     {["paste"]="sfTaO.pic",["path"]="/sprpic/flowering_tree.pic",["dtype"]=1},
  82.     {["paste"]="sfTcn.pic",["path"]="/sprpic/redslug.pic",["dtype"]=1},
  83.     {["paste"]="sfTdn.pic",["path"]="/sprpic/dirty_blobdemon.pic",["dtype"]=1},
  84.     {["paste"]="sfTfA.pic",["path"]="/sprpic/d_maggot.pic",["dtype"]=1},
  85.     {["paste"]="sfTgF.pic",["path"]="/sprpic/ironturtle.pic",["dtype"]=1},
  86.     {["paste"]="sfThM.pic",["path"]="/sprpic/flamefiend.pic",["dtype"]=1},
  87.     {["paste"]="sfTl8.pic",["path"]="/sprpic/zombie5.pic",["dtype"]=1},
  88.     {["paste"]="sfTmh.pic",["path"]="/sprpic/deadghoul.pic",["dtype"]=1},
  89.     {["paste"]="sfTnu.pic",["path"]="/sprpic/odecfaddi.pic",["dtype"]=1},
  90.     {["paste"]="sfTp1.pic",["path"]="/sprpic/d_ghost.pic",["dtype"]=1},
  91.     {["paste"]="sfTq2.pic",["path"]="/sprpic/evfotr.pic",["dtype"]=1},
  92.     {["paste"]="sfTr1.pic",["path"]="/sprpic/twihnt.pic",["dtype"]=1},
  93.     {["paste"]="sfTsm.pic",["path"]="/sprpic/vanlt1.pic",["dtype"]=1},
  94.     {["paste"]="sfTvg.pic",["path"]="/sprpic/wraith_gudini.pic",["dtype"]=1},
  95.     {["paste"]="sfTwY.pic",["path"]="/sprpic/vundf.pic",["dtype"]=1},
  96.     {["paste"]="sfTzj.pic",["path"]="/sprpic/yellowslug.pic",["dtype"]=1},
  97.     {["paste"]="sfTzY.pic",["path"]="/sprpic/m_golem.pic",["dtype"]=1},
  98.     {["paste"]="sfTAT.pic",["path"]="/sprpic/bnkt.pic",["dtype"]=1},
  99.     {["paste"]="sfTC3.pic",["path"]="/sprpic/csl1.pic",["dtype"]=1},
  100.     {["paste"]="sfTEK.pic",["path"]="/sprpic/mogeghoul.pic",["dtype"]=1},
  101.     {["paste"]="sfTG2.pic",["path"]="/sprpic/kt_ghost.pic",["dtype"]=1},
  102.     {["paste"]="sfTH8.pic",["path"]="/sprpic/skelet6.pic",["dtype"]=1},
  103.     {["paste"]="sfTHT.pic",["path"]="/sprpic/deighoul.pic",["dtype"]=1},
  104.     {["paste"]="sfTKI.pic",["path"]="/sprpic/c_ghost.pic",["dtype"]=1},
  105.     {["paste"]="sfTLD.pic",["path"]="/sprpic/mvalgr.pic",["dtype"]=1},
  106.     {["paste"]="sfTMW.pic",["path"]="/sprpic/mvaltghoul.pic",["dtype"]=1},
  107.     {["paste"]="sfTNS.pic",["path"]="/sprpic/evfmv.pic",["dtype"]=1},
  108.     {["paste"]="sfTPC.pic",["path"]="/sprpic/rdwarrior.pic",["dtype"]=1},
  109.     {["paste"]="sfTQL.pic",["path"]="/sprpic/zombie6.pic",["dtype"]=1},
  110.     {["paste"]="sfTSt.pic",["path"]="/sprpic/zombie7.pic",["dtype"]=1},
  111.     {["paste"]="sfTT9.pic",["path"]="/sprpic/mvalnecwraith.pic",["dtype"]=1},
  112.     {["paste"]="sfTVj.pic",["path"]="/sprpic/chest1.pic",["dtype"]=1},
  113.     {["paste"]="sfTW8.pic",["path"]="/sprpic/dohbenages.pic",["dtype"]=1},
  114.     {["paste"]="sfTXe.pic",["path"]="/sprpic/bkmanwr.pic",["dtype"]=1},
  115.     {["paste"]="sfTYC.pic",["path"]="/sprpic/udegefn.pic",["dtype"]=1},
  116.     {["paste"]="sfTZ2.pic",["path"]="/sprpic/mvalfwarrior.pic",["dtype"]=1},
  117.     {["paste"]="sfTZV.pic",["path"]="/sprpic/slrenow.pic",["dtype"]=1},
  118.     {["paste"]="sfU0Y.pic",["path"]="/sprpic/mfghost.pic",["dtype"]=1},
  119.     {["paste"]="sfU1W.pic",["path"]="/sprpic/mvalwr.pic",["dtype"]=1},
  120.     {["paste"]="sfU3i.pic",["path"]="/sprpic/mvalwoodenspirit.pic",["dtype"]=1},
  121.     {["paste"]="sfU64.pic",["path"]="/sprpic/mvalfsphere.pic",["dtype"]=1},
  122.     {["paste"]="q2H06.pic",["path"]="/itempic/animal_fur.pic",["dtype"]=1}, -- itempic
  123.     {["paste"]="q2H1m.pic",["path"]="/itempic/bn_armor.pic",["dtype"]=1},
  124.     {["paste"]="q2H56.pic",["path"]="/itempic/bn_boots.pic",["dtype"]=1},
  125.     {["paste"]="q2H6R.pic",["path"]="/itempic/bn_helmet.pic",["dtype"]=1},
  126.     {["paste"]="q2Hlx.pic",["path"]="/itempic/bn_necklace.pic",["dtype"]=1},
  127.     {["paste"]="q2HmX.pic",["path"]="/itempic/bn_pants.pic",["dtype"]=1},
  128.     {["paste"]="q2Hos.pic",["path"]="/itempic/bone_necklace.pic",["dtype"]=1},
  129.     {["paste"]="q2Hqd.pic",["path"]="/itempic/condensed_hp.pic",["dtype"]=1},
  130.     {["paste"]="q2Hs9.pic",["path"]="/itempic/condensed_mp.pic",["dtype"]=1},
  131.     {["paste"]="q2Hth.pic",["path"]="/itempic/copper_ingot.pic",["dtype"]=1},
  132.     {["paste"]="q2Hwm.pic",["path"]="/itempic/copper_ore.pic",["dtype"]=1},
  133.     {["paste"]="q2Hx5.pic",["path"]="/itempic/gravel.pic",["dtype"]=1},
  134.     {["paste"]="q2Hyp.pic",["path"]="/itempic/iron_ingot.pic",["dtype"]=1},
  135.     {["paste"]="q2HCf.pic",["path"]="/itempic/iron_ore.pic",["dtype"]=1},
  136.     {["paste"]="q2HEb.pic",["path"]="/itempic/large_hp.pic",["dtype"]=1},
  137.     {["paste"]="q2HFf.pic",["path"]="/itempic/large_mp.pic",["dtype"]=1},
  138.     {["paste"]="q2HHV.pic",["path"]="/itempic/long_sword.pic",["dtype"]=1},
  139.     {["paste"]="q2HJd.pic",["path"]="/itempic/medium_hp.pic",["dtype"]=1},
  140.     {["paste"]="q2HK5.pic",["path"]="/itempic/medium_mp.pic",["dtype"]=1},
  141.     {["paste"]="q2HNP.pic",["path"]="/itempic/rookies_armor.pic",["dtype"]=1},
  142.     {["paste"]="q2HPA.pic",["path"]="/itempic/rookies_boots.pic",["dtype"]=1},
  143.     {["paste"]="q2HUZ.pic",["path"]="/itempic/rookies_helmet.pic",["dtype"]=1},
  144.     {["paste"]="q2HXA.pic",["path"]="/itempic/rookies_pants.pic",["dtype"]=1},
  145.     {["paste"]="q2HYQ.pic",["path"]="/itempic/rough_fur.pic",["dtype"]=1},
  146.     {["paste"]="q2I1Q.pic",["path"]="/itempic/rough_skin.pic",["dtype"]=1},
  147.     {["paste"]="q2I3q.pic",["path"]="/itempic/rough_thread.pic",["dtype"]=1},
  148.     {["paste"]="q2I55.pic",["path"]="/itempic/s_coal.pic",["dtype"]=1},
  149.     {["paste"]="q2I8e.pic",["path"]="/itempic/small_hp.pic",["dtype"]=1},
  150.     {["paste"]="q2I9z.pic",["path"]="/itempic/small_mp.pic",["dtype"]=1},
  151.     {["paste"]="q2Ifw.pic",["path"]="/itempic/stone_hand_axe.pic",["dtype"]=1},
  152.     {["paste"]="q2IgU.pic",["path"]="/itempic/teleportptr.pic",["dtype"]=1},
  153.     {["paste"]="q2IiN.pic",["path"]="/itempic/w_spear.pic",["dtype"]=1},
  154.     {["paste"]="q2IjQ.pic",["path"]="/itempic/wood.pic",["dtype"]=1},
  155.     {["paste"]="q2Iom.pic",["path"]="/itempic/wooden_sword.pic",["dtype"]=1},
  156.     {["paste"]="q2Ipa.pic",["path"]="/itempic/xbox.pic",["dtype"]=1},
  157.     {["paste"]="sfUci.pic",["path"]="/itempic/ybox.pic",["dtype"]=1},
  158.     {["paste"]="sfUfn.pic",["path"]="/itempic/cn_helmet.pic",["dtype"]=1},
  159.     {["paste"]="sfUgl.pic",["path"]="/itempic/cn_armor.pic",["dtype"]=1},
  160.     {["paste"]="sfUkG.pic",["path"]="/itempic/cn_pants.pic",["dtype"]=1},
  161.     {["paste"]="sfUlp.pic",["path"]="/itempic/cn_boots.pic",["dtype"]=1},
  162.     {["paste"]="sfUma.pic",["path"]="/itempic/cn_necklace.pic",["dtype"]=1},
  163.     {["paste"]="sfUoL.pic",["path"]="/itempic/d_sword.pic",["dtype"]=1},
  164.     {["paste"]="sfUpI.pic",["path"]="/itempic/d_spear.pic",["dtype"]=1},
  165.     {["paste"]="sfUqG.pic",["path"]="/itempic/d_axe.pic",["dtype"]=1},
  166.     {["paste"]="sfUrN.pic",["path"]="/itempic/oil1.pic",["dtype"]=1},
  167.     {["paste"]="sfUsu.pic",["path"]="/itempic/steel_ingot.pic",["dtype"]=1},
  168.     {["paste"]="sfUuf.pic",["path"]="/itempic/fiendmask.pic",["dtype"]=1},
  169.     {["paste"]="sfUve.pic",["path"]="/itempic/afitem.pic",["dtype"]=1},
  170.     {["paste"]="sfUxj.pic",["path"]="/itempic/brokenweapon.pic",["dtype"]=1},
  171.     {["paste"]="sfUxZ.pic",["path"]="/itempic/elementpowder.pic",["dtype"]=1},
  172.     {["paste"]="sfUyU.pic",["path"]="/itempic/elementfragment.pic",["dtype"]=1},
  173.     {["paste"]="sfUAL.pic",["path"]="/itempic/greenelementcrystal.pic",["dtype"]=1},
  174.     {["paste"]="sfUCK.pic",["path"]="/itempic/mwstone.pic",["dtype"]=1},
  175.     {["paste"]="sfUE9.pic",["path"]="/itempic/mestone.pic",["dtype"]=1},
  176.     {["paste"]="sfUFA.pic",["path"]="/itempic/dehpendant.pic",["dtype"]=1},
  177.     {["paste"]="sfUH3.pic",["path"]="/itempic/e_sword.pic",["dtype"]=1},
  178.     {["paste"]="sfUIv.pic",["path"]="/itempic/e_axe.pic",["dtype"]=1},
  179.     {["paste"]="sfUJ2.pic",["path"]="/itempic/e_spear.pic",["dtype"]=1},
  180.     {["paste"]="sfUKQ.pic",["path"]="/itempic/bn_ring.pic",["dtype"]=1},
  181.     {["paste"]="sfULz.pic",["path"]="/itempic/cn_robe.pic",["dtype"]=1},
  182.     {["paste"]="sfUMC.pic",["path"]="/itempic/cn_ring.pic",["dtype"]=1},
  183.     {["paste"]="sfUNB.pic",["path"]="/itempic/bn_robe.pic",["dtype"]=1},
  184.     {["paste"]="sfUOB.pic",["path"]="/itempic/mq_sword.pic",["dtype"]=1},
  185.     {["paste"]="sfUPR.pic",["path"]="/itempic/zbox.pic",["dtype"]=1},
  186.     {["paste"]="sfUQR.pic",["path"]="/itempic/klv_armor.pic",["dtype"]=1},
  187.     {["paste"]="sfURO.pic",["path"]="/itempic/h_almred.pic",["dtype"]=1},
  188.     {["paste"]="sfURO.pic",["path"]="/itempic/dn_armor.pic",["dtype"]=1},
  189.     {["paste"]="sfUTU.pic",["path"]="/itempic/dn_boots.pic",["dtype"]=1},
  190.     {["paste"]="sfUUL.pic",["path"]="/itempic/dn_helmet.pic",["dtype"]=1},
  191.     {["paste"]="sfUVs.pic",["path"]="/itempic/dn_pants.pic",["dtype"]=1},
  192.     {["paste"]="sfUWx.pic",["path"]="/itempic/dn_necklace.pic",["dtype"]=1},
  193.     {["paste"]="sfUYq.pic",["path"]="/itempic/trte.pic",["dtype"]=1},
  194.     {["paste"]="sfUZ5.pic",["path"]="/itempic/ek_robe.pic",["dtype"]=1},
  195.     {["paste"]="sfUZB.pic",["path"]="/itempic/f_spear.pic",["dtype"]=1},
  196.     {["paste"]="sfV0K.pic",["path"]="/itempic/f_axe.pic",["dtype"]=1},
  197.     {["paste"]="sfV1F.pic",["path"]="/itempic/f_sword.pic",["dtype"]=1},
  198.     {["paste"]="sfV2Q.pic",["path"]="/itempic/bshield.pic",["dtype"]=1},
  199.     {["paste"]="sfV3J.pic",["path"]="/itempic/brokenplml.pic",["dtype"]=1},
  200.     {["paste"]="sfV63.pic",["path"]="/itempic/mvblade.pic",["dtype"]=1},
  201.     {["paste"]="sfV6T.pic",["path"]="/itempic/ironpearl.pic",["dtype"]=1},
  202.     {["paste"]="sfV7T.pic",["path"]="/itempic/fgm_axe.pic",["dtype"]=1},
  203.     {["paste"]="sfV8C.pic",["path"]="/itempic/fgm_sword.pic",["dtype"]=1},
  204.     {["paste"]="sfV9Y.pic",["path"]="/itempic/fgm_spear.pic",["dtype"]=1},
  205.     {["paste"]="sfVck.pic",["path"]="/itempic/mtrpr.pic",["dtype"]=1},
  206.     {["paste"]="sfVdo.pic",["path"]="/itempic/bone1.pic",["dtype"]=1},
  207.     {["paste"]="sfVfm.pic",["path"]="/itempic/fncring.pic",["dtype"]=1},
  208.     {["paste"]="sfVgc.pic",["path"]="/itempic/fncnecklace.pic",["dtype"]=1},
  209.     {["paste"]="sfVhI.pic",["path"]="/itempic/unimedal.pic",["dtype"]=1},
  210.     {["paste"]="sGErhvZZ",["path"]="/itempic.data",["dtype"]=2}, -- pastebin
  211.     {["paste"]="Rzkip5p0",["path"]="/translate.lang",["dtype"]=2},
  212.     {["paste"]="Ynx9n4wg",["path"]="/game.lua",["dtype"]=2},
  213. }
  214.  
  215. local fData = {
  216.     CURRENTFOLDER.."image/",
  217.     CURRENTFOLDER.."sprpic/",
  218.     CURRENTFOLDER.."itempic/",
  219.     CURRENTFOLDER.."saves/",
  220. }
  221.  
  222. for f = 1, #fData do
  223.  if not fs.exists(fData[f]) then
  224.  fs.makeDirectory(fData[f])
  225.  end
  226. end
  227.  
  228. local downloadElementsCount = 0
  229.  
  230. for f = 1, #dData do
  231.  if not fs.exists(CURRENTFOLDER..dData[f]["path"]) then
  232.  downloadElementsCount = downloadElementsCount + 1
  233.  end
  234. end
  235.  
  236. local function downloadFile(ssilka, filename)
  237.   local f, reason = io.open(filename, "w")
  238.   if not f then
  239.     io.stderr:write("Failed opening file for writing: " .. reason)
  240.     return
  241.   end
  242.   local result, response = pcall(internet.request, ssilka)
  243.   if result then
  244.     for chunk in response do
  245.       f:write(chunk)
  246.     end
  247.     f:close()
  248.   else
  249.     io.write("failed.\n")
  250.     f:close()
  251.     io.stderr:write("HTTP request failed: " .. response .. "\n")
  252.   end
  253. end
  254.  
  255. local function downloadFromPuush(paste, shortpath)
  256. downloadFile("http://puu.sh/"..paste, CURRENTFOLDER..shortpath)
  257. end
  258.  
  259. local function downloadFromPastebin(paste, shortpath)
  260. downloadFile("http://pastebin.com/raw.php?i="..paste, CURRENTFOLDER..shortpath)
  261. end
  262.  
  263. local function centerText(text,y)
  264. term.setCursor(80-(require("unicode").len(text))/2,y)
  265. io.write(tostring(text))
  266. end
  267.  
  268. local dopInfo = {
  269. "Разрешение экрана только 160х50",
  270. "DoubleBuffering lib by IgorTimofeev",
  271. "Image lib и colorlib by IgorTimofeev",
  272. "Thread lib by Zer0Galaxy",
  273. "Требования к вашему компьютеру:",
  274. "1.75 МБ и более оперативной памяти;",
  275. "300 КБ и более свободной памяти",
  276. "на жестком диске;",
  277. "Монитор и ведеокарта должны быть",
  278. "только 3-го уровня.",
  279. "Рекомендуется OpenComputers версии 1.6+"
  280. }
  281.  
  282. for f = 1, #dopInfo do
  283. io.write(dopInfo[f],"\n")
  284. end
  285.  
  286. centerText("Загрузка элементов Wirthe16 rpg game",11)
  287.  
  288. for f = 1, #libsData do
  289.  if not fs.exists("/lib/"..libsData[f][2]) then
  290.  downloadFile(libsData[f][1],"/lib/"..libsData[f][2])
  291.  centerText(string.rep(" ",60),12)
  292.  centerText("/Загрузка из интернета библиотеки: "..libsData[f][2],12)
  293.  end
  294. os.sleep()
  295. end
  296.  
  297. local celem = 0
  298.  
  299. for f = 1, #dData do
  300.  if not fs.exists(CURRENTFOLDER..dData[f]["path"]) then
  301.   celem = celem + 1
  302.   if dData[f]["dtype"] == 1 then
  303.   downloadFromPuush(dData[f]["paste"],dData[f]["path"])
  304.   elseif dData[f]["dtype"] == 2 then
  305.   downloadFromPastebin(dData[f]["paste"],dData[f]["path"])
  306.   end
  307.  centerText(string.rep(" ",60),13)
  308.  centerText("Загружено "..celem.." файлов ("..math.ceil(celem*100/downloadElementsCount).."%)",13)
  309.  end
  310. os.sleep()
  311. end
  312.  
  313. centerText("Запустить игру? Y/N",14)
  314.  
  315. while true do
  316. local ev = {require("event").pull()}
  317.  if ev[1] == "key_up" then
  318.   if ev[4] == 21 then
  319.   dData, dopInfo = nil, nil
  320.   shell.execute(CURRENTFOLDER.."game.lua")
  321.   break
  322.   elseif ev[4] == 49 then
  323.   break
  324.   end
  325.  end
  326. end
  327.  
  328. gpu.setBackground(0x000000)
  329. term.clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement