Back to "movement" tags

Auto Rails by Xyio

Description: This script works hand in hand with the Razor2Rails program which converts a razor .macro file you record of your movements to script compatible lists that you insert. You can use this in any script where you would like pre-recorded movement to be available. This script is the most simple example so you can see the working parts. You must be on the exact square you started recording at when you start this. (I suggest marking a rune and writing the location >info [target self] at the top of the script.) Link to Razor2Rail: https://github.com/malbolger/Razor2Rail (source code available).

1#Auto Rails by Xyio
2
3#Write your starting location below for reference
4#Staring location: (example) 2007, 2239 -- Horseshoe Bay
5#
6# 
7# <><><><><><><><><><><><><><><><><><><><><>
8# ******************************************
9# //--------------------------------------//
10# //----PASTE RAILS FILE CONTENTS HERE----//
11
12
13# //-------END RAILS FILE CONTENTS -------//
14# //--------------------------------------//
15#*******************************************
16# <><><><><><><><><><><><><><><><><><><><><>
17#
18# ----CONFIG BELOW----
19#----Use Rails?--- (0 if off, 1 is on)
20setvar useRails 1
21#
22#
23# Delay between movement attempts
24setvar movementDelay 250
25#
26#
27# Variables to make our location persist.
28setvar xListEntry 0
29setvar yListEntry 0
30
31
32#----------------DO NOT EDIT BELOW THIS LINE-----------------------
33
34while not dead
35    if useRails == 1
36        if atlist xCoord 0 as x
37            setvar xListEntry x
38        endif
39        if atlist yCoord 0 as y
40            setvar yListEntry y
41        endif       
42        if position xListEntry yListEntry              
43            overhead 'at location'                                   
44            if list moveList > 0             
45                poplist moveList 'front'
46                poplist xCoord 'front'
47                poplist yCoord 'front'
48            else
49                overhead "::: Back to town rail completed :::"
50                cast "recall"
51                waitfortarget 3000
52                if findtype 'recall rune' backpack
53                    targettype 'recall rune' backpack
54                    overhead "::: Recalled Out :::" 15
55                endif
56                if findtype 'Runebook' backpack
57                    targettype 'Runebook' backpack
58                    overhead "::: Recalled Out :::" 15
59                endif
60            endif
61        else            
62            if atlist moveList 0 as firstEntry
63                #overhead xListEntry
64                #overhead yListEntry
65                if firstEntry == 1
66                    overhead '::: moving north :::' 55
67                    walk 'north'
68                    wait movementDelay
69                endif
70                if firstEntry == 2
71                    overhead '::: moving right :::' 55
72                    walk 'right'
73                    wait movementDelay
74                endif
75                if firstEntry == 3
76                    overhead '::: moving east :::' 55
77                    walk 'east'
78                    wait movementDelay
79                endif
80                if firstEntry == 4
81                    overhead '::: moving down :::' 55
82                    walk 'down'
83                    wait movementDelay
84                endif
85                if firstEntry == 5
86                    overhead '::: moving south :::' 55
87                    walk 'south'
88                    wait movementDelay
89                endif
90                if firstEntry == 6
91                    overhead '::: moving left :::' 55
92                    walk 'left'
93                    wait movementDelay
94                endif
95                if firstEntry == 7
96                    overhead '::: moving west :::' 55
97                    walk 'west'
98                    wait movementDelay
99                endif
100                if firstEntry == 8
101                    overhead '::: moving up :::' 55
102                    walk 'up'
103                    wait movementDelay
104                endif
105            endif
106        endif
107    endif    
108endwhile
109