Lore Page Organizer by FewUnderstandThis
Description: Moves lore pages to corresponding books, else to overflow container
1# Lore Page Organizer by @FewUnderstandThis
2# Requires containers for lore books, lore page source, lore page overflow
3
4clearsysmsg
5clearignore
6
7# Create lists
8overhead 'Compiling lists...'
9## Dungeons
10removelist 'dungeons'
11createlist 'dungeons'
12pushlist 'dungeons' 'aegis keep'
13pushlist 'dungeons' 'cavernam'
14pushlist 'dungeons' 'darkmire temple'
15pushlist 'dungeons' 'inferno'
16pushlist 'dungeons' 'the mausoleum'
17pushlist 'dungeons' 'mount petram'
18pushlist 'dungeons' 'nusero'
19pushlist 'dungeons' 'ossuary'
20pushlist 'dungeons' 'pulma'
21pushlist 'dungeons' 'shadowspire cathedral'
22## Towns
23removelist 'towns'
24createlist 'towns'
25pushlist 'towns' 'anchor'
26pushlist 'towns' 'andaria'
27pushlist 'towns' 'cambria'
28pushlist 'towns' 'corpse creek'
29pushlist 'towns' 'horseshoe bay'
30pushlist 'towns' 'outpost'
31pushlist 'towns' 'prevalia'
32pushlist 'towns' 'shelter island'
33pushlist 'towns' 'terran'
34## Volumes, must check 10 before 1
35removelist 'volumes'
36createlist 'volumes'
37pushlist 'volumes' 'vol 10'
38pushlist 'volumes' 'vol 1'
39pushlist 'volumes' 'vol 2'
40pushlist 'volumes' 'vol 3'
41pushlist 'volumes' 'vol 4'
42pushlist 'volumes' 'vol 5'
43pushlist 'volumes' 'vol 6'
44pushlist 'volumes' 'vol 7'
45pushlist 'volumes' 'vol 8'
46pushlist 'volumes' 'vol 9'
47
48# Set containers
49overhead 'Set book container:' 1150
50setvar books
51wait 250
52overhead 'Set page source container:' 1150
53setvar source
54wait 250
55overhead 'Set page overflow container:' 1150
56setvar overflow
57wait 250
58
59# Organizer
60overhead 'Organizing...' 1150
61while findtype 'parchment' 'source' as page
62 getlabel page pageLabel
63 overhead '---' 1150
64 overhead pageLabel
65 if 'creatures of' in pageLabel
66 while find page 'source' and findtype 29107 'books' as book
67 getlabel book bookLabel
68 foreach d in 'dungeons'
69 if d in pageLabel and d in bookLabel
70 overhead 'Match!' 1150
71 lift page
72 wait 500
73 drop book
74 wait 500
75 if insysmsg 'already contains that page'
76 overhead 'Already in book...' 1150
77 elseif insysmsg 'add the lore page'
78 overhead 'Success!' 1150
79 else
80 overhead 'CHECK SCRIPT!' 38
81 endif
82 clearsysmsg
83 endif
84 endfor
85 ignore book
86 endwhile
87 elseif 'tales of' in pageLabel
88 while find page 'source' and findtype 29106 'books' 2236 as book
89 getlabel book bookLabel
90 foreach d in 'dungeons'
91 if d in pageLabel and d in bookLabel
92 overhead 'Match!' 1150
93 lift page
94 wait 500
95 drop book
96 wait 500
97 if insysmsg 'already contains that page'
98 overhead 'Already in book...' 1150
99 elseif insysmsg 'add the lore page'
100 overhead 'Success!' 1150
101 else
102 overhead 'CHECK SCRIPT!' 38
103 endif
104 clearsysmsg
105 endif
106 endfor
107 ignore book
108 endwhile
109 elseif 'history of' in pageLabel
110 while find page 'source' and findtype 29108 'books' as book
111 getlabel book bookLabel
112 foreach t in 'towns'
113 if t in pageLabel and t in bookLabel
114 overhead 'Match!' 1150
115 lift page
116 wait 500
117 drop book
118 wait 500
119 if insysmsg 'already contains that page'
120 overhead 'Already in book...' 1150
121 elseif insysmsg 'add the lore page'
122 overhead 'Success!' 1150
123 else
124 overhead 'CHECK SCRIPT!' 38
125 endif
126 clearsysmsg
127 endif
128 endfor
129 ignore book
130 endwhile
131 elseif 'outlands mythology' in pageLabel
132 while find page 'source' and findtype 29106 'books' 2261 as book
133 getlabel book bookLabel
134 foreach v in 'volumes'
135 if v in pageLabel and v in bookLabel
136 overhead 'Match!' 1150
137 lift page
138 wait 500
139 drop book
140 wait 500
141 if insysmsg 'already contains that page'
142 overhead 'Already in book...' 1150
143 elseif insysmsg 'add the lore page'
144 overhead 'Success!' 1150
145 else
146 overhead 'CHECK SCRIPT!' 38
147 endif
148 clearsysmsg
149 endif
150 endfor
151 ignore book
152 endwhile
153 endif
154 # Move to overflow if no room in books
155 if find page 'source'
156 overhead 'To overflow...' 1150
157 lift page
158 wait 500
159 drop 'overflow' -1 -1 -1
160 wait 500
161 endif
162 clearignore
163endwhile
164
165overhead '---' 1150
166overhead 'Organizer complete!' 1150
167overhead 'Organizer complete!' 1150
168overhead 'Organizer complete!' 1150