-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvorticaltransfer.cmd
More file actions
159 lines (138 loc) · 3.78 KB
/
vorticaltransfer.cmd
File metadata and controls
159 lines (138 loc) · 3.78 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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
include library.cmd
action math bundletransfervalue add $1 when You scan through (?:.*) and finally decide that they're worth a total of about (\d+) (Kronars|Lirums|Dokoras)\.
action math pouchtransfervalue add $1 when You sort through the gems and finally decide that they're worth a total of about (\d+) (Kronars|Lirums|Dokoras)\.
var bundletransfervalue 0
var pouchtransfervalue 0
var bundlestransferred 0
var pouchestransferred 0
#goto TRANSFERRECEIVELOOP
if_1 then
{
if ("%1" = "g") then
{
put #echo Yellow Giving.
var mode 1
var origin vault
var destination vortical sack
}
if ("%1" = "r") then
{
put #echo Yellow Receiving.
var mode 2
var origin space
var destination vault
}
}
else
{
put #echo Must have an argument of either, "g", for giver, or, "r", for receiver.
exit
}
gosub STOWALL
if (%mode = 1) then
{
var transferitem bundle
goto TRANSFERGIVELOOP
}
if (%mode = 2) then
{
goto TRANSFERRECEIVELOOP
}
exit
TRANSFERGIVELOOP:
gosub GETITEM %transferitem from %origin
gosub APPRAISE my %transferitem
if ("$righthand" != "Empty") then
{
gosub PUTLOOP
if ("%transferitem" = "bundle") then math bundlestransferred add 1
if ("%transferitem" = "gem pouch") then math pouchestransferred add 1
put #echo Yellow Bundles Transferred: %bundlestransferred
if (%bundlestransferred > 0) then
{
put #echo Yellow Total BUndle Value: %bundletransfervalue
var averagebundle %bundletransfervalue
math averagebundle divide %bundlestransferred
put #echo Yellow Average Bundle Value: %averagebundle
}
put #echo Yellow Pouches transferred: %pouchtransferred
if (%pouchestransferred > 0) then
{
put #echo Yellow Total Pouch Value: %pouchtransfervalue
var averagepouch %pouchestransfervalue
math averagepouch divide %pouchestransferred
put #echo Yellow Average Pouch Value: %averagepouch
}
goto TRANSFERGIVELOOP
}
else
{
if ("%transferitem" = "bundle") then
{
var transferitem gem pouch
goto TRANSFERGIVELOOP
}
else
{
put #echo Yellow Done!
exit
}
}
PUTLOOP:
gosub PUTITEM my %transferitem in %destination
if ("$righthand" != "Empty") then
{
pause 2
goto PUTLOOP
}
else return
TRANSFERRECEIVELOOP:
gosub GETLOOP
gosub APPRAISE my %transferitem
gosub PUTITEM $righthand in %destination
if ("$righthand" != "Empty") then
{
gosub PUTITEM $righthand in vortical sack
put #echo Yellow Vault full!
exit
}
if ("%transferitem" = "bundle") then math bundlestransferred add 1
if ("%transferitem" = "gem pouch") then math pouchestransferred add 1
put #echo Yellow Bundles Transferred: %bundlestransferred
if (%bundlestransferred > 0) then
{
put #echo Yellow Total BUndle Value: %bundletransfervalue
var averagebundle %bundletransfervalue
math averagebundle divide %bundlestransferred
put #echo Yellow Average Bundle Value: %averagebundle
}
put #echo Yellow Pouches transferred: %pouchestransferred
if (%pouchestransferred > 0) then
{
put #echo Yellow Total Pouch Value: %pouchtransfervalue
var averagepouch %pouchtransfervalue
math averagepouch divide %pouchestransferred
put #echo Yellow Average Pouch Value: %averagepouch
}
goto TRANSFERRECEIVELOOP
GETLOOP:
gosub GETITEM bundle in %origin
if ("$righthand" = "Empty") then
{
gosub GETITEM gem pouch in %origin
if ("$righthand" = "Empty") then
{
pause 2
goto GETLOOP
}
else
{
var transferitem gem pouch
return
}
}
else
{
var transferitem bundle
return
}