forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdr-scripts_install.lic
104 lines (89 loc) · 2.85 KB
/
dr-scripts_install.lic
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
=begin
dr-scripts install helper
Aims to automate running through the steps from https://github.com/rpherbig/dr-scripts/wiki/First-Time-Setup
Please see us on Discord if there are any issues, or raise an issue on Github
author: Mahtra ([email protected])
game: Dragonrealms
version: 1.1
changelog:
1.1 (2022-01-28):
Minor revisions based on feedback on Github
1.0 (2022-01-27):
First release
=end
def wait_for_script_to_complete(name, args = [], flags = {})
script_handle = start_script(name, args.map { |arg| arg =~ /\s/ ? "\"#{arg}\"" : arg }, flags)
if script_handle
pause 2
pause 0.5 while Script.running.include?(script_handle)
end
script_handle
end
def download_dependency
if(File.exist?('./scripts/dependency.lic'))
echo "Dependency exist already, skipping downloads"
else
echo "Downloading dependency"
wait_for_script_to_complete('repository', ['download', 'dependency.lic'])
pause 2
end
end
def install_dependency
if(File.exist?('./scripts/dependency.lic'))
echo "Dependency exist already installed, skipping downloads"
else
echo "Installing dependency, this might take a few minutes"
wait_for_script_to_complete('dependency', ['install'])
end
end
def enable_use_lich_fork
echo "Switching to DR fork"
ExecScript.start('use_lich_fork')
pause 2
end
def run_setupaliases
if(File.exist?('./scripts/setupaliases.lic'))
wait_for_script_to_complete('setupaliases')
pause 2
end
end
def download_narost_glass
echo "Downloading narost-glass, and setting up map alias"
wait_for_script_to_complete('repository', ['download', 'narost-glass.lic'])
UpstreamHook.run("<c>#{$clean_lich_char}alias add --global map = #{$clean_lich_char}narost-glass")
pause 2
end
def enable_autostarts
echo "Adding textsubs, and roomnumbers to autostarts"
ExecScript.start("autostart(['textsubs', 'roomnumbers'])")
pause 2
end
def display_information
if(File.exist?('./scripts/links.lic'))
echo "Additional resources can be found in the links below"
wait_for_script_to_complete('links')
pause 2
end
end
def ensure_monsterbold
echo "Setting monsterbold"
fput("set monsterbold")
pause 2
end
def log_out
echo "***************************************************"
echo "*******Install completed*******"
echo "*******Logging out of the game now*******"
echo "*******Log back in to proceed*******"
echo "***************************************************"
fput('exit')
end
download_dependency
install_dependency
enable_use_lich_fork
run_setupaliases
download_narost_glass
enable_autostarts
display_information
ensure_monsterbold
log_out