Author Topic: Animal Taming 0.1 for Public Testing  (Read 11454 times)

0 Members and 1 Guest are viewing this topic.

Offline VicVegaTopic starter

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 0
  • VicVega has no influence.
  • Respect: +8
  • Referrals: 0
    • View Profile
Animal Taming 0.1 for Public Testing
« on: May 25, 2009, 11:09:56 AM »
0
What this script does?

1. Scans the zone for tame animals acording to your skill at the moment.
2. Tames an animal, releases it and then kills it with your steed, till there is no more animals left on the zone.
3. If no more animals available on the zone, returns to the starting point.

Only tested with Great Harts at the moment, but it should work with all the other animals supported I hope.  

This informative table is extracted from the UDTaming script, only works with the animals listed here, but if you want to add animals types it's easy to do so:

Quote
; The following table was generated from data gathered off the UO Stratics
; taming page. Analysing their results produces a success rate calculation
; based upon the character's Animal Taming skill only. Modifying the Animal
; Lore did not produce any noticable changes in the success rates.
;
; The formula determined for calculating success rate is R = (S - B) * 2 where
; R is the success rate, S is the character's taming skill, and B is the
; minumum skill required to tame minus 0.1 (this is the base skill
; requirement). Using basic algebra and solving for S provides a formula that
; can can be used calculate the skill required to achieve a specific success
; rate (S = R / 2 + B). This formula is used in the table below to determine
; which creatures will provide the best chances to recieve a gain while
; taming.
; Column descriptions:
;
; ANIMAL    The name of the animal to tame
; REQ SKILL The minimum skill required to tame
; MIN GAIN  The skill level that has a 10% success rate
; MAX GAIN  The skill level that has an 90% success rate
; C/M       Monster (Yes/No)
; TYPE      EasyUO FindItem type for animal
;
;                      REQ    MIN    MAX
; ANIMAL             SKILL   GAIN   GAIN  C/M  TYPE
; Sheep               11.1     16     56   N   TF_PF
; Cow                 11.1     16     56   N   IG_NG
; Hind                23.1     28     68   N   TG
; Timber Wolf         23.1     28     68   N   PG
; Great Hart          59.1     64    104   N   AH
; Bull                71.1     76    116   N   YG_XG
; Ridgeback           83.1     88    128   N   BK

Code: [Select]
;=================================================================
; Script Name: Animal Taming
; Author: VicVega
; Version: 0.3
; Shard OSI / FS: UO Legends
; Revision Date: 26/5/2009
; Purpose: Trains Animal Taming to GM
; Globals: None
;=================================================================
; Instructions: You need to setup your steed ID in %steedID
;               variable on setup
;************************ Setup **********************************
gosub setup

repeat
  gosub chooseTamingAnimal
  gosub findClosestAnimal %tameable
  gosub tamingMonitor
until #charGhost = yes
halt
;************************* Subs **********************************
sub tamingMonitor
  if %findDist <> N/A
  {
    if %findtype in %tameable
      gosub Taming %findid
  }
  if %findDist = N/A
  {
    event sysmessage no more animals around
    event pathfind %charstartx %charstarty %charstartz
    wait 10s
  }
return

sub setup
  set %steedID OFWC
  set %charstartx #charposx
  set %charstarty #charposy
  set %charstartz #charposz
return

sub Taming
  set %oldTameFollowers #followers
  set %tameID %1
  gosub checkParagon %tameID
  finditem %tameID G_16
  while #findkind <> -1
  {
    set %tameid #findid
    if %tameid <> #ltargetid
      event exmsg %tameid 3 30 target!
    gosub TameAnimal
    if #followers > %oldTameFollowers
       gosub tamingRelease
    finditem %tameID G_16
  }
return

sub checkParagon
event property %1
if Paragon in #property
{
   event sysmessage killing paragon!
   gosub killPet
}
return

sub TameAnimal
  set #ltargetid %tameid
  set #ltargetkind 1
  while #findDist > 2
  {
    event pathfind #findX #findY #findZ
    wait 1s
    finditem %tameID G_16
  }

  event macro 13 35 ; animal taming
  target 3s
  event macro 22 0 ; last target

  gosub scan seems_to_accept anger_the_beast fail_to_tame
  + too_far clear_path too_many_followers can't_see_that
  + too_angry distracted someone_else tame_already
  + cannot_be_tamed can't_tame_that no_chance

  set %ignore someone_else in #result || tame_already in #result
  if %ignore = #true
    ignoreitem %tameID
 return

