Check-in [fe5e42d573]
Overview
SHA1:fe5e42d573a954fcea606a01662c249b909c18d6
Date: 2015-07-08 20:28:06
User: spaskalev
Comment:somewhat improved taming script :) from 4/16/2012
Timelines: family | ancestors | trunk
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2015-07-08
20:28
[fe5e42d573] Leaf: somewhat improved taming script :) from 4/16/2012 (user: spaskalev, tags: trunk)
20:20
[f235f7790c] Added hub-01-loot, working since 2006 :) (user: spaskalev, tags: trunk)
Changes

Added tame-2.euo version [149564909d].

            1  +sub INIT
            2  +  initEvents
            3  +  ignoreItem reset
            4  +  set %__EMPTY__
            5  +return
            6  +
            7  +sub WAIT_TARGET
            8  +  set #targcurs 1
            9  +  targetloop:
           10  +  If #targcurs = 1
           11  +  goto targetloop
           12  +return
           13  +
           14  +sub CONFIGURE
           15  +  event SysMessage Please move your character to the desired home location and target an animal for taming.
           16  +  gosub WAIT_TARGET
           17  +  findItem #LTARGETID
           18  +  set %TAME_TYPE #FINDTYPE
           19  +  set %TAME_ID
           20  +  set %HOME_X #CHARPOSX
           21  +  set %HOME_Y #CHARPOSY
           22  +  set %DEFAULT_FOLLOWERS #FOLLOWERS
           23  +  set %LAST_ATTEMPT 0
           24  +return
           25  +
           26  +sub MOVE_CHAR
           27  +  move %1 %2 0 2s
           28  +  if  #CHARPOSX <> %1 || #CHARPOSY <> %2
           29  +  {
           30  +    event PathFind %1 %2
           31  +    sleep 2s
           32  +  }
           33  +return
           34  +
           35  +sub SEARCH_TAME
           36  +  findItem %TAME_TYPE
           37  +  if #FINDKIND = -1
           38  +  {
           39  +    set %TAME_ID
           40  +    return
           41  +  }
           42  +  event Property #FINDID
           43  +  if Paragon in #PROPERTY
           44  +  {
           45  +    ignoreItem #FINDID
           46  +    set %TAME_ID
           47  +    return
           48  +  }
           49  +  set %TAME_ID #FINDID
           50  +return
           51  +
           52  +sub ATTEMPT_TAME
           53  +  if %LAST_ATTEMPT + 3500 < #SYSTIME
           54  +  {
           55  +    event Macro 13 35
           56  +    target 2s
           57  +    set #LTARGETID %TAME_ID
           58  +    event Macro 22 0
           59  +    set %LAST_ATTEMPT #SYSTIME
           60  +  }
           61  +return
           62  +
           63  +sub AUTOMATE
           64  +  gosub SEARCH_TAME
           65  +  while %TAME_ID = %__EMPTY__
           66  +  {
           67  +    gosub MOVE_CHAR %HOME_X %HOME_Y
           68  +    gosub SEARCH_TAME
           69  +  }
           70  +  while #FINDKIND <> -1
           71  +  {
           72  +    gosub MOVE_CHAR #FINDX #FINDY
           73  +    gosub ATTEMPT_TAME
           74  +    if #FOLLOWERS > %DEFAULT_FOLLOWERS
           75  +    {
           76  +      ignoreItem %TAME_ID
           77  +      gosub SEARCH_TAME
           78  +    }
           79  +    findItem %TAME_ID
           80  +  }
           81  +return
           82  +
           83  +gosub INIT
           84  +gosub CONFIGURE
           85  +while #true
           86  +{
           87  +  gosub AUTOMATE
           88  +}
           89  +
           90  +halt