-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcitizenship.lic
More file actions
175 lines (151 loc) · 5.57 KB
/
citizenship.lic
File metadata and controls
175 lines (151 loc) · 5.57 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
=begin
--------------------------------------------------------------------------------
Title : Citizenship
Date : 12/28/2014
Author : Oweodry
Use :
;citizenship help
;citizenship <town>
Details :
Generic citizenship script which will purchase items which cost approximately
50-100 silver until the character has citizenship.
Notes :
- Currently supports: FWI, IMT, WL, SH, Teras
- May require approx. 8hrs and 100k (hard-coded failsafe to halt at 250k)
- There is a limit to the number of silver per hour which credits citizenship
- Reducing pause time may waste silvers without reducing citizenship time
- I'm willing to update to support other towns (some info needed from user)
- Releases may not always be tested
Updates :
- 10/07/2014 Released
- 12/28/2014 Teras added (thanks to Veni for supplying values)
--------------------------------------------------------------------------------
=end
# Without pauses, requires: ~400k in bank, ~8hrs
# ---------- Initialization (start) ------------------------------------------ #
# Location dependent info
towndata = { #"" => { "town" => "", "bank" => , "clerk" => , "npc" => "" },
"fwi" => { "town" => "Isle of the Four Winds", "bank" => 3672, "clerk" => 16696, "npc" => "clerk" },
"imt" => { "town" => "Icemule Trace", "bank" => 3370, "clerk" => 2437, "npc" => "giantess" },
"wl" => { "town" => "Wehnimer's Landing", "bank" => 400, "clerk" => 398, "npc" => "clerk" },
"sol" => { "town" => "Solhaven", "bank" => 5710, "clerk" => 12824, "npc" => "sailor" },
"ti" => { "town" => "Kharam-Dzu", "bank" => 1838, "clerk" => 12541, "npc" => "clerk" }
}
# Time to pause between buying things (edit this value if you want)
pausetime = 60
$citizenship_total_withdrawn = 0
# Generic go2 function
def go_place(location)
start_script "go2",["#{location}","_disable_confirm_"]
wait_until { !running?"go2" }; pause 0.25
end
# Withdraw
def do_bank(data)
go_place(data["bank"])
multifput "deposit all","withdraw 50000 note"
$citizenship_total_withdrawn += 50000
if $citizenship_total_withdrawn > 250000
echo "### Failsafe: Over 250k has been withdrawn from your bank account"
echo "### Exiting just in case something has gone wrong"
exit
end
end
# Current citizenship
def check_citizenship
pause 0.5; clear
fput "citizenship"
citstring = matchtimeout(1, /You.*citizenship/i)
return citstring
end
# Check citizen status at clerk
def do_clerk(data)
go_place(data["clerk"])
fput "ask #{data["npc"]} about citizenship"
citstring = matchtimeout(1, /You.*citizenship/i)
if citstring =~ /you do seem to be eligible for full citizenship/i
fput "write book"
elsif citstring =~ /already have citizenship/i
echo "### You're already a citizen somewhere!"
fput "citizenship"
exit
end
end
# ---------- Initialization (end) -------------------------------------------- #
# ---------- Arguments (start) ----------------------------------------------- #
# Four Winds
if script.vars.find { |var| var =~ /fwi/i }
town = "fwi"
def do_buying
noun = "bread"
go_place("12283"); multifput "order 5","buy"; pause 0.5
while checkright =~ /#{noun}/ or checkleft =~ /#{noun}/
fput "eat my #{noun}"; waitrt?; pause 0.5
end
end
# Icemule
elsif script.vars.find { |var| var =~ /imt/i }
town = "imt"
def do_buying
noun = "pepper"
go_place("3449"); multifput "order 10","take #{noun} on ##{GameObj.room_desc.find { |obj| obj.noun == "bar" }.id}"; pause 0.5
while checkright =~ /#{noun}/ or checkleft =~ /#{noun}/
fput "eat my #{noun}"; waitrt?; pause 0.5
end
end
# Landing
elsif script.vars.find { |var| var =~ /wl/i }
town = "wl"
def do_buying
noun = "sandwich"
go_place("3809"); multifput "order 13","take #{noun} on ##{GameObj.room_desc.find { |obj| obj.noun == "bar" }.id}"; pause 0.5
while checkright =~ /#{noun}/ or checkleft =~ /#{noun}/
fput "eat my #{noun}"; waitrt?; pause 0.5
end
end
# Solhaven
elsif script.vars.find { |var| var =~ /sol/i }
town = "sol"
def do_buying
noun = "bread"
go_place("12808"); multifput "order 1","buy"; pause 0.5
while checkright =~ /#{noun}/ or checkleft =~ /#{noun}/
fput "eat my #{noun}"; waitrt?; pause 0.5
end
end
# Teras Isle
elsif script.vars.find { |var| var =~ /ti/i }
town = "ti"
def do_buying
noun = "pie"
go_place("12535"); multifput "order 3","buy"; pause 0.5
while checkright =~ /#{noun}/ or checkleft =~ /#{noun}/
fput "eat my #{noun}"; waitrt?; pause 0.5
end
end
# Help text
else
respond("\n\tThis script iteratively buys 50-100 silver items to obtain citizenship.
It will purchase 1 item per minute and check with the town clerk every
10 minutes. Budget approximately 100k and 8hrs. This script will exit if
more than 250k is withdrawn from your bank account.")
respond("\n\tSyntax: ;#{script.name} <town code>\n\n")
locations = ["\tCode\t-\tTown"]
towndata.keys.each { |k| locations.push("\t#{k}\t-\t#{towndata[k]["town"]}") }
locations.each { |loc| respond(loc) }; respond("\n")
exit
end
# ---------- Arguments (end) ------------------------------------------------- #
# ---------- Main (start) ---------------------------------------------------- #
start_time=Time.now
empty_hands
# Main loop
while check_citizenship !~ /You currently have full citizenship.* #{towndata[town]["town"]}/i
if checkright !~ /note/ and checkleft !~ /note/ then do_bank(towndata[town]); end
10.times { do_buying; pause pausetime }
do_clerk(towndata[town])
end
fill_hands
echo "### Full citizenship in #{towndata[town]["town"]}!"
echo "### Started: #{start_time}"
echo "### Finished: #{Time.now}"
# ---------- Main (end) ------------------------------------------------------ #