sub scan
  set %maxTimeOutScan 15
  set %timeout #scnt + %maxTimeOutScan
  set %jrnl #jindex
  scanjournal %jrnl

  while #scnt < %timeout
  {
    finditem %tameID G_16
    if #finddist > 2
      event pathfind #findX #findY #findZ
    if %jrnl < #jindex
    {
      set %jrnl %jrnl + 1
      scanjournal %jrnl
    }

    for %journalCounter 1 %0
    {
      if % . %journalCounter in #journal
        return % . %journalCounter
    }
  }
return

sub TamingRelease
  msg all follow me $
  gosub releasePet
  gosub killPet
return

sub releasePet
  set %releaseGumpSize 270_120
  set %maxTimeOut 15
  set %timeOut #scnt + %maxTimeOut
  set %waitForGump #true
  
  exevent popup %tameID 10
  while %waitForGump = #true
  {
    wait 1s
    set %waitForGump #contSize <> %releaseGumpSize && #scnt < %timeOut
  }

  set %releaseGumpX #contposx + 35
  set %releaseGumpY #contposy + 90
  click %releaseGumpX  %releaseGumpY
  wait 15
return

sub killPet
  gosub dismount
  gosub atackTamedPet %tameID
  finditem %steedID
  while #findKind <> -1
  {
    gosub mount
    finditem %steedID
  }
return

sub dismount
  set #lObjectID #charID
  event macro 17
  wait 1s
return

sub atackTamedPet
  set %victimID %1
  set #lTargetKind 1
  SET #lTargetID %victimID
  event exmsg %tameid 3 30 kill this!
  gosub atack
  finditem %victimID
  set %maxTimeOut 10
  set %timeOut #scnt + %maxTimeOut
  while #findKind <> -1
  {
    wait 1s
    finditem %victimID
    event exmsg %tameid 3 30 kill this!
    gosub checkAtackTimeOut
  }
return

sub atack
  msg all kill $
  target 25s
  event macro 22 0
return

sub checkAtackTimeOut
    if #scnt > %timeOut
    {
          gosub atack
          set %timeOut #scnt + %maxTimeOut
    }
return

sub mount
  finditem %steedID
  set #lObjectID %steedID
  while #findDist > 1
  {
    msg all follow me $
    wait 1s
    finditem %steedID
  }
  event macro 17
  wait 1s
return

sub findClosestAnimal
  finditem %1 G_16
  set %findid #findid
  set %findtype #findtype
  set %finddist #findDist
  if #findcnt > 1
  {
    for #findIndex 1 #findcnt
    {
      if #findkind <> -1 && #findDist < %findDist
      {
        set %findid #findid
        set %findtype #findtype
        set %finddist #findDist
      }
    }
  }
return

sub chooseTamingAnimal
  chooseskill anim
  if #skill = #skillcap
  {
    display ok Taming skillcap reached
    halt
  }

  if #skill >= 300 && #skill < 450
    set %tameable TF_PF_IG_NG_TG
  if #skill >= 450 && #skill < 600
    set %tameable TG_PG
  if #skill >= 600 && #skill < 750
    set %tameable AH
  if #skill >= 750 && #skill < 900
    set %tameable YG_XG_AH
  if #skill >= 900 && #skill < 1200
    set %tameable BK
return

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
animalTaming.txt
« Last Edit: May 26, 2009, 01:20:52 PM by VicVega »
To learn, read.
To know, write.
To master, teach.

Offline VicVegaTopic starter

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 0
  • VicVega has no influence.
  • Respect: +8
  • Referrals: 0
    • View Profile
Re: Animal Taming 0.1 for Public Testing
« Reply #1 on: May 26, 2009, 06:27:52 AM »
0
New version, some fixes, improved stability and code readbility.

Version 0.3 published, fixed problem with RidgeBacks and now kills RidgeBack Paragons (wich are not tamable)
« Last Edit: May 26, 2009, 01:11:41 PM by VicVega »
To learn, read.
To know, write.
To master, teach.

Offline Ultima

  • Insane Scripter
  • *
  • Posts: 1580
  • Activity:
    0%
  • Reputation Power: 26
  • Ultima is on the verge of being accepted.Ultima is on the verge of being accepted.Ultima is on the verge of being accepted.Ultima is on the verge of being accepted.Ultima is on the verge of being accepted.
  • Gender: Male
  • Respect: +160
  • Referrals: 4
    • View Profile
Re: Animal Taming 0.1 for Public Testing
« Reply #2 on: May 29, 2009, 05:33:00 PM »
0
I finally got around to testing this script. I got my butt thrown in jail the other day for using Maddog's Jhelom Bull Pen Trainer so some other method to get gains is urgently needed. 8)

I added Gamans to the list which are great for gains I really don't understand why more people don't tame gaman's to 120 instead of Bulls. I 120'd my first tamer off Gamans. Totally secluded and virtually danger free....

Anyways...I couldn't get the script to work for me. After taming the Gaman it would give the All Follow Me command but wouldn't release newly tamed pet and dismount and kill it. When I manually released the pet it killed it but then the script just sat there idle.

Not quite sure where the problem lay. It could be my end with my client. There are quite a few scripts that won't run on my main computer but will on my computer which runs Windows Vista. I'll try it on my 2nd computer as well and see if the results are any different.

Hopefully someone else also gives this a try because we really do need more taming scripts. ;)

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3617
  • Activity:
    0%
  • Reputation Power: 39
  • 12TimesOver has a powerful will.12TimesOver has a powerful will.12TimesOver has a powerful will.12TimesOver has a powerful will.12TimesOver has a powerful will.12TimesOver has a powerful will.12TimesOver has a powerful will.
  • Gender: Male
  • Respect: +316
  • Referrals: 2
    • View Profile
Re: Animal Taming 0.1 for Public Testing
« Reply #3 on: May 30, 2009, 03:38:49 AM »
0
Vic, compliments to you on such well organized code. It's refreshing to get neat code, makes it so much more readable and yours is laid out very well.

I want to give this a test for you since the timing is perfect (training a tamer as we speak but, like Ultima, am having issues with griefers using Maddog's). My only issue is that I will need to modify your "Killpet" sub to mage-kill the tame instead of mount-kill it. If that's no problem for you from the testing perspective I'll give it a whirl later today when my son goes down for a nap. If you don't want me to mod it I'll probably do it anyway but I just won't tell you how it goes  ;)

Would be REALLY easy to integrate a kill option into the setup routine then just sub out to "Sub Magekill" or "Sub Mountkill" based on the setup option. Just a thought :P

XII
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline VicVegaTopic starter

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 0
  • VicVega has no influence.
  • Respect: +8
  • Referrals: 0
    • View Profile
Re: Animal Taming 0.1 for Public Testing
« Reply #4 on: June 01, 2009, 01:47:00 AM »
0
Feel free to modify the script, I don't mind.

I know I could support other methods of killing, but I don't have a tamer with the skills to do so and I prefer to test the script in order to know if it works fine at least for me.

I'm glad you like the code.
To learn, read.
To know, write.
To master, teach.

Offline VicVegaTopic starter

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 0
  • VicVega has no influence.
  • Respect: +8
  • Referrals: 0
    • View Profile
Re: Animal Taming 0.1 for Public Testing
« Reply #5 on: June 01, 2009, 01:58:03 AM »
0
I finally got around to testing this script. I got my butt thrown in jail the other day for using Maddog's Jhelom Bull Pen Trainer so some other method to get gains is urgently needed. 8)

I added Gamans to the list which are great for gains I really don't understand why more people don't tame gaman's to 120 instead of Bulls. I 120'd my first tamer off Gamans. Totally secluded and virtually danger free....

Anyways...I couldn't get the script to work for me. After taming the Gaman it would give the All Follow Me command but wouldn't release newly tamed pet and dismount and kill it. When I manually released the pet it killed it but then the script just sat there idle.

Not quite sure where the problem lay. It could be my end with my client. There are quite a few scripts that won't run on my main computer but will on my computer which runs Windows Vista. I'll try it on my 2nd computer as well and see if the results are any different.

Hopefully someone else also gives this a try because we really do need more taming scripts. ;)

In order to release the pet I use this command:

Quote
exevent popup %tameID 10

