TC官方合作论坛

 找回密码
 立即注册
查看: 3108|回复: 9

[讨论] 有木有一起研究eve脚本的啊

[复制链接]
发表于 2013-2-27 09:39:17 | 显示全部楼层 |阅读模式

马上加入TC

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
RT
-。-个人比较喜欢这个游戏,只是觉得里面的内容用脚本省事些,只不过自己研究时间长了有点无聊,有木有一起研究的啊-。-
回复

使用道具 举报

发表于 2013-2-27 10:22:39 | 显示全部楼层
沙发!
回复 支持 反对

使用道具 举报

发表于 2013-2-27 10:23:09 | 显示全部楼层
我路过。。。
回复 支持 反对

使用道具 举报

发表于 2013-2-27 10:31:40 | 显示全部楼层
什么游戏!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-2-27 10:47:46 | 显示全部楼层
回复 4楼1192576065的帖子

eve 星战前夜
回复 支持 反对

使用道具 举报

发表于 2013-4-22 12:44:06 | 显示全部楼层

大家可以交流交流!

#import "dm.dmsoft" dm
namespace 采矿脚本
//定义默认空间

int  My_hwnd          //存放自身句柄
string Path        //存放当前路径
string Gamer_num //已存的玩家数量

int ping_Wide        //屏幕宽度
int ping_High        //屏幕高度


int  Game_hwnd          //存放游戏句柄
bool running         //运行标志位
bool caikuangchuan          //是否是采矿船

string caiji_zhonglei         //存放采集种类 //存放下拉框的序号
string caiji_image          //存放采集种类图像
string caiji_image_1         //存放采集种类图像
string caiji_image_2         //存放采集种类图像
string caiji_image_3         //存放采集种类图像
string caiji_image_4         //存放采集种类图像

string Player_name        //角色名称
string Rongliang            //货舱容量
string Kaicailiang        //开采量
string Flytime                //飞行时间

double     Kaicailiang_Ready        //已经开采量


int Run_State                 //采集状态

int Chazhao_Cishu       //查找总览中物品的次数
int Chazhao_Cishu_temp       //查找总览中物品的次数

int xiaoxx               //当前小行星的位置

int  x,y,index              //找图寄存器
int  x1,y1               //找图寄存器,存放总览坐标
int  x2,y2               //找图寄存器,存放选中的物品坐标
int  x3,y3               //找图寄存器,存放仓库_Index
int  x4,y4               //找图寄存器,存放右上角
int  x5,y5               //找图寄存器,存放物品机库位置
int  x6,y6               //找图寄存器,存放名字位置

string Static_str        //临时变量
int    Static_int        //临时变量
//----------------------------------------------------
function bool init()    //软件初始化
    timer.kill("timer0")        //定时器停止
    bool exists
    My_hwnd=window.getmyhwnd()//获取自身句柄
    Path=system.getcurrentpath()//获得当前路径
    system.getscreen(ping_Wide,ping_High) //获得屏分辨率
   
   
        //window.setwindowcaption(My_hwnd,convert.inttostr(ping_Wide) + ","+ convert.inttostr(ping_High))
   
    //window.setwindowsize(My_hwnd,245,313)//标准化窗口
    //help.messagebox(Path)
   
    //检查是否存在配置文件   
    exists=file.exist(Path + "Data.ini")
    if (exists)        
        // 文件存在,读取已存信息  
        Gamer_num= help.readini("GAMER_NUM","NUM",Path + "Data.ini")
        //遍历游戏玩家名,添加到列表中
        for (int i=1 ;i<=convert.strtoint(Gamer_num);i++)
            combo.addtext("ComboBox0",help.readini("GAMER_NUM",convert.inttostr(i),Path + "Data.ini"))
        endfor
        
        // 加载默认用户
        combo.setcursel("ComboBox0",convert.strtoint(help.readini("CONFIG","NULL",Path + "Data.ini")))
        combo.setcursel("ComboBox2",0)
        采矿脚本.button0_click() //加载该用户信息
        Game_hwnd=window.findwindow("EVE - "+Player_name,"triuiScreen")//获得游戏句柄
        
    else        
        // 文件不存在,创建文件      
        help.writeini("CONFIG","NULL","0",Path + "Data.ini")
        help.writeini("GAMER_NUM","NUM","0",Path + "Data.ini")
    endif
   
    help.settray("EVE_AI",false)//添加托盘
   
            bool ret//判断大漠插件是否注册

        ret=help.isregister("dm.dmsoft")

        if(ret)

        else  
                ret=help.regdll("rc:dm.dll",true)

                if(ret)
                    help.messagebox("注册成功!")
                else
                    help.messagebox("大漠插件注册失败,请手动注册!")
                endif


        endif

    // ==============================
   
    return true
endfunction

//----------------------------------------------------
function bool start_click()    //开始/停止按钮  
   
    if (running)
        //运行->停止状态
        
        window.setwindowsize(My_hwnd,245,250)//标准化窗口
        button.settext("start","运行")
        running=false           
        help.writeini(Player_name,"运行中","否",Path + "Data.ini") //当前不在挂机状态
        
        
        window.setwindowcaption(My_hwnd,"EVE_AI")
        timer.kill("timer0")        //定时器停止
         dm.LockInput (0) //解锁键盘鼠标
        dm.UnBindWindow() //解除绑定窗口
         dm.SetWindowTransparent(Game_hwnd,255)          //回复显示
    else     
        //停止->启动状态
        
        采矿脚本.Get_Setting()//获得设置信息
        if (Player_name==""  )
            help.messagebox("角色信息不完整")
        else
            
            //string Game_run= help.readini(Player_name,"运行中",Path + "Data.ini")
            //if (Game_run=="是")
                //help.messagebox("其他脚本正在控制该窗口,请关闭其他脚本后继续.")
            //else            
                //获得游戏窗口句柄
                Game_hwnd=window.findwindow("EVE - "+Player_name,"triuiScreen")
                if(Game_hwnd==0)
                    help.messagebox("游戏窗口没有找到")
                else
                    window.setwindowsize(My_hwnd,245,65)//小型化窗口
                    button.settext("start","停止")
                    running=true
                    help.writeini(Player_name,"运行中","是",Path + "Data.ini") //在挂机状态
                    
                caikuangchuan=false//当前为非采矿船
                //caikuangchuan=true//当前为非采矿船
                    Chazhao_Cishu_temp=0//清零
                    
                        dm.BindWindow(Game_hwnd,"dx2","dx2","dx",0) //绑定窗口
                        dm.EnableRealMouse (1,20,30)              //设置鼠标
                        dm.EnableMouseSync( 1,400)
                        dm.EnableRealKeypad( 1)                     //设置键盘
                    bool state
                    
                    state=check.getstate("check48")
                    if (state == true)  
                        dm.LockInput (1)//锁定键盘鼠标
                    else  
                        dm.LockInput (0) //解锁键盘鼠标
                        
                    endif
                    
                    if (state == true)
                        window.setwindowtop(My_hwnd,true)//置顶
                    else
                        window.setwindowtop(My_hwnd,false) //取消置顶
                        window.activate(My_hwnd)        //激活
                    endif
                    
                    state=check.getstate("check1")
                    if (state == true)
                         dm.SetWindowTransparent(Game_hwnd, 0)          //隐藏显示
                    else
                         dm.SetWindowTransparent(Game_hwnd,255)          //回复显示
                    endif
     
   
                    timer.register("timer0",1000)//启动定时器
                    
                    
                    
                    select (combo.getcursel("ComboBox2"))        //判断软件功能
                        case 0:               
                        Run_State=0//默认开采状态为0
                        window.setwindowcaption(My_hwnd,Player_name + "   采矿")
                        case 1:
                        Run_State=100//跳跃初始状态为100
                        window.setwindowcaption(My_hwnd,Player_name + "   跳跃")
                        
                     
                     
                        default:
                        Run_State=0//默认开采状态为0
                    endselect
                    
                        //Run_State=20//默认开采状态为0
                    
                endif
            //endif
            
            
        endif
        
        
        
        
        
        
    endif
    return true
