-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
if getgenv and not getgenv().shared then getgenv().shared = {} end | ||
local errorPopupShown = false | ||
local setidentity = syn and syn.set_thread_identity or set_thread_identity or setidentity or setthreadidentity or function() end | ||
local getidentity = syn and syn.get_thread_identity or get_thread_identity or getidentity or getthreadidentity or function() return 8 end | ||
local isfile = isfile or function(file) | ||
local suc, res = pcall(function() return readfile(file) end) | ||
return suc and res ~= nil | ||
end | ||
local delfile = delfile or function(file) writefile(file, "") end | ||
|
||
local function displayErrorPopup(text, func) | ||
local oldidentity = getidentity() | ||
setidentity(8) | ||
local ErrorPrompt = getrenv().require(game:GetService("CoreGui").RobloxGui.Modules.ErrorPrompt) | ||
local prompt = ErrorPrompt.new("Default") | ||
prompt._hideErrorCode = true | ||
local gui = Instance.new("ScreenGui", game:GetService("CoreGui")) | ||
prompt:setErrorTitle("Vape") | ||
prompt:updateButtons({{ | ||
Text = "OK", | ||
Callback = function() | ||
prompt:_close() | ||
if func then func() end | ||
end, | ||
Primary = true | ||
}}, 'Default') | ||
prompt:setParent(gui) | ||
prompt:_open(text) | ||
setidentity(oldidentity) | ||
end | ||
|
||
local function vapeGithubRequest(scripturl) | ||
if not isfile("vape/"..scripturl) then | ||
local suc, res | ||
task.delay(15, function() | ||
if not res and not errorPopupShown then | ||
errorPopupShown = true | ||
displayErrorPopup("The connection to github is taking a while, Please be patient.") | ||
end | ||
end) | ||
suc, res = pcall(function() return game:HttpGet("https://raw.githubusercontent.com/7GrandDadPGN/VapeV4ForRoblox/"..readfile("vape/commithash.txt").."/"..scripturl, true) end) | ||
if not suc or res == "404: Not Found" then | ||
displayErrorPopup("Failed to connect to github : vape/"..scripturl.." : "..res) | ||
error(res) | ||
end | ||
if scripturl:find(".lua") then res = "--This watermark is used to delete the file if its cached, remove it to make the file persist after commits.\n"..res end | ||
writefile("vape/"..scripturl, res) | ||
end | ||
return readfile("vape/"..scripturl) | ||
end | ||
|
||
if not shared.VapeDeveloper then | ||
local commit = "main" | ||
for i,v in pairs(game:HttpGet("https://github.com/7GrandDadPGN/VapeV4ForRoblox"):split("\n")) do | ||
if v:find("commit") and v:find("fragment") then | ||
local str = v:split("/")[5] | ||
commit = str:sub(0, str:find('"') - 1) | ||
break | ||
end | ||
end | ||
if commit then | ||
if isfolder("vape") then | ||
if ((not isfile("vape/commithash.txt")) or (readfile("vape/commithash.txt") ~= commit or commit == "main")) then | ||
for i,v in pairs({"vape/Universal.lua", "vape/MainScript.lua", "vape/GuiLibrary.lua"}) do | ||
if isfile(v) and readfile(v):find("--This watermark is used to delete the file if its cached, remove it to make the file persist after commits.") then | ||
delfile(v) | ||
end | ||
end | ||
if isfolder("vape/CustomModules") then | ||
for i,v in pairs(listfiles("vape/CustomModules")) do | ||
if isfile(v) and readfile(v):find("--This watermark is used to delete the file if its cached, remove it to make the file persist after commits.") then | ||
delfile(v) | ||
end | ||
end | ||
end | ||
if isfolder("vape/Libraries") then | ||
for i,v in pairs(listfiles("vape/Libraries")) do | ||
if isfile(v) and readfile(v):find("--This watermark is used to delete the file if its cached, remove it to make the file persist after commits.") then | ||
delfile(v) | ||
end | ||
end | ||
end | ||
writefile("vape/commithash.txt", commit) | ||
end | ||
else | ||
makefolder("vape") | ||
writefile("vape/commithash.txt", commit) | ||
end | ||
else | ||
displayErrorPopup("Failed to connect to github, please try using a VPN.") | ||
error("Failed to connect to github, please try using a VPN.") | ||
end | ||
end | ||
|
||
return loadstring(vapeGithubRequest("MainScript.lua"))() |