看流星社区

 找回密码
 注册账号
查看: 2526|回复: 1

高手来看看怎么在这段代码中加角色死亡关机命令

[复制链接]

该用户从未签到

发表于 2011-3-11 10:14:43 | 显示全部楼层 |阅读模式
[ScriptOption]
Description=武林外传脚本  
BeginHotkey= 121
BeginHotkeyMod= 0
EndHotKey= 122
EndHotKeyMod= 0
Enable= 1
RunOnce= 0
Type= 1
Number= 1
ScriptFormat= 0
[Comment]
快捷键:、普通攻击;F1、连续技能;、拾取;、为辅助技能;、为辅助技能;  
        8、为辅助技能;、回城;、打坐。、红药;、蓝药。  

[InitVar]
UserVar=血量下限(%)|VarName=Var5|Type=Long|Value= 50  
UserVar=低血保护(%)|VarName=Var1|Type=Long|Value= 40  
UserVar=魔力下限(%)|VarName=Var6|Type=Long|Value= 40  
UserVar=低魔保护(%)|VarName=Var2|Type=Long|Value= 30  
UserVar=技能F1延时(秒)|VarName=Var3|Type=Long|Value= 12  
UserVar=技能延时(秒)|VarName=Var4|Type=Long|Value= 0  
UserVar=技能延时(秒)|VarName=Var7|Type=Long|Value= 0  
UserVar=技能延时(秒)|VarName=Var8|Type=Long|Value= 1800  
UserVar=挂主攻怪|VarName=Var9|Type=DownList|Value= 1|Enum=是;否  

[VBSScriptCode]
[Main]
Dim address,xiel,xiels,mol,mols,HWnd,getexp,nowexp
Sub Main()
  HWnd=HApp.getAcceptHwnd()
  'MessageBox HWnd
  Delay 500
  addres0=HMEM.Read32Bit(HWnd,&H12F82C)+&H24
  address=HMEM.Read32Bit(HWnd,addres0)+&H254
  'address=&H6C53940
  If Var7>0 Then
    HApp.SendKeypress HWnd,"7"
    Delay 1000
    jn7t=GetTime
  End If
  If Var8>0 Then
    HApp.SendKeypress HWnd,"8"
    Delay 1000
    jn8t=GetTime
  End If
  nowexp=0:getexp=0
  Caption="Yaofei提示你:当前经验:"&HMEM.read32Bit(HWnd,address+&H8)&".挂机所得经验:"&getexp'"/"&"升级所需经验:"&HMEM.read16Bit(HWnd,&H89E650+4*HMEM
ad8Bit(HWnd,address-&H8))
  HWindow.SetCaption HWnd,Caption
  addxie=GetTime:addxien=0
  Do While 1=1
    nowexp=HMEM.read32Bit(HWnd,address+&H8)
    xiels=HMEM.read16Bit(HWnd,address+&H18)
    mols=HMEM.read16Bit(HWnd,address+&H1C)
    xiel=HMEM.read16Bit(HWnd,address)
    If 100*xiel-Var1*xiels<=0 Then
        HApp.SendKeypress HWnd,"0"
        Do
          Delay 50
          xiel=HMEM.read16Bit(HWnd,address)
          If HMEM.read32Bit(HWnd,address+&H544)<>0 Then
            Delay 100
            
            HApp.SendKeypress HWnd,"F1"
            Delay 100
            HApp.SendKeypress HWnd,"F1"
            Do
                Delay 100
            Loop While HMEM.read32Bit(HWnd,address+&H544)<>0
            HApp.SendKeypress HWnd,"0"
          End If
        Loop While xiel-xiels<0
        ' Else
        'If 100*xiel-Var5*xiels<=0 And (GetTime-addxie)\8000-addxien>=0 Then
        '   HApp.SendKeypress HWnd,"4"
        ' End If
    End If
    mol=HMEM.read16Bit(HWnd,address+&H4)
    If 100*mol-mols*Var2<=0 Then
        HApp.SendKeypress HWnd,"0"
        Do
          Delay 100
          mol=HMEM.read16Bit(HWnd,address+4)
          If HMEM.read32Bit(HWnd,address+&H544)<>0 Then
            HApp.SendKeypress HWnd,"F1"
            Do
                Delay 100
            Loop While HMEM.read32Bit(HWnd,address+&H544)<>0
            gett=GetTime
            Do
                HApp.SendKeypress HWnd,"3"
                Delay 100
            Loop While GetTime-gett<=1000
            HApp.SendKeypress HWnd,"0"
          End If
        Loop While mol-mols<0
    Else
        If 100*mol-mols*Var6<=0 Then HApp.SendKeypress HWnd,"5"
    End If
    If Var7>0 Then
        If GetTime-jn7t-1000*Var7>=0 Then
          HApp.SendKeypress HWnd,"7"
          Delay 1000
          jn7t=GetTime
        End If
    End If
    If Var8>0 Then
        If GetTime-jn8t-1000*Var8>=0 Then
          HApp.SendKeypress HWnd,"8"
          Delay 1000
          jn8t=GetTime
        End If
    End If
    If Var9=trim("是") Then  
        Do While HMEM.read32Bit(HWnd,address+&H544)<>0
          Call attack
          Delay 200
        Loop
    Else
        qt=GetTime
        Do While HMEM.read32Bit(HWnd,address+&H544)=0
          HApp.SendKeypress HWnd,"Tab"
          Delay 300
          If GetTime-qt>=8000 Then Exit Do
        Loop
        Call attack
    End If
    Do While HMEM.read32Bit(HWnd,address+&H544)<>0
        Call attack
        Delay 200
    Loop
    Delay 100
  Loop
