Skip to content

Commit

Permalink
Update installer.md
Browse files Browse the repository at this point in the history
  • Loading branch information
NoryiE committed Jul 28, 2022
1 parent 8dc84fa commit 21ff14c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/home/installer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ This is just a script which helps you to setup your program to automatically ins
Here is a very basic one which just installs basalt.lua if don't exist:
```lua
--Basalt configurated installer
local filePath = "basalt" --here you can change the file path default: basalt
local filePath = "basalt.lua" --here you can change the file path default: basalt
if not(fs.exists(filePath))then
shell.run("pastebin run ESs1mg7P packed true "..filePath) -- this is an alternative to the wget command
shell.run("pastebin run ESs1mg7P packed true "..filePath:gsub(".lua", "")) -- this is an alternative to the wget command
end
local basalt = require(filePath) -- here you can change the variablename in any variablename you want default: basalt
local basalt = require(filePath:gsub(".lua", "")) -- here you can change the variablename in any variablename you want default: basalt
```

## Advanced Installer
This is a visual version, it asks the user if he wants to install basalt.lua (if not found)<br>
![](https://raw.githubusercontent.com/Pyroxenium/Basalt/master/docs/_media/installer.png)
```lua
--Basalt configurated installer
local filePath = "basalt" --here you can change the file path default: basalt
local filePath = "basalt.lua" --here you can change the file path default: basalt
if not(fs.exists(filePath))then
local w,h = term.getSize()
term.clear()
Expand Down Expand Up @@ -51,7 +51,7 @@ if not(fs.exists(filePath))then
local event, p1,p2,p3,p4 = os.pullEvent()
if(event=="mouse_click")then
if(p3==math.floor(h/2+2))and(p2>=w/2-8)and(p2<=w/2-2)then
shell.run("pastebin run ESs1mg7P packed true "..filePath)
shell.run("pastebin run ESs1mg7P packed true "..filePath:gsub(".lua", ""))
_installerWindow.setVisible(false)
term.clear()
break
Expand All @@ -69,6 +69,6 @@ if not(fs.exists(filePath))then
term.clear()
end

local basalt = require(filePath) -- here you can change the variablename in any variablename you want default: basalt
local basalt = require(filePath:gsub(".lua", "")) -- here you can change the variablename in any variablename you want default: basalt
------------------------------
```

0 comments on commit 21ff14c

Please sign in to comment.