@@ -6,19 +6,19 @@ This is just a script which helps you to setup your program to automatically ins
6
6
Here is a very basic one which just installs basalt.lua if don't exist:
7
7
``` lua
8
8
-- Basalt configurated installer
9
- local filePath = " basalt" -- here you can change the file path default: basalt
9
+ local filePath = " basalt.lua " -- here you can change the file path default: basalt
10
10
if not (fs .exists (filePath ))then
11
- shell .run (" pastebin run ESs1mg7P packed true " .. filePath ) -- this is an alternative to the wget command
11
+ shell .run (" pastebin run ESs1mg7P packed true " .. filePath : gsub ( " .lua " , " " ) ) -- this is an alternative to the wget command
12
12
end
13
- local basalt = require (filePath ) -- here you can change the variablename in any variablename you want default: basalt
13
+ local basalt = require (filePath : gsub ( " .lua " , " " ) ) -- here you can change the variablename in any variablename you want default: basalt
14
14
```
15
15
16
16
## Advanced Installer
17
17
This is a visual version, it asks the user if he wants to install basalt.lua (if not found)<br >
18
18
![ ] ( https://raw.githubusercontent.com/Pyroxenium/Basalt/master/docs/_media/installer.png )
19
19
``` lua
20
20
-- Basalt configurated installer
21
- local filePath = " basalt" -- here you can change the file path default: basalt
21
+ local filePath = " basalt.lua " -- here you can change the file path default: basalt
22
22
if not (fs .exists (filePath ))then
23
23
local w ,h = term .getSize ()
24
24
term .clear ()
@@ -51,7 +51,7 @@ if not(fs.exists(filePath))then
51
51
local event , p1 ,p2 ,p3 ,p4 = os .pullEvent ()
52
52
if (event == " mouse_click" )then
53
53
if (p3 == math.floor (h / 2 + 2 ))and (p2 >= w / 2 - 8 )and (p2 <= w / 2 - 2 )then
54
- shell .run (" pastebin run ESs1mg7P packed true " .. filePath )
54
+ shell .run (" pastebin run ESs1mg7P packed true " .. filePath : gsub ( " .lua " , " " ) )
55
55
_installerWindow .setVisible (false )
56
56
term .clear ()
57
57
break
@@ -69,6 +69,6 @@ if not(fs.exists(filePath))then
69
69
term .clear ()
70
70
end
71
71
72
- local basalt = require (filePath ) -- here you can change the variablename in any variablename you want default: basalt
72
+ local basalt = require (filePath : gsub ( " .lua " , " " ) ) -- here you can change the variablename in any variablename you want default: basalt
73
73
---- --------------------------
74
74
```
0 commit comments