Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function clicked(x,y,x1,y1,x2,y2)
- if x >= x1 and x <= x2 and y >= y1 and y <= y2 then
- return true
- end
- return false
- end
- local function pastebin(paste,path)
- local file = http.get("http://pastebin.com/raw.php?i="..paste)
- if file then
- file = file.readAll()
- h=fs.open(path,"w")
- h.write(file)
- h.close()
- else
- term.setBackgroundColor(32768)
- term.clear()
- term.setCursorPos(1,1)
- error("Error 404")
- end
- end
- local dataDownload = {
- {["paste"]="dxYxX6dn",["path"]="game1main/graphics"},
- {["paste"]="77kUygXF",["path"]="game1main/backgroundg.img"},
- {["paste"]="vqxBbzi9",["path"]="game1main/game1itamname"},
- {["paste"]="GXzR4ig8",["path"]="game1main/gamemain"},
- }
- local function download()
- for f = 1, #dataDownload do
- if not fs.exists(dataDownload[f]["path"]) then
- pastebin(dataDownload[f]["paste"],dataDownload[f]["path"])
- end
- end
- end
- term.setBackgroundColor(8192)
- term.clear()
- term.setCursorPos(1,1)
- term.write(string.rep("-",51))
- term.setCursorPos(19,1)
- term.write("Game launcher")
- local vnltext = "Game1 launcher by Wirthe16"
- term.setCursorPos(51-#vnltext,19)
- term.write(vnltext)
- local vnftext = "CC Graphics API by Wirthe16, Milliost"
- term.setCursorPos(51-#vnftext,18)
- term.write(vnftext)
- term.setCursorPos(18,4)
- term.write("Downloading...")
- download()
- term.setCursorPos(18,4)
- term.write(" ")
- term.setCursorPos(19,5)
- term.write("Quit Play")
- while true do
- local e, b, x, y = os.pullEvent()
- if e == "mouse_click" and b == 1 and clicked(x,y,19,5,22,5) then
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1,1)
- break
- elseif e == "mouse_click" and b == 1 and clicked(x,y,27,5,30,5) then
- shell.run("game1main/gamemain")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement