Author Topic: Pearls vs EasyUO : close encounters  (Read 2780 times)

0 Members and 1 Guest are viewing this topic.

Offline PearlsTopic starter

  • Hero Member
  • *
  • Posts: 557
  • Activity:
    0%
  • Reputation Power: 13
  • Pearls barely matters.Pearls barely matters.
  • Respect: +65
  • Referrals: 1
    • View Profile
Pearls vs EasyUO : close encounters
« on: April 30, 2010, 08:03:59 AM »
0
So ive started looking at the wiki.easyuo a lot and starting to grasp some of the basics. Havent tried writing anything yet thou. I've took UOMaddog's Jhelom Pen Taming Trainer and printed out the code so i could take some notes and understand the flow he is using. Was surprised to find out that i understood more then expected ;) There is one thing that i'm a bit confused about thou, i'll highlight the code and maybe someone could enlighten me a little on whats taking place.

Code: [Select]
;Look for animal to tame
sub LookAroundAndTame
findItem %tamingtypes G_12 ;pretty sure this means a radius of 12 tiles to scan for
;If not found, move to next spot
if #findCnt < 1
   {
   gosub NextSpot
   return
   }
set %tamingtarget #findid
WalkToTarget:
if #finddist > 2
   {
   event PathFind #findx #findy #findz
   wait 20
   goto WalkToTarget
   }
;Attempt to tame animal (include safety timer)
AttemptToTame:
event macro 13 35 ;Use Taming Skill
target 5s ;Wait for targeting cursor
set #ltargetid %tamingtarget ;Set taming target to last target
set #ltargetkind 1
event macro 22 0 ;Target taming target
set %scantimer #scnt + 20 ;Saftey timer for poor scripting on my part!
ScanForSuccess:
scanjournal 1
if #scnt > %scantimer ;Check to see if saftey timer has expired
   {
   deletejournal
   return
   }
if seems_to_accept_you_as_master in #journal
   {
   deletejournal
   return
   }
if animal_looks_tame_already in #journal
   {
   deletejournal
   ignoreitem %tamingtarget
   return
   }
if else_is_already_taming_that_creature in #journal
   {
   deletejournal
   ignoreitem %tamingtarget
   return
   }
if have_no_chance_of_taming_this_creature in #journal
   {
   deletejournal
   ignoreitem %tamingtarget
   return
   }
if fail_to_tame_the_creature in #journal
   {
   deletejournal
   wait 5
   goto AttemptToTame
   }
if are_too_far_away_to_continue_taming in #journal
   {
   deletejournal
   goto WalkToTarget
   }
if animal_is_too_angry_to_continue_taming in #journal
   {
   deletejournal
   ignoreitem %tamingtarget
   return
   }
finditem %tamingtarget
if #finddist > 2
   {
   event PathFind #findx #findy #findz
   }
goto ScanForSuccess
return

If i read through the code i get the impression it gets stuck in a loop reading the journal, but it doesnt so i'm clearly missing something. Probably this part :

Code: [Select]
finditem %tamingtarget
if #finddist > 2
   {
   event PathFind #findx #findy #findz
   }
goto ScanForSuccess

edit : cant add colors in code?
« Last Edit: April 30, 2010, 08:06:38 AM by Pearls »
XII : "My happiness as a married man is directly related to the amount of sex I have which, in turn, requires that I pretend I like these movies every now and then and that it really doesn't bother me when she tells me about her problems but doesn't want me to give her a solution ;) "

Offline Hoby

  • Elite
  • *
  • *
  • Posts: 1344
  • Activity:
    0%
  • Reputation Power: 14
  • Hoby barely matters.Hoby barely matters.
  • Gender: Male
  • Respect: +79
  • Referrals: 1
    • View Profile
Re: Pearls vs EasyUO : close encounters
« Reply #1 on: April 30, 2010, 08:59:57 AM »
0
haha, cleaver title for the thread  :D
I like you, your death shall be quick and painless!!
I may have alzheimers, but at least I don't have alzheimers.
Walruses are like vampires, only awesome
Pwned-The total domination or shut down of a person or thing. 
I believe a hangover is gods way of saying you kicked ass last night!
Life's to short to remove usb safely.

Offline Masscre

  • Gran Master Jester !!
  • Scripthack
  • *
  • Posts: 4615
  • Activity:
    0%
  • Reputation Power: 55
  • Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!
  • Gender: Male
  • Air Guitar Commander !!
  • Respect: +144
  • Referrals: 1
    • View Profile
Re: Pearls vs EasyUO : close encounters
« Reply #2 on: April 30, 2010, 09:37:23 AM »
0
This code snippit will move you to less than 2 tiles of the wanted tile and will continue to move you within 2 tiles of the expected animal.  So yes it will continue to do this for ever but not in the way you are thinking.  It will pathfind until you are less than 2 tiles away from the expected animal and then move to the next step and then come back again when you are over 2 tiles away from the expected animal.  did I make sense to you pearls or did i confuse you more?

Offline PearlsTopic starter

  • Hero Member
  • *
  • Posts: 557
  • Activity:
    0%
  • Reputation Power: 13
  • Pearls barely matters.Pearls barely matters.
  • Respect: +65
  • Referrals: 1
    • View Profile
Re: Pearls vs EasyUO : close encounters
« Reply #3 on: April 30, 2010, 10:26:28 AM »
0
I might have been a little too vague ;-)

Part i'm wondering about is once u tamed an animal for example, how does it break free from "goto ScanForSuccess", i know that it does deletejournal, which means u wont read what uve read already right. Then it does return, which means breaking free from the if right, or is it breaking free from sub LookAroundAndTame, which includes the ScanForSuccess part. Just curious how its breaking away so it would eventually go back to release & kill .
XII : "My happiness as a married man is directly related to the amount of sex I have which, in turn, requires that I pretend I like these movies every now and then and that it really doesn't bother me when she tells me about her problems but doesn't want me to give her a solution ;) "

Offline Scotch_Tape

  • Jr. Member
  • **
  • Posts: 55
  • Activity:
    0%
  • Reputation Power: 1
  • Scotch_Tape has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Pearls vs EasyUO : close encounters
« Reply #4 on: May 10, 2010, 05:09:47 AM »
0
Then it does return, which means breaking free from the if right, or is it breaking free from sub LookAroundAndTame, which includes the ScanForSuccess part.

A Return will leave the sub.  So once it see's the return it will not come back to that loop until it hits the gosub again.  Unless there is a goto somewhere else in the script, but I hear that's just bad coding. 

Someone correct me if I'm wrong. 

Tags: