Author Topic: Need help with pet transfer sub.  (Read 5513 times)

0 Members and 1 Guest are viewing this topic.

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +57
  • Referrals: 1
    • View Profile
Need help with pet transfer sub.
« on: May 28, 2009, 11:21:21 AM »
0
Okay, so if your reading this, you probably know I am writing a zoo turn in script as my first script.  Yah yah I know, starting out a little big.  So here is what I am working on now, turning in bears/wolves/slimes to the donation box.  Now, I found TM's context menu handler subs, having a little problem understanding it.  Because I dont want to call ALL the context menu options, just the one for transfer and click the donation box, then click yes on the "Are you sure you want to transfer this?".  Original topic is here: http://www.scriptuo.com/index.php?topic=79.0

Code: [Select]

  set %CONTEXT_Transfer 593758  ; is the code for transfer a pet.

Here is my sub for the transfer

Code: [Select]
Sub turnin
gosub Gate ;gates you and pets to moonglow zoo box
donationbox:
set #lObjectID TIGFQMD         ;sets the ID of the donation box
set #lObjectTYPE CUD ; Sets Type of ID of the donation box
event macro ;double click donation box
event macro
turninpets:
                                                        ; Transfer code will go here.
if controlslots >=varTurnins                    ; This checks if your are done with your pet turn ins...
  GoTo turninpets:                                ; if your not done it will return to the turninpets:

return

Now, my question is, what variables do I need from TM's context menu and where do I put them?  Im still a little confused to some parts of scripting.  But I am learning fast.  So, can anyone help with this?

Do I need to put anything at the beginning of the script for config purposes?  Or can it be included in this turn in sub?  I would like it to just randomly target a tame, bring up the context menu, click transfer and target the donation box.
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: Need help with pet transfer sub.
« Reply #1 on: May 28, 2009, 12:03:07 PM »
0
for pet transfer to box the pets context menu never changes.  for that reason i would just make it short and sweet-

