king777sa 发表于 2008-11-25 23:44:14

郁闷的很.我自己帮朋友 写了个游戏脚本..在我自己机子上可以用??????他的就不行为什么

郁闷的很.我自己帮朋友 写了个游戏脚本..在我自己机子上可以用??????他的就不行为什么


代码下面:
Global $Paused
HotKeySet("{F4}", "TogglePause")

HotKeySet("{F3}", "mian")
HotKeySet("{F5}", "terminate");alt-q 退出
While 1
Sleep(100)
WEnd
Func terminate()
MsgBox(0,"脚本提示","呵呵 (^_^)作者:萧萧 美女妹妹@@###如有疑惑,请联系本人改进,,,过验证的几率为50%,还在改进中.....脚本要退出,你确定吗")
Exit
EndFunc   ;==>terminate
Func TogglePause()

$size = WinGetPos("倚天剑与屠龙刀")
$x=$size
$y=$size

    $Paused = NOT $Paused
    While $Paused
      sleep(100)
      ToolTip('脚本已被“暂停”再按F4 又可以运行了,呵呵 (^_^)作者:萧萧 美女妹妹@@###如有疑惑,请联系本人改进,,,过验证的几率为50%,还在改进中.....',$x+300,$y+500)
    WEnd
    ToolTip("")
EndFunc
Func mian()

   MsgBox(0,"脚本提示","呵呵 (^_^)作者:萧萧 美女妹妹@@###如有疑惑,请联系本人改进,,,过验证的几率为50%,还在改进中.....脚本要运行,你确定吗")
While 1=1
$size = WinGetPos("倚天剑与屠龙刀");积活游戏窗口
$x=$size
$y=$size
;=================================BB血蓝的+++++++++++++++++++++++++
               $ybb = Hex(PixelGetColor( $x+174, $y+46),6);判断是否出BB,战斗外 给BB+++红 蓝

                              if string($ybb) <> "100c31" then
                                       $bb = Hex(PixelGetColor( $x+226, $y+39),6);给BB加红的位置
                                              if string($bb) = "083042" then

                                                         MouseClick("right", $x+174, $y+46, 2)
            EndIf
                        EndIf

;=========================================================================


;===================================验证+++++++++++++++++++++++++++++++++++++
$coord = PixelSearch( $x+278, $y+351, $x+281, $y+353, 0x000000 );

         If Not @error Then
                     $coord = PixelSearch( $x+512, $y+353,$x+517, $y+356, 0x000000 )
                            If Not @error Then
      
                           $coord = PixelSearch( $x+280, $y+480,$x+300, $y+500, 0x211808 )
                           
             Sleep(4000);表示 出现了验证
                              If Not @error Then
                     MouseClick("left",$x+460, $y+480, 2);验证的....地方选2的答案
               EndIf
                  EndIf
EndIf   ;yezheng jiehsu
;=================================>人物战斗外给自己加血蓝

$zdw = Hex(PixelGetColor( $x+777, $y+37),6)
               if string($zdw) ="bd7d10" then
                        $hong = Hex(PixelGetColor( $x+129, $y+39),6)
      
                                  if string($hong) = "08344a" then

                                  Send("{F1}")
                                     EndIf
                                 $lan = Hex(PixelGetColor( $x+130, $y+52),6)

                              if string($lan) = "184152" then

                                       Send("{F2}")
                                             EndIf
                                          EndIf


   

             call ("zhandou")
                Sleep(300)
            







WEnd

EndFunc   ;==>mian
Func zhandou()

$size = WinGetPos("倚天剑与屠龙刀")
$x=$size
$y=$size



$coord = PixelSearch($x+500, $y+113,$x+779, $y+236, 0x847563 );
   If Not @error Then
    $coord = PixelSearch( $x+500, $y+113, $x+800, $y+200, 0x10Ae9c)
                If Not @error Then


                  MouseClick("left", $coord, $coord+24, 1);人物攻击..............
                                    Else
                                     sleep (10)
   

   $coord = PixelSearch($x+726, $y+182, $x+769, $y+240, 0xa59284) ;先判断给 人物红
   
   
               If Not @error Then
      
       $hong = Hex(PixelGetColor( $x+129, $y+39),6)
      
                                  if string($hong) = "08344a" then

                        Send("{F1}")
                               EndIf
                                 $lan = Hex(PixelGetColor( $x+130, $y+52),6);判断 人物蓝

                              if string($lan) = "184152" then

                                       Send("{F2}")
                                             EndIf
      
      
   
                        MouseClick("left",$coord+2,$coord+39, 1)
   
   
                  EndIf
   
            EndIf   
EndIf




EndFunc

duxing47 发表于 2008-11-26 02:02:28

抓色点来说呢
一般是 色深 不同
比如32色 和16色 抓出来的 颜色的值是不同的哦

liongodmien 发表于 2008-11-26 10:58:56

用数值比较会比字符比较来的兼容性好

king777sa 发表于 2008-11-30 14:56:50

数字 怎么 比较 呢

liongodmien 发表于 2008-11-30 15:42:30

原帖由 king777sa 于 2008-11-30 14:56 发表 http://www.autoitx.com/images/common/back.gif
数字 怎么 比较 呢
就是分别将RGB进行比较,以判断是否为某种颜色

king777sa 发表于 2008-12-2 23:30:12

ddddddddddddddddddddd

king777sa 发表于 2008-12-4 13:36:11

谢谢 朋友学习哈哈,,,好 了
页: [1]
查看完整版本: 郁闷的很.我自己帮朋友 写了个游戏脚本..在我自己机子上可以用??????他的就不行为什么