Updated Basalt (markdown)

Robert Jelic
2022-04-03 21:15:08 +02:00
parent 521a9cc1ec
commit a26bf22f4e

@@ -95,19 +95,19 @@ Here is a premade installer you can add into your script if you want:
This is a visual version, it asks the user if he wants to install NyoUI.lua (if not found)<br> This is a visual version, it asks the user if he wants to install NyoUI.lua (if not found)<br>
![](https://i.imgur.com/b4Ys7FB.png) ![](https://i.imgur.com/b4Ys7FB.png)
````lua ````lua
--NyoUI configurated installer --Basalt configurated installer
local filePath = "NyoUI.lua" --here you can change the file path default: NyoUI.lua local filePath = "basalt.lua" --here you can change the file path default: basalt.lua
if not(fs.exists(filePath))then if not(fs.exists(filePath))then
local w,h = term.getSize() local w,h = term.getSize()
term.clear() term.clear()
local _installerWindow = window.create(term.current(),w/2-7,h/2-3,16,6) local _installerWindow = window.create(term.current(),w/2-7,h/2-3,16,6)
_installerWindow.setBackgroundColor(colors.blue) _installerWindow.setBackgroundColor(colors.blue)
_installerWindow.write("NyoUI Installer ") _installerWindow.write("Basalt Installer ")
_installerWindow.setBackgroundColor(colors.lightGray) _installerWindow.setBackgroundColor(colors.lightGray)
for line=2,6,1 do for line=2,6,1 do
_installerWindow.setCursorPos(1,line) _installerWindow.setCursorPos(1,line)
if(line==3)then if(line==3)then
_installerWindow.write("No NyoUI found! ") _installerWindow.write("No Basalt found! ")
elseif(line==4)then elseif(line==4)then
_installerWindow.write("Install it? ") _installerWindow.write("Install it? ")
elseif(line==6)then elseif(line==6)then
@@ -127,9 +127,10 @@ if not(fs.exists(filePath))then
local event, p1,p2,p3,p4 = os.pullEvent() local event, p1,p2,p3,p4 = os.pullEvent()
if(event=="mouse_click")then if(event=="mouse_click")then
if(p3==math.floor(h/2+2))and(p2>=w/2-7)and(p2<=w/2-5)then if(p3==math.floor(h/2+2))and(p2>=w/2-7)and(p2<=w/2-5)then
shell.run("wget https://raw.githubusercontent.com/NoryiE/NyoUI/master/NyoUI.lua "..filePath) shell.run("wget https://raw.githubusercontent.com/NoryiE/Basalt/master/basalt.lua "..filePath)
_installerWindow.setVisible(false) _installerWindow.setVisible(false)
term.clear() term.clear()
break
end end
if(p3==h/2+2)and(p2<=w/2+7)and(p2>=w/2+5)then if(p3==h/2+2)and(p2<=w/2+7)and(p2>=w/2+5)then
_installerWindow.setVisible(false) _installerWindow.setVisible(false)
@@ -141,17 +142,17 @@ if not(fs.exists(filePath))then
term.clear() term.clear()
end end
local NyoUI = dofile(filePath) -- here you can change the variablename in any variablename you want default: NyoUI local basalt = dofile(filePath) -- here you can change the variablename in any variablename you want default: basalt
------------------------------ ------------------------------
```` ````
Here is a very basic one which just installs NyoUI.lua if don't exist: Here is a very basic one which just installs NyoUI.lua if don't exist:
````lua ````lua
--NyoUI configurated installer --NyoUI configurated installer
local filePath = "NyoUI.lua" --here you can change the file path default: NyoUI.lua local filePath = "basalt.lua" --here you can change the file path default: basalt.lua
if not(fs.exists(filePath))then if not(fs.exists(filePath))then
shell.run("wget https://raw.githubusercontent.com/NoryiE/NyoUI/master/NyoUI.lua "..filePath) shell.run("wget https://raw.githubusercontent.com/NoryiE/Basalt/master/basalt.lua "..filePath)
end end
local NyoUI = dofile(filePath) -- here you can change the variablename in any variablename you want default: NyoUI local basalt = dofile(filePath) -- here you can change the variablename in any variablename you want default: basalt
```` ````