背景:
阅读新闻

知秋脚本_设点驯兽_不用魔法杀动物

[日期:2006-12-18] 来源:  作者:知秋 [字体: ]

;作者:知秋
;QQ:190352
;使用前一定要将客户端设成英文模式。
;
;可以设点,并保存供以后调用的驯兽脚本。
;使用杀掉放野的生物功能时,请在身上放些绷带,并开好自动使用绷带的脚本。
;因为脚本是使用魔法的火球术杀掉生物,所以最好是身上穿有100%省药装或带足够的药。
;如果要自己设点,就不要选择“随机走动”功能,否则设的点无效。
;设的点必须是第1个和最后一个能够相连,每两个点之间的间隔一般定在20步以内,最好设小点。
;自动搜索范围我一般设14个点,基本上能够把你所能见到的生物找到。根据情况自己定吧。

;设点功能:
;增加:走到一个点上,按“增加”,就可以把你所处的位置“追加”到最后面;
;我靠近哪:在你停卡驯兽时,你可以使用此功能查看你离设置的哪个点最近;
;走到:可以走到相连的最近的前后两个点上
;重设:清空已设的点

;保存:请在文件名处输入完整的文件名及路径,路径不能使用长文件名,不能有空格等符号。 保存过程很慢,所以请等待“保存成功”提示出现。
;保存功能设置:一定要在EUO里的tools菜单下-options里的Permissions项目里,把"Disable Execute"前面的勾勾去掉才能保存。
;脚本安全:在保存时才把那勾勾去掉,保存完毕后一定要把勾勾打回,要不然你的EUO就变得极不安全了。

;调出:在文件名处输入完整的文件名及路径即可调出已保存的点。
;开始驯兽时,脚本会自动判断你当前最靠近哪个点。

initevents

set %GetTameID 0

set %TameSkill 0
set %CanDist 3
set %myPetName NoNo
set %spot 1
set %maxSpot 11
set %MaxDangerSpot 1

gosub initmenu

set %spotNum 0
set %CurrentSpot 0

set %FoundCount 0

set %randwalkCount 0

set %CheckCount 0

;gosub setspot


MainLoop:
 if %SpotNum > 0 && #MENUBUTTON = Starting
  gosub CheckSpot
 if #MenuButton = CheckSpot
 {
  set #menuButton N/A
  gosub CheckSpot
 }
 if #menubutton = menualTame
  gosub menualGet
 if #MenuButton = AddSpot
  gosub Addspot
 if #menuButton = GotoSpot
  gosub GotoSpot
 if #menuButton = ResetSpot
  gosub ResetSpot
 if #menuButton = SaveSpot
  gosub SaveSpot
 if #menuButton = LoadSpot
  gosub LoadSpot
 if #MENUBUTTON = Starting
  goto Begin
 if #MenuButton = Closed
  halt

 wait 10
 menu set jStatus 程序已暂停...
 goto MainLoop

Begin:
 gosub GetTameID
 if #Result = NextSpot
 {
  menu get RandWalk
  if #menuRes = #True
  {
   set %RandWalkCount %RandWalkCount + 1
   if %RandWalkCount >= 10
   {
    set %RandWalkCount 0
    ignoreitem reset
   }
   gosub RandOmWalk
   goto MainLoop
  }
  gosub GotoNextSpot
  goto MainLoop
 }
 if #Result = Cancel
  goto MainLoop
L1:
;-----------------------------------------------
 gosub CheckTameID
 if #Result = Nothing
  goto MainLoop
;-----------------------------------------------
 if #Result = GotoNextSpot
  gosub GotoNextStop
;-----------------------------------------------
 if #Result = ClosetoIT
  gosub CloseToIT
;-----------------------------------------------
 if #Result = CanTame
 {
  gosub TameIT
  goto mainLoop
 }
;-----------------------------------------------
 if #Result = Ignore
  ignoreitem %TameID
;-----------------------------------------------
goto MainLoop

sub GetTameID
 if %GetTameID = #True
  return
 
  
 set %GetTameID #True
 menu get AutoGetTameID
 if #menuRes = #False
 {
  set %GetTameID #False
  return Cancel
 }
 menu set jStatus 正在搜索生物...
  
 Menu GetNum FindDist 4
 set %FindDist #MenuRes
 
 set %MinDist %FindDist
 set %Mi 0
 set %Found 0
 set %TameID 0
 gosub TamingCheckSkill
 if #Random < 100
  event macro 21