End Sub
Sub attack()
  a=GetTime:an=0:jn2=0:jn3=0
  Do
    HApp.SendKeypress HWnd,"1"
    'Delay 500
    If Var3>0 And (GetTime-a)\(1000*Var3)-jn2>=0 Then
        HApp.SendKeypress HWnd,"F1"
        Delay 100
        jn2=jn2+1
    End If
    If HMEM.read16Bit(HWnd,address+&H544)=0 Then Exit Do
    If GetTime-a>20000 Then Exit Do
    If Var4>0 And (GetTime-a)\(1000*Var4)-jn3>=0 Then
        HApp.SendKeypress HWnd,"F1"
        Delay 100
        jn3=jn3+1
    End If
    If HMEM.read16Bit(HWnd,address+&H544)=0 Then Exit Do
    If GetTime-a>18000 Then Exit Do
    xiels=HMEM.read16Bit(HWnd,address+&H18)
    xiel=HMEM.read16Bit(HWnd,address)
    If 100*xiel-Var5*xiels<=0 And (GetTime-a)\8000-an>=0 Then
        HApp.SendKeypress HWnd,"4"
        an=an+1
    End If
    If GetTime-a>20000 Then Exit Do
  Loop While HMEM.read32Bit(HWnd,address+&H544)<>0
  jt=GetTime
  Do
    HApp.SendKeypress HWnd,"3"
    Delay 100
  Loop While GetTime-jt<=1500
  If HMEM.read32Bit(HWnd,address+&H8)-nowexp>=0 And leverup=0 Then
    getexp=getexp+HMEM.read32Bit(HWnd,address+&H8)-nowexp
  Else
    leverup=1
    getexp=getexp+HMEM.read32Bit(HWnd,address+&H8)-tempexp
    tempexp=HMEM.read32Bit(HWnd,address+&H8)
  End If
  Caption="Yaofei提示你:当前经验:"&HMEM.read32Bit(HWnd,address+&H8)&".挂机所得经验:"&getexp  
  HWindow.SetCaption HWnd,Caption
End Sub
[MainEnd]
[VBSLib]
\MyLib\Default.Txt
[EndVBSLib]
[PublicVar]

[EndPublicVar]




只想加         个死亡自动关机代码 怎么加 请大虾指教  
谢谢

该用户从未签到

发表于 2011-3-11 10:15:00 | 显示全部楼层
游侠的代码,加个判断:If xiel=HMEM.read16Bit(HWnd,address)=0 Then
                              RunApp "Shutdown.exe -s -t 10"
                          End If
点击按钮快速添加回复内容: 支持 高兴 激动 给力 加油 苦寻 生气 回帖 路过 感恩
您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

小黑屋|手机版|Archiver|看流星社区 |网站地图

GMT+8, 2024-5-4 01:58

Powered by Kanliuxing X3.4

© 2010-2019 kanliuxing.com

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