EasyUO

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

Script Name
The Bountiful Harvest 豐收季節
Author
溺水魚 & GeniusKiKi
Version
20170312
Revision Date
2014/3/17
Public Release
2014/3/17
Purpose
方便玩家採集資源
Website
http://zh.ody.wikia.com/wiki/豐收季節

============================= 程式設定區 ============================= ;
initevents
set %m\_mo POF\_rwf\_lnk\_jjg\_PPO\_fuo\_atf\_npo\_jph\_tsf\_nmh\_vrh\_jtf\_soh\_bph\_

```
        +zto_buo_xth_opo_cuo_xrh_guo_mtf_rrh_vth_ysf_buh_auo_trh_zth_
        +woh_usf_lmh_qpo_ppo_SVH_CKF_KUF_JUF_KZF_JZF_MZF_WZF_tlk_NVF_
        +HVF_GVF_BVF_EVF_ZVF_UVF_ylf_ZLK_RZF_SZF_DUF_TZF_UZF_YZF_IUF_
        +bwr_nws_yws_xws_fxs_

```

set %axes lsf\_bsf\_nsf\_zrf\_rmh\_lph\_uoh\_fsf\_ ;設定斧頭種類
set %a ，
set %BandageTime 160 - ( #dex / 20 ) \* 10
set #MENUBUTTON 0

menu Clear
menu Window Title 豐收季節 by 溺水魚
menu font size 10
menu Window Size 350 300
menu Shape Shape 3 3 345 295 3 6 3 gray 1 $dedddd
menu Shape Shape 3 200 345 1 3 6 6 gray 1 $dedddd
menu Edit BankRunebook 10 10 100 銀行座標
menu Button BankRun 110 10 45 20 設定
menu Edit BankBag 10 60 100 設定資源包
menu Button SetBankBag 110 60 45 20 設定
menu Edit setwood 180 10 120 設定樹林座標
menu Button setadds 280 10 45 20 設定
menu Button Start 10 100 120 40 開始採集資源
menu Font Color $565656
menu font size 12
MENU FONT STYLE bu
menu Text xxx 180 120 Powered By 溺水魚
menu Text xxx 10 150 ASGARD 阿斯嘉 - 眾神國度
menu Text xxx 10 180 http://zh.asg.wikia.com/wiki/Asgard\_Wiki
menu Font Color red
MENU FONT STYLE b
menu Text Tips 10 210 歡迎使用豐收季節砍樹走路版(2014/03/17)
menu Show

loop:

menu get ResSelect
set %Rec #menures

if #MenuButton = setadds
{
 gosub setadds
 set #MenuButton 0
}

if #MenuButton = SetBankBag
{
 gosub SetBag
 set #MenuButton 0
}
if #MenuButton = BankRun
{

```
gosub Setgohome

```

 set #MenuButton 0
}

if #MenuButton = Start
{
 menu Delete Start
 menu Button Stop 10 100 120 40 停止採集資源
 menu set Tips 啟動採集資源程序
 move %wpox %wpoy a

```
 gosub Start

```

}

if #MenuButton = Stop
{
 menu Delete Stop
 menu Button Start 10 100 120 40 開始採集資源
 menu set Tips 暫停採集資源程序，請按開始繼續
 set %Start #false
 set #MenuButton 0
}

if #MenuButton = closed
{
 halt
}

GOTO loop

sub setadds
{

```
 menu set Tips 設定森林的座標，請選擇地點

```

 gosub s7GetTarget

```
 FINDITEM #LTARGETID

```

 set %wpox #FINDX

```
 set %wpoy #FINDY
 menu set setwood %wpox %a %wpoy
 set %REC 3

```

 return
}

sub Setgohome
{

```
 menu set Tips 設定回家的座標，請選擇地點

```

 gosub s7GetTarget

```
 FINDITEM #LTARGETID

```

 set %hpox #FINDX

```
 set %hpoy #FINDY
 menu set BankRunebook %hpox %a %hpoy
 set %REC 3

```

 return
}

sub SetBag
{
 menu set Tips 設定存放資源容器，請選擇容器
 nextCPos 10 10
 msg Bank $$
 gosub s7GetTarget
 FINDITEM #result
 set %BAG\_B #FINDID
 menu set BankBag %BAG\_B
 menu set Tips 存放資源容器已設定完成
 return
}

sub start
{

```
 WHILE #MenuButton <> CLOSED
  {
       menu set Tips 開始尋找可以砍伐的樹木

```

 tile Init

```
     	for %x 0 10

```

 {
 for %y 0 10
 {
 set %xpos #charposx - %x

```
       set %ypos #charposy - %y

```

 gosub moveTree
 set %xpos #charposx + %x

```
       set %ypos #charposy + %y

```

 gosub moveTree
 set %xpos #charposx - %x

```
       set %ypos #charposy + %y

```

 gosub moveTree
 set %xpos #charposx + %x

```
       set %ypos #charposy - %y

```

 gosub moveTree
 }
 }

```
  }
 	return

```

}

sub moveTree
{
 menu set Tips 正在尋找可以砍伐的樹木
 if #WEIGHT > #MAXWEIGHT + 30

```
     	{

```

 gosub WEIGHT

```
     	}
 menu Text WEIGHT 10 250 目前負重--- #WEIGHT

```

 tile CNT %xpos %ypos

```
	tile GET %xpos %ypos 2

```

 if TREE in #TILENAME && #TILENAME <> o'hii\_tree
 {
 gosub getTreeName
 menu set Tips 找到一株 %TreeName ( %xpos %A %ypos )

```
   	move %xpos %ypos 1 a

```

 set %move 1
 gosub chop\_single

```
   }
     return
 }

```

}

sub getTreeName
{
 set %TreeName #TILENAME
 if #TILENAME = tree
 set %TreeName 樹
 if #TILENAME = oak\_tree
 set %TreeName 像樹
 if #TILENAME = willow\_tree
 set %TreeName 柳樹
 if #TILENAME = walnut\_tree
 set %TreeName 胡桃樹
 if #TILENAME = cedar\_tree
 set %TreeName 香柏樹
 if #TILENAME = Yew\_tree
 set %TreeName 紫杉大樹
 if #TILENAME = cypress\_tree
 set %TreeName 白扁柏樹
 return
}

sub chop\_single
{
 WHILE %move = 1

```
 	{

```

 finditem %axes
 set #LOBJECTID #FINDID
 set #LTARGETX %xpos
 set #LTARGETY %ypos
 set #LTARGETZ #tilez
 set #LTARGETKIND 3
 set #LTARGETTILE #tiletype
 if #FINDKIND = -1

```
   {
  	menu set Tips 找不到斧頭，無法進行伐木
  	gosub no
   }

```

 menu set Tips 正在砍伐一株 %TreeName ( %xpos %A %ypos )
 Event macro 17 0
 Target
 Event macro 22 0
 wait 2s
 FINDITEM ZLK c\_ , #BACKPACKID
 set #LTARGETID #FINDID
 if #FINDSTACK = 0
 {
 set %move 0
 return
 }
 if #FINDSTACK > 0
 {
 finditem %axes
 set #LOBJECTID #FINDID
 set #LTARGETKIND 1
 Event macro 17 0
 Target 1s
 Event macro 22 0
 menu Text WEIGHT 10 250 目前負重--- #WEIGHT
 }

```
   if #MenuButton = Stop
   {
 	goto loop
   }

```

 }
 return
}

sub tobank
{

```
 move %hpox %hpoy a
	msg bank $$

```

 wait 2s

```
 return

```

}

sub WEIGHT
{
 menu set Tips 負重不堪負荷，進行負重處理程序

```
 gosub tobank
 msg bank $$

```

 finditem %m\_mo c\_ , #BACKPACKID
 WAIT 2
 menu set Tips 正在存放身上的物資
 WHILE #FINDCNT <> 0 ;找到物品的處理
 {
 Exevent Drag #findid #findstack ;拿起尋找到的物件全部

```
   wait 10
   Exevent Dropc %BAG_B	;放進自己的包包中

```

 wait 20
 finditem %m\_mo c\_ , #BACKPACKID
 }
 wait 20
 set #MenuButton Start

```
 goto loop

```

}

sub NO ;缺少斧頭回銀行

 WHILE c in #CHARSTATUS
 {
 gosub HITS
 }

```
 gosub tobank
 menu set Tips 領取斧頭或是繃帶

```

 finditem %m\_mo c\_ , #BACKPACKID
 WAIT 2

 WHILE #FINDCNT <> 0 ;找到物品的處理
 {
 Exevent Drag #findid #findstack ;拿起尋找到的物件全部

```
   wait 10
   Exevent Dropc %BAG_B	;放進自己的包包中

```

 wait 20
 finditem %m\_mo c\_ , #BACKPACKID
 }

```
 finditem %BAG_B c_
 set #LOBJECTID #FINDID
 set #LTARGETKIND 1
 Event macro 17 0
 wait 1S
 finditem %axes c_ , #BACKPACKID
 WHILE #FINDSTACK < 1
 {
 finditem %axes c_ , %BAG_B
 Exevent Drag #findid 1	;拿起尋找到的物件全部
 wait 10
 Exevent Dropc #BACKPACKID	;放進自己的包包中
 wait 20
 finditem %axes c_ , #BACKPACKID
 }

```

```
 set #LHANDID #FINDID
 Event macro 24 1
 wait 30

```

 set #MenuButton Start

```
 goto LOOP

```

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ ;
* @name s7GetTarget
* @author snicker7

sub s7GetTarget
{
 set #ltargetid
 set #targcurs 1
 \_waitfortargcurs:
 if #targcurs = 1 2
 wait 1
 goto \_waitfortargcurs
 return #ltargetid
}