forked from matt-lowe/lich-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhighlight_links.lic
More file actions
61 lines (55 loc) · 2.3 KB
/
highlight_links.lic
File metadata and controls
61 lines (55 loc) · 2.3 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
=begin
This script changes the highlight color of links in the room description in the Wizard frontend.
https://github.com/matt-lowe/lich-scripts
tillmen@lichproject.org
=end
unless $fake_stormfront
respond 'This script is only useful in fake stormfront mode.'
end
unless defined?(Map.dijkstra)
respond 'Your versin of Lich is too old for this script.'
end
Settings.load
if script.vars.empty? and Settings['foreground_start']
$link_highlight_start = Settings['foreground_start'] + Settings['background_start']
$link_highlight_end = Settings['background_end'] + Settings['foreground_end']
elsif ( (script.vars[1].to_i > 127) and (script.vars[1].to_i < 142) ) or (script.vars[1] == 'none')
if (script.vars[1].to_i > 127) and (script.vars[1].to_i < 142)
Settings['foreground_start'] = script.vars[1].to_i.chr
Settings['foreground_end'] = 160.chr
else
Settings['foreground_start'] = ''
Settings['foreground_end'] = ''
end
if (script.vars[2].to_i > 143) and (script.vars[2].to_i < 159)
Settings['background_start'] = script.vars[2].to_i.chr
Settings['background_end'] = 163.chr
else
Settings['background_start'] = ''
Settings['background_end'] = ''
end
Settings.save
$link_highlight_start = Settings['foreground_start'] + Settings['background_start']
$link_highlight_end = Settings['background_end'] + Settings['foreground_end']
respond "Link highlights changed #{$link_highlight_start}like so#{$link_highlight_end}."
elsif script.vars[1] =~ /menu/i
respond
respond ' foreground background'
for num in 128..142
respond " #{num.chr} #{num} #{160.chr} #{(num+16).chr} #{(num+16)} #{163.chr}"
end
respond ' none none'
respond
respond 'Select a foreground and background color for links in room descriptions.'
respond
respond ' example: ;highlight 135 none'
respond
else
respond
respond 'Usage: ;highlight_links help - shows this message'
respond ' ;highlight_links menu - shows available colors and their codes'
respond ' ;highlight_links [#|none] [#|none] - sets or clears forground and background colors'
respond ' ;highlight_links - sets the highlight colors to whatever was set last,'
respond ' so that the script can be added to your favs list'
respond
end