endfunction

//----------------------------------------------------
function bool 采矿脚本_close()    //关闭窗口前提示
   
    if (running)
        //运行 状态
        int result
        result= help.confirmationbox("脚本正在运行,确定要退出?","注意!",2,true)
        if(result==7)//选择"是"
                dm.LockInput (0) //解锁键盘鼠标
            dm.UnBindWindow() //解除绑定窗口
            dm.SetWindowTransparent(Game_hwnd,255)          //回复显示  
            help.exit()
        endif   
        
    else      
        help.exit()
    endif
   
    return true
endfunction

//----------------------------------------------------
function bool button0_click()    //载入按钮
    string str_temp
   
    Player_name=combo.gettext("ComboBox0")        //获得名称
   
    str_temp= help.readini(Player_name,"运行中",Path + "Data.ini")//读取是否被控
    //if (str_temp=="是")
        //help.messagebox("载入失败!此游戏窗口正在被其他脚本控制!")
    //else
        Rongliang= help.readini(Player_name,"Rongliang",Path + "Data.ini") //容量
        edit.settext("edit1",Rongliang)
        Kaicailiang= help.readini(Player_name,"Kaicailiang",Path + "Data.ini")//开采速度
        edit.settext("edit2",Kaicailiang)        
        Flytime= help.readini(Player_name,"Flytime",Path + "Data.ini")//飞行时间
        edit.settext("edit0",Flytime)
        
        help.writeini("CONFIG","NULL",convert.inttostr(combo.getcursel("ComboBox0")),Path + "Data.ini")
        
        采矿脚本.Get_Setting()//重新加载信息
    //endif
   
    return true
endfunction


//----------------------------------------------------
function bool button1_click()//保存当前玩家的信息
   
    采矿脚本.Get_Setting()//获得设置信息
    if (Player_name=="" || Rongliang=="" || Kaicailiang=="")
        help.messagebox("角色信息不完整")        
        return false
    else
        //写入信息
        help.writeini(Player_name,"Rongliang",Rongliang,Path + "Data.ini")
        help.writeini(Player_name,"Kaicailiang",Kaicailiang,Path + "Data.ini")
        help.writeini(Player_name,"Flytime",Flytime,Path + "Data.ini")      
        help.writeini(Player_name,"运行中","否",Path + "Data.ini") //当前不在挂机状态
        
        //遍历游戏玩家名,判断是否重名
        bool ChongMing=false
        string name_temp
        int i
        for ( i=1 ;i<=convert.strtoint(Gamer_num);i++)
            
            name_temp= help.readini("GAMER_NUM",convert.inttostr(i),Path + "Data.ini")
            if (name_temp==Player_name)
                ChongMing=true
            endif
        endfor
        
        if (ChongMing)//如果发现重名,表示之前存过该人物信息,
        else//否则新建信息
            i=convert.strtoint(Gamer_num)
            i=i+1
            Gamer_num=convert.inttostr(i)
            help.writeini("GAMER_NUM", Gamer_num ,Player_name,Path + "Data.ini") //添加姓名
            help.writeini("GAMER_NUM","NUM", Gamer_num ,Path + "Data.ini")         //更新个数
            combo.addtext("ComboBox0",Player_name )//将本次添加的用户加到列表中
        endif
        
        return true
        
        
    endif
   
   
   
   
endfunction





function bool Get_Setting()    //获得设置信息
   
    //获得基本信息
    Player_name=combo.gettext("ComboBox0")
    Rongliang=edit.gettext("edit1")
    Kaicailiang=edit.gettext("edit2")     
    Flytime=edit.gettext("edit0")
   
    return true
endfunction


//----------------------------------------------------
function bool timer0_ontime()//采矿主控程序
    采矿脚本.采矿_流程控制()
   
    bool state
   
    state=check.getstate("check48")
    if (state == true)
            Static_str=采矿脚本.当前状态判断()
        if (Static_str==statictext.gettext("Static"))
        else
                statictext.settext("Static", Static_str )
        endif
        
    else
        if (statictext.gettext("Static")==convert.inttostr(Run_State) +Static_str)
            
        else         
            
            Static_str=statictext.gettext("Static")
            statictext.settext("Static", convert.inttostr(Run_State) +Static_str )
            // 日志文件
            Static_int=Static_int+1     
            help.writeini("num","num",convert.inttostr(Static_int),Path + "record.ini")
            help.writeini("CONFIG",convert.inttostr(Static_int),statictext.gettext("Static"),Path + "record.ini")
            
        endif  
        
    endif
    return true
endfunction

function string 当前状态判断()//当前状态判断
    int temp
   
    if (Run_State>=1000)        
        return " 服务器维护,正在返回空间站。"
    endif
   
    if (Run_State<100) //采矿流程
        
        if (Run_State>=80)        
            return " 正在转移矿物"
        endif
        
        if (Run_State>=70)        
            return " 正在查看仓库"
        endif
        
        if (Run_State>=60)        
            return " 正在返回空间站"
        endif
        
        if (Run_State==53)        
            temp=convert.doubletoint(Kaicailiang_Ready)
            return " 正在采矿  " +convert.inttostr(temp)+ "/"+ Rongliang
        endif
        
        if (Run_State==59)   
            return " 正在采矿  "
        endif
        if (Run_State>=54)        
            return " 锁定完成"
        endif
        
        if (Run_State>=51)        
            return " 正在锁定矿物 "+convert.inttostr(Chazhao_Cishu)+ " 秒"
        endif
        
        if (Run_State==50)        
            return " 正在飞向矿物 "+convert.inttostr(Chazhao_Cishu)+ " 秒"
        endif
        
        
        if (Run_State>=40)        
            return " 找不到矿物,返回空间站"
        endif
        
        //if (Run_State>=30)        
        //return " :正在查找需要开采的矿物"
        //endif
        
        if (Run_State>=20)        
            return " 正在查找需要开采的矿物"
        endif
        
        
        if (Run_State>=10)        
            return " 正在飞向采矿地点"
        endif
        
        if (Run_State>=1)        
            return " 正在离开空间站"
        endif
        
        if (Run_State==0)        
            return " 游戏没有打开!脚本停止"
        endif
    else
        
        if (Run_State<200) //跳跃流程
            if (Run_State==190)        
                return " 已到达目的地"
            endif
            
            
            if (Run_State<110)        
                return " 正在出站"
            else      
                return " 跳跃中"               
            endif
            
            
            
            
        else
        endif
        
        
        
        
    endif
endfunction
//----------------------------------------------------
function bool 采矿_流程控制()//采矿主控程序
   
    Game_hwnd=window.findwindow("EVE - "+Player_name,"triuiScreen")
    if(Game_hwnd==0)
        statictext.settext("Static"," 游戏没有运行" )
        return false
        
    else
        
        int  rwidth,rheight
        window.getwindowsize(Game_hwnd,rwidth,rheight)//判断窗口大小
         
        if (rwidth<ping_Wide)
        window.setwindowmax(Game_hwnd)        //最大化窗口
        endif
        
         
        
        
        
        采矿脚本.判断是否有通告()//关闭通告
        
        
        select (Run_State)
            //====================================================================
            case 0:        //位置判断
            bool resurt=采矿脚本.找到选中的物品()
            if (resurt)
                Run_State=60  //表示已经离开空间站,为保证回盾正常开启,从新进站后再出站
            else
                Run_State=70  //如果没有找到,说明在空间站,卸货               
            endif     
            
            
            //====================================================================
            case 1:
            Chazhao_Cishu_temp=0//出站清零
            Kaicailiang_Ready=0//已开采数为0
            采矿脚本.出站()
            Run_State= 2
            
            case 2:
            采矿脚本.出站()
            bool resurt= 采矿脚本.出站完成判断()
            if (resurt)
                Run_State=3
            endif     
            
            case 3:
            采矿脚本.出站()
            bool resurt= 采矿脚本.出站完成判断()
            if (resurt)
                Run_State=4
            endif
            
            case 4:
            bool   resurt= 采矿脚本.找到选中的物品()
            if (resurt)  
                Run_State=5//表示已经离开空间站  
                statictext.settext("Static"," 出站完成" )
            else
                Run_State=3 //表示还未完成出站,继续判断
            endif   
            case 5:
            
            //采矿脚本.正在启动装备()
            Run_State=10
            
            //====================================================================
            case 10:
            bool resurt= 采矿脚本.跃迁至采矿地点()
            if (resurt)
                Run_State=15      
            else
                Run_State=10                        
            endif  
            
            
            
            case 15:
            bool resurt= 采矿脚本.调转船体方向()
            if (resurt)
                Run_State=16                 
            endif   
            
            case 16:
            bool resurt= 采矿脚本.跃迁引擎启动()
            if (resurt)
                Run_State=16   //跃迁停止后连续4秒判断,
            else
                Run_State=17                  
            endif   
            case 17:
            bool resurt= 采矿脚本.跃迁引擎启动()
            if (resurt)
                Run_State=16
            else
                Run_State=18                     
            endif   
            case 18:
            bool resurt= 采矿脚本.跃迁引擎启动()
            if (resurt)
                Run_State=16   
            else
                Run_State=19                  
            endif   
            
            case 19:
            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
            help.sleep(100)            
            dm.LeftClick()// 左键单击
            help.sleep(100)            
            dm.KeyPressChar("K")//按下"K"键,  召唤无人机  
            Run_State=20
            
            
            
            
            //====================================================================
            case 20:
            bool resurt= 采矿脚本.找到选中的物品()
            if (resurt)
                Run_State=21                 
            endif            
            case 21:
            bool resurt= 采矿脚本.加载采矿设置()
            if (resurt)
                Run_State=23        
            else      
                Run_State=40        
                statictext.settext("Static"," 找不到<采矿设置>" )  
            endif   
            
            
            Chazhao_Cishu=convert.strtoint(Flytime) //飞行时间
            
            //case 22:
            //bool resurt= 采矿脚本.设置总览焦点()
            //if (resurt)     
            //Run_State=23            
            //endif   
            
            
            case 23:
            bool resurt= 采矿脚本.判断总览中是否有东西()
            if (resurt)      
                //如果 做找到图片,表示总览中没有物体,进入返航流程
                statictext.settext("Static"," 找不到所需矿物,返航中" )  
                Run_State=40        
               
            else
                //如果没有做找到图片,表示总览中有对应的矿
                Run_State=30        
                //Chazhao_Cishu=1
                //caiji_image=caiji_image_1  
               
            endif   
            
            
            
            case 30:        //找到所需矿物
            
            dm.KeyPressChar("W")  //按下"W"键,  环绕矿物
            dm.KeyPressChar("f4")  //按下"f4"键,  启动加力/微跃
            
            Run_State=31   
            statictext.settext("Static"," 找到所需矿物" )
            
            
            case 31:        //找到所需矿物
            Run_State=50   
                if( Chazhao_Cishu_temp== 0)                    //判断是中断采集还是初次采集
                    
                    dm.KeyDownChar ("f5")  //按住"f5"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f5")  //按住"f5"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f5")  //按住"f5"键,  关闭矿枪都
                    help.sleep(20)
                    dm.KeyDownChar ("f5")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f5")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f5")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                    
                    dm.KeyDownChar ("f6")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f6")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f6")  //按住"f1"键,  关闭矿枪都
                    help.sleep(20)
                    dm.KeyDownChar ("f6")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f6")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f6")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                    
                    dm.KeyDownChar ("f7")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f7")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f7")  //按住"f1"键,  关闭矿枪都
                    help.sleep(20)
                    dm.KeyDownChar ("f7")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f7")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f7")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                    
                    dm.KeyDownChar ("f8")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f8")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f8")  //按住"f1"键,  关闭矿枪都
                    help.sleep(20)
                    dm.KeyDownChar ("f8")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f8")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f8")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                        //dm.KeyPressChar("f5")  //按下"f5"键,  启动防御装备
                        //dm.KeyPressChar("f6")  //按下"f6"键,  启动防御装备
                        //dm.KeyPressChar("f7")  //按下"f7"键,  启动防御装备
                        //dm.KeyPressChar("f8")  //按下"f8"键,  启动防御装备
                else
                endif           
            statictext.settext("Static"," 找到所需矿物" )
            
            
            
            //====================================================================
            
            case 40:////找不到矿,进入返航流程
            bool resurt= 采矿脚本.跃迁至空间站()
            Run_State=41        
            
            case 41: //查找《找到选中的物品》
            bool resurt= 采矿脚本.找到选中的物品()
            if (resurt)
                Chazhao_Cishu=10        //10秒
                Run_State=42 //延时10秒,循环判断是否已经按过<停靠>
                statictext.settext("Static"," 正在进站")  
            else
                Run_State=43//当找不到时,表示已进站完毕
                Chazhao_Cishu=5        //5秒
                statictext.settext("Static"," 进站完毕")  
               
            endif   
            
            
            case 42:                     
            Chazhao_Cishu=Chazhao_Cishu-1
            if (Chazhao_Cishu==0)  
                Run_State=40 //延时10秒,循环判断是否已经按过<停靠>
            endif
            
            
            case 43:                     
            Chazhao_Cishu=Chazhao_Cishu-1
            if (Chazhao_Cishu==0)   
                //window.closewnd(Game_hwnd)        //关闭游戏
                statictext.settext("Static"," 找不到矿,关闭脚本" )
                return false
            endif
            
            
            
            //====================================================================
            
            case 50: //找到矿物后,飞向矿物
            statictext.settext("Static"," 正在飞向矿物 "+convert.inttostr(Chazhao_Cishu)+ " 秒" )  
            Chazhao_Cishu=Chazhao_Cishu-1
            if (Chazhao_Cishu==0)
               
                dm.KeyPressChar("f4")  //按下"f4"键,  关闭加力/微跃
               
                Chazhao_Cishu=6        //锁定矿物,6秒
                Run_State=51            
               
                dm.KeyPressChar("M")  //按下"M"键,
               
                dm.KeyPressChar("P")  //按下"P"键,  锁定矿物  
               
            endif
            
            case 51: //锁定矿物
            statictext.settext("Static"," 正在锁定矿物 "+convert.inttostr(Chazhao_Cishu)+ " 秒" )  
            Chazhao_Cishu=Chazhao_Cishu-1
            if (Chazhao_Cishu==0)
                if( Chazhao_Cishu_temp== 0)                    //判断是中断采集还是初次采集
                        Chazhao_Cishu=(convert.doubletoint( convert.strtodouble(Rongliang) /convert.strtodouble(Kaicailiang))+1)*60
                else
                    Chazhao_Cishu=Chazhao_Cishu_temp
                endif
                //开采时间=货舱容量/开采量+1//开采矿物
                    //Chazhao_Cishu=Chazhao_Cishu-1
                    //dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪
                    //help.sleep(20)
                    dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪都
                    help.sleep(20)
                    dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f1")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f1")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                    //dm.KeyUpChar ("f1")    //抬起"f1"键,  关闭矿枪
                    //help.sleep(20)
                    
                    //dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    //help.sleep(20)
                    dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f2")    //抬起"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f2")    //抬起"f2"键,  关闭矿枪
                    help.sleep(20)
                    //dm.KeyUpChar ("f2")    //抬起"f2"键,  关闭矿枪
                    //help.sleep(20)
                    
                    //dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    //help.sleep(20)
                    dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f3")    //抬起"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f3")    //抬起"f3"键,  关闭矿枪
                    help.sleep(20)
                    //dm.KeyUpChar ("f3")    //抬起"f3"键,  关闭矿枪
                    //help.sleep(20)
                    //dm.KeyPressChar("f1")  //按下"f1"键,  启动矿枪
                    //help.sleep(50)
                    //dm.KeyPressChar("f2")  //按下"f2"键,  启动矿枪
                    //help.sleep(50)
                    //dm.KeyPressChar("f3")  //按下"f3"键,  启动矿枪
                    
                    help.sleep(200)
                    bool resurt= 采矿脚本.找到仓库_左上角定位()//找到左上角,并切换到列表模式
                    if (resurt)
                        Run_State=54        //找到后,图像计时
                    else
                            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
                            help.sleep(100)            
                            dm.LeftClick()// 左键单击
                            help.sleep(100)
                        dm.KeyPressChar("n")  //按下"n"键,  关闭仓库
                        Run_State=52//如果找不到,计时采矿
                    endif     
                    statictext.settext("Static"," 正在开采矿物: " + " 0/" + Rongliang)
            endif
            
            case 52:  //查找仓库右上角
            Chazhao_Cishu=Chazhao_Cishu-1
            bool resurt= 采矿脚本.找到仓库_左上角定位()//找到左上角,并切换到列表模式
            if (resurt)
                Run_State=54        //找到后,图像计时
            else
            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
            help.sleep(100)            
            dm.LeftClick()// 左键单击
            help.sleep(100)
                dm.KeyPressChar("n")  //按下"n"键,  关闭仓库
                Run_State=53//如果找不到,计时采矿
            endif     
            
            
            case 53: //开采矿物中
            
            Chazhao_Cishu=Chazhao_Cishu-1
            if (Chazhao_Cishu==0)
                Run_State=60   
            else
                bool resurt= 采矿脚本.找到总览_没有选择物品()
                if (resurt)                 //矿物已经开采完毕
                    Run_State=23   
                       
                    Chazhao_Cishu_temp = Chazhao_Cishu+1    //保存当前采矿值
                    if (check.getstate("check0")==true)
                      Chazhao_Cishu=3  
                    else
                        Chazhao_Cishu=convert.strtoint(Flytime) //飞行时间   
                    endif
                else
                    if (Chazhao_Cishu % 60==0)
                        Kaicailiang_Ready=Kaicailiang_Ready + convert.strtodouble(Kaicailiang)
                        //progress0
                        statictext.settext("Static"," 正在开采矿物: " + convert.inttostr(convert.doubletoint(Kaicailiang_Ready)) + "/" + Rongliang)
                        if(convert.strtodouble(Rongliang)<=Kaicailiang_Ready)
                            statictext.settext("Static"," 开采完毕" )  
                            Run_State=60
                        endif
                    else
                        
                    endif
                    
                endif   
            endif
            
            
            
            case 54:
            Chazhao_Cishu=Chazhao_Cishu-1
              bool resurt= 采矿脚本.找到仓库_Index()//     找到后收舱,然后再打开               
            if (resurt)
                Run_State=55
            else
            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
            help.sleep(100)            
            dm.LeftClick()// 左键单击
            help.sleep(100)
                dm.KeyPressChar("n")  //按下"n"键,  关闭仓库
                Run_State=53//如果找不到,计时采矿
            endif     
            
            
            
            case 55: //        显示列表
            Chazhao_Cishu=Chazhao_Cishu-1
             dm.MoveTo( x3+7,y3+7)//移动
            help.sleep(200)            
            dm.LeftClick()// 左键单击
            help.sleep(100)  
            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
                Run_State=56
            
            case 56: // 收缩列表
            Chazhao_Cishu=Chazhao_Cishu-1
            bool resurt= 采矿脚本.找到向下箭头()//                     
            if (resurt)
                Run_State=57
            else
                Run_State=56
            endif   
               
            case 57: // 显示列表
            Chazhao_Cishu=Chazhao_Cishu-1
             bool resurt= 采矿脚本.点击向下箭头()//     点击向下箭头,查看是否有矿石舱                     
            if (resurt)
                Run_State=58  
            endif         
            
            case 58: //          
            Chazhao_Cishu=Chazhao_Cishu-1
               if (caikuangchuan==true)//当前为采矿船
                bool resurt= 采矿脚本.找矿石舱()//
                if (resurt)                 //矿物已经开采完毕
                else
                    dm.MoveTo( x3+57, y3+75)//移动
                    help.sleep(200)            
                    dm.LeftClick()// 左键单击
                    help.sleep(100)  
                    dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
                endif

               else
                 采矿脚本.点击船仓()// 找不到到矿石舱 点击船仓
               endif         
                 
                Run_State=59        //
            
            case 59: //            
                Chazhao_Cishu=Chazhao_Cishu-1

                bool resurt= 采矿脚本.找到总览_没有选择物品()
                if (resurt)                 //矿物已经开采完毕
                    Run_State=23   
                    dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
                    help.sleep(100)            
                    dm.LeftClick()// 左键单击
                    help.sleep(100)
                    dm.KeyPressChar("n")  //按下"n"键,  关闭仓库
                    Chazhao_Cishu_temp = Chazhao_Cishu+1    //保存当前采矿值
                    if (check.getstate("check0")==true)
                        Chazhao_Cishu=3  
                    else
                        Chazhao_Cishu=convert.strtoint(Flytime) //飞行时间   
                    endif                 
                else   
                    resurt= 采矿脚本.找仓库_满仓()
                    if (resurt)       
                        statictext.settext("Static"," 开采完毕" )  
                        dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
                        help.sleep(100)            
                        dm.LeftClick()// 左键单击
                        help.sleep(100)
                        dm.KeyPressChar("n")  //按下"n"键,  关闭仓库
                        Run_State=60
                    endif
                endif   
               
                //每隔60秒,关闭/打开一下矿枪,减少采空的数量
                if (Chazhao_Cishu % 60==0 && caikuangchuan==true)
                     //dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪
                    //help.sleep(20)
                    dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪都
                    help.sleep(20)
                    dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f1")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f1")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                    //dm.KeyUpChar ("f1")    //抬起"f1"键,  关闭矿枪
                    //help.sleep(20)
                    
                    //dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    //help.sleep(20)
                    dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f2")    //抬起"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f2")    //抬起"f2"键,  关闭矿枪
                    help.sleep(20)
                    //dm.KeyUpChar ("f2")    //抬起"f2"键,  关闭矿枪
                    //help.sleep(20)
                    
                    //dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    //help.sleep(20)
                    dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f3")    //抬起"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f3")    //抬起"f3"键,  关闭矿枪
                    help.sleep(20)
                    //dm.KeyUpChar ("f3")    //抬起"f3"键,  关闭矿枪
                    //help.sleep(20)
                    
                    //dm.KeyPressChar("f1")  //按下"f1"键,  关闭矿枪
                    //help.sleep(50)
                    //dm.KeyPressChar("f2")  //按下"f2"键,  关闭矿枪
                    //help.sleep(50)
                    //dm.KeyPressChar("f3")  //按下"f3"键,  关闭矿枪
                    
                        Run_State=35
                    
                else
                    
                endif
            
            
            
            
            
            
            case 35:
                 Run_State=36
            case 36:
                 Run_State=37
            
            case 37: //     判断当前矿是否采完        
                Chazhao_Cishu=Chazhao_Cishu-1

                bool resurt= 采矿脚本.找到总览_没有选择物品()
                if (resurt)                 //矿物已经开采完毕
                    Run_State=23   
                    dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
                    help.sleep(100)            
                    dm.LeftClick()// 左键单击
                    help.sleep(100)
                    dm.KeyPressChar("n")  //按下"n"键,  关闭仓库
                    Chazhao_Cishu_temp = Chazhao_Cishu+1    //保存当前采矿值
                    if (check.getstate("check0")==true)
                        Chazhao_Cishu=3  
                    else
                        Chazhao_Cishu=convert.strtoint(Flytime) //飞行时间   
                    endif                 
                else   
                    resurt= 采矿脚本.找仓库_满仓()
                    if (resurt)       
                        statictext.settext("Static"," 开采完毕" )  
                        dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
                        help.sleep(100)            
                        dm.LeftClick()// 左键单击
                        help.sleep(100)
                        dm.KeyPressChar("n")  //按下"n"键,  关闭仓库
                        Run_State=60
                    else
                        //dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪
                    //help.sleep(20)
                    dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪都
                    help.sleep(20)
                    dm.KeyDownChar ("f1")  //按住"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f1")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f1")    //抬起"f1"键,  关闭矿枪
                    help.sleep(20)
                    //dm.KeyUpChar ("f1")    //抬起"f1"键,  关闭矿枪
                    //help.sleep(20)
                    
                    //dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    //help.sleep(20)
                    dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f2")  //按住"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f2")    //抬起"f2"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f2")    //抬起"f2"键,  关闭矿枪
                    help.sleep(20)
                    //dm.KeyUpChar ("f2")    //抬起"f2"键,  关闭矿枪
                    //help.sleep(20)
                    
                    //dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    //help.sleep(20)
                    dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyDownChar ("f3")  //按住"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f3")    //抬起"f3"键,  关闭矿枪
                    help.sleep(20)
                    dm.KeyUpChar ("f3")    //抬起"f3"键,  关闭矿枪
                    help.sleep(20)
                    //dm.KeyUpChar ("f3")    //抬起"f3"键,  关闭矿枪
                    //help.sleep(20)
                            //dm.KeyPressChar("f1")  //按下"f1"键,  启动矿枪
                            //help.sleep(50)
                            //dm.KeyPressChar("f2")  //按下"f2"键,  启动矿枪
                            //help.sleep(50)
                            //dm.KeyPressChar("f3")  //按下"f3"键,
                        Run_State=59   
                    endif
                endif   
                 
            
            
            
            
            
            
            
            //====================================================================
            
            case 60://矿采完,进入返航流程
            bool resurt= 采矿脚本.跃迁至空间站()  
            Run_State=61   
            
            
            
            case 61: //查找《找到选中的物品》
            bool resurt= 采矿脚本.找到选中的物品()
            if (resurt)
                Chazhao_Cishu=10        //10秒
                Run_State=62 //延时10秒,循环判断是否已经按过<停靠>
                statictext.settext("Static"," 正在进站")  
            else
                Run_State=63//当找不到时,表示已进站完毕
                Chazhao_Cishu=5        //5秒
                statictext.settext("Static"," 进站完毕")  
               
            endif   
            
            
            case 62:                     
            Chazhao_Cishu=Chazhao_Cishu-1
            if (Chazhao_Cishu==0)  
                Run_State=60 //延时10秒,循环判断是否已经按过<停靠>
            endif
            
            
            
            case 63:                     
            Chazhao_Cishu=Chazhao_Cishu-1
            if (Chazhao_Cishu==0)  
                Run_State=70 //延时5秒,循环判断是否已经按过<停靠>
            endif
            
            
            //====================================================================
            case 70: //打开货仓
            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
            help.sleep(100)            
            dm.LeftClick()// 左键单击
            help.sleep(100)
            dm.KeyPressChar("N")     //按下"N"键, 打开货仓  
            Run_State=71
            
            case 71: //
            bool resurt= 采矿脚本.找到仓库_左上角定位()//找到左上角,并切换到列表模式
            if (resurt)
                Run_State=72
            else
                Run_State=0//如果找不到,再次按N键从新找
            endif     
            
            case 72: //
            bool resurt= 采矿脚本.找到仓库_Index()//     找到后收舱,然后再打开               
            if (resurt)
                Run_State=65
            else
                Run_State=0
            endif     
            
            case 65: //
                     dm.MoveTo( x3+7,y3+7)//移动
                    help.sleep(200)            
                    dm.LeftClick()// 左键单击
                    help.sleep(100)  
                    dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
            
                        Run_State=73
            
            case 73: //
            bool resurt= 采矿脚本.找到向下箭头()//                     
            if (resurt)
                Run_State=74
            else
                Run_State=73
            endif   
            
            case 74: //
            bool resurt= 采矿脚本.找到物品机库()//                     
            if (resurt)
                Run_State=75
            else//如果找不到物品机库,查找右上角有没有选中的物品
                resurt= 采矿脚本.找到选中的物品()
                if (resurt)
            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
            help.sleep(100)            
            dm.LeftClick()// 左键单击
            help.sleep(100)
                    dm.KeyPressChar("N")  //按下"N"键, 关闭货仓      
                    Run_State=60//表示已经离开空间站,为保证回盾正常开启,从新进站后再出站  
                else
                    
                        x5=x3+38
                        y5=y3+67
                    Run_State=75 //找不到机库,直接赋值
                endif   
            endif  
            
            case 75: //
            bool resurt= 采矿脚本.点击船仓()//                     
            if (resurt)
                Run_State=76  
            endif  
            case 76: //
            bool resurt= 采矿脚本.是否有货物()//                     
            if (resurt)
                Run_State=77 //没有货物,查看矿石舱
            else
                Run_State=79 //有货物
            endif
            
             case 77: //
            bool resurt= 采矿脚本.点击向下箭头()//     点击向下箭头,查看是否有矿石舱   
                Run_State=78  
            
            case 78: //
            bool resurt= 采矿脚本.找矿石舱()//                     
            if (resurt)
                caikuangchuan=true//当前为采矿船
                Run_State=79        //找到矿石舱,继续查看是否有货物
            else
                Run_State=99        //找不到到矿石舱
            endif  
                  
            
            
            
            case 79: //
            bool resurt= 采矿脚本.找到名字()//                     
            if (caikuangchuan)
                y5=y5+50        //机库位置加50       
                Run_State=92        //如果是采矿船,跳90
            else
                Run_State=80         // 不是采矿船,跳80
            endif  
            
            //====================================================================
            case 80: //
            bool resurt= 采矿脚本.点击船仓()//                     
            if (resurt)
                Run_State=81  
            endif  
            
            
            case 81: //   
            Run_State=82
            
            case 82: //
            bool resurt= 采矿脚本.是否有货物()//                     
            if (resurt)
                Run_State=77 //没有货物,查看矿石舱
            else
                Run_State=83
            endif  
            
            case 83: //
            bool resurt= 采矿脚本.搬运货物1()//            
            Run_State=84 //不可炼化,搬运货物
            
            case 84: //     搬运货物2
            bool resurt= 采矿脚本.搬运货物2()//
            Run_State=85
            case 85: //   
            bool resurt= 采矿脚本.搬运货物3()//
            Run_State=86
            case 86: //   
            Run_State=87  
            
            case 87: //     
            Run_State=88
            case 88: //   
            Run_State=80   
            
            //====================================================================
            //case 90: //
            //bool resurt= 采矿脚本.点击向下箭头()//     点击向下箭头,查看是否有矿石舱   
                //Run_State=91  
            
            case 90: //
            bool resurt= 采矿脚本.找矿石舱()//                     
            if (resurt)
                Run_State=92        //找到矿石舱,继续查看是否有货物
            else
                Run_State=99        //找不到到矿石舱
            endif  
                  
            case 92: //   
            Run_State=93
            
            case 93: //
            bool resurt= 采矿脚本.是否有货物()//                     
            if (resurt)
                Run_State=99//没有货物,查看矿石舱
            else
                Run_State=94
            endif  
                 
            case 94: //
            bool resurt= 采矿脚本.搬运货物1()//
            
            Run_State=95 //不可炼化,搬运货物
            
            case 95: //     搬运货物2
            bool resurt= 采矿脚本.搬运货物2()//
            Run_State=96
            case 96: //   
            bool resurt= 采矿脚本.搬运货物3()//
            Run_State=97
            case 97: //   
            Run_State=98  
            case 98: //     
            Run_State=90  
            
            
            case 99: //
            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
            help.sleep(100)            
            dm.LeftClick()// 左键单击
            help.sleep(100)
            dm.KeyPressChar("N")       //按下"N"键, 关闭货仓  
            Run_State=1
            
            
            
            
            //====================================================================
            //====================================================================
            //====================================================================
            //====================================================================
            
            case 1001://服务器关闭,返航流程
            bool resurt= 采矿脚本.跃迁至空间站()
            Run_State=1002        
            
            
            
            case 1002: //查找《找到选中的物品》
            bool resurt= 采矿脚本.找到选中的物品()
            if (resurt)
                Chazhao_Cishu=10        //10秒
                Run_State=1003 //延时10秒,循环判断是否已经按过<停靠>
                statictext.settext("Static"," 正在进站")  
            else
                Run_State=1004//当找不到时,表示已进站完毕
                Chazhao_Cishu=5        //5秒
                statictext.settext("Static"," : 进站完毕")  
               
            endif   
            
            
            case 1003:                     
            Chazhao_Cishu=Chazhao_Cishu-1
            if (Chazhao_Cishu==0)  
                Run_State=1001 //延时10秒,循环判断是否已经按过<停靠>
            endif
            
            
            case 1004:                     
            Chazhao_Cishu=Chazhao_Cishu-1
            if (Chazhao_Cishu==0)   
                window.closewnd(Game_hwnd)        //关闭游戏
                statictext.settext("Static"," 服务器关闭,自动关闭游戏" )
                return false
            endif
            
            
            
            //====================================================================
            //====================================================================
            //====================================================================
            //====================================================================
            
            case 100://跳跃星门流程  
            bool resurt=采矿脚本.找到选中的物品()
            if (resurt)
                Run_State=105  //表示已经离开空间站,加载跳跃设置
            else
                Run_State=101  //如果没有找到,已经在空间站中,出站
            endif   
            
            //====================================================================
            case 101:
            
            采矿脚本.出站()
            Run_State= 102
            
            case 102:
            bool resurt= 采矿脚本.出站完成判断()
            if (resurt)
                Run_State=103
            endif     
            
            case 103:
            bool resurt= 采矿脚本.出站完成判断()
            if (resurt)
                Run_State=104
            endif
            
            case 104:
            bool   resurt= 采矿脚本.找到选中的物品()
            if (resurt)  
                Run_State=105//表示已经离开空间站  
                statictext.settext("Static"," 出站完成" )
            else
                Run_State=103 //表示还未完成出站,继续判断
            endif   
            case 105:
            
            bool resurt= 采矿脚本.加载跳跃设置()
            if (resurt)
                Run_State=110        
            else      
                statictext.settext("Static"," 找不到<跳跃设置>" )  
                Run_State=105
            endif   
            
            
            //====================================================================
            
            case 110:
            
            bool resurt=采矿脚本.跳跃是否完成()
            if (resurt)
                Run_State=111  //跳跃没有完成,继续跳
                statictext.settext("Static"," 正在跳跃中" )
            else
                Run_State=190  //跳跃完成
                statictext.settext("Static"," 已到达目的地" )
            endif   
            
            
            
            
            
            case 111:
            bool resurt= 采矿脚本.判断总览中是否有东西()
            if (resurt)        
                Run_State=111        //等待系统刷新               
            else
                Run_State=112          // 跳到下一个门   
                dm.KeyPressChar("D")     //按下"D"键, 循环跳跃                  
            endif   
            
            
            case 112:
            Run_State=113          // 等待1秒   
            case 113:
            Run_State=114          // 等待1秒   
            case 114:
            Run_State=115          // 等待1秒   
            case 115:
            Run_State=110          // 等待1秒   
            
            
            case 190:                          
            bool resurt=采矿脚本.跳跃是否完成()
            if (resurt)
                Run_State=111  //跳跃没有完成,继续跳
                statictext.settext("Static"," 正在跳跃中" )
            else
                Run_State=190  //跳跃完成
                statictext.settext("Static"," 已到达目的地" )
            endif   
            
            
            
            
            
            
            
            
            
            //====================================================================
            default:
        endselect
        
    endif
    return true
