Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Install [EN]:
- -- 1) Goto your Computer, place a Monitor and a Redstone-Output Signal.
- -- 2) Type in your Computer following Command: "pastebin run jdeg8qfu".
- -- 3) Reboot your Computer.
- --Install [DE]:
- -- 1) Gehe zu deinem Computer und baue einen Monitor und ein Redstone Signal an ihm dran.
- -- 2) Tippe in deinem Computer folgenden Befehl: "pastebin run jdeg8qfu" ein.
- -- 3) Starte deinen Computer neu.
- -- [License] --
- -- This Program is under Open source license!
- -- Developed by COOLGAMETUBE
- -- ©COOLGAMETUBE 2015 - now
- -- Don't say, it's your Programm!
- -- Don't remove this lincense part!
- -- Using on Servers accepted! (If point 4 and 5 done)
- -- Enjoy it!
- -- [License] --
- Content = {
- Folders = {
- "/lib",
- "/res",
- "/res/flags",
- },
- Files = {
- {
- Path = "/lib/WicowsTools",
- Content = "--[[DONT REMOVE THIS NOTICE!!!\
- Download: pastebin get REaZXV7W WicowsTools || http://www.pastebin.com/REaZXV7W\
- Copyright ©COOLGAMETUBE\
- Copyright ©Buschrolle\
- Copyright ©JcraftxD\
- \
- Release: 11.08.2015\
- \
- EULA:\
- -I will not share this API whithout this notice!\
- -I able to modify and reupload it, if this notice was not removed.\
- -I will credit COOLGAMETUBE.\
- -I able to set my Credit, if this Programm has modified(New Functions)\
- -This API will be FREE avaiable (no money)\
- -If i upload a programm, that include this API, i will set the Credits of COOLGAMETUBE]]\
- \
- function packmanSystem()\
- if fs.exists(\"/usr/bin/packman\") then\
- return true\
- else\
- return false\
- end\
- end\
- \
- local tArgs = {...}\
- \
- function GetAuthor()\
- return \"COOLGAMETUBE\"\
- end\
- \
- function GetVersion()\
- return 1.23\
- end\
- \
- function MagicClear(t)\
- if not t then t = 0.5 end\
- l = {\"[\", \"-\", \"]\", \" \", t}\
- x, y = term.getSize()\
- lt = \"\"\
- ct = \"\"\
- for i = 1, x do\
- le = l[2]\
- if i == 1 then le = l[1] end\
- if i == x then le = l[3] end\
- lt = lt .. le\
- ct = ct .. l[4]\
- end\
- for i = 1, y do\
- term.setCursorPos(1, i -1)\
- write(ct)\
- term.setCursorPos(1, i)\
- write(lt)\
- sleep(l[5])\
- end\
- term.setCursorPos(1, 1)\
- term.clear()\
- end\
- \
- function MagicSpam()\
- s = 0.1\
- x, y = term.getSize()\
- lt = \"\"\
- scnd = true\
- for i = 1, y do\
- for i = 1, x do\
- lt = lt .. tostring(math.random(0,9))\
- end\
- term.setCursorPos(1, i)\
- write(lt)\
- if scnd then\
- sleep(s)\
- scnd = false\
- else\
- scnd = true\
- end\
- end\
- term.setCursorPos(1,y)\
- end\
- \
- function toInt(str)\
- num = \"\"\
- sp = false\
- for a = 1, string.len(str) do\
- l = string.sub(str, a,a)\
- if l == \"0\" or l == \"1\" or l == \"2\" or l == \"3\" or l == \"4\" or l == \"5\" or l == \"6\" or l == \"7\" or l == \"8\" or l == \"9\" or l == \".\" then\
- if l == \".\" and not sp then\
- num = num .. l\
- elseif l ~= \".\" then\
- num = num .. l\
- end\
- end\
- end\
- if num == \"\" or num == nil then num = 0 end\
- return tonumber(num)\
- end\
- \
- function digit_sum(num)\
- num = toInt(num)\
- num = tostring(num)\
- \
- numlet = {}\
- if string.len(num) > 1 then\
- for a = 1, string.len(num) do\
- numlet[a] = string.sub(num, a,a)\
- end\
- else\
- numlet[1] = num\
- end\
- local result = nil\
- if #numlet > 1 then\
- local rn = 0\
- for i = 1, #numlet do\
- rn = rn + toInt(numlet[i])\
- end\
- result = rn\
- else\
- result = toInt(numlet[1])\
- end\
- return result\
- end\
- \
- function invert(num)\
- num = toInt(num)\
- num = tostring(num)\
- numlet = {}\
- if string.len(num) > 1 then\
- for a = 1, string.len(num) do\
- numlet[a] = string.sub(num, a,a)\
- end\
- else\
- numlet[1] = num\
- end\
- \
- local result = nil\
- if #numlet > 1 then\
- local rn = \"\"\
- for i = 1, (#numlet) do\
- rn = rn..numlet[#numlet-i+1]\
- end\
- result = rn\
- else\
- result = numlet[1]\
- end\
- return result\
- end\
- \
- function SplitStr(inputstr, sep)\
- if sep == nil then\
- sep = \"%s\"\
- end\
- local t={} ; i=1\
- for str in string.gmatch(inputstr, \"([^\"..sep..\"]+)\") do\
- t[i] = str\
- i = i + 1\
- end\
- return t\
- end\
- \
- function ReplaceStr(str, rep, to) \
- if not rep then return nil end\
- str = tostring(str)\
- local pcs = SplitStr(str, rep)\
- str = pcs[1]\
- for n=2,#pcs do\
- str = str..to..pcs[n]\
- end\
- return str\
- end\
- \
- function WriteFile(file, text, append)\
- local m = \"w\"\
- if append == true then\
- m = \"a\"\
- end\
- if not fs.exists(file) then\
- if not fs.isReadOnly(file) then\
- f = fs.open(file, m)\
- f.write(text)\
- f.close()\
- return true\
- else\
- return false\
- end\
- else\
- return false\
- end\
- end\
- \
- function ReadFile(file)\
- if fs.exists(file) then\
- local f = fs.open(file, \"r\")\
- local text = f.readAll()\
- f.close()\
- if text ~= nil then\
- return text\
- else\
- return \"ERROR!\"\
- end\
- else\
- return false\
- end\
- end\
- \
- function SimpleClear()\
- term.setBackgroundColor(colors.black)\
- term.setTextColor(colors.white)\
- term.clear()\
- term.setCursorPos(1, 1)\
- end\
- \
- function CreateBorder()\
- term.clear()\
- local letters = {\"+\",\"-\",\"|\",}\
- local x,y = term.getSize()\
- local cy = 1 \
- local lt = \"\"\
- for i = 1, y do\
- cy = i\
- lt = \"\"\
- for i = 1, x do\
- if cy == 1 and i == 1 then\
- lt = lt..letters[1]\
- elseif cy == 1 and i == x then\
- lt = lt..letters[1]\
- elseif cy == y and i == 1 then\
- lt = lt..letters[1]\
- elseif cy == y and i == x then\
- lt = lt..letters[1]\
- elseif cy == 1 then\
- lt = lt..letters[2]\
- elseif cy == y then\
- lt = lt..letters[2]\
- elseif i == 1 then\
- lt = lt..letters[3]\
- elseif i == x then\
- lt = lt..letters[3]\
- else\
- lt = lt..\" \"\
- end\
- end\
- term.setCursorPos(1, i)\
- write(lt)\
- end\
- term.setCursorPos(2, 2)\
- end\
- \
- function is(var)\
- if var then\
- return true\
- else\
- return false\
- end\
- end\
- \
- function Log(msg, terminal, add)\
- if terminal then\
- if terminal == term or terminal == term.current() then\
- if add then\
- term.write(msg)\
- else\
- print(msg)\
- end\
- else\
- if add then\
- terminal.write(msg)\
- else\
- x, y = terminal.getCursorPos()\
- terminal.write(msg)\
- terminal.setCursorPos(1, y+1)\
- end\
- end\
- end\
- end\
- \
- function GetRawWebString(url)\
- if type(url) ~=\"string\" then error(\"Can't execute function GetRawWebString(string) because parameter[1] is not a string!\") return false end\
- local connection = http.get(url)\
- if connection then\
- local result = connection.readAll()\
- connection.close()\
- return result\
- else\
- return false\
- end\
- end\
- function CheckCompatible(file, returnVersion, outputTerm)\
- t = nil\
- o = nil\
- funcList = nil\
- osv = nil\
- fo = nil\
- f = nil\
- foundMv = nil\
- -------------\
- t = outputTerm\
- o = is(returnVersion)\
- funcList = textutils.unserialize(GetRawWebString(\"http://pastebin.com/raw.php?i=tvVjyfHD\"))\
- osv = toInt(_CC_VERSION)\
- fo = fs.open(file, \"r\")\
- f = fo.readAll()\
- fo.close()\
- foundMv = false\
- for i = 1, #funcList[\"list\"] do\
- if not foundMv then\
- Log(\"Check Version: \"..funcList[\"list\"][i][\"vers\"]..\" ...\", t)\
- sleep(0.01) --yielding!\
- for fu = 1, #funcList[\"list\"][i][\"funcList\"] do\
- sleep(0.01) --yielding!\
- if string.find(f, \"turtle.\") and trutle or not string.find(f, \"turtle.\") and not turtle then\
- if string.find(f, funcList[\"list\"][i][\"funcList\"][fu]) then foundMv = funcList[\"list\"][i][\"vers\"] end\
- end\
- end\
- end\
- end\
- r = nil\
- if foundMv then\
- if foundMv > osv then\
- Log(\"false, NOT compatible! Min Version: \"..foundMv, t)\
- r = false\
- else\
- Log(\"true, Min Version: \"..foundMv, t)\
- r = true\
- end\
- else\
- Log(\"true, Min Version: First Release!\", t)\
- r = true\
- end\
- if o then\
- return r, foundMv\
- else\
- return r\
- end\
- end\
- \
- function GetWebHash(HashType, Data)\
- GetRawWebString(\"http://coolgametube.net/cc/hash.php?mode=\"..HashType\"&str=\"..Data)\
- end\
- \
- function BigChar(char)\
- if char == \"a\" then return \"A\"\
- elseif char == \"b\" then return \"B\"\
- elseif char == \"c\" then return \"C\"\
- elseif char == \"d\" then return \"D\"\
- elseif char == \"e\" then return \"E\"\
- elseif char == \"f\" then return \"F\"\
- elseif char == \"g\" then return \"G\"\
- elseif char == \"h\" then return \"H\"\
- elseif char == \"i\" then return \"I\"\
- elseif char == \"j\" then return \"J\"\
- elseif char == \"k\" then return \"K\"\
- elseif char == \"l\" then return \"L\"\
- elseif char == \"m\" then return \"M\"\
- elseif char == \"n\" then return \"N\"\
- elseif char == \"o\" then return \"O\"\
- elseif char == \"p\" then return \"P\"\
- elseif char == \"q\" then return \"Q\"\
- elseif char == \"r\" then return \"R\"\
- elseif char == \"s\" then return \"S\"\
- elseif char == \"t\" then return \"T\"\
- elseif char == \"u\" then return \"U\"\
- elseif char == \"v\" then return \"V\"\
- elseif char == \"w\" then return \"W\"\
- elseif char == \"x\" then return \"X\"\
- elseif char == \"y\" then return \"Y\"\
- elseif char == \"z\" then return \"Z\"\
- else return char end\
- end \
- \
- function BigLetters(text)\
- local BStr = \"\"\
- for i = 1, string.len(text) + 1 do \
- BStr = BStr..BigChar(string.sub(text, i,i)) \
- end \
- return BStr\
- end",
- },
- {
- Path = "/res/boot.img",
- Content = "\
- dd55 55dd\
- d115 511d\
- d115 511d\
- d115 55511d\
- d115 51100d\
- d115 511ddd\
- d115 555 511d\
- d115 55155 55511d\
- d115 51115 51100d\
- d115 51115 511ddd\
- d115 51115 55511d\
- d115 51115 51100d\
- d1155511155511ddd\
- d0011100011100d eee ee ee\
- ddd010ddd010ddd e e e\
- dd0dd dd0dd ee eee e\
- ddd ddd e e e\
- ee ee eee",
- },
- {
- Path = "/res/changelog.txt",
- Content = "--Install [EN]:\
- -- 1) Goto your Computer, place a Monitor and a Redstone-Output Signal.\
- -- 2) Type in your Computer following Command: \"pastebin run jdeg8qfu\".\
- -- 3) Reboot your Computer.\
- \
- --Install [DE]:\
- -- 1) Gehe zu deinem Computer und baue einen Monitor und ein Redstone Signal an ihm dran.\
- -- 2) Tippe in deinem Computer folgenden Befehl: \"pastebin run jdeg8qfu\".\
- -- 3) STarte deinen Computer neu.\
- \
- -- [License] --\
- -- This Program is under Open source license!\
- -- Developed by COOLGAMETUBE\
- -- ©COOLGAMETUBE 2015 - now\
- -- Don't say, it's your Programm!\
- -- Don't remove this lincense part!\
- -- Using on Servers accepted! (If point 4 and 5 done)\
- -- Enjoy it!\
- -- [License] --\
- \
- -- +[CHANGELOG] --\
- \
- -- [Vers. 1.1]\
- -- Fixed Crash at the first start, if the http api is deactivated while downloading the Boot-Image\
- -- Version display on Computer while running\
- -- Code Optimizations (Redstone)\
- --------------\
- -- [Vers. 1.2]\
- -- Don't show pin/Puk Field if pressed Clear\
- -- Code Optimizations (Numpad)\
- --------------\
- -- [Vers. 1.3]\
- -- Split ConfigFile to Config and Settings\
- -- Add VersionTAG to ConfigFile\
- -- Code Optimisations (VariableNames)\
- -- Fixed Bug: Register your PIN/PUK and you clear it, the orange field is still there\
- --------------\
- -- [Vers. 1.3.1]\
- -- 1 function, that wrote in 2 functions is now once\
- --------------\
- -- [Vers. 1.3.2]\
- -- Fixed code damage\
- -- Seconds now min. 1sec\
- -- Code Optimizations (Boolean Name)\
- --------------\
- -- [Vers. 1.4]\
- -- SettingsFile now will be loaded!\
- -- [Custom.] customColors now loading!\
- -- Starting Costumization implemention\
- -- Code Optimizations (ColorNames)\
- -- Fixed another Code damage\
- -- Starting MuliLanguage implementation\
- --------------\
- -- [Vers. 1.4.0.1]\
- -- VersString now get VersionNumber from vers float\
- --------------\
- -- [Vers. 1.5]\
- -- Transforming all files into --> 1 <-- CCInstall-Installation-File! Thaz AMAZING! :D\
- -- Moved Changelog from Script into a textfile\
- --------------\
- -- [Vers. 1.6]\
- -- English languagePack implementet! Awesome!\
- -- New languagePacks can be easylie hardcoded!\
- -- Updated WicowsTools Lib to 1.23!\
- -- Code Optimizations\
- --------------\
- -- [Planned]\
- --{[!CS] == ComingSoon!}\
- -- Full controlable colors [!CS]\
- --\
- -- Shorter Code (At time its a code Jungle :P)\
- --\
- -- Fails and Sucess Display getting an UI\
- --\
- -- New Monitor UI\
- -- -[CHANGELOG] --\
- \
- --[TODO]\
- --Implement Settings\
- ----------------",
- },
- {
- Path = "/res/flags/flagSite_1.img",
- Content = "fff 0e0\
- e e\
- 444 0e0",
- },
- {
- Path = "/res/lang.dat",
- Content = "{ en = {\"Welcome to Wicows Security!\",\
- \"Please go to your monitor and make that\\n computer accessible only to you!\",\
- \"New\",\
- \"OPN\",\
- \"SEC\",\
- \"Fails\",\
- \"Succeed\",\
- \"Settings\",\
- \"Languages\",\
- \"Colors\",\
- \"OPN time\",\
- \"Sucess\",\
- },\
- de = {\
- \"Willkommen zu Wicows Security!\",\
- \"Bitte gehe zu deinem Monitor und mach diesen\\n Computer nur fuer dich zugaenglich!\",\
- \"Neu\",\
- \"OFN\",\
- \"SEK\",\
- \"Fehlschlaege\",\
- \"Erfolge\",\
- \"Einstellungen\",\
- \"Sprachen\",\
- \"Farben\",\
- \"OFN Zeit\",\
- \"Erfolg\",\
- },\
- }",
- },
- {
- Path = "/startup",
- Content = "\
- local SoftwareVersion = 1.6\
- \
- os.loadAPI(\"lib/WicowsTools\")\
- \
- local vers = \"Wicows Security \"..SoftwareVersion..\" -by COOLGAMETUBE \"\
- \
- local cfgfile = \"cfg/config.cfg\"\
- local settingfile = \"cfg/settings.cfg\"\
- \
- if not fs.exists(\"cfg/\") then fs.makeDir(\"cfg/\") end\
- \
- local ss = WicowsTools.SplitStr(cfgfile,\"/\") ss[2] = \"/\"..ss[2]\
- if not fs.exists(cfgfile) and fs.exists(ss[2]) then shell.run(\"copy \"..ss[2]..\" \"..cfgfile) fs.delete(ss[2]) end\
- \
- local ss = WicowsTools.SplitStr(settingfile, \"/\") ss[2] = \"/\"..ss[2]\
- if not fs.exists(settingfile) and fs.exists(ss[2]) then shell.run(\"copy \"..ss[2]..\" \"..settingfile) fs.delete(ss[2]) end\
- \
- \
- if not fs.exists(\"res/boot.img\") or not fs.exists(\"res/lang.dat\") then\
- error(\"InstallationError!\")\
- end\
- \
- \
- term.setBackgroundColor(512)\
- term.clear()\
- \
- if fs.exists(\"res/boot.img\") then\
- paintutils.drawImage(paintutils.loadImage(\"res/boot.img\"), 1, 1)\
- end\
- \
- term.setCursorPos(1, 1)\
- term.write(vers)\
- sleep(0.5)\
- term.setBackgroundColor(512)\
- term.clear()\
- term.setCursorPos(1, 19)\
- \
- local new = false\
- local monPos = nil\
- for k,v in pairs(rs.getSides()) do\
- if peripheral.getType(v)=='monitor' then\
- monPos=v\
- break\
- end\
- end\
- \
- local mon = peripheral.wrap(monPos)\
- local m1 = false\
- local pin = \"\"\
- local cfgTable = {[\"ConfigVersion\"] = 2, [\"pin\"] = nil, [\"puk\"] = nil, [\"fails\"] = 0, [\"sucess\"] = 0, [\"locked\"] = false, [\"tries\"] = 3, [\"open\"] = nil}\
- local settingsTable = {[\"SettingsVersion\"] = 1, [\"lang\"] = \"en\", [\"Colors\"] = {[\"TextColor\"] = colors.white, [\"ButtonBackgroundColor\"] = 8192, [\"TextFieldBackgroundColor\"] = 2, [\"DesktopColor\"] = 512}}\
- local lang = textutils.unserialize(WicowsTools.ReadFile(\"res/lang.dat\"))\
- \
- function t(lid)\
- return lang[settingsTable[\"lang\"]][lid]\
- end\
- \
- function getColor(color)\
- return settingsTable[\"Colors\"][color]\
- end\
- \
- \
- function UpgradeV2()\
- fs.delete(settingfile)\
- \
- h = fs.open(cfgfile, \"r\")\
- local cfgTablefile = textutils.unserialize(h.readAll())\
- h.close()\
- \
- fs.delete(cfgfile)\
- \
- cfgTable[\"pin\"] = cfgTablefile[\"pin\"]\
- cfgTable[\"puk\"] = cfgTablefile[\"puk\"]\
- cfgTable[\"fails\"] = cfgTablefile[\"fails\"]\
- cfgTable[\"sucess\"] = cfgTablefile[\"sucess\"]\
- cfgTable[\"locked\"] = cfgTablefile[\"locked\"]\
- cfgTable[\"tries\"] = cfgTablefile[\"tries\"]\
- cfgTable[\"open\"] = cfgTablefile[\"open\"]\
- \
- local h = fs.open(cfgfile, \"w\")\
- h.write(textutils.serialize(cfgTable))\
- h.close()\
- \
- local h = fs.open(settingfile, \"w\")\
- h.write(textutils.serialize(settingsTable))\
- h.close()\
- end\
- \
- function DrawKeyboard(n)\
- mon.setBackgroundColor(getColor(\"DesktopColor\"))\
- mon.clear()\
- mon.setBackgroundColor(getColor(\"ButtonBackgroundColor\"))\
- mon.setTextColor(getColor(\"TextColor\"))\
- mon.setCursorPos(1, 2)\
- mon.write(\"1\")\
- mon.setCursorPos(4, 2)\
- mon.write(\"2\")\
- mon.setCursorPos(7, 2)\
- mon.write(\"3\")\
- \
- mon.setCursorPos(1, 3)\
- mon.write(\"4\")\
- mon.setCursorPos(4, 3)\
- mon.write(\"5\")\
- mon.setCursorPos(7, 3)\
- mon.write(\"6\")\
- \
- mon.setCursorPos(1, 4)\
- mon.write(\"7\")\
- mon.setCursorPos(4, 4)\
- mon.write(\"8\")\
- mon.setCursorPos(7, 4)\
- mon.write(\"9\")\
- \
- mon.setCursorPos(1, 5)\
- mon.write(\"R\")\
- mon.setCursorPos(4, 5)\
- mon.write(\"0\")\
- mon.setCursorPos(7, 5)\
- if m1 then\
- mon.write(\">\")\
- else\
- mon.write(\"X\")\
- end\
- \
- pinlen = n\
- pinlencur = 0\
- pin = \"\"\
- while pinlencur < pinlen do\
- if pinlencur == 0 then\
- mon.setBackgroundColor(getColor(\"DesktopColor\"))\
- mon.write(\" \")\
- mon.setCursorPos(1, 1)\
- if pinlen == 2 then\
- mon.write(t(4)..\" \"..t(5))\
- else\
- if new then\
- if pinlen == 4 then\
- mon.write(t(3)..\" PIN\")\
- end\
- \
- if pinlen == 7 then\
- mon.write(t(3)..\" PUK\")\
- end\
- else\
- if pinlen == 4 then\
- mon.write(\"PIN\"..\":\")\
- end\
- \
- if pinlen == 7 then\
- mon.write(\"PUK\"..\":\")\
- end\
- end\
- end\
- end \
- mon.setCursorPos(1, 1)\
- mon.setTextColor(getColor(\"TextColor\"))\
- \
- event, side, x, y = os.pullEvent()\
- if event == \"mouse_click\" then\
- if x == 1 and y == 1 then\
- term.clear()\
- term.setCursorPos(1, 1)\
- term.write(\"Resetting...\")\
- sleep(0.3)\
- fs.delete(cfgfile)\
- fs.delete(settingfile)\
- os.reboot()\
- end\
- end\
- if event == \"monitor_touch\" then\
- local doSkipPressed = false\
- \
- if x == 1 and y == 2 then\
- pin = pin..\"1\"\
- end\
- if x == 4 and y == 2 then\
- pin = pin..\"2\"\
- end\
- if x == 7 and y == 2 then\
- pin = pin..\"3\"\
- end\
- if x == 1 and y == 3 then\
- pin = pin..\"4\"\
- end\
- if x == 4 and y == 3 then\
- pin = pin..\"5\"\
- end\
- if x == 7 and y == 3 then\
- pin = pin..\"6\"\
- end\
- if x == 1 and y == 4 then\
- pin = pin..\"7\"\
- end\
- if x == 4 and y == 4 then\
- pin = pin..\"8\"\
- end\
- if x == 7 and y == 4 then\
- pin = pin..\"9\"\
- end\
- if x == 1 and y == 5 then\
- mon.setBackgroundColor(32768)\
- mon.clear()\
- mon.setTextColor(getColor(\"TextColor\"))\
- mon.setCursorPos(1, 1)\
- mon.write(\"...\") mon.setCursorPos(1, 2)\
- os.reboot()\
- end\
- if x == 4 and y == 5 then\
- if m1 then\
- if pinlencur > 0 then\
- pin = pin..\"0\"\
- else\
- doSkipPressed = true\
- end\
- else\
- pin = pin..\"0\"\
- end\
- end\
- \
- local showcfgTableField = true\
- if x == 7 and y == 5 then\
- if m1 then\
- pinlencur = 2\
- else\
- doSkipPressed = true\
- pin = \"\"\
- pinlencur = 0\
- showcfgTableField = false\
- end\
- end\
- \
- \
- if pinlencur > 0 then\
- showcfgTableField = true\
- end\
- \
- \
- if showcfgTableField then\
- mon.setBackgroundColor(getColor(\"TextFieldBackgroundColor\"))\
- mon.write(\" \")\
- mon.setCursorPos(1, 1)\
- mon.write(pin)\
- else\
- mon.setCursorPos(1, 1)\
- mon.setBackgroundColor(getColor(\"DesktopColor\"))\
- mon.write(\" \")\
- end\
- \
- if doSkipPressed == true then\
- pinlencur = 0\
- doSkipPressed = false\
- else\
- pinlencur = pinlencur + 1\
- doSkipPressed = false\
- end\
- \
- end\
- end\
- end\
- \
- function rsout(bool)\
- rs.setOutput(\"left\", bool)\
- rs.setOutput(\"right\", bool)\
- rs.setOutput(\"front\", bool)\
- rs.setOutput(\"back\", bool)\
- rs.setOutput(\"top\", bool)\
- rs.setOutput(\"bottom\", bool)\
- end\
- \
- function sucess()\
- mon.setBackgroundColor(8192)\
- mon.setTextColor(getColor(\"TextColor\"))\
- mon.clear()\
- mon.setCursorPos(1, 3)\
- mon.write(\"SUCESS!\")\
- \
- rsout(true)\
- \
- for i = 1, cfgTable[\"open\"] do\
- mon.setCursorPos(1, 5)\
- mon.write(t(4)..\": \" .. cfgTable[\"open\"] - (i - 1) .. \" \")\
- sleep(1)\
- end\
- \
- mon.setBackgroundColor(32768)\
- mon.clear()\
- \
- rsout(false)\
- \
- fs.delete(cfgfile)\
- h = fs.open(cfgfile, \"w\")\
- h.write(textutils.serialize(cfgTable))\
- if rb then\
- os.reboot()\
- end\
- \
- os.reboot()\
- end\
- local loaded = false\
- function DrawOnComputer()\
- term.setBackgroundColor(getColor(\"DesktopColor\"))\
- term.clear()\
- \
- term.setBackgroundColor(16384)\
- term.setCursorPos(1, 1)\
- term.write(vers)\
- term.setBackgroundColor(getColor(\"DesktopColor\"))\
- \
- term.setCursorPos(2, 3)\
- term.write(t(6)..\": \"..cfgTable[\"fails\"])\
- \
- term.setCursorPos(2, 5)\
- term.write(t(7)..\": \"..cfgTable[\"sucess\"])\
- \
- term.setCursorPos(44-4, 19)\
- --term.write(t(8)) ----------------------------------------------------------------------------------<<<<<<<<<<<<<<<<<<<<<<\
- term.write(\"Coming Soon!\")\
- \
- end\
- \
- function LangLeftName(bgcolor,fgcolor,text)\
- mon.setCursorPos(1, 2)\
- mon.setBackgroundColor(bgcolor)\
- mon.setTextColor(fgcolor)\
- mon.write(text)\
- end\
- \
- function LangRightName(bgcolor,fgcolor,text)\
- mon.setCursorPos(6, 2)\
- mon.setBackgroundColor(bgcolor)\
- mon.setTextColor(fgcolor)\
- mon.write(text)\
- end\
- \
- function PerfectWrite(x,y,bgcolor,fgcolor,text)\
- mon.setCursorPos(x, y)\
- mon.setBackgroundColor(bgcolor)\
- mon.setTextColor(fgcolor)\
- mon.write(text)\
- end\
- \
- function SelectLanguage(cs)\
- local mx = 1\
- if not cs then cs = 1 end\
- if cs == 0 then cs = mx end\
- if cs > mx then cs = 1 end\
- \
- local flags = {\
- {\"de\", \"en\"},\
- }\
- \
- shell.run(\"monitor \"..monPos..\" clear\")\
- local mon = peripheral.find(\"monitor\")\
- term.redirect(mon)\
- paintutils.drawImage(paintutils.loadImage(\"res/flags/flagSite_\"..cs..\".img\"), 1, 1)\
- \
- LangLeftName (colors.red, colors.white, WicowsTools.BigLetters(flags[cs][1]))\
- LangRightName(colors.red, colors.white, WicowsTools.BigLetters(flags[cs][2]))\
- \
- PerfectWrite(4,1,colors.lightGray,colors.black,\"|\")\
- PerfectWrite(4,2,colors.lightGray,colors.black,\"|\")\
- PerfectWrite(4,3,colors.lightGray,colors.black,\"|\")\
- \
- PerfectWrite(1,4,colors.lime,colors.orange,\"SELECT!\")\
- \
- PerfectWrite(1,5,colors.lightGray,colors.black,\"<<<\")\
- PerfectWrite(4,5,colors.gray,colors.red, cs )\
- PerfectWrite(5,5,colors.lightGray,colors.black,\">>>\")\
- local compl = false\
- while not comp do\
- event, side, x, y = os.pullEvent()\
- if event == \"monitor_touch\" then\
- if x < 4 and y < 4 then --LeftLang\
- settingsTable[\"lang\"] = flags[cs][1]\
- comp = true\
- elseif x > 4 and y < 4 then --RightLang\
- settingsTable[\"lang\"] = flags[cs][2]\
- comp = true\
- elseif x < 4 and y > 4 then --PrevSite\
- SelectLanguage(cs-1)\
- elseif x > 4 and y > 4 then --NextSite\
- SelectLanguage(cs+1)\
- end\
- end\
- end\
- end\
- \
- \
- if fs.exists(cfgfile) then\
- if not fs.exists(settingfile) then\
- UpgradeV2()\
- end\
- \
- \
- h = fs.open(cfgfile, \"r\")\
- cfgTable = textutils.unserialize(h.readAll())\
- h.close()\
- \
- h = fs.open(settingfile, \"r\")\
- settingsTable = textutils.unserialize(h.readAll())\
- h.close()\
- term.setTextColor(getColor(\"TextColor\"))\
- DrawOnComputer()\
- \
- rb = false\
- if cfgTable[\"tries\"] == 0 then\
- cfgTable[\"locked\"] = true\
- end\
- \
- if not cfgTable[\"locked\"] then\
- \
- DrawKeyboard(4)\
- \
- if pin == cfgTable[\"pin\"] then\
- cfgTable[\"sucess\"] = cfgTable[\"sucess\"] + 1\
- cfgTable[\"tries\"] = 3\
- DrawOnComputer()\
- sucess()\
- else\
- cfgTable[\"tries\"] = cfgTable[\"tries\"] - 1\
- cfgTable[\"fails\"] = cfgTable[\"fails\"] + 1\
- DrawOnComputer()\
- rb = true\
- end\
- else\
- \
- \
- DrawKeyboard(7)\
- \
- if pin == cfgTable[\"puk\"] then\
- cfgTable[\"locked\"] = false\
- cfgTable[\"tries\"] = 3\
- rb = true\
- else\
- rb = true\
- end\
- end\
- fs.delete(cfgfile)\
- h = fs.open(cfgfile, \"w\")\
- h.write(textutils.serialize(cfgTable))\
- if rb then\
- os.reboot()\
- end\
- else\
- \
- new = true\
- \
- term.setCursorPos(5, 2)\
- print(t(1))\
- term.setCursorPos(3, 4)\
- print(t(2))\
- \
- \
- SelectLanguage()\
- \
- \
- DrawKeyboard(4)\
- cfgTable[\"pin\"] = pin\
- \
- DrawKeyboard(7)\
- cfgTable[\"puk\"] = pin\
- \
- \
- m1 = true\
- \
- DrawKeyboard(2)\
- cfgTable[\"open\"] = tonumber(pin)\
- m1 = false\
- mon.setBackgroundColor(32768)\
- mon.setTextColor(getColor(\"TextColor\"))\
- mon.clear()\
- \
- local h = fs.open(\"/config.cfg\", \"w\")\
- h.write(textutils.serialize(cfgTable))\
- h.close()\
- \
- os.reboot()\
- \
- end",
- },
- },
- Title = "Wicows Security 1,6",
- }
- if not http then print("You need Internet!") return false end
- shell.run("clear")
- print("Getting Resources...")
- function HiddenPastebinGET(pstbinID, savLocFile)
- if not noUpdate then
- local sCode = pstbinID
- local sFile = savLocFile
- local sPath = shell.resolve( sFile )
- if fs.exists( sPath ) then
- fs.delete(sPath)
- end
- local response = http.get(
- "http://pastebin.com/raw.php?i="..textutils.urlEncode( pstbinID )
- )
- if response then
- local sResponse = response.readAll()
- response.close()
- res = sResponse
- end
- if res then
- local file = fs.open( sPath, "w" )
- file.write( res )
- file.close()
- end
- end
- end
- HiddenPastebinGET("REaZXV7W", "CCInstaller_WicowsTools")
- os.loadAPI("CCInstaller_WicowsTools")
- local WicowsTools = CCInstaller_WicowsTools
- x, y = term.getSize()
- DebugLog = window.create(term.current(), 2, 2, x -2, y-2)
- WicowsTools.CreateBorder()
- function Log(str, add)
- x, y = DebugLog.getCursorPos()
- w, h = DebugLog.getSize()
- if y > h then
- term.setBackgroundColor(colors.black)
- term.clear()DebugLog.clear()
- WicowsTools.CreateBorder()
- DebugLog.setCursorPos(1, 1)
- end
- x, y = DebugLog.getCursorPos()
- DebugLog.write(str)
- if not add then
- DebugLog.setCursorPos(1, y+1)
- end end
- Log("Welcome to the CCInstaller") Log("for: " .. Content["Title"]) Log("") sleep(2.5)
- Log("Initalizing Content...") sleep(0.5)
- Log("Folders: "..tostring(#Content["Folders"])) Log(" Files: "..tostring(#Content["Files"])) Log("")
- local fc = #Content["Folders"]
- if fc > 0 then
- Log("Creating Folders...")
- for i = 1, fc do
- Log("Create Folder: "..Content["Folders"][i])
- if not fs.exists(Content["Folders"][i]) then fs.makeDir(Content["Folders"][i]) end
- sleep(0.1)
- end
- end
- Log("") Log("Extract Files...") Log("")
- local fc = #Content["Files"]
- for i = 1, fc do
- Log("Extract File: "..Content["Files"][i]["Path"])
- WicowsTools.WriteFile(Content["Files"][i]["Path"], Content["Files"][i]["Content"])
- sleep(0.1)
- end
- sleep(1)
- Log("Done! Rebooting...")
- sleep(2.5)
- os.loadAPI("CCInstaller_WicowsTools")
- fs.delete("CCInstaller_WicowsTools")
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement