-
Notifications
You must be signed in to change notification settings - Fork 1
/
previewSeed.ahk
246 lines (186 loc) · 4.52 KB
/
previewSeed.ahk
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
/*
*
* Random Gen RWG Script
* - by dcsobral (originally written by HarveyUK 2019/12/20)
*/
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
;if not A_IsAdmin
; Run *RunAs "%A_ScriptFullPath%"
#Include %A_ScriptDir%
#Include stdio.ahk
; Command line args
RWGSize := A_Args[1]
RWGSeed := A_Args[2]
RWGTowns := A_Args[3]
RWGWilderness := A_Args[4]
RWGRivers := A_Args[5]
RWGCraters := A_Args[6]
RWGCracks := A_Args[7]
RWGLakes := A_Args[8]
RWGPlains := A_Args[9]
RWGHills := A_Args[10]
RWGMountains := A_Args[11]
RWGRandom := A_Args[12]
/*
* Defined Co-ordinates
*
*/
Coordmode, Mouse, Screen
; World Seed Box
worldSeedX := 874
worldSeedY := 341
; Arrows horizontal location
leftArrowX := 696
rightArrowX := 1071
; World Size vertical arrows
sizeArrowY := 406
; Towns vertical arrows
townsArrowY := 516
; Rivers vertical arrows
wildernessArrowY := 566
; Craters vertical arrows
riversArrowY := 626
; Cracks vertical arrows
cratersArrowY := 676
; Lakes vertical arrows
cracksArrowY := 736
; Plains Weight vertical arrows
lakesArrowY := 796
; Hills Weight vertical arrows
plainsArrowY := 846
; Mountains Weight vertical arrows
hillsArrowY := 906
; Random Weight vertical arrows
mountainsArrowY := 956
; Random Weight vertical arrows
randomArrowY := 1016
; World Generation Button
worldGenX := 900
worldGenY := 1066
WinActivate, 7 Days To Die
Sleep, 500
Send, {F1}
Sleep, 500
Send, xui open rwgeditor
Sleep, 500
Send, {Return}
Sleep, 500
Send, {F1}
Sleep, 500
Stdout("Seed: " . RWGSeed)
MouseClick, Left, worldSeedX, worldSeedY ; Location in the 7D2D Client where the World Seed Box is.
Sleep, 500
Send, %RWGSeed%
Sleep, 500
move := 10 ; Default to avoid errors
if RWGSize = 6144
{
move := -1
}
else if RWGSize = 8192
{
move := 0
}
else if RWGSize = 10240
{
move := 1
}
else if RWGSize = Default
{
move := 0
}
changeOption("World Size", RWGSize, move, leftArrowX, rightArrowX, sizeArrowY)
changeNoneToManyOption("Gen Towns", RWGTowns, leftArrowX, rightArrowX, townsArrowY)
changeNoneToManyOption("Gen Wilderness", RWGWilderness, leftArrowX, rightArrowX, wildernessArrowY)
changeNoneToManyOption("Rivers", RWGRivers, leftArrowX, rightArrowX, riversArrowY)
changeNoneToManyOption("Craters", RWGCraters, leftArrowX, rightArrowX, cratersArrowY)
changeNoneToManyOption("Cracks", RWGCracks, leftArrowX, rightArrowX, cracksArrowY)
changeNoneToManyOption("Lakes", RWGLakes, leftArrowX, rightArrowX, lakesArrowY)
changeZeroToTenOption("Plains Weight", 6, RWGPlains, leftArrowX, rightArrowX, plainsArrowY)
changeZeroToTenOption("Hills Weight", 6, RWGHills, leftArrowX, rightArrowX, hillsArrowY)
changeZeroToTenOption("Mountains Weight", 3, RWGMountains, leftArrowX, rightArrowX, mountainsArrowY)
changeZeroToTenOption("Random Weight", 0, RWGRandom, leftArrowX, rightArrowX, randomArrowY)
; Start generation
Stdout("Generate World")
MouseClick, Left, worldGenX, worldGenY ; Location of the Generate World Button
changeYesNoOption(name, value, leftArrowX, rightArrowX, arrowY)
{
move := 10 ; Default to avoid errors
if value = No
{
move := -1
}
else if value = Yes
{
move := 0
}
else if value = Default
{
move := 0
}
else
{
Stdout("Unknown option '" . value . "' for " . name)
return
}
changeOption(name, value, move, leftArrowX, rightArrowX, arrowY)
}
changeZeroToTenOption(name, default, value, leftArrowX, rightArrowX, arrowY)
{
if value = Default
{
move := 0
}
else
{
move := value - default
}
changeOption(name, value, move, leftArrowX, rightArrowX, arrowY)
}
changeNoneToManyOption(name, value, leftArrowX, rightArrowX, arrowY)
{
; Default value to avoid errors
move := 10
if value = None
{
move := -2
}
else if value = Few
{
move := -1
}
else if value = Default
{
move := 0
}
else if value = Many
{
move := 1
}
else
{
Stdout("Unknown option '" . value . "' for " . name)
return
}
changeOption(name, value, move, leftArrowX, rightArrowX, arrowY)
}
changeOption(name, value, move, leftArrowX, rightArrowX, arrowY)
{
Stdout(name . ": " . value . " (" . move . ")")
While move != 0
{
if move < 0
{
MouseClick, Left, leftArrowX, arrowY
move := move + 1
}
else if move > 0
{
MouseClick, Left, rightArrowX, arrowY
move := move - 1
}
Sleep, 250
}
}
/* vim: set ts=4 sw=4 tw=100 et :*/