-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartup
More file actions
43 lines (38 loc) · 1.28 KB
/
Copy pathstartup
File metadata and controls
43 lines (38 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
local bedrockPath='/ccDropBox'
if OneOS then OneOS.LoadAPI('/System/API/Bedrock.lua', false)
elseif fs.exists(bedrockPath..'/Bedrock')then
os.loadAPI(bedrockPath..'/Bedrock')else if http then print('Downloading Bedrock...')
local h=http.get('http://pastebin.com/raw.php?i=0MgKNqpN')
if h then
local f=fs.open(bedrockPath..'/Bedrock','w')
f.write(h.readAll())
f.close()
h.close()
os.loadAPI(bedrockPath..'/Bedrock')
else error('Failed to download Bedrock. Is your internet working?') end
else error('This program needs to download Bedrock to work. Please enable HTTP.')
end
end
if Bedrock then
Bedrock.BasePath = bedrockPath
Bedrock.ProgramPath = "/ccDropBox"
end
local program = Bedrock:Initialise()
program:Run(function()
text = paintutils.loadImage("/ccDropBox/gui/text")
paintutils.drawImage(text,6,1)
--logo = paintutils.loadImage("/ccDropBox/gui/logo")
--paintutils.drawImage(logo,23,5)
program:LoadView("main")
program:GetObject("ExitButton").OnClick = function(self, event, side, x, y)
program:DisplayAlertWindow('Are you sure?', 'Are you sure you want to exit ccDropbox?', {'Yes', 'No'}, function(value)
if value == 'Yes' then
term.setBackgroundColor(colors.black)
term.clear()
term.setCursorPos(1,1)
program:Quit()
else
end
end)
end
end)