Loop1:
 Menu GetNum FindDist 4
 set %FindDist #MenuRes
 set %Mi %Mi + 1
 finditem %TameAble %Mi G_ , %FindDist
 if #FindKind = -1 && %Found = 0
 {
  set %CheckCount %CheckCount + 1
  menu set jStatus 在搜索范围内找不到生物...第 %CheckCount 次
  menu get checktimes
  set %Checkresult Cancel
   set %GetTameID #False
  if %CheckCount >= #MenuRes
  {
   set %CheckCount 0
   set %CheckResult NextSpot
  }
  return %CheckResult
   
 }
 if #FindKind = -1
 {
  menu set jStatus 找到生物
  set %OldTameID %TameID
  return Found
 }
 

 if #FindID = %TameID
  goto Loop1

 set %Found %Found + 1

        menu set jStatus 状态:找到第 %Found 只生物。

 if %Found = 1
 {
  set %MinDist #FindDist
  set %TameID #FindID
  set %TameX #FindX
  set %TameY #FindY
  set %TameZ #FindZ
  set %TameDist #FindDist
  set %TameType #FindType
         event exmsg %TameID 3 30 I am No: %Found !
  goto Loop1
 }
 
 if #FINDDIST < %MinDist && %OldTameID <> %TameID
 {
  set %MinDist #FindDist
  set %TameID #FindID
  set %TameX #FindX
  set %TameY #FindY
  set %TameZ #FindZ
  set %TameDist #FindDist
  set %TameType #FindType
 }

        event exmsg %TameID 3 30 I am No: %Found !

 if #Random < 300 && %OldTameID <> %TameID
 {
  menu set jStatus 随机选了一只..
  set %OldTameID %TameID
  return
 } 

 if %MinDist <= %CanDist && %OldTameID <> %TameID
 {
  menu set jStatus 状态:第 %Mi 只生物在可驯范围.
  set %OldTameID %TameID
  return
 }
 goto Loop1
 
SubGetTameIDEnd:
return

sub menualGet
 menu get AutoGetTameID
 if #menuRes = #True
  menu set AutoGetTameID #False
  
 if #TargCurs = 1
 {
  menu set jStatus 状态:因为上一个动作的目标指定未完成,不能指定训兽目标
  set %GetTameID #False
  set #menubutton N/A
  return
 }
 set #LtargetID N/A
 menu set jStatus 状态:请手动指定目标...
 set %GetTameID #False
 set #menubutton N/A
 set %tameID 0

 set #TARGCURS 1
menualgetloop:
 wait 1s
 if #Targcurs = 0
 {
  if #LtargetID <> N/A
  {
   set %GetTameID #True
   set %tameID #LTARGETID
   set #menubutton Starting
  }
  return
 }
  goto menualgetloop
return

  
sub CheckTameID
 if %GetTameID = #False
  return Nothing

 set %GetTameID #False
 
 finditem %TameID G_20
 if %TameID = 0 || #FindKind = -1
 {
  event exmsg #charid 3 0 No No No.
  menu set jStatus 您当前无当驯服这个生物,可能该生物已被您驯过
  return Nothing
 }
 if #FindDist > 3
  return CloseToIT
 if #FindDist <= 3
  return CanTame
return Nothing

sub CloseToIT
 menu get AutoFollow
 if #menuRes = #False
  return Ignore
 set %j 0 
Loop2:
 finditem %TameID G_ , 20
 if #FindKind = -1
  return Ignore
  
 if #FindDist <= %CanDist
  return CanTame

 set %j %j + 1
 menu set jStatus 指定目标太远,正在靠近...第 %j 次
 if %j >= 5
 {
  menu set jStatus 经过5次尝试仍不能靠近生物,放弃...
  return Ignore
 }

 set %oldx #CHARPOSX
 set %oldy #CHARPOSY
 event pathfind #findx #findy #findz
 wait 2s
 if %oldx = #CHARPOSX && %oldy = #CHARPOSY
 {
  menu set jStatus 您好象不能靠近该生物,放弃...
  
  return Ignore
 }
 goto Loop2
return

sub TameIT
 set %tameCount 0
tameloop:
        finditem %TameID G_ , %CanDist
 if #FindKind = -1
 {
         event exmsg %TameID 3 50 HA I run Away !
         menu set jStatus 状态:生物离开可驯范围...
         return
 }
        event exmsg %TameID 3 50 Hei...You,Come Here Please..
        wait 1s
 set %tamecount %tamecount + 1
 if %tamecount >= 15
 {
  menu set jStatus 状态:经过15次重试后仍未能驯服该生物,放弃.
  ignoreitem %tameid
  return
 }
 
 menu set jStatus 状态:正在驯兽...第 %TameCount 次
 set %tamejournal #jindex + 1
 set %tamefollow #followers
 set #ltargetid %tameid
 set #ltargetkind 1
 event macro 13 35
 target
 event macro 22

    gosub TamingMonitor
    if #result = success
    {
     menu set jStatus 状态:驯兽成功.
     event exmsg %tameid 3 0 Hello!my friends!come here.
     wait 1s
     menu get releaseit
     set %releaseit #menuRes
     
     if %releaseit = -1
         gosub tamingRelease
        return
    }
    if #result = retry
    {
     menu set jStatus 状态:失败,正在重试...
        goto TameLoop
    }
    if #result = retrylater
    {
 ignoreitem %tameid
        return
    }
    if #result = ignore
    {
     menu set jStatus 状态:驯兽失败,可能生物已不存在...
 ignoreitem %tameid
        return
    }
    if #result = cancel
    {
    menu set jStatus 状态:驯兽取消...
 ignoreitem %tameid
        return
    }
    if #result = skill
    {
    menu set jStatus 状态:驯兽技能不够,放弃该生物...
 ignoreitem %tameid
        return
    }

return

sub TamingMonitor
    set %movetimer 0
    set %tametimer #systime + 15000
 set %tmpzzz 0
    TamingMonitorLoop:
 set %tmpzzz %tmpzzz + 1
 menu get AutoFollow
 set %AutoFollow #menuRes
 if %tmpzzz >= 20 && %AutoFollow = -1
 {
  set %tmpzzz 0
  finditem %tameid
  if #Finddist > 5
  {
   set %tmpyyy #findy - 2
   event pathfind #Findx %tmpyyy #Findz
  }
 }
    if #jindex >= %tamejournal
    {
        scanjournal %tamejournal
        set %tamejournal %tamejournal + 1
        if seems_to_accept in #journal
            return success
        if that_animal_looks in #Journal
           return ignore
        if anger_the_beast in #journal
            return retry
        if fail_to_tame in #journal
            return retry
        if too_far in #journal
            return retry
        if clear_path in #journal
            return retry
        if too_many_followers in #journal
            return cancel
        if can't_see_that in #journal
            return retrylater
        if too_angry in #journal
            return retrylater
        if distracted in #journal
            return retrylater
        if someone_else in #journal
            return retrylater
        if tame_already in #journal
            return ignore
        if target_cannot in #journal
            return ignore
        if cannot_be_tamed in #journal
            return ignore
        if can't_tame_that in #journal
            return ignore
        if no_chance in #journal
            return skill
    }
    if #followers > %tamefollow
        return success
    if #systime > %tametimer
        return retry
    finditem %tameid G_20
    if #findkind = -1
        return ignore
    goto TamingMonitorLoop
return

sub tamingRelease
 menu set jStatus 状态:正在放弃已驯的生物...
 gosub setTameName
    set %tamefollow #followers
    set %tmpii 0
    TamingReleaseLoop:
 if %tamefollow > #Followers
 {
  gosub killmytamePet
  return
 }

    set %tmpii %tmpii + 1
    finditem %tameid
    if #findkind = -1 || %tmpii >= 6
 {
  click #CURSORX #CURSORY r
         return
 }

    gosub GetAnimalDisplacement
 set %tmpjj 0