endfunction





//----------------------------------------------------
function bool 判断是否有通告()
   
   
    index=window.findpic(Game_hwnd,0,0,200,100,"rc:主屏_版本.bmp",#202020,0.6,0,x,y)//找图
    if (index==-1)   
    else     
        //找到后点击   
        dm.KeyPressChar("esc")    //按下"取消"键, 关闭多余窗口
    endif
   
   
    index=window.findpic(Game_hwnd,ping_Wide/2-300,ping_High/2-100,ping_Wide/2+300,ping_High/2+300,"rc:主屏提示_确定.bmp",#202020,0.6,0,x,y)//找图
    if (index==-1)   
    else     
        //找到后点击         
        dm.MoveTo( x+23, y+11)//移动
        help.sleep(200)            
        dm.LeftClick()// 左键单击
        help.sleep(100)
        dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
        
    endif
     
    index=window.findpic(Game_hwnd,ping_Wide/2-300,ping_High/2-100,ping_Wide/2+300,ping_High/2+300,"rc:主屏提示_关闭.bmp",#202020,0.6,0,x,y)//找图
    if (index==-1)   
    else     
        //找到后点击           
        dm.MoveTo( x+23, y+11)//移动
        help.sleep(200)            
        dm.LeftClick()// 左键单击
        help.sleep(100)
        dm.MoveTo( ping_Wide/2 , 10)//鼠标归位               
        return true  
    endif
   
    if (Run_State< 1000)// 已在返航途中,不进行判断
        index=window.findpic(Game_hwnd,ping_Wide/2-300,ping_High*3/10-100,ping_Wide/2+300,ping_High*3/10+100,"rc:主屏提示_离服务器关闭还有.bmp",#303030,0.5,0,x,y)//找图
        if (index==-1)   
        else     
            Run_State= 1001//服务器关闭,紧急入站状态
        endif
    endif
   
   
    return true  
endfunction


//----------------------------------------------------
function bool 出站()                             //出站代码 默认快捷键(L)

            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
            help.sleep(100)            
            dm.LeftClick()// 左键单击
            help.sleep(100)
    dm.KeyPressChar("L")  //按下"L"键, 出站快捷键  
    statictext.settext("Static"," 正在出空间站" )
    return true
endfunction
//----------------------------------------------------
function bool 出站完成判断()
    index=window.findpic(Game_hwnd,ping_Wide/2-200,ping_High/2-170,ping_Wide/2+200,ping_High+170,"rc:主屏提示_准备离站.bmp",#202020,0.5,0,x,y)//找图
    if (index==-1)
         
        index=window.findpic(Game_hwnd,ping_Wide/2-300,ping_High/2-170,ping_Wide/2+300,ping_High+170,"rc:主屏提示_正在进入太空.bmp",#202020,0.5,0,x,y)//找图
        if (index==-1)
            return true
        else
            statictext.settext("Static"," 正在进入太空" )
            return false
        endif
    else              
        statictext.settext("Static"," 准备离站" )
        return false
    endif
   
endfunction



//----------------------------------------------------
function bool  跃迁至采矿地点()  
    index=window.findpic(Game_hwnd,0,0,200,200,"rc:左上角标志.bmp",#505050,0.6,0,x,y)//找图
    if (index==-1)  
        return false  
    else        
        dm.MoveTo( x+7, y+7)//移动
        help.sleep(200)            
        dm.LeftClick()// 左键单击
        help.sleep(400)  
        
        index=window.findpic(Game_hwnd,0,0,200,ping_High,"rc:左上角标志_采矿地点.bmp",#202020,0.6,0,x,y)//找图
        if (index==-1)      
            return false  
        else     
            //找到后点击      
            dm.MoveTo( x+7, y+7)//移动
            help.sleep(200)            
            dm.LeftClick()// 左键单击
            help.sleep(400)  
            
            index=window.findpic(Game_hwnd,0,0,500,ping_High,"rc:左上角标志_采矿地点_跃迁至0m内.bmp",#202020,0.6,0,x,y)//找图
            if (index==-1)   
                return false  
            else     
                //找到后点击        
                dm.MoveTo( x+7, y+7)//移动
                help.sleep(200)            
                dm.LeftClick()// 左键单击
                help.sleep(100)  
                dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
                statictext.settext("Static"," 跃迁至采矿地点" )
                return true  
            endif
            
            
            
            
            
            
            
        endif
        
        
        
        
    endif  
endfunction

//----------------------------------------------------
function bool  跃迁至空间站()  
    index=window.findpic(Game_hwnd,0,0,200,200,"rc:左上角标志.bmp",#505050,0.6,0,x,y)//找图
    if (index==-1)  
        return false  
    else     
        
        dm.MoveTo( x+7, y+7)//移动
        help.sleep(200)            
        dm.LeftClick()// 左键单击
        help.sleep(400)   
        
        
        
        index=window.findpic(Game_hwnd,0,0,200,ping_High,"rc:左上角标志_卸货地点.bmp",#202020,0.6,0,x,y)//找图
        if (index==-1)      
            return false  
        else     
            //找到后点击         
            
            dm.MoveTo( x+7, y+7)//移动
            help.sleep(200)            
            dm.LeftClick()// 左键单击
            help.sleep(400)   
            index=window.findpic(Game_hwnd,0,0,500,ping_High,"rc:左上角标志_卸货地点_停靠.bmp",#202020,0.6,0,x,y)//找图
            if (index==-1)   
                return false  
            else     
                //找到后点击        
               
                dm.MoveTo( x+7, y+7)//移动
                help.sleep(200)            
                dm.LeftClick()// 左键单击
                help.sleep(100)  
                dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
                statictext.settext("Static"," 跃迁至空间站" )
               
                return true  
            endif
            
            
        endif
        
    endif  
endfunction

//----------------------------------------------------
function bool 加载采矿设置()
    index=window.findpic(Game_hwnd,ping_Wide-500,0,ping_Wide,ping_High/2,"rc:总览.bmp",#202020,0.6,2,x,y)//找图
    if (index==-1)
        return false      
    else           
        dm.MoveTo( x+7, y+7)//移动
        help.sleep(200)            
        dm.LeftClick()// 左键单击
        help.sleep(400)  
        x1=x
        y1=y//保存总览坐标
        
        index=window.findpic(Game_hwnd,x1,y1,ping_Wide,ping_High/2,"rc:总览_加载采矿设置.bmp",#202020,0.6,2,x,y)//找图
        if (index==-1)
            return false      
        else         
            dm.MoveTo( x+7, y+7)//移动
            help.sleep(200)            
            dm.LeftClick()// 左键单击
            help.sleep(100)  
            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
            statictext.settext("Static"," 总览_加载采矿设置 " )
            return true     
        endif
        
        
        
        
        
        
        
        
    endif
   
   
endfunction

//----------------------------------------------------
function bool 加载跳跃设置()
    index=window.findpic(Game_hwnd,ping_Wide-500,0,ping_Wide,ping_High/2,"rc:总览.bmp",#202020,0.6,2,x,y)//找图
    if (index==-1)
        return false      
    else           
        dm.MoveTo( x+7, y+7)//移动
        help.sleep(200)            
        dm.LeftClick()// 左键单击
        help.sleep(400)  
        x1=x
        y1=y//保存总览坐标
        
        index=window.findpic(Game_hwnd,x1,y1,ping_Wide,ping_High/2,"rc:总览_加载跳跃设置.bmp",#202020,0.6,2,x,y)//找图
        if (index==-1)
            return false      
        else         
            dm.MoveTo( x+7, y+7)//移动
            help.sleep(200)            
            dm.LeftClick()// 左键单击
            help.sleep(100)  
            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位  
            statictext.settext("Static"," 总览_加载跳跃设置 " )
            return true     
        endif
        
        
    endif
   
   
endfunction
//----------------------------------------------------
function bool 调转船体方向()
    index=window.findpic(Game_hwnd,ping_Wide/2-300,ping_High/2,ping_Wide/2+300,ping_High-170,"rc:主屏提示_跃迁引擎启动.bmp",#202020,0.6,0,x,y)//找图
    if (index==-1)
        statictext.settext("Static"," 调转船体方向" )        
        return false  
    else         
        statictext.settext("Static"," 跃迁引擎启动 " )
        return true  
    endif
   
   
endfunction
//----------------------------------------------------
function bool 跃迁引擎启动()  
    index=window.findpic(Game_hwnd,ping_Wide/2-300,ping_High/2,ping_Wide/2+300,ping_High-170,"rc:主屏提示_跃迁引擎启动.bmp",#202020,0.6,0,x,y)//找图
    if (index==-1)
        statictext.settext("Static"," 跃迁引擎停止" )
        return false  
    else         
        statictext.settext("Static"," 跃迁引擎启动 " )
        return true         
    endif
endfunction
//----------------------------------------------------
function bool 找到选中的物品()
    index=window.findpic(Game_hwnd,ping_Wide-500,0,ping_Wide,ping_High*3/10,"rc:总览_选中的物品.bmp",#202020,0.6,2,x,y)//找图
    if (index==-1)
        statictext.settext("Static"," 找不到<选中的物品>" )
        return false      
    else         
        statictext.settext("Static"," 找到<选中的物品>" )
        x2=x
        y2=y//保存坐标               
        return true     
    endif
endfunction

//----------------------------------------------------
function bool 设置总览焦点()   
    dm.MoveTo( x1+10, y1+57)//移动
    help.sleep(200)            
    dm.LeftClick()// 左键单击
    help.sleep(100)  
    dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
   
    statictext.settext("Static"," 设置总览焦点" )
    return true
endfunction
//----------------------------------------------------
function bool 判断总览中是否有东西()
    index=window.findpic(Game_hwnd,x1,y1,ping_Wide,y1+300,"rc:总览_没有发现任何东西.bmp",#303030,0.5,0,x,y)//找图
    if (index==-1)
        //statictext.settext("Static"," 逐个判断是否是所需矿物" )
        
        dm.MoveTo( x1+10, y1+72)//移动
        help.sleep(200)            
        dm.LeftClick()// 左键单击
        help.sleep(100)  
        dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
        return false      
    else        
        statictext.settext("Static"," 总览中没有发现任何东西" )
        return true        
    endif
endfunction








//----------------------------------------------------
function bool 找到总览_没有选择物品()
    index=window.findpic(Game_hwnd,x2,y2,ping_Wide,y2+500,"rc:总览_没有选择物品.bmp",#202020,0.6,0,x,y)//找图
    if (index==-1)   
        return false      
    else               
        return true        
    endif
endfunction



//----------------------------------------------------
function bool 找到仓库_左上角定位()
    index=window.findpic(Game_hwnd,0,0,ping_Wide,ping_High,"rc:仓库_左上角定位1.bmp",#303030,0.5,2,x,y)//找图
    if (index==-1)
        
        index=window.findpic(Game_hwnd,0,0,ping_Wide,ping_High,"rc:仓库_左上角定位2.bmp",#303030,0.5,2,x,y)//找图
        if (index==-1)
            
            index=window.findpic(Game_hwnd,0,0,ping_Wide,ping_High,"rc:仓库_左上角定位3.bmp",#303030,0.5,2,x,y)//找图
            if (index==-1)
                statictext.settext("Static"," 找不到<仓库_右上角>" )
                return false      
            else               
            endif
        else              
        endif   
    else            
    endif
        dm.MoveTo( x+104, y+7)//移动
        help.sleep(200)            
        dm.LeftClick()// 左键单击
        help.sleep(100)  
        dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
        x4=x
        y4=y//保存总览坐标
        statictext.settext("Static"," 切换到列表图" )  
        return true   
endfunction


//----------------------------------------------------
function bool 找到仓库_Index()
    index=window.findpic(Game_hwnd,0,y4-100,x4,y4+200,"rc:仓库_Index.bmp",#303030,0.5,0,x,y)//找图
    if (index==-1)
        statictext.settext("Static"," 没有找到仓库_Index" )
        return false      
    else      
        
        x3=x
        y3=y
        
        //找到左箭头,点击一下
        index=window.findpic(Game_hwnd,x3,y3-100,x4,y3+200,"rc:仓库_左箭头.bmp",#303030,0.5,0,x,y)//找图
        if (index==-1)
        statictext.settext("Static"," 没有找到仓库_左箭头" )
            
        return false      
        else  
             dm.MoveTo( x+15,y+10)//移动
            help.sleep(200)            
            dm.LeftClick()// 左键单击
            help.sleep(100)  
            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位  
                statictext.settext("Static"," 找到仓库_Index和左箭头" )
            
        return true  
            
        endif      
    endif
endfunction

//----------------------------------------------------
function bool 找到向下箭头()
    index=window.findpic(Game_hwnd,x3,y3,x4,y3+300,"rc:仓库_向下箭头_未选中.bmp",#303030,0.5,0,x,y)//找图
    if (index==-1)
        index=window.findpic(Game_hwnd,x3,y3,x4,y3+300,"rc:仓库_向下箭头_选中.bmp",#303030,0.5,0,x,y)//找图
        if (index==-1)      
            statictext.settext("Static"," 收舱完毕" )
            return true  
        else        
            dm.MoveTo( x+5, y+3)//移动
            help.sleep(200)            
            dm.LeftClick()// 左键单击
            help.sleep(100)  
            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
            statictext.settext("Static"," 正在收舱" )
            return false      
        endif
        
    else      
        dm.MoveTo( x+5, y+3)//移动
        help.sleep(200)            
        dm.LeftClick()// 左键单击
        help.sleep(400)   
        dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
        statictext.settext("Static"," 正在收舱" )  
        return false         
    endif
endfunction

//----------------------------------------------------
function bool 找到物品机库()
    index=window.findpic(Game_hwnd,x3,y3,x4,y3+300,"rc:仓库_物品机库.bmp",#404040,0.5,0,x,y)//找图
    if (index==-1)   
        statictext.settext("Static"," 没有找到<物品机库>" )
        
        return false   
    else      
        statictext.settext("Static"," 找到<物品机库>" )
        x5=x
        y5=y
        return true        
    endif
endfunction


//----------------------------------------------------
function bool 找到名字()
    index=window.findpic(Game_hwnd,x3,y3,x4,y3+300,"rc:仓库_名字.bmp",#303030,0.5,0,x,y)//找图
    if (index==-1)   
        statictext.settext("Static"," 没有找到<名字>" )
        x6=x4
        y6=y4 +50
        return true      
    else      
        statictext.settext("Static"," 找到<名字>" )
        x6=x
        y6=y
        return true        
    endif
endfunction

//----------------------------------------------------
function bool 点击船仓()
    dm.MoveTo( x3+23, y3+30)//移动
    help.sleep(200)            
    dm.LeftClick()// 左键单击
    help.sleep(100)  
    dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
   
    return true  
endfunction

//----------------------------------------------------
function bool 是否有货物()
    index=window.findpic(Game_hwnd,x3,y3,ping_Wide,y3+500,"rc:仓库_没有发现任何物品.bmp",#303030,0.5,0,x,y)//找图
    if (index==-1)   
        statictext.settext("Static"," 还有货物" )
        return false     
    else      
        statictext.settext("Static"," 没有发现任何物品" )
        return true   
    endif  
endfunction


//----------------------------------------------------
function bool 点击向下箭头()
    dm.MoveTo( x3+5, y3+30)//移动
    help.sleep(200)            
    dm.LeftClick()// 左键单击
    help.sleep(100)  
    dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
   
    return true  
endfunction
//----------------------------------------------------
function bool 找矿石舱()
    index=window.findpic(Game_hwnd,x3,y3,x3+200,y3+200,"rc:仓库_矿石舱.bmp",#303030,0.5,0,x,y)//找图
    if (index==-1)   
        statictext.settext("Static"," 没有矿石舱" )
        return false     
    else        
            dm.MoveTo( x+35, y+8)//移动
            help.sleep(200)            
            dm.LeftClick()// 左键单击
            help.sleep(100)  
            dm.MoveTo( ping_Wide/2 , 10)//鼠标归位
        statictext.settext("Static"," 找到矿石舱" )
   
        return true   
    endif  
endfunction

//----------------------------------------------------
function bool 找仓库_满仓()
    index=window.findpic(Game_hwnd,x4-15,y4,x4,y4+70,"rc:仓库_满仓.bmp",#303030,0.5,0,x,y)//找图
    if (index==-1)     
        return false     
    else         
        return true   
    endif  
endfunction

//----------------------------------------------------
function bool 搬运货物1()  
   
   
    dm.MoveTo( x6+23, y6+30)//移动,货物
    help.sleep(200)              
    dm.LeftDown()// 左键按下
   
   
    return true   
endfunction
//----------------------------------------------------
function bool 搬运货物2()  
   
    dm.MoveTo( x5+30, y5+8)//移动到货柜  
    help.sleep(200)   
    dm.LeftUp()// 左键抬起
    help.sleep(200)  
    dm.MoveTo( ping_Wide/2 , 10)//鼠标归位            
    return true   
endfunction

//----------------------------------------------------
function bool 搬运货物3()  
            
    dm.MoveTo( x5+30, y5+8)//移动到货柜
            help.sleep(100)            
            dm.LeftClick()// 左键单击
    help.sleep(100)  
    dm.MoveTo( ping_Wide/2 , 10)//鼠标归位   
   
    return true   
endfunction


//----------------------------------------------------
function bool  跳跃是否完成()  
    index=window.findpic(Game_hwnd,0,0,300,300,"rc:跳跃_路径.bmp",#505050,0.6,0,x,y)//找图
    if (index==-1)  
        return false        
    else      
        return true //没找到,表示跳跃完成
    endif  
endfunction




function bool check48_click()//置顶显示
   
    bool state
   
    state=check.getstate("check48")
    if (state == true)
        window.setwindowtop(My_hwnd,true)//置顶
            state=check.getstate("check1")
            if (state == true)
                 dm.SetWindowTransparent(Game_hwnd, 0)          //隐藏显示
            else
                 dm.SetWindowTransparent(Game_hwnd,255)          //回复显示
            endif
    else
        window.setwindowtop(My_hwnd,false) //取消置顶
        window.activate(My_hwnd)        //激活
                 dm.SetWindowTransparent(Game_hwnd,255)          //回复显示
        
    endif
   
        if (running==true)
            state=check.getstate("check48")
            if (state == true)  
                dm.LockInput (1) //锁定键盘鼠标
            else  
                dm.LockInput (0) //解锁键盘鼠标
            endif
        endif
   
   
   
    return true
endfunction






function bool check1_click()//隐藏程序
   
   
    bool state
   
    state=check.getstate("check1")
    if (state == true)
         dm.SetWindowTransparent(Game_hwnd, 0)          //隐藏显示
    else
         dm.SetWindowTransparent(Game_hwnd,255)          //回复显示
    endif
     
   
   
   
return true
endfunction



endnamespace
//空间结束语句
回复 支持 反对

使用道具 举报

发表于 2013-10-28 19:04:02 | 显示全部楼层
lizxcv 发表于 2013-4-22 12:44
#import "dm.dmsoft" dm
namespace 采矿脚本
//定义默认空间

我擦  大神啊·
回复 支持 反对

使用道具 举报

发表于 2013-10-28 19:30:33 | 显示全部楼层
当时听朋友说玩这个游戏要有耐心。。果断直接忽略掉了。
回复 支持 反对

使用道具 举报

发表于 2014-1-21 22:01:55 | 显示全部楼层
好长。。不过这个是网上的脚本吧。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条

关闭

小黑屋|TC官方合作论坛 (苏ICP备18045623号)

GMT+8, 2024-9-28 23:47 , Processed in 0.057954 second(s), 23 queries .

Powered by 海安简单软件服务部

© 2008-2019 版权所有 保留所有权利

快速回复 返回顶部 返回列表