-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollscript.au3
611 lines (495 loc) · 17.5 KB
/
rollscript.au3
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
; itemreader
#include "itemreader.au3"
#include <Math.au3>
HotKeySet("{HOME}", "begin")
HotKeySet("{END}", "end")
HotKeySet("{PAUSE}", "TogglePause")
Global $Paused = False
Global $InitialMouseLoc[2]
While 1
Sleep(10)
WEnd
Func GetLeftStat($string, $tofind)
Local $position = StringInStr($string,$tofind)
if $position Then
Return Number(StringStripWS(StringTrimRight($string,$position - 1),1))
EndIf
Return 0
EndFunc
Func GetRightStat($string, $tofind)
Local $position = StringInStr($string,$tofind)
if $position Then
Return Number(StringStripWS(StringTrimLeft($string,$position + StringLen($tofind) - 1),1))
EndIf
Return 0
EndFunc
Func GetFireResist($string)
Const $LookupStr = "Fire Resist"
return GetRightStat($string, $LookupStr)
EndFunc
Func GetLightningResist($string)
Const $LookupStr = "Lightning Resist"
return GetRightStat($string, $LookupStr)
EndFunc
Func GetColdResist($string)
Const $LookupStr = "Cold Resist"
return GetRightStat($string, $LookupStr)
EndFunc
Func GetPoisonResist($string)
Const $LookupStr = "Poison Resist"
return GetRightStat($string, $LookupStr)
EndFunc
Func GetAllResist($string)
Const $LookupStr = "All Resistances"
return GetRightStat($string, $LookupStr)
EndFunc
Func GetLife($string)
Const $LookupStr = "to Life"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetReplenishLife($string)
Const $LookupStr = "Replenish Life"
return GetRightStat($string, $LookupStr)
EndFunc
Func GetToStrength($string)
Const $LookupStr = "to Strength"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetToDexterity($string)
Const $LookupStr = "to Dexterity"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetToEnergy($string)
Const $LookupStr = "to Energy"
if not StringInStr($string,"Sorceress Only") Then
return GetLeftStat($string, $LookupStr)
EndIf
EndFunc
Func GetToMana($string)
Const $LookupStr = "to Mana"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetFasterCastRate($string)
Const $LookupStr = "Faster Cast Rate"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetFasterRunWalk($string)
Const $LookupStr = "Faster RunWalk"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetFasterHitRecovery($string)
Const $LookupStr = "Faster Hit Recovery"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetFasterBlockRate($string)
Const $LookupStr = "Faster Block Rate"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetIncreasedAttackSpeed($string)
Const $LookupStr = "Increased Attack Speed"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetToSorceressSkillLevels($string)
Const $LookupStr = "to Sorceress Skill Levels"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetToBarbarianSkillLevels($string)
Const $LookupStr = "to Barbarian Skill Levels"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetToPaladinSkillLevels($string)
Const $LookupStr = "to Paladin Skill Levels"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetToAmazonSkillLevels($string)
Const $LookupStr = "to Amazon Skill Levels"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetToNecroMancerSkillLevels($string)
Const $LookupStr = "to Necromancer Skill Levels"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetEnhancedDefense($string)
Const $LookupStr = "Enhanced Defense"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetEnhancedDamage($string)
Const $LookupStr = "Enhanced Damage"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetToMinimumDamage($string)
Const $LookupStr = "to Minimum Damage"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetToMaximumDamage($string)
Const $LookupStr = "to Maximum Damage"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetAddedDamage($string)
Const $LookupStr = "Adds"
Local $position = StringInStr($string,$LookupStr)
if $position and not StringInStr($string,"fire") and not StringInStr($string,"cold") and not StringInStr($string,"poison") and not StringInStr($string,"lightning") Then
Local $Right = StringStripWS(StringTrimLeft($string,$position + StringLen($LookupStr) - 1),1)
Local $damageposition = StringInStr($Right,"damage")
ConsoleWrite($Right & @CRLF)
if $damageposition Then
Local $addedDamage = StringStripWS(StringTrimRight($Right,$damageposition),8)
if StringLen($addedDamage) == 4 Then
Return Number(StringLeft($addeddamage,2)) + Number(StringRight($addeddamage,2))
ElseIf StringLen($addedDamage) == 3 Then
Return Number(StringLeft($addeddamage,1)) + Number(StringRight($addeddamage,2))
Else
Return Number(StringLeft($addeddamage,1)) + Number(StringRight($addeddamage,1))
EndIf
EndIf
EndIf
Return 0
EndFunc
Func GetColdDamage($string)
Local $position = StringInStr($string,"cold damage")
Return $position
EndFunc
Func GetToEnergyShield($string)
Const $LookupStr = "to Energy Shield Sorceress Only"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetToChillingArmor($string)
Const $LookupStr = "to Chilling Armor Sorceress Only"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetToShiverArmor($string)
Const $LookupStr = "to Shiver Armor Sorceress Only"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetToBlizzard($string)
Const $LookupStr = "to Blizzard Sorceress Only"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetLifeStolenPerHit($string)
Const $LookupStr = "Life stolen per hit"
return GetLeftStat($string, $LookupStr)
EndFunc
Func GetMinRequirements($string)
Const $LookupStr = "Requirements"
return GetRightStat($string, $LookupStr)
EndFunc
Func ShouldKeep()
Local $iColdResist, $iLightningResist, $iFireResist, $iPoisonResist, $iAllResist
Local $iToLife,$iToStrength, $iToDexterity, $iToEnergy, $iToMana, $iToReplenishLife
Local $iFasterCast, $iFasterRun, $iFasterHitRecovery, $iFasterBlockRate, $iIncreasedAttackSpeed
Local $iBarbarianSkills, $iSorcSkills, $iPaladinSkills, $iNecromancerSkills, $iAmazonSkills
Local $iEnhancedDefense,$iEnhancedDamage,$iToMinDamage, $iToMaxDamage, $iAddedDamage, $iColdDamage
Local $iMinRequirements, $iLifeStolenPerHit
Local $iToEnergyShield, $iToChillingArmor, $iToShiverArmor, $iToBlizzard
Local $aArray = GetItemStats()
ConsoleWrite('found new item: ' & @CRLF)
Local Const $arrayLength = UBound($aArray)
For $i = 0 to $arrayLength - 1
Local $Stringvalue = $aArray[$i]
ConsoleWrite('stat: ' & $Stringvalue & @CRLF)
$iColdResist += GetColdResist($Stringvalue)
$iLightningResist += GetLightningResist($Stringvalue)
$iFireResist += GetFireResist($Stringvalue)
$iPoisonResist += GetPoisonResist($Stringvalue)
$iAllResist += GetAllResist($Stringvalue)
$iSorcSkills += GetToSorceressSkillLevels($Stringvalue)
$iBarbarianSkills += GetToBarbarianSkillLevels($Stringvalue)
$iPaladinSkills += GetToPaladinSkillLevels($Stringvalue)
$iAmazonSkills += GetToAmazonSkillLevels($Stringvalue)
$iNecromancerSkills += GetToNecroMancerSkillLevels($Stringvalue)
$iToLife += GetLife($Stringvalue)
$iToStrength += GetToStrength($Stringvalue)
$iToDexterity += GetToDexterity($Stringvalue)
$iToEnergy += GetToEnergy($Stringvalue)
$iToMana += GetToMana($Stringvalue)
$iToReplenishLife += GetReplenishLife($Stringvalue)
$iFasterCast += GetFasterCastRate($Stringvalue)
$iFasterRun += GetFasterRunWalk($Stringvalue)
$iFasterHitRecovery += GetFasterHitRecovery($Stringvalue)
$iFasterBlockRate += GetFasterBlockRate($Stringvalue)
$iIncreasedAttackSpeed += GetIncreasedAttackSpeed($Stringvalue)
$iEnhancedDefense += GetEnhancedDefense($Stringvalue)
$iEnhancedDamage += GetEnhancedDamage($Stringvalue)
$iToMinDamage += GetToMinimumDamage($Stringvalue)
$iToMaxDamage += GetToMaximumDamage($Stringvalue)
$iAddedDamage += GetAddedDamage($Stringvalue)
$iLifeStolenPerHit += GetLifeStolenPerHit($Stringvalue)
$iColdDamage += GetColdDamage($Stringvalue)
$iMinRequirements += GetMinRequirements($Stringvalue)
$iToEnergyShield += GetToEnergyShield($Stringvalue)
$iToChillingArmor += GetToChillingArmor($Stringvalue)
$iToShiverArmor += GetToShiverArmor($Stringvalue)
$iToBlizzard +=GetToBlizzard($Stringvalue)
Next
#CS ConsoleWrite('enhanced defense: ' & $iEnhancedDefense & @CRLF)
ConsoleWrite('FCR: ' & $iFasterCast & @CRLF)
ConsoleWrite('FRW: ' & $iFasterRun & @CRLF)
ConsoleWrite('FHR: ' & $iFasterHitRecovery & @CRLF)
ConsoleWrite('FBR: ' & $iFasterBlockRate & @CRLF)
ConsoleWrite('cold resist: ' & $iColdResist & @CRLF)
ConsoleWrite('light resist: ' & $iLightningResist & @CRLF)
ConsoleWrite('fire resist: ' & $iFireResist & @CRLF)
ConsoleWrite('poison resist: ' & $iPoisonResist & @CRLF)
ConsoleWrite('all resist: ' & $iAllResist & @CRLF)
ConsoleWrite('to life: ' & $iToLife & @CRLF)
ConsoleWrite('life: ' & $iToLife & @CRLF)
ConsoleWrite('strength: ' & $iToStrength & @CRLF)
ConsoleWrite('dexterity: ' & $iToDexterity & @CRLF)
ConsoleWrite('energy: ' & $iToEnergy & @CRLF)
ConsoleWrite('mana: ' & $iToMana & @CRLF)
ConsoleWrite('dexterity: ' & $iToDexterity & @CRLF)
ConsoleWrite('energy: ' & $iToEnergy & @CRLF)
ConsoleWrite('mana: ' & $iToMana & @CRLF)
ConsoleWrite('added damage: ' & $iAddedDamage & @CRLF)
ConsoleWrite('energy shield: ' & $iToEnergyShield & @CRLF)
#CE
#CS
;amulets
if $iSorcSkills == 2 and $iFasterCast == 20 and $iColdResist + $iLightningResist + $iFireResist > 70 and $iToLife + $iToStrength * 2 + $iToDexterity * 2 + $iToEnergy + $iToMana * 0.5 >= 30 Then
Return True
EndIf
if $iSorcSkills == 2 and $iFasterCast == 20 and $iColdResist + $iLightningResist + $iFireResist > 90 and $iToLife + $iToStrength * 2 + $iToDexterity * 2 + $iToEnergy + $iToMana * 0.5 >= 40 Then
Return True
EndIf
if $iSorcSkills ==2 and $iFasterCast >= 10 And $iColdResist + $iLightningResist + $iFireResist > 70 and $iToLife + $iToStrength * 2 + $iToDexterity * 2 + $iToEnergy + $iToMana * 0.5 >= 80 Then
Return True
EndIf
if $iNecromancerSkills == 2 and $iFasterCast >= 10 And $iColdResist + $iLightningResist + $iFireResist > 70 and $iToLife + $iToStrength * 2 >= 70 Then
Return True
EndIf
if $iNecromancerSkills == 2 and $iFasterCast >= 10 And $iToLife + $iToStrength * 2 >= 90 Then
Return True
EndIf
if $iPaladinSkills == 2 and $iFasterCast >= 10 And $iColdResist + $iLightningResist + $iFireResist > 70 and $iToLife + $iToStrength * 3 >= 70 Then
Return True
EndIf
if $iPaladinSkills == 2 and $iFasterCast >= 10 And $iToLife + $iToStrength * 3 >= 110 Then
Return True
EndIf
If $iBarbarianSkills == 2 And $iToLife + $iToStrength * 4 + $iToDexterity * 4 + $iToMinDamage * 4 + $iToMaxDamage * 4 >= 110 and $iColdResist + $iLightningResist + $iFireResist > 70 Then
Return True
EndIf
If $iBarbarianSkills == 2 And $iToLife + $iToStrength * 4 + $iToDexterity * 4 + $iToMinDamage * 4 + $iToMaxDamage * 4 >= 150 Then
Return True
EndIf
if $iAmazonSkills == 2 and $iToLife + $iToStrength * 3 + $iToDexterity * 3 + $iToMinDamage * 4 + $iToMaxDamage * 4 >= 90 and $iColdResist + $iLightningResist + $iFireResist > 70 Then
Return True
EndIf
if $iAmazonSkills == 2 and $iToLife + $iToStrength * 3 + $iToDexterity * 3 + $iToMinDamage * 4 + $iToMaxDamage * 4 >= 120 Then
Return True
EndIf
#CE
#CS
;bows
If $iIncreasedAttackSpeed < 20 Then
Return False
EndIf
If $iAmazonSkills == 2 and $iEnhancedDamage >= 180 and $iMinRequirements >=30 Then
Return True
EndIf
If $iAmazonSkills == 2 and $iEnhancedDamage >= 195 Then
Return True
EndIf
#CE
#CS
; weapons
If $iEnhancedDamage >= 190 and $iBarbarianSkills == 2 AND $iToMinDamage + $iToMaxDamage + $iAddedDamage + $iToStrength * 0.5 >= 10 Then
Return True
EndIf
If $iEnhancedDamage >= 190 AND $iToMinDamage + $iToMaxDamage + $iAddedDamage + $iToStrength * 0.5 >= 20 Then
Return True
EndIf
#CE
#CS
; rings
If $iToMinDamage + $iToMaxDamage + $iAddedDamage >= 4 AND $iToStrength * 3 + $iToDexterity * 3 + $iToLife >= 60 And $iColdResist + $iLightningResist + $iFireResist >= 55 Then
Return True
EndIf
If $iToStrength + $iToDexterity >= 29 And $iColdResist + $iLightningResist + $iFireResist >= 55 Then
Return True
EndIf
If $iToMinDamage + $iToMaxDamage + $iAddedDamage >= 4 and $iToStrength And $iColdResist + $iLightningResist + $iFireResist >= 70 Then
Return True
EndIf
If $iFasterCast >= 10 AND $iToStrength * 3 + $iToDexterity * 3 + $iToLife >= 60 And $iColdResist + $iLightningResist + $iFireResist >= 70 Then
Return True
EndIf
If $iToStrength * 4 + $iToDexterity * 4 + $iToLife >= 100 And $iColdResist + $iLightningResist + $iFireResist >= 70 Then
Return True
EndIf
#CE
#CS
; boots
If $iFasterRun >= 30 and $iToDexterity * 2 + $iToStrength * 2 + $iToLife >= 40 and $iColdResist + $iLightningResist + $iFireResist >= 70 Then
Return True
EndIf
If $iFasterHitRecovery >= 20 and $iToDexterity * 2 + $iToStrength * 2 + $iToLife + $iToMana >= 40 and $iColdResist + $iLightningResist + $iFireResist >= 70 Then
Return True
EndIf
#CE
#CS
; helms
If $iToMinDamage >= 2 AND $iToDexterity >= 10 AND $iToLife >= 45 And ( $iColdResist + $iFireResist >= 50 OR $iColdResist + $iLightningResist >= 50 ) Then
Return True
EndIf
If $iToLife + $iToDexterity >= 60 And $iColdResist + $iLightningResist + $iFireResist >= 75 Then
Return True
EndIf
If $iFasterHitRecovery >= 20 AND $iToDexterity * 2 + $iToLife + $iToMana + $iToReplenishLife * 2 >= 100 And $iColdResist >= 28 Then
Return True
EndIf
If $iFasterHitRecovery >= 20 AND $iToDexterity * 2 + $iToLife + $iToMana + $iToReplenishLife * 2 >= 55 And ( $iColdResist + $iFireResist >= 55 OR $iColdResist + $iLightningResist >= 55 ) Then
Return True
EndIf
#CE
#CS
If $iSorcSkills ==2 AND $iToEnergyShield >= 3 AND $iToChillingArmor >= 3 Then
Return True
EndIf
#CE
#CS
; belts
If $iFasterHitRecovery >= 10 AND $iToDexterity * 1.5 + $iToStrength * 2 + $iToLife >= 65 AND ( $iColdResist + $iFireResist >= 55 OR $iColdResist + $iLightningResist >= 55) Then
Return True
EndIf
If $iColdDamage > 0 and $iToDexterity * 1.5 + $iToStrength * 4 + $iToLife >= 110 AND ( $iColdResist + $iFireResist >= 55 OR $iColdResist + $iLightningResist >= 55 )Then
Return True
EndIf
#CE
#cs
;bvb armors
If $iEnhancedDefense >=95 AND $iMinRequirements == 40 AND $iToStrength * 4 + $iToLife >= 80 Then
Return True
EndIf
If $iEnhancedDefense >=98 AND $iToDexterity * 2 + $iToStrength * 4 + $iToLife >= 120 Then
Return True
EndIf
#CE
;shields
If $iFasterHitRecovery >= 10 AND ( $iColdResist >= 30 and $iFireResist >= 15 and $iLightningResist >= 15 ) AND $iToLife + $iToStrength * 2 + $iToDexterity * 2 + $iToEnergy + $iToMana + $iToReplenishLife * 4 >= 80 Then
Return True
EndIf
If $iFasterBlockRate == 30 AND $iFasterHitRecovery >= 10 AND ( $iColdResist >= 30 and $iFireResist >= 15 and $iLightningResist >= 15 ) AND $iToLife + $iToStrength * 2 + $iToDexterity * 2 + $iToEnergy + $iToMana + $iToReplenishLife * 4 >= 30 Then
Return True
EndIf
Return False
EndFunc
Func GetCurrentInventoryLoc($column,$row)
local $CoordResult[2] = [432 + $column * 30,332 + $row * 30]
return $CoordResult
EndFunc
Func MoveItemToInventory($column,$row)
Sleep(1000)
MouseClick("left",$InitialMouseLoc[0],$InitialMouseLoc[1])
Sleep(1000)
Local $MoveToLoc = GetCurrentInventoryLoc($column,$row)
MouseClick("left",$MoveToLoc[0], $MoveToLoc[1] )
Sleep(1000)
EndFunc
Func MoveItemFromInventory($column,$row)
Local $MoveToLoc = GetCurrentInventoryLoc($column,$row)
Sleep(1000)
MouseClick("left",$MoveToLoc[0], $MoveToLoc[1] )
Sleep(1000)
MouseClick("left",$InitialMouseLoc[0],$InitialMouseLoc[1])
Sleep(1000)
EndFunc
Func GetRandomName()
Local $result = ''
For $i = 1 to 5
$result = $result & Chr(Random(97, 122, 1)) ;a-z
Next
Return $result
EndFunc
Func WaitUntilPixelHasColor($x,$y,$color)
Local $count = 0
While 1
If $count > 100000 Then
ConsoleWrite("still wrong color: " & PixelGetColor($x,$y) & " after " & $count & " iterations, stopping script" & @CRLF )
Exit
Endif
Sleep(100)
If PixelGetColor($x,$y) == $color Then
Sleep(500)
ExitLoop
Else
ConsoleWrite("wrong color: " & PixelGetColor($x,$y) & @CRLF )
EndIf
$count = $count + 1
WEnd
Return
EndFunc
Func RestartGame()
Send("{ESC}")
Sleep(1000)
Send("{ESC}")
MouseMove(400,600)
Sleep(500)
Send("{UP}")
Sleep(500)
Send("{ENTER}")
WaitUntilPixelHasColor(756,407, 1052688)
MouseClick("left",593,460)
Sleep(500)
Send(GetRandomName())
Sleep(100)
Send("{TAB}")
Sleep(100)
Send("cx")
Sleep(100)
Send("{ENTER}")
WaitUntilPixelHasColor(9,571, 1052688)
Sleep(500)
Send("i")
Sleep(500)
MouseClick("right",681,350)
EndFunc
Func begin()
Local $column = 0, $row = 0
Const $itemwidth = 2
Const $itemheight = 3
$InitialMouseLoc = MouseGetPos()
ConsoleWrite('starting rolling ' & @CRLF)
Local $gametimer = TimerInit()
While 1
If Not WinActive("[Class:Diablo II]") Then
ConsoleWrite("killed script due to inactive diablo window" & @CRLF)
Exit
EndIf
Local $gametime = TimerDiff($gametimer)
If Number($gametime,3) / (1000*60*60) > 1 Then
RestartGame()
$gametimer = TimerInit()
EndIf
Local $shouldkeep = ShouldKeep()
If $shouldkeep Then
MoveItemToInventory($column,$row)
$column = $column + $itemwidth
if $column >= 8 Then
$column = 0
$row = $row + $itemheight
EndIf
If $row > 3 + $itemheight - 1 Then
Exit
EndIf
If $row >= 3 + $itemheight - 1 and $column >= 7 + $itemwidth - 1 Then
Exit
EndIf
Sleep(500)
MoveItemFromInventory($column,$row)
Else
MouseClick("left",239,338)
MouseMove($InitialMouseLoc[0],$InitialMouseLoc[1])
Sleep(50)
Endif
WEnd
EndFunc
Func End()
Exit
EndFunc
Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
WEnd
EndFunc