DragStatusLoop:   
    finditem %tameid
    if #FindKind = -1
 return
 set %tmpjj %tmpjj + 1
 if %tmpjj > 4
 {
     event macro 1 0 All Come
  set %tmpjj 0
  gosub randomwalk
 }
    gosub GetScreenXY #findx #findy #findz 0 %screenydisp
        click %screenx %screeny G
        wait 10
        click %screenx %screeny P
        wait 10

 if #ContName = Status_Gump
 {
  if #ContID = #CharID
  {
   contpos 772 654
   set %tmpjj 0
   gosub randomwalk
   goto DragStatusLoop
  }
  contpos 609 2
  if #contid <> %tameid
  {
   click 721 25 r
       goto DragStatusLoop
  }
  if #contid = %tameid
   goto RenameIT
 }
 goto DragStatusLoop
RenameIT:
    if #contid = %tameid
    {
     set %rename 0
        gosub TamingRename
        if %rename = 0
         goto TamingReleaseLoop
        set %tmpi 0
 tamingreleasetmploop1:
        event macro 1 0 %tamename Release
 wait 15
 set %tmpi %tmpi + 1
 if %tmpi >= 6
  goto TamingReleaseLoop
        wait 10
        if #CONTNAME <> generic_gump
  goto tamingreleasetmploop1
 click 88 141
 wait 2s
 if %tamefollow > #Followers
 {
  menu get Killit
  set %killit #menuRes
  if %killit = -1
   gosub killmytamePet
  if %Killit = #False
   ignoreitem %tameID
  return
 }
    }
    goto TamingReleaseLoop
return

sub killmytamePet
killpetloop:
 finditem %tameid
 if #Findkind = -1
  return
 if #Targcurs = 1
 {
  wait 1s
  goto killpetloop
 }
 event pathfind #Findx #Findy #Findz
; event macro 15 17
; target 6s
; if #TARGCURS = 1
; {
  set #LTARGETID %tameid
  set #LTARGETKIND 1
  set #LOBJECTID %tameid
  event macro 27
;  event macro 22
;  wait 1s
; }
 goto killpetloop
return
sub TamingRename
    set %screenx 721
    set %screeny 25
    for %i 1 10
    {
 click %screenx %screeny
     if #contid <> %tameid
     {
      set %rename 0
      return
     }
        key BACK
    }
    if #contid <> %tameid
    {
     set %rename 0
     return
    }
    click %screenx %screeny
    msg %tamename
    msg $
    click %screenx %screeny r
    set %rename 1
return

sub GetAnimalDisplacement
    set %screenydisp -32
    if %tametype in GE_ZD_L_M_TF__IG_NG__ZF_PF_EG_CO_TG_PG_VD
        set %screenydisp -25
    if %tametype in AH
        set %screenydisp -45
    if %tametype in DG_AG_WC_RF_WG_TC
        set %screenydisp -15
return