May be you are on a Sphere shard? (Sphere shards don't support the exevent popup command)

Or may be you are in a shard wich is RunUO but doesn't support exevent popup command anyway.

If exevent popup works fine on your shard, may be the entries on the context menu when you click on the animal are different and it's not the 10th entry wich has the "release" option, in that case you should change "10" by the entry number of your "release" option.

If the exevent popup command doesn't prompt the pop up confirmation window about releasing the pet, the script will loop on this line:

Quote
  exevent popup %tameID 10
  while %waitForGump = #true
...
« Last Edit: June 01, 2009, 02:03:24 AM by VicVega »
To learn, read.
To know, write.
To master, teach.

Online TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13007
  • Activity:
    1.2%
  • Reputation Power: 151
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1335
  • Referrals: 32
    • View Profile
    • ScriptUO
Re: Animal Taming 0.1 for Public Testing
« Reply #6 on: June 01, 2009, 05:08:54 AM »
0
RunUO supports event popup for some reason, but OSI does not.  You have to handle the gump instance and do the clicking yourself.  Normally for my scripts to be compatible for both RunUO and OSI, I generally just do the click myself instead of using the built-in selection function.

It's annoying for a function like this to be basically broken in EUO, but it's been this way forever.
« Last Edit: June 01, 2009, 05:11:07 AM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline seeriusly

  • Full Member
  • ***
  • Posts: 219
  • Activity:
    0%
  • Reputation Power: 6
  • seeriusly has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: Animal Taming 0.1 for Public Testing
« Reply #7 on: August 02, 2009, 08:52:07 AM »
0
Perhaps if you just guild your tamer, all you'd have to do is say all kill...  ???  That's what I do when taming gamans...  ride ethereal, and have mare to kill.  Haven't tried the script, but will keep it in mind.

Offline Noobie

  • Sr. Member
  • *
  • Posts: 262
  • Activity:
    0%
  • Reputation Power: 1
  • Noobie has no influence.
  • Gender: Male
  • Respect: +13
  • Referrals: 1
    • View Profile
Re: Animal Taming 0.1 for Public Testing
« Reply #8 on: August 30, 2009, 08:22:38 PM »
0
I found that if i add a Return in i was able to mount back up not sure what you had in mind with the finditem %steedID, but i got it to run better with out it.



sub killPet
  gosub dismount
  gosub atackTamedPet %tameID
  finditem %steedID
  while #findKind <> -1
  {
    gosub mount
    finditem %steedID               <<<<<<<<<<<<< Return
  }

Offline UOMaddog

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1620
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +165
  • Referrals: 8
    • View Profile
    • My Website
Re: Animal Taming 0.1 for Public Testing
« Reply #9 on: August 30, 2009, 09:57:53 PM »
0
I'm glad to hear soo many people using my script, however I do understand the frustration of Jhelom Farms! I very much like the way VicVega has his code organized (I'm OCD about stuff like that myself!) and I also like his idea of the taming "chart" so to speak. You could put almost an entire library of animals in the script, broken down into 5.0 skill segments (some animals may be in multiple sections). You already have it in there for the most part, but I'd honestly try to make it as large of a list as possible and break it down into smaller segments (such as 5.0). I am in the process of totally revamping my script at the moment (trying to make it much less Twinkle McNugget) so I'm trying to avoid reading through all your code cuz then it sticks in my mind and I unintentionally use bits and pieces. However, if you have any questions, feel free to PM me and we could work on stuff together!


Just an idea, but one of the best community projects might be an SUO Ultimate Taming Trainer! Something that would function flawlessly with a GM Detector, healing, paragons, moving to new taming areas, etc. Kind of like Roadkill's all-in-one taming script on EUO, but a million times better! The reason I suggest this is because I know 3-5 of us have been working on our own taming scripts and it seems like we might be able to put something even better together if we work together!
« Last Edit: August 30, 2009, 09:59:25 PM by UOMaddog »
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5436
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +391
  • Referrals: 1
    • View Profile
Re: Animal Taming 0.1 for Public Testing
« Reply #10 on: September 02, 2009, 07:03:23 AM »
0
Just an idea, but one of the best community projects might be an SUO Ultimate Taming Trainer! Something that would function flawlessly with a GM Detector, healing, paragons, moving to new taming areas, etc. Kind of like Roadkill's all-in-one taming script on EUO, but a million times better! The reason I suggest this is because I know 3-5 of us have been working on our own taming scripts and it seems like we might be able to put something even better together if we work together!

Done and dusted already MadDog.. had a basic verion of this up on Uocoders and posted the more advanced version of it here recently .. Has the skill/Tamables chart and all thefeatures  Except for Killing paragons as i never do the ish bit myself personally.  Unfortunatly at present its an Elite only script, and im also sure it could use some improvment in places.   ENs-Automated Tamer Trainer

Very nice looking code  VicVega
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline UOMaddog

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1620
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +165
  • Referrals: 8
    • View Profile
    • My Website
Re: Animal Taming 0.1 for Public Testing
« Reply #11 on: September 02, 2009, 11:34:37 AM »
0
Wow, glad to hear it EN! If I ever get access, I'll take a look and possibly send you a snippet to add for paragons and it will be the most complete taming script ever! Hehe!
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Scrripty

  • Guest
Re: Animal Taming 0.1 for Public Testing
« Reply #12 on: September 11, 2009, 09:16:16 AM »
0
I can see a potential problem with the event pathfind portion...  In the documentation for event pathfind I believe I read that it ONLY works for places that are on your screen.  So if an animal leads you away, it will fail.  Not sure how that works on RunUO?  I'm not 100 percent sure tho as I don't use event pathfind much...

Offline marcos.gardioli

  • Restricted
  • *
  • Posts: 1
  • Activity:
    0%
  • Reputation Power: 1
  • marcos.gardioli has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Animal Taming 0.1 for Public Testing
« Reply #13 on: April 20, 2020, 05:27:39 AM »
0
2020 returning to the game! Great script, thx!

Tags: