注意:这里显示的坐标都是相对于游戏窗口的坐标(即,截图最左上角坐标为(0,0),不是全屏幕的坐标。
二、某点颜色的获得:
《QQ游戏外挂制作教程(对对碰)》中判断方块是否可消采用的方法需要获取游戏窗口中某点的颜色,来建立方块矩阵。程序中有这么一段代码:
If color1 = 16777215 And color2 = 16777215 Then .type = Panda
If color1 = 2097151 And color2 = 1353909 Then .type = Chicken
If color1 = 4473924 And color2 = 14209230 Then .type = Dog
If color1 = 13828048 And color2 = 3862322 Then .type = Frog
If color1 = 8623264 And color2 = 5805536 Then .type = Monkey
If color1 = 10921638 And color2 = 9408399 Then .type = Cat
If color1 = 15398649 And color2 = 1655140 Then .type = Ox
其中的16777215,2097151…这些是用GetPixel获得的颜色值。关于这个值的获得,可以直接用程序中的getColor 函数来得到,这里就不再重复阐述了。
说明:这里获得的颜色值,是在显示颜色为32位时获得的。如果在16位或其他的颜色质量下获得的值是不同的。如果要让外挂适合在各种颜色质量下都能正常运行,可以在多种颜色质量下取色,或者采取其他的算法不与实现去到的颜色对比来判断方块是否可消。
如有更多的问题,请与我联系。我将不断在此文中补充[email protected]
转载请注明出处:版权所有(a)Cyril 405 工作室