-
Notifications
You must be signed in to change notification settings - Fork 72
/
class_ShinsImageScanClass.ahk
698 lines (617 loc) · 56.5 KB
/
class_ShinsImageScanClass.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
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
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
;Image/pixel scanning class by Spawnova (5/15/22)
;https://github.com/Spawnova/ShinsImageScanClass
;
;General purpose class to scan image data for images and pixels, for ahk_L (not compatible with ahk V2)
;
;Image transparency is not handled in this class, if an image contains pixels that are not fully opaque they are simply ignored;
;which can be used to match images with portions that should be ignored by having those pixels be less than 0xFF000000
;
;I designed this class to be relatively user friendly but still maintain good performance
;I can't promise it will work for every setup, I can only confirm that it works for me on windows 10 (32 and 64 bit)
;
;All returned coordinate positions are dependant on the mode used, desktop uses screen space, client uses client space, otherwise window space
class ShinsImageScanClass {
;title : ahk window title or other type of identifier, leave blank or set to 0 to scan the entire desktop
;UseClientArea : If a window is specified it will use the client area (generally does not include title bar and menus)
; Otherwise it will include the entirety of the window, which also includes extra space on the sides
; and bottom used for mouse dragging
__New(title:=0, UseClientArea:=1) {
this.AutoUpdate := 1 ;when disabled, requires you to call Update() manually to refresh pixel data, useful when you need to scan multiple things on 1 frame
this.UseControlClick := 0 ;when enabled attempts to use ControlClick to send clicks which works for background programs
;not all programs will respond to this however, so it may be necessary to use normal clicks which have to be foreground
;#############################
; Setup internal stuff
;#############################
if (!DllCall("GetModuleHandle", "str", "gdiplus", "Ptr"))
DllCall("LoadLibrary", "str", "gdiplus")
VarSetCapacity(gsi, 24, 0)
NumPut(1,gsi,0,"uint")
DllCall("gdiplus\GdiplusStartup", "Ptr*", token, "Ptr", &gsi, "Ptr", 0)
this.gdiplusToken := token
this.bits := (a_ptrsize == 8) ;0=32,1=64
this.desktop := (title = 0 or title = "")
this.UseClientArea := UseClientArea
this.imageCache := []
if (this.desktop)
coordmode,mouse,screen
else if (UseClientArea)
coordmode,mouse,client
else
coordmode,mouse,window
this._ScanImage := this.mcode("VVdWU4PsRItEJGSLTCRYi1wkXItUJGCJRCQ4i0QkXA+3SQiLWwSLOIn4iXwkMMH4EIlEJDxmOcEPhpwFAACLRCRYD7dACmY5+A+GiwUAAIn9D7f/iUwkCMHtECn4iXwkDCnpiUQkLIlMJCCE0g+EWgEAAIXbD4SVAgAAi0QkLIXAD458AgAAi0QkCMdEJDQAAAAAx0QkKAAAAADB4AKJbCQEiUQkFI0ErQAAAACJRCQYD7bCicWLRCQghcAPjiYCAACLRCQ0x0QkHAAAAACJRCQkjbYAAAAAi3wkDIX/D4S0AAAAi0QkJIt8JFzHRCQQAAAAAIlEJAiQjbQmAAAAAIt0JASF9nRxMcmNtgAAAACLXI8Igfv////+dlSLdCRYjQSNAAAAAAMGi3QkCIsEMInewf4QicLB+hAPttKJFCSJ8g+28osUJCnyidbB/h8x8inyOeoPj3UBAAAPtsQPtt8p2Jkx0CnQOcUPjGABAACDwQE5TCQEdZeDRCQQAYtMJBSLRCQQAUwkCAN8JBg5RCQMD4Vo////gHwkOAAPhCQEAAAPt0QkPIt8JBwPt1QkMGbR6AH4ZtHqweAQD7fSA0QkKIPERFsB0F5fXcOF2w+E0wIAAIXAD44mAQAAx0QkFAAAAACJLCSLbCRYi0wkIIXJD46UAgAAx0QkEAAAAADrMo22AAAAAItNAI0cBoHi////AIsMmYHh////ADnKdFuDRCQQAYtEJBA5RCQgD4RYAgAAi1QkDIXS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FdQV5BX8OF2w+EKwIAAIX2D47zAgAAx0QkFAAAAAAx/0WF5A+OqgAAADHb6ylmDx9EAABNixNMY8Il////AEeLBIJBgeD///8ARDnAdFaDwwFBOdx+fUGNNB9FhfZ0ZUUx0kGNNB8PH0QAAEWF/3RLRIn4Ro0MF0SJVCQQQQ+vwkQPr81ImEKNFAtJjUyFCEEB8WYPH4QAAAAAAIsBPf////53j4PCAUiDwQRBOdF160SLVCQQQYPCAesEQYPCAUU51n+nifODRCQUAYPDAUE53H+Dg8cBOXwkJA+FQP///+kM////i0wkJIXJD44A////x0QkLAAAAABBjX//x0QkKAAAAADHRCQgAAAAAESJdCQUTYnui1QkHIXSD460AAAAx0QkGAAAAABmkItEJBSFwA+E4wAAAEhjRCQYRItkJCBFMe0x7UiJRCQIRYX/D4SvAAAASGPFSYsTRTHASY00hkljxEgDRCQISI0cgusiDx9AAA+2xA+2zSnImTHQKdBEOch/PUmNQAFMOcd0dUmJwEKLTIYIQosEg0GJyonCwfoQQcH6EEUPttIPttJEKdJBidJBwfofRDHSRCnSRDnKfrGDRCQYAYtEJBg5RCQcD49W////g0QkLAGLXCQQi0QkLAFcJCA5RCQkD4Ul////i0QkKIlEJBTp9P3//2YPH0QAAEGDxQFEAf1EA2QkEEQ5bCQUD4Ux////RAF8JBiDRCQoAYNEJBgBi0QkGDlEJBwPj/T+///rnIt8JCSF/w+OrP3//0Ux5DH/RY1X/0SJZCQIi3QkHIX2D46OAAAARTHk6xIPH4AAAAAAQYPEAUQ5ZCQcfndFhfZ0XzHbSWP0RYX/dE2NBB9JixMPr8VImEgB8EyNDIJEifgPr8NImE2NRIUAMcAPH0QAAEGLDIFBi1SACIHh////AIHi////ADnRdadIjVABSTnCdAVIidDr2YPDAUE53n+mRQH8g0QkCAFBg8QBRDlkJBx/iYPHATl8JCQPhVn///9Ei2QkCESJZCQU6ej8///HRCQUAAAAAOnb/P//x0QkFP7////pzvz//5CQkJCQkJCQ")
this._ScanImageCountRegion := this.mcode("VVdW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+B9EMcBEKcBBicCJ0A+20sH4EA+2wCn4QYnCQcH6H0Qx0EQp0EE5wEEPTcApykGJ0EHB+B9EMcJEKcI50A9MwjnwD57ASYPBBA+2wEEBw0w5y3WfQYPGAUUB50Q5dCQED4Vt////RInYSIPEGFteX11BXEFdQV5BX8NmDx+EAAAAAACJx4XAD4RFAQAARInjRYniZg9u4jHJwesCQY10JP9Bg+L8RTHJZg9vFQAAAABIweMERTHbZg9w3AAPH4AAAAAARYXkD4TqAAAATYtFAIP+Aw+G8gAAAEhjwWYP78lJjQSASI0sAw8fAPMPbwBIg8AQZg/bwmYPdsNmD/rISDnFdedmD2/BZg9z2AhmD/7IZg9vwWYPc9gEZg/+yGYPfshBAcNEidBFOdQPhIUAAACNLAFIY+1BiyyogeX///8AOdVAD5TFQA+27UEB641oAUE57H5gAc1IY+1BiyyogeX///8AOepAD5TFQA+27UEB641oAkE57H48Ac1IY+1BiyyogeX///8AOdVAD5TFg8ADQA+27UEB60Q54H0YAchImEGLBIAl////ADnQD5TAD7bAQQHDQYPBAUQB4UQ5zw+F/f7//+mb/v//McDpX////0Ux2+mM/v//kJCQkJCQkJCQ////AP///wD///8A////AA==")
this._ScanPixelCountRegion := this.mcode("VVdWU4PsKItMJEyLdCREi1wkVItEJEABzotUJFCJdCQUid+FyXkMi0wkRIl0JESJTCQUi3QkSAHWiXQkEIXSeQyLVCRIiXQkSIlUJBCLTCREhckPiMsBAACLVCRIhdIPiL8BAACLdCQ8i0wkFA+3dgg5zo1W/4l0JBgPT9GJVCQUidWLVCQ8D7dSCjtUJBCNSv8PT0wkEIlMJBCE2w+E7QAAADlMJEgPjWsBAAAPr3QkSInCifvB6hAPttuJXCQIiXQkHIt0JETB5gKJdCQgjTStAAAAAIl0JCQPtvKJdCQED7b0D7bAiUQkDIk0JDH2i0QkFDlEJER9cItEJDyLXCQgiyiLRCQcweACAcMB6wNsJCQBxY12AIsTD7bOKwwkidAPttKJz8H4EMH/Hw+2wCtEJAQx+Sn5icfB/x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Zg8o8PIPUfZ3dPIPLMZBOccPncCDwwEPtsBBAcI53nWtZg8fRAAAg8UBQTnsdYDpG////w8fAInYK4QksAAAAGYP78APr8BEAdDyDyrAZg8u+GYPKPDyD1H2d27yDyzGOYQkwAAAAA+dwA+2wAFEJCTpwP7//0Ux0unR/v//RImEJLgAAACJlCSoAAAASImMJKAAAABEiVQkJESJXCQg6AAAAABEi1QkJESLXCQgRIuEJLgAAACLlCSoAAAASIuMJKAAAADpQP///0iJjCSgAAAARIlUJCxEiVwkKOgAAAAARItUJCxEi1wkKEiLjCSgAAAA6WT///+QkJCQkJCQ")
this._ScanPixelPosition := this.mcode("VVdWU4tUJBSLdCQci0wkGA+3QgiLfCQgi1wkJDnwD4aMAAAAD7dqCjn9D4aAAAAAD6/HixIB8L4BAAAAixSCidAl////ADnIdFkx9oTbdFOJzw+264nGD7bSwe8Qwf4QD7bEifsPtvsp/on3wf8fMf4p/g+2+Q+2zSn6idfB/x8x+in6OdYPTdYpyInBwfkfMcgpyDnCD03COcUPncAPtsCJxluJ8F5fXcONtgAAAAC+/v///+vskJCQkJCQkJCQ|D7dBEESLVCQoRDnAD4aeAAAARA+3WRJFOcsPhpAAAABED6/ISIsBRQHIQosMgEG4AQAAAInIJf///wA50HRoRTHARYTSdGBFD7bKQYnSQYnAD7bJQcHqEEHB+BAPtsRFD7bSRSnQRYnCQcH6H0Ux0EUp0EQPttIPttZEKdFBicpBwfofRDHRRCnRQTnIQQ9NyCnQmTHQKdA5wQ9MyEUxwEE5yUEPncBEicDDDx9EAABBuP7////r75CQkJCQkJCQ")
this.tBufferPtr := tBufferPtr := this.SetVarCapacity("ttBuffer",4096,0)
this.dataPtr := dataPtr := this.SetVarCapacity("_data",64,0)
if (!this.desktop and !this.hwnd := winexist(title)) {
msgbox % "Could not find window: " title "!`n`nScanner will not function!"
return
}
if (!this.GetRect(gw,gh))
return
this.width := gw
this.height := gh
this.srcDC := DllCall("GetDCEx", "Ptr", (this.desktop ? 0 : this.hwnd),"Uint",0,"Uint",(this.UseClientArea ? 0 : 1))
this.dstDC := DllCall("CreateCompatibleDC", "Ptr", 0)
NumPut(tBufferPtr,dataPtr+0,(this.bits ? 8 : 4),"Ptr")
this.CreateDIB()
}
;#########################################################################################################
;Image
;
;image : Path to image file
;variance : Value between 0-255, determines how close/far pixels must be to match the target color
;&returnX : Variable to store the x result into
;&returnY : Variable to store the y result into
;
;return ; Returns 1 if the image was found; 0 otherwise
Image(image,variance=0,ByRef returnX=0,ByRef returnY=0,centerResults=1) {
if (!this.CacheImage(image))
return 0
if (this.AutoUpdate)
this.Update()
data := DllCall(this._ScanImage,"Ptr",this.dataPtr,"Ptr",this.imageCache[image],"uchar",variance,"uchar",centerResults,"int")
if (data > 0) {
returnX := data >> 16
returnY := data & 0xFFFF
return 1
}
return 0
}
;#########################################################################################################
;ImageRegion
;
;image : Path to image file
;x1 : Top left starting x position
;y1 : Top left starting y position
;w : Width of pixels to search, starting from x1
;h : Height of pixels to search, starting from y1
;variance : Value between 0-255, determines how close/far pixels must be to match the target color
;&returnX : Variable to store the x result into
;&returnY : Variable to store the y result into
;
;return ; Returns 1 if the image was found in the specified region; 0 otherwise
ImageRegion(image,x1,y1,w,h,variance=0,ByRef returnX=0,ByRef returnY=0,centerResults=1) {
if (!this.CacheImage(image))
return 0
if (this.AutoUpdate)
this.Update()
data := DllCall(this._ScanImageRegion,"Ptr",this.dataPtr,"Ptr",this.imageCache[image],"int",x1,"int",y1,"int",w,"int",h,"uchar",variance,"uchar",centerResults,"int")
if (data > 0) {
returnX := data >> 16
returnY := data & 0xFFFF
return 1
}
return 0
}
;#########################################################################################################
;ImageCount
;
;image : Path to image file
;variance : Value between 0-255, determines how close/far pixels must be to match the target color
;
;return ; Returns the amount of images found; 0 otherwise
ImageCount(image,variance=0) {
if (!this.CacheImage(image))
return 0
if (this.AutoUpdate)
this.Update()
c := DllCall(this._ScanImageCount,"Ptr",this.dataPtr,"Ptr",this.imageCache[image],"uchar",variance,"int")
return (c > 0 ? c : 0)
}
;#########################################################################################################
;ImageCountRegion
;
;image : Path to image file
;x1 : Top left starting x position
;y1 : Top left starting y position
;w : Width of pixels to search, starting from x1
;h : Height of pixels to search, starting from y1
;variance : Value between 0-255, determines how close/far pixels must be to match the target color
;
;return ; Returns the amount of images found in the specified region; 0 otherwise
ImageCountRegion(image,x1,y1,w,h,variance=0) {
if (!this.CacheImage(image))
return 0
if (this.AutoUpdate)
this.Update()
c := DllCall(this._ScanImageCountRegion,"Ptr",this.dataPtr,"Ptr",this.imageCache[image],"int",x1,"int",y1,"int",w,"int",h,"uchar",variance,"int")
return (c > 0 ? c : 0)
}
;#########################################################################################################
;ImageClosestToPoint
;
;image : Path to image file
;pointX : x position of the point
;pointY : y position of the point
;variance : Value between 0-255, determines how close/far pixels must be to match the target color
;&returnX : Variable to store the x result into
;&returnY : Variable to store the y result into
;centerResults : Value between 0-1, if enabled the positions returned will be centered as oposed to top left of the target image
; This also affects distance calculations for closest image
;MaxRadius : Maximum circular radius to search in; lower values require images to be closer to the point
;
;return ; Returns 1 if an image was found close enough to the point; 0 otherwise
ImageClosestToPoint(image,pointX,pointY,variance=0,byref returnX=0,byref returnY=0,centerResults=1,maxRadius=9999) {
if (!c := this.ImageArray(image,a,variance,centerResults))
return 0
min := maxRadius
i := 0
loop % c {
xd := a[a_index].x - pointX
yd := a[a_index].y - pointY
dist := sqrt(xd*xd + yd*yd)
if (dist < min) {
min := dist
i := a_index
}
}
if (i = 0)
return 0
returnX := a[i].x
returnY := a[i].y
return 1
}
;#########################################################################################################
;ImageArray
;
;image : Path to image file
;&array : An array which will hold all the image locations (first element would be array[1].x and array[1].y)
;variance : Value between 0-255, determines how close/far pixels must be to match the target color
;centerResults : Value between 0-1, if enabled the positions returned will be centered as oposed to top left of the target image
;
;return ; Returns 1 (and updates &array) if any number of images were found; 0 otherwise
ImageArray(image,byref array,variance=0,centerResults=1) {
if (!this.CacheImage(image))
return 0
if (this.AutoUpdate)
this.Update()
count := DllCall(this._ScanImageArray,"Ptr",this.dataPtr,"Ptr",this.imageCache[image],"uchar",variance,"uchar",centerResults,"int")
if (count > 0) {
array := []
loop % count {
v := NumGet(this.tBufferPtr,(a_index-1)*4,"uint")
array.push({x:v>>16,y:v&0xFFFF})
}
return count
}
return 0
}
;#########################################################################################################
;ImageArrayRegion
;
;image : Path to image file
;&array : An array which will hold all the image locations (first element would be array[1].x and array[1].y)
;x1 : Top left starting x position
;y1 : Top left starting y position
;w : Width of pixels to search, starting from x1
;h : Height of pixels to search, starting from y1
;variance : Value between 0-255, determines how close/far pixels must be to match the target color
;centerResults : Value between 0-1, if enabled the positions returned will be centered as oposed to top left of the target image
;
;return ; Returns 1 (and updates &array) if any number of images were found in the specified region; 0 otherwise
ImageArrayRegion(image,byref array,x1,y1,w,h,variance=0,centerResults=1) {
if (!this.CacheImage(image))
return 0
if (this.AutoUpdate)
this.Update()
count := DllCall(this._ScanImageArrayRegion,"Ptr",this.dataPtr,"Ptr",this.imageCache[image],"int",x1,"int",y1,"int",w,"int",h,"uchar",variance,"uchar",centerResults,"int")
if (count > 0) {
array := []
loop % count {
v := NumGet(this.tBufferPtr,(a_index-1)*4,"uint")
array.push({x:v>>16,y:v&0xFFFF})
}
return count
}
return 0
}
;#########################################################################################################
;Pixel
;
;color : Color of pixel to find (can be in 0xRRGGBB or 0xFFRRGGBB format)
;variance : Value between 0-255, determines how close/far pixels must be to match the target color
;&returnX : Variable to store the x result into
;&returnY : Variable to store the y result into
;
;return ; Returns 1 if pixel was found; 0 otherwise
Pixel(color,variance=0,ByRef returnX=0,ByRef returnY=0) {
color &= 0xFFFFFF
if (this.AutoUpdate)
this.Update()
data := DllCall(this._ScanPixel,"Ptr",this.dataPtr,"Uint",color,"uchar",variance,"int")
if (data > 0) {
returnX := data >> 16
returnY := data & 0xFFFF
return 1
}
return 0
}
;#########################################################################################################
;PixelRegion
;
;color : Color of pixel to find (can be in 0xRRGGBB or 0xFFRRGGBB format)
;x1 : Top left starting x position
;y1 : Top left starting y position
;w : Width of pixels to search, starting from x1
;h : Height of pixels to search, starting from y1
;variance : Value between 0-255, determines how close/far pixels must be to match the target color
;&returnX : Variable to store the x result into
;&returnY : Variable to store the y result into
;
;return ; Returns 1 if a pixel inside the specified region was found; 0 otherwise
PixelRegion(color,x1,y1,w,h,variance=0,byref returnX=0,byref returnY=0) {
color &= 0xFFFFFF
if (this.AutoUpdate)
this.Update()
data := DllCall(this._ScanPixelRegion,"Ptr",this.dataPtr,"Uint",color,"int",x1,"int",y1,"int",w,"int",h,"uchar",variance,"int")
if (data > 0) {
returnX := data >> 16
returnY := data & 0xFFFF
return 1
}
return 0
}
;#########################################################################################################
;PixelPosition
;
;color : Color of pixel to match at a given position(can be in 0xRRGGBB or 0xFFRRGGBB format)
;pointX : X position
;pointY : Y position
;variance : Value between 0-255, determines how close/far pixels must be to match the target color
;
;return ; Returns 1 if the color matched at the specified position; 0 otherwise
PixelPosition(color,pointX,pointY,variance=0) {
color &= 0xFFFFFF
if (this.AutoUpdate)
this.Update()
c := DllCall(this._ScanPixelPosition,"Ptr",this.dataPtr,"Uint",color,"uint",pointX,"uint",pointY,"uint",variance,"int")
return (c == 1 ? 1 : 0)
}
;#########################################################################################################
;PixelCount
;
;color : Color of pixel to find (can be in 0xRRGGBB or 0xFFRRGGBB format)
;variance : Value between 0-255, determines how close/far pixels must be to match the target color
;
;return ; Returns the amount of matching pixels; 0 otherwise
PixelCount(color,variance=0) {
color &= 0xFFFFFF
if (this.AutoUpdate)
this.Update()
c := DllCall(this._ScanPixelCount,"Ptr",this.dataPtr,"Uint",color,"uchar",variance,"int")
return (c > 0 ? c : 0)
}
;#########################################################################################################
;PixelCountRegion
;
;color : Color of pixel to find (can be in 0xRRGGBB or 0xFFRRGGBB format)
;x1 : Top left starting x position
;y1 : Top left starting y position
;w : Width of pixels to search, starting from x1
;h : Height of pixels to search, starting from y1
;variance : Value between 0-255, determines how close/far pixels must be to match the target color
;
;return ; Returns the amount of matching pixels in the specified region; 0 otherwise
PixelCountRegion(color,x1,y1,w,h,variance=0) {
color &= 0xFFFFFF
if (this.AutoUpdate)
this.Update()
c := DllCall(this._ScanPixelCountRegion,"Ptr",this.dataPtr,"Uint",color,"int",x1,"int",y1,"int",w,"int",h,"uchar",variance,"int")
return (c > 0 ? c : 0)
}
;#########################################################################################################
;PixelCountRadius
;
;color : Color of pixel to find (can be in 0xRRGGBB or 0xFFRRGGBB format)
;pointX : X position
;pointY : Y position
;radius : Radius to search in
;variance : Value between 0-255, determines how close/far pixels must be to match the target color
;
;return ; Returns the amount of matching pixels in a specified radius; 0 otherwise
PixelCountRadius(color,pointX,pointY,radius,variance=0) {
color &= 0xFFFFFF
if (this.AutoUpdate)
this.Update()
c := DllCall(this._ScanPixelCountRadius,"Ptr",this.dataPtr,"Uint",color,"uint",pointX,"uint",pointY,"uint",radius,"uchar",variance,"int")
return (c > 0 ? c : 0)
}
;#########################################################################################################
;GetPixel
;
;pointX : X position
;pointY : Y position
;
;return ; Returns the pixel at the pointX,pointY location
GetPixel(pointX,pointY) {
if (this.AutoUpdate)
this.Update()
if (pointX < 0 or pointY < 0 or pointX >= this.width or pointY >= this.height) {
msgbox % "Cannot get a pixel at position: " pointX "," pointY " as it lies outside of the source region!"
return 0
}
return NumGet(this.temp0,(pointX+pointY*this.width)*4,"uint")
}
;#########################################################################################################
;SaveImage
;
;name : Name to save to file to
;
;return ; Saves the current pixel buffer to a png image
SaveImage(name) {
if (!InStr(name,".png"))
name .= ".png"
if (this.autoUpdate)
this.Update()
DllCall("gdiplus\GdipCreateBitmapFromHBITMAP", "Ptr", this.hbm, "Ptr", 0, "Ptr*", bm)
;largely borrowed from tic function, encoder stuff is a pain
DllCall("gdiplus\GdipGetImageEncodersSize", "uint*", nCount, "uint*", nSize)
VarSetCapacity(ci, nSize)
DllCall("gdiplus\GdipGetImageEncoders", "uint", nCount, "uint", nSize, "Ptr", &ci)
if !(nCount && nSize) {
msgbox % "Problem getting encoder information"
return 0
}
Loop % nCount {
sString := StrGet(NumGet(ci, (idx := (48+7*A_PtrSize)*(A_Index-1))+32+3*A_PtrSize), "UTF-16") ;Thanks tic, this particularily confused me!
if (InStr(sString, "*.PNG")) {
pCodec := &ci+idx
break
}
}
if (!pCodec) {
msgbox % "Problem finding png codec"
return 0
}
DllCall("gdiplus\GdipSaveImageToFile", "Ptr", bm, "Ptr", &name, "Ptr", pCodec, "uint", 0)
}
;#########################################################################################################
;Click
;
;pointX : X position to click
;pointY : Y position to click
;button : Type of click (left,right,middle)
;
;return ; Returns 1 on success; 0 otherwise
;
;notes : ControlClick will not work for every application
Click(pointX,pointY,button:="left") {
if (this.UseControlClick) {
t := "ahk_id " this.hwnd
ControlClick, x%pointX% y%pointY%, %t%,,%button%,,NA
} else {
if (!WinActive("ahk_id " this.hwnd)) {
msgbox % "Attempting to click in target window but it is not active!`n`nIf you want to click inactive windows set 'UseControlClick' to true after initializing the class"
return 0
}
click,%pointX%,%pointY%,%button%
}
return 1
}
;#########################################################################################################
;ClickDrag
;
;pointX1 : X position to start click
;pointY1 : Y position to start click
;pointX2 : X position to end click
;pointY2 : Y position to end click
;button : Type of click (left,right,middle)
;
;return ; Returns 1 on success; 0 otherwise
;
;notes : ControlClick will not work for every application
ClickDrag(pointX1,pointY1,pointX2,pointY2,button:="left") {
if (this.UseControlClick) {
t := "ahk_id " this.hwnd
ControlClick, x%pointX1% y%pointY1%, %t%,,%button%,,NA D
sleep 10
ControlClick, x%pointX2% y%pointY2%, %t%,,%button%,,NA U
} else {
if (!WinActive("ahk_id " this.hwnd)) {
msgbox % "Attempting to click in target window but it is not active!`n`nIf you want to click inactive windows set 'UseControlClick' to true after initializing the class"
return 0
}
MouseClickDrag,%button%,%pointX1%,%pointY1%,%pointX2%,%pointY2%
}
return 1
}
;#########################################################################################################
;ClickRegion
;
;pointX : X position to click
;pointY : Y position to click
;w : Width of region
;h : Height of region
;button : Type of click (left,right,middle)
;
;return ; Returns 1 on success; 0 otherwise
;
;notes : Clicks randomly within the specified region
ClickRegion(pointX,pointY,w,h,button:="left") {
this.CheckRegion(pointX,pointY,w,h)
pointX += this.Random(0,w)
pointY += this.Random(0,h)
return this.Click(pointX,pointY,button)
}
;##########################################
; internal functions used by the class
;##########################################
CheckRegion(byref x, byref y, byref w, byref h) {
if (w < 0) {
w := -w
x -= w
}
if (h < 0) {
h := -h
y -= h
}
}
CheckWindow() {
if (this.desktop)
return 1
if (this.UseClientArea and !this.GetClientRect(w,h))
return 0
else if (!this.UseClientArea and !this.GetWindowRect(w,h))
return 0
if (w != this.width or h != this.height) {
this.width := w
this.height := h
DllCall("DeleteObject","Ptr",this.hbm)
this.CreateDIB()
}
return 1
}
CreateDIB() {
VarSetCapacity(_scan,8)
VarSetCapacity(bi,40,0)
NumPut(this.width,bi,4,"int")
NumPut(-this.height,bi,8,"int")
NumPut(40,bi,0,"uint")
NumPut(1,bi,12,"ushort")
NumPut(32,bi,14,"ushort")
this.hbm := DllCall("CreateDIBSection", "Ptr", this.dstDC, "Ptr", &bi, "uint", 0, "Ptr*", _scan, "Ptr", 0, "uint", 0, "Ptr")
this.temp0 := _scan
NumPut(_scan,this.dataPtr,0,"Ptr")
NumPut((this.height<<16)+this.width,this.dataPtr,(this.bits ? 16 : 8),"uint")
DllCall("SelectObject", "Ptr", this.dstDC, "Ptr", this.hbm)
}
SetVarCapacity(key,size,fill=0) {
this.SetCapacity(key,size)
DllCall("RtlFillMemory","Ptr",this.GetAddress(key),"Ptr",size,"uchar",fill)
return this.GetAddress(key)
}
_Delete() {
DllCall("gdiplus\GdiplusShutdown", "Ptr*", this.gdiplusToken)
}
CacheImage(image) {
if (this.imageCache.haskey(image))
return 1
if (image = "") {
msgbox % "Error, expected resource image path but empty variable was supplied!"
return 0
}
if (!FileExist(image)) {
msgbox % "Error finding resource image: '" image "' does not exist!"
return 0
}
if (!A_IsUnicode) {
VarSetCapacity(wchar, strlen(image)*2)
DllCall("kernel32\MultiByteToWideChar", "uint", 0, "uint", 0, "Ptr", &image, "int", -1, "Ptr", &wchar, "int", strlen(image))
DllCall("gdiplus\GdipCreateBitmapFromFile", "Ptr", &wchar, "Ptr*", bm)
} else
DllCall("gdiplus\GdipCreateBitmapFromFile", "Ptr", &image, "Ptr*", bm)
DllCall("gdiplus\GdipGetImageWidth", "Ptr", bm, "Uint*", w)
DllCall("gdiplus\GdipGetImageHeight", "Ptr", bm, "Uint*", h)
VarSetCapacity(r,16)
NumPut(x,r,0,"uint")
NumPut(y,r,4,"uint")
NumPut(w,r,8,"uint")
NumPut(h,r,12,"uint")
VarSetCapacity(bmdata, 32, 0)
DllCall("Gdiplus\GdipBitmapLockBits", "Ptr", bm, "Ptr", &r, "uint", 3, "int", 0x26200A, "Ptr", &bmdata)
scan := NumGet(bmdata, 16, "Ptr")
p := DllCall("GlobalAlloc", "uint", 0x40, "ptr", 16+((w*h)*4), "ptr")
NumPut((w<<16)+h,p+0,0,"uint")
loop % ((w*h)*4)
NumPut(NumGet(scan+0,a_index-1,"uchar"),p+0,a_index+7,"uchar")
loop % (w*h)
if (NumGet(scan+0,(a_index-1)*4,"uint") < 0xFF000000) {
NumPut(1,p+4,"uint")
break
}
DllCall("Gdiplus\GdipBitmapUnlockBits", "Ptr", bm, "Ptr", &bmdata)
DllCall("gdiplus\GdipDisposeImage", "ptr", bm)
this.ImageCache[image] := p
return 1
}
Update() {
if (this.CheckWindow())
DllCall("gdi32\BitBlt", "Ptr", this.dstDC, "int", 0, "int", 0, "int", this.width, "int", this.height, "Ptr", this.srcDC, "int", 0, "int", 0, "uint", 0xCC0020)
}
GetRect(ByRef w, ByRef h) {
if (this.desktop) { ;only gets primary screen for now, I may add support for virtual later
w := a_screenwidth
h := a_screenheight
return 1
}
if (this.UseClientArea) {
if (!this.GetClientRect(w,h)) {
msgbox % "Problem with Client rectangle dimensions, is window minimized?`n`nScanner will not function!"
return 0
}
} else {
if (!this.GetWindowRect(w,h)) {
msgbox % "Problem with Window rectangle dimensions, is window minimized?`n`nScanner will not function!"
return 0
}
}
return 1
}
GetClientRect(byref w, byref h) {
if (!DllCall("GetClientRect", "Ptr", this.hwnd, "Ptr", this.tBufferPtr))
return 0
w := NumGet(this.tBufferPtr,8,"int")
h := NumGet(this.tBufferPtr,12,"int")
if (w <= 0 or h <= 0)
return 0
return 1
}
GetWindowRect(byref w, byref h) {
if (!DllCall("GetWindowRect", "Ptr", this.hwnd, "Ptr", this.tBufferPtr))
return 0
x := NumGet(this.tBufferPtr,0,"int")
y := NumGet(this.tBufferPtr,4,"int")
w := NumGet(this.tBufferPtr,8,"int") - x
h := NumGet(this.tBufferPtr,12,"int") - y
if (w <= 0 or h <= 0)
return 0
return 1
}
Random(min,max) {
random,result,min,max
return result
}
Mcode(str) {
s := strsplit(str,"|")
if (s.length() != 2)
return
if (!DllCall("crypt32\CryptStringToBinary", "str", s[this.bits+1], "uint", 0, "uint", 1, "ptr", 0, "uint*", pp, "ptr", 0, "ptr", 0))
return
p := DllCall("GlobalAlloc", "uint", 0, "ptr", pp, "ptr")
if (this.bits)
DllCall("VirtualProtect", "ptr", p, "ptr", pp, "uint", 0x40, "uint*", op)
if (DllCall("crypt32\CryptStringToBinary", "str", s[this.bits+1], "uint", 0, "uint", 1, "ptr", p, "uint*", pp, "ptr", 0, "ptr", 0))
return p
DllCall("GlobalFree", "ptr", p)
}
}