Refill Runebooks by jfrostp
Description: Refills runebook/tomes on the walls, in your backpack, and in nearby chests
1# Refills runebooks/tomes in backpack, nearby, and in chests
2# Modified version of the Jaseowns script
3
4@setvar! globalTimeout 650
5
6# Set this to the serial of a chest if you don't carry recall scrolls in your backpack
7setvar! recallScrollsChest 0
8
9@clearsysmsg
10@cleardragdrop
11@clearignore
12
13setvar! recallScrolls 0
14if recallScrollsChest != 0
15 if findtype 8012 recallScrollsChest as item
16 setvar! recallScrolls item
17 endif
18endif
19
20if recallScrolls = 0
21 if findtype 8012 backpack as item
22 setvar! recallScrolls item
23 endif
24endif
25
26if recallScrolls = 0
27 overhead "Out of scrolls!" 34
28 stop
29endif
30
31# Backpack
32while findtype "runetome|runebook" backpack as tome
33 getlabel recallScrolls desc
34 overhead desc 88
35
36 lift recallScrolls 60000
37 if insysmsg 'not found or out of range'
38 overhead "Out of scrolls!" 34
39 stop
40 endif
41
42 drop tome
43 @ignore tome
44endwhile
45
46# Nearby tomes
47while findtype "runetome|runebook" ground -1 -1 2 as tome
48 getlabel recallScrolls desc
49 overhead desc 88
50
51 lift recallScrolls 60000
52 if insysmsg 'not found or out of range'
53 overhead "Out of scrolls!" 34
54 stop
55 endif
56
57 drop tome
58 @ignore tome
59endwhile
60
61# Nearby chests
62while findtype 2473|3710|41451|41452|3646|3647|3644|3645|41449|41450|29832|29833|2472|29077|29078|2475|3648|3649|3708|3650|3651|41453|41454|2474|3709|3650|3651|41455|41456|29086|29087 true as chest
63 while findtype "runetome|runebook" chest as tome
64 getlabel recallScrolls desc
65 overhead desc 88
66
67 lift recallScrolls 60000
68 if insysmsg 'not found or out of range'
69 overhead "Out of scrolls!" 34
70 stop
71 endif
72
73 drop tome
74 @ignore tome
75 endwhile
76 @ignore chest
77endwhile
78
79@clearsysmsg
80@cleardragdrop
81@clearignore