按键精灵脚本源码 开心宝贝后台跳绳

脚本附件:

运行环境:分辨率:1280×800 色深:32位 操作系统:Microsoft Windows XP 按键精灵版本:7.12.5013

@piaoliuxia 2009/11/18

//开心宝贝后台跳绳   //V1.0   //2009.10.30   //漂流侠 http://hi.baidu.com/piaoliuxia   //QQ:277058507   //---------------------------------------------   //以下是自定义变量   UserVar PetColor=2BBFEF 宝贝身上的特征颜色   UserVar RopeColor=000099 绳子变化时颜色(一般不动)   UserVar SearchArea="20|120|750|400" 查色范围(左上角、右下角坐标)   //UserVar FeedPet=DropList{否:0|是:1}=0 是否主动喂食   UserVar FoodXY="400|580" 食物坐标   UserVar HealthXY="730|330" 健康度坐标(需要补食位置)   UserVar FeedDelay=7000 宝贝吃饭花费时间   UserVar DelayTime=50 延迟时间   UserVar TryCount=5 尝试自动跳绳次数   UserVar LogFile="C:\RopeLog.txt" 跳绳记录位置   Dim Hwnd   Dim FlagOver   //-------------   Rect=Split(SearchArea,"|")   X1=CInt(Rect(0))   Y1=CInt(Rect(1))   X2=CInt(Rect(2))   Y2=CInt(Rect(3))   //取得鼠标所在窗体句柄   Plugin Hwnd=Window.MousePoint()   //初始化结束标志   FlagOver=0   Plugin startTime =GetSysInfo.GetTime()   text= "-----------开始时间"&Time&"计划自动起跳"&TryCount&"次-----------!"   Plugin File.WriteFileEx(LogFile, text)   m=1   For TryCount       Plugin T1 =GetSysInfo.GetTime()       //检测是否有弹出对话框阻挡,如果有,就点击关闭       Plugin PopDialog = Bkgnd.FindColor(Hwnd,225,270,520,385,"FFCC00")       If PopDialog <> "-1|-1"           PopXY= split(PopDialog,"|")           PopX=CInt(PopXY(0))           PopY=CInt(PopXY(1))           Plugin Bkgnd.LeftClick(Hwnd,PopX,PopY)       EndIf        //       //开始引导宝贝拿绳子准备起跳       Gosub 自动引导宝贝跳绳       //       n=0       While FlagOver =0           Gosub 一次跳绳过程           If FlagOver=0               n=n+1           EndIf        EndWhile        Plugin T2 =GetSysInfo.GetTime()       T=round((T2-T1)/1000/60,1)       n=round(n/1.6,0)       text = "第 "&m&" 次:结束时间"&Time&"  本次共运行了"&T&"分钟,跳了 "&n&" 下(估计值)"       //下面这句是向目标文件(LogFile)写入文本内容(text)       Plugin File.WriteFileEx(LogFile, text)       m=m+1   EndFor    EndScript    //脚本运行结束   Sub 一次跳绳过程       Plugin UseTime1 =GetSysInfo.GetTime()       Rem 查是否可起跳       Delay DelayTime       Plugin EnableJump = Bkgnd.FindColor(Hwnd,X1,Y1,X2,Y2,RopeColor)       If EnableJump <> "-1|-1"           //如果可以起跳,则查找宝贝身上的特征色           Delay 50           Plugin FindPet = Bkgnd.FindColor(Hwnd,X1,Y1,X2,Y2,PetColor)           If FindPet <> "-1|-1"               //如果找到宝贝位置,则后台发送鼠标左键点击               PetPos=split(FindPet,"|")               PetX=CInt(PetPos(0))               PetY=CInt(PetPos(1))               Plugin Bkgnd.LeftClick(Hwnd, PetX, PetY)           EndIf        Else            Plugin UseTime2 =GetSysInfo.GetTime()           UseTime = UseTime2-UseTime1           If UseTime < 5000               Goto 查是否可起跳           Else                FlagOver = 1           EndIf        EndIf    Return 一次跳绳过程   //尝试自动引导宝贝喂食、跳绳   Sub 自动引导宝贝跳绳       Rem 把食物、绳子拿给宠物       HealthArray=split(HealthXY,"|")       HealthX=CInt(HealthArray(0))       HealthY=CInt(HealthArray(1))       Plugin HealthColor = Bkgnd.GetPixelColor(Hwnd,HealthX,HealthY)       If HealthColor <> "3833EE"           //喂食           Plugin FindPet = Bkgnd.FindColor(Hwnd,X1,Y1,X2,Y2,PetColor)           If FindPet <> "-1|-1"               PetPos=split(FindPet,"|")               PetX=CInt(PetPos(0))               PetY=CInt(PetPos(1))               FoodArray=split(FoodXY,"|")               FoodX=CInt(FoodArray(0))               FoodY=CInt(FoodArray(1))               Plugin Bkgnd.LeftClick(Hwnd,130,390)               Delay 200               Plugin Bkgnd.LeftDown(Hwnd, FoodX, FoodY)               //Delay 200               Plugin Bkgnd.MoveTo(Hwnd, PetX, PetY)               Delay 200               Plugin Bkgnd.LeftClick(Hwnd, PetX, PetY)               Delay FeedDelay           EndIf        EndIf        Plugin FindPet = Bkgnd.FindColor(Hwnd,X1,Y1,X2,Y2,PetColor)       If FindPet <> "-1|-1"           PetPos=split(FindPet,"|")           PetX=CInt(PetPos(0))           PetY=CInt(PetPos(1))           //拿绳子           Plugin Bkgnd.LeftClick(Hwnd,130,390)           Delay 200           Plugin Bkgnd.LeftDown(Hwnd, 400, 520)           //Delay 200           Plugin Bkgnd.MoveTo(Hwnd, PetX, PetY)           Delay 200           Plugin Bkgnd.LeftClick(Hwnd, PetX, PetY)           Delay 500           Plugin Bkgnd.LeftClick(Hwnd,130, 390)           FlagOver=0       Else            FlagOver=1       EndIf    Return 自动引导宝贝跳绳   Sub OnScriptExit       Plugin T2 =GetSysInfo.GetTime()       T=round((T2-T1)/1000/60,1)       n=round(n/1.6,0)       text = "第 "&m&" 次:结束时间"&Time&"  本次共运行了"&T&"分钟,跳了 "&n&" 下(估计值)"       //下面这句是向目标文件(LogFile)写入文本内容(text)       Plugin File.WriteFileEx(LogFile, text)       Plugin EndTime =GetSysInfo.GetTime()       TotalTime=round((EndTime-StartTime)/1000/60,0)       text= "----结束!"&Time&"  共经过"&TotalTime&"分钟,实际尝试自动起跳"&m&"次"       //下面这句是向目标文件(LogFile)写入文本内容(text)       Plugin File.WriteFileEx(LogFile, text)       MessageBox "脚本运行结束!快看看创造的记录吧~~"       VBSCall RunApp(LogFile)   Return

按键精灵脚本源码 开心宝贝后台跳绳》有0个想法

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注