sub GetScreenXY
    set %1 ( %1 - #charposx ) * 22  ; world x-coordinate
    set %2 ( #charposy - %2 ) * 22  ; world y-coordinate
    set %3 ( %3 - #charposz ) * 4   ; world z-coordinate
    if %0 < 4 || %4 = N/A
        set %4 0                    ; x displacement, added to screen coordinate
    if %0 < 5 || %5 = N/A
        set %5 35                   ; y displacement, added to screen coordinate
    set %screenx #clileft + #clixres / 2 + %1 + %2 + %4
    set %screeny #clitop + #cliyres / 2 + %1 - %2 - %3 + %5
    set %offscreen #true
    if %screenx > #clileft &&
        + %screeny > #clitop &&
        + %screenx < ( #clileft + #clixres ) &&
        + %screeny < ( #clitop + #cliyres )
    {
        set %offscreen #false
        ;click %screenx %screeny F
    }
return
sub WalkToNextSpot
 msg ....$
 set %spot %spot + 1
 if %spot > %maxSpot
  set %spot 1
  
 set %tmpi 0
walkloop:
 event pathfind %x . %spot %y . %spot %z . %spot
 wait 6s
 set %tmpx1 %x . %spot
 set %tmpy1 %y . %spot
 set %tmpx #CHARPOSX - %tmpx1 abs
 set %tmpy #CHARPOSY - %tmpy1 abs
 set %tmpi %tmpi + 1
 if %tmpi > 2
  return
 if %tmpx > 2 || %tmpy > 2
  goto walkloop
 return
return
sub TamingCheckSkill
    chooseskill anim
    if #skill = #skillcap
    {
        display ok Taming skillcap reached
        halt
    }
    if %tameskill = #skill
        return
    set %tameskill #skill

    if %tameskill >= 0 && %tameskill < 40
        set %tameable HG_RD_NF_BE_NF_GO_WC
    if %tameskill >= 40 && %tameskill < 160
        set %tameable HG_RD_NF_BE_NF_GO_WC_RF_AG_KB_WG_WG
    if %tameskill >= 160 && %tameskill < 220
        set %tameable HG_RD_NF_BE_NF_GO_WC_RF_AG_KB_WG_WG_IG_NG_ZF_JF_TF_PF
    if %tameskill >= 220 && %tameskill < 280
        set %tameable HG_RD_NF_BE_NF_GO_WC_RF_AG_KB_WG_WG_IG_NG_ZF_JF_TF_PF_TC
    if %tameskill >= 280 && %tameskill < 340
        set %tameable GO_WC_RF_AG_KB_WG_WG_IG_NG_ZF_JF_TF_PF_TC_BB_TG_VE_PG
    if %tameskill >= 340 && %tameskill < 380
        set %tameable WC_RF_AG_KB_WG_WG_IG_NG_ZF_JF_TF_PF_TC_BB_TG_VE_PG_CO_CG_JG_ZGB_XF_SF_MG_SG_OF_EG
    if %tameskill >= 380 && %tameskill < 460
        set %tameable RF_AG_KB_WG_WG_IG_NG_ZF_JF_TF_PF_TC_BB_TG_VE_PG_CO_CG_JG_ZGB_XF_SF_MG_SG_OF_EG_BG_EG_VF_DG
    if %tameskill >= 460 && %tameskill < 520
        set %tameable IG_NG_ZF_JF_TF_PF_TC_BB_TG_VE_PG_CO_CG_JG_ZGB_XF_SF_MG_SG_OF_EG_BG_EG_VF_DG_ZI_ZE
    if %tameskill >= 520 && %tameskill < 580
        set %tameable IG_NG_ZF_JF_TF_PF_TC_BB_TG_VE_PG_CO_CG_JG_ZGB_XF_SF_MG_SG_OF_EG_BG_EG_VF_DG_ZI_ZE_UF_UE_M_L
    if %tameskill >= 580 && %tameskill < 640
        set %tameable TC_BB_TG_VE_PG_CO_CG_JG_ZGB_XF_SF_MG_SG_OF_EG_BG_EG_VF_DG_ZI_ZE_UF_UE_VD_YF_L_M_AH
    if %tameskill >= 640 && %tameskill < 700
        set %tameable BB_TG_VE_PG_CO_CG_JG_ZGB_XF_SF_MG_SG_OF_EG_BG_EG_VF_DG_ZI_ZE_UF_UE_VD_YF_L_M_SD_AH_WF_QE_ZD
    if %tameskill >= 700 && %tameskill < 760
        set %tameable CO_CG_JG_ZGB_XF_SF_MG_SG_OF_EG_BG_EG_VF_DG_ZI_ZE_UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD
    if %tameskill >= 760 && %tameskill < 796
        set %tameable BG_EG_VF_DG_ZI_ZE_UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_YG
    if %tameskill >= 796 && %tameskill < 820
        set %tameable BG_EG_VF_DG_ZI_ZE_UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_YG
    if %tameskill >= 820 && %tameskill < 856
        set %tameable ZI_ZE_UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_YG
    if %tameskill >= 856 && %tameskill < 880
        set %tameable ZI_ZE_UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_YG
    if %tameskill >= 880 && %tameskill < 892
        set %tameable UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_YG_LD_W_WJ
    if %tameskill >= 892 && %tameskill < 904
        set %tameable UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_YG_LD_W_WJ
    if %tameskill >= 904 && %tameskill < 940
        set %tameable UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_YG_LD_W_WJ
    if %tameskill >= 940 && %tameskill < 988
        set %tameable tlxdmmd
    if %tameskill >= 988 && %tameskill < 1000
        set %tameable SD_AH_WF_QE_GE_ZD_YG_LD_W_WJ
    if %tameskill >= 1000 && %tameskill < 1012
        set %tameable SD_AH_WF_QE_GE_ZD_YG_LD_W_WJ_TJ
    if %tameskill >= 1012
        set %tameable SD_AH_WF_QE_GE_ZD_YG_LD_W_WJ_TJ

return


sub setTameName
set %jjj asgjhaeoituysvnsdgbasdlhgajsytoiaswetsgashawwkjwehasgdaskdgjskdbvasdgahsietgaiegtskdgsadg
str len %jjj
set %kkk #strRes - 3
set %xxx #RANDOM * %kkk / 1000

str mid %jjj %xxx 5
set %tamename #strRes
return

sub RandOmWalk
randomwalkloop:
 set %tmpX #CHARPOSX
 set %tmpY #CHARPOSY
 set %rand #random
 set %ii #random / 125
 set %i #random / 200 + 2
 if %ii < 4
  set %iii %ii + 4
 else
  set %iii %ii - 4

 for %j 1 %i
 {
  event macro 5 %ii
  for %tmpspot 1 %MaxDangerSpot
  {
   set %tmpdx1 %dx . %tmpspot
   set %tmpdy1 %dy . %tmpspot

   set %tmpddx1 %ddx . %tmpspot
   set %tmpddy1 %ddy . %tmpspot

   if #CharPosx >= %tmpdx1 && #charposx <= %tmpddx1 && #charposy >= %tmpdy1 && #charposy <= %tmpddy1
   {
    event exmsg #CharID 3 0 Hei...Danger!!!!!Back......
    set %ii %iii
    event macro 5 %iii
    event macro 5 %iii
    event macro 5 %iii
    event macro 5 %iii
    event macro 5 %iii
    event macro 5 %iii
    goto randomwalkloop
   }
  }
 }
 if %tmpX = #CHARPOSX && %tmpY = #CHARPOSY
  goto randomwalkloop
return

sub initmenu
 menu Clear
 menu Window Title 知秋 训兽脚本
 menu Window Color InactiveCaptionText
 menu Window Size 247 394
 menu Font Transparent #true
 menu Font Align Right
 menu Font Name Tahoma
 menu Font Size 8
 menu Font Style
 menu Font Color Black
 menu Font Align Left
 menu Font BGColor InactiveCaptionText
 menu Text m1 144 0 自动搜索范围:
 menu Shape EUOShape1 4 124 245 17 3 7 1 Black 7 BtnFace
 menu Text jStatus 5 124 状态:
 menu Text EUOLabel1 8 160 文件名
 menu Text EUOLabel2 120 16 每个点搜索          次
 menu Check AutoGetTameID 5 -3 100 20 #True 自动搜索生物
 menu Font BGColor HighlightText
 menu Edit finddist 228 1 20 14
 menu Edit CheckTimes 180 12 25 1
 menu Font BGColor InactiveCaptionText
 menu Check RandWalk 5 35 200 20 #false 找不到合适生物时随机走动
 menu Check releaseit 5 53 200 20 #false 自动放野被驯的生物
 menu Check killit 5 68 200 20 #false 杀掉被放野的生物
 menu Check AutoFollow 5 83 200 20 #true 自动跟随被驯生物
 menu Font BGColor BtnFace
 menu Button Starting 20 102 60 18 开始驯兽
 menu Button Stopping 90 102 60 18 停止驯兽
 menu Button CheckSpot 160 102 60 18 我靠近哪
 menu Button AddSpot 5 140 42 18 增加
 menu Button GotoSpot 48 140 42 18 走到
 menu Button ResetSpot 91 140 46 18 重设
 menu Button SaveSpot 158 140 42 18 保存
 menu Button LoadSpot 202 140 38 18 调出
 menu Font BGColor HighlightText
 menu Edit FileName 48 160 192 驯兽点0.txt
 menu List Create spot 5 180 236 210
 menu Font Color White
 menu Font BGColor Teal
 menu Button menualTame 18 18 100 18 手动指定目标
 menu Show 800 1
 menu hideEUO
set #menuButton N/A
return

sub AddSpot
 set #menuButton N/A
 set %spotNum %spotNum + 1
 set %tmpx %SpotNum ,  :  , #CHARPOSX ,  /  , #CHARPOSY ,  /  , #CHARPOSZ
 
 set %spotx . %spotNum #CHARPOSX

 set %spoty . %spotNum #CHARPOSy

 set %spotz . %spotNum #CHARPOSz

 menu list add spot %tmpx
return

sub GotoSpot
 set #menuButton N/A
 if %spotNum <= 0
 {
  menu set jStatus 您未设点
  return
 }
 menu get spot
 set %tmpspot #menuRes
 if %tmpspot = 0
 {
  set %tmpspot 1
  menu list select spot 1
 }
 event pathfind %spotx . %tmpspot %spoty . %tmpspot %spotz . %tmpspot
return

sub ResetSpot
 set #menuButton N/A
 set %spotNum 0
 for %tmpi 1 %spotnum
 {
  deletevar %spotx . %tmpi
  deletevar %spoty . %tmpi
  deletevar %spotz . %tmpi
 }
 menu delete spot
 menu List Create spot 5 180 240 210
return

sub GotoNextSpot
 if %SpotNum <= 0
  return
 if %spotx . %CurrentSpot = #CHARPOSX && %spoty . %CurrentSpot = #CHARPOSY
 set %CurrentSpot %CurrentSpot + 1
 if %CurrentSpot > %SpotNum
 {
  set %RandWalkCount 0
  ignoreitem reset
  set %CurrentSpot 1
 }
 set %RandWalkCount %RandWalkCount + 1
 if %RandWalkCount >= 10
 {
  set %RandWalkCount 0
  ignoreitem reset
 }
 menu list select spot %CurrentSpot
 event pathfind %Spotx . %CurrentSpot %Spoty . %CurrentSpot %Spotz . %CurrentSpot
 wait 2s
return

sub CheckSpot
set %tmpCur 0
set %tmpspotrabs 20

for %tmpspoti 1 %SpotNum
{
 set %tmpspotx #CHARPOSX - %Spotx . %tmpSpoti abs
 set %tmpspoty #CHARPOSY - %Spoty . %tmpSpoti abs
 set %tmpspotr %tmpspotx + %tmpspoty
 if %tmpspotr <= %tmpspotrabs
 {
  set %tmpspotrabs %tmpspotr
  set %tmpcur %tmpspoti
 }
}
if %tmpcur <> 0
{
 set %CurrentSpot %TmpCur
 menu list select spot %CurrentSpot
}
else
{
    if #menuButton = Starting
    {
 menu get RandWalk
 if #menuRes = #False
  gosub RandOmWalk
    }
}
return

sub SaveSpot
 set #menuButton N/A
 if %SpotNum <= 0
 {
  display 未设置点,不能保存.
  return
 }
 menu get filename
 set %filename #menuRes
 menu set jStatus 正在保存 %filename ...
; execute cmd.exe /c echo > %filename sub initspot
 execute cmd.exe /c echo > %filename set % , spotnum %spotnum
 
 for %tmpspoti 1 %spotnum
 {
  menu list select spot %tmpspoti
  menu set jStatus 正在保存第 %tmpspoti 行
  execute cmd.exe /c echo >> %filename set % , spotx , %tmpspoti %spotx . %tmpspoti
  execute cmd.exe /c echo >> %filename set % , spoty , %tmpspoti %spoty . %tmpspoti
  execute cmd.exe /c echo >> %filename set % , spotz , %tmpspoti %spotz . %tmpspoti
 }
; execute cmd.exe /c echo >> %filename return 
 display 保存完毕.
return

sub LoadSpot
 set #menuButton N/A
 for %tmpi 1 %spotnum
 {
  deletevar %spotx . %tmpi
  deletevar %spoty . %tmpi
  deletevar %spotz . %tmpi
 }
 set %spotnum 0
 menu delete spot
 menu List Create spot 5 180 240 210
 menu get filename
 set %filename #menuRes
 call %filename initspot
 for %tmpi 1 %spotnum 
 {
  set %tmpx %tmpi ,  :  ,  %spotx . %tmpi ,  /  ,  %spoty . %tmpi ,  /  ,  %spotz . %tmpi
  menu list add spot %tmpx
 }
return

收藏 推荐 打印 | 录入:樊鹏华 | 阅读:
相关新闻