use:
exevent popup %pet (or #findid of pet to be transfered)

then use container positions to do a simple click.

I will show you tonight how i do it in my zoo donator.

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +57
  • Referrals: 1
    • View Profile
Re: Need help with pet transfer sub.
« Reply #2 on: May 28, 2009, 12:31:20 PM »
0
for pet transfer to box the pets context menu never changes.  for that reason i would just make it short and sweet-

use:
exevent popup %pet (or #findid of pet to be transfered)

then use container positions to do a simple click.

I will show you tonight how i do it in my zoo donator.

Will this do the single left click as well?  And does %pet mean the pet name or will it grab a random pet closest?  #findid, does this need to be the type or id?  As in I can just put in the PG_VF_VE_GE_ZD_ of types of pets that would be had here?

So if setup went like this
Code: [Select]
set %varTameID PG_VF_VE_GE_ZD_

then the line to transfer could be this...
Code: [Select]
exevent popup #TameID
set %CONTEXT_Transfer 593758

Is this correct?
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: Need help with pet transfer sub.
« Reply #3 on: May 28, 2009, 03:47:24 PM »
0
something like this....
look for the tamed pet.
set it
popup name
select spot
target donation box

From my zoo donator:
Code: [Select]
finditem %tamed G_1  <---- this could be bear id
if #findkind <> -1
    {
    set %tamed #findid       <----set the bear id
    exevent popup %tamed    <-----pop up context
    set %safety_timer #scnt + 3
    repeat
    until #contsize = 118_186 || ( #scnt > %safety_timer )    <---waits for correct cont. size
    set %clickx #CONTPOSX + 15 ;clicks context menu location to transfer   
    set %clicky #CONTPOSY + 145    <---sets cont position and adds location from point 0, 0 on menu
    click %clickx %clicky f              <--- does a fast click on that position above
    target
    set #ltargetid %donation      <---- targets % donation (the box set earlier)
    set #ltargetkind 1               <--- sets object type as 1 (important so easy uo finds it)
    event macro 22                    <last target and it is gone

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +57
  • Referrals: 1
    • View Profile
Re: Need help with pet transfer sub.
« Reply #4 on: May 28, 2009, 06:29:40 PM »
0
Wow, that just confused the hell out of me lol.  Damn pain killers fogging my perception I think.

One thing I do know in fact is if you pets have a name WITHOUT spaces, say just "bear" you can say "bear transfer" and it will bring up a target cursor.  Then click the donation box and it will bring up the yes/no dialog, click yes and there you have it, pet is donated.  No need to even open the donation box, which is cool.

Now, I think if you have 5 pets with all the same name, it will just randomly pick one to donate.  That or you will get 5 confirmation boxes that you need to click yes to.  I am going to check this, because if it works like that, no need to even use the transfer dialog by clicking on the pet just "macro 1 0 petname transfer". 

Then all I need is a sub to rename the pets as they are tamed.  To me this seems MUCH easier.  I will check that right now and let you know.
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +57
  • Referrals: 1
    • View Profile
Re: Need help with pet transfer sub.
« Reply #5 on: May 28, 2009, 06:46:57 PM »
0
Okay went there with charger of the fallen mount.  Tamed 4 polar bears, renamed them all to "a" gated them to moonglow zoo.  said "A transfer" and it brought up the target, clicked the donation box and it transfer one, repeated "a transfer" and targeted the box and another was transfer.  Did this through the whole four I had, all the same name and all 4 transfer without having to single left click for the dialog to "select transfer" and didnt have to open the donation box either.  So pretty much like this...

say: a transfer
click yes
say: a transfer
click yes
say: a transfer
click yes
say: a transfer
click yes

done.

So basicly I will just need a sub with the taming to change all names to "a" or "pet" or "donation" or whatever variable is set and have the sub gate to moonglow and do what I just said...

Code: [Select]
sub Donate
petdonate:
macro 1 0 pet transfer
wait 1s
set lobjectTYPE donation box ect
set lobjectID donation box
(click yes on gump)
if #followers >1 goto petdonate:

That seem right for just the turn in?

As I said, it seems a lot easier to do this and change the pets name at the time of taming.  Probably faster too, no dialogs.
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +57
  • Referrals: 1
    • View Profile
Re: Need help with pet transfer sub.
« Reply #6 on: May 29, 2009, 08:46:23 AM »
0
_C2_

In the taming sub I put in a rename (well used MD's) and it renames all new tames to "a" and put this code into my donation tamer.  It works well, all I needed was the x y for the click.

Code: [Select]
Sub turnin
gosub Gate                                   ; gates you and pets to moonglow zoo box
donationbox:
set #lTargetID TIGFQMD                       ; sets the ID of the donation box
set #lTargetTYPE CUD                         ; Sets Type of ID of the donation box
turninpets:
event macro 1 0 a transfer                     ;
wait 1s
event macro 22 0                                     ;
if #followers >=%varTurnins                                   ;<---IS this correct????
  {                                                  ;
  goto turninpets
  }
gosub ReturnToTame
return
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: Need help with pet transfer sub.
« Reply #7 on: May 29, 2009, 08:58:29 AM »
0
what i was trying to show you was a different way to do donations.  using the pets menu and clicking transfer.  you really don't need to go through the process of renaming a pet to donate although that works fine too.  Also the container posx/y stuff ensures that all computer set-ups and resolutions can use it.  if you don't account for container positions ... and do plain old screen clicks you end up with user problems left and right.   renaming bypasses containers though.  

the box id that you put in 7 digits is only specific to your shard BTW.

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +57
  • Referrals: 1
    • View Profile
Re: Need help with pet transfer sub.
« Reply #8 on: May 29, 2009, 09:49:34 AM »
0
_C2_

The gump I am using the x y for is the "Are you sure you want to transfer ownership of this pet?" gump.  Is there an easier and more universal code that will click the yes button on that specific gump?  How would you do it, with the code I have?
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: Need help with pet transfer sub.
« Reply #9 on: May 29, 2009, 10:07:33 AM »
0
_C2_

The gump I am using the x y for is the "Are you sure you want to transfer ownership of this pet?" gump.  Is there an easier and more universal code that will click the yes button on that specific gump?  How would you do it, with the code I have?
[/quote

here is how to go about it if you wish to make a more stable click.
go to the box with an animal and transfer it but leave up the yes/no gump.

play this code:
Code: [Select]
set #contposx 0
set #contposy 0
halt

Now don't move the container!
look at the bottom of the frame of easy uo window to find the cursor coordinates.  move your cursor around to see which ones move xxx/xxx, your x/y.  Now hover over the yes, and get the x/y numbers.

now that you have the universal click positions for all users/ resolutions...
use this code snip it:
Code: [Select]
    set %clickx #CONTPOSX + ;(x position that you found)   
    set %clicky #CONTPOSY + ;(y position you found)
    click %clickx %clicky f  ;<-- that will click for you once set
this basically sets your clicks up based on where the gump begins on the screen and adds on the coords you found to make the click point hit yes.

Just paste that over your click line.  it is longer than one line but more stable.

could look like this once you add the locations:

Code: [Select]
Sub turnin
gosub Gate                                   ; gates you and pets to moonglow zoo box
donationbox:
set #lTargetID TIGFQMD                       ; sets the ID of the donation box
set #lTargetTYPE CUD                         ; Sets Type of ID of the donation box
turninpets:
event macro 1 0 a transfer                     ;
wait 1s
event macro 22 0                                     ;
wait 10
    set %clickx #CONTPOSX + ;(x position that you found)   
    set %clicky #CONTPOSY + ;(y position you found)
    click %clickx %clicky f  ;<-- that will click for you once set
if #followers >=%varTurnins                                   ;<---IS this correct????
  {                                                  ;
  goto turninpets
  }
gosub ReturnToTame
return

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +57
  • Referrals: 1
    • View Profile
Re: Need help with pet transfer sub.
« Reply #10 on: May 29, 2009, 10:17:19 AM »
0
Thanks C2, you da man!

Sorry Im gonna stop putting in the underscores if thats alright with you, its faster to type your name lol.
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • Reputation Power: 154
  • 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: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Need help with pet transfer sub.
« Reply #11 on: May 29, 2009, 10:19:25 AM »
0
At least it's not still Cake2.  :p
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: Need help with pet transfer sub.
« Reply #12 on: May 29, 2009, 11:04:53 AM »
0
ah the good old days.  i didn't even notice the underscores.  You know those are only there because u cannot search two letter names at least you couldn't on the old site when it first changed.

Tags: