Author Topic: Pet gheal potion script (requesting help)  (Read 4236 times)

0 Members and 1 Guest are viewing this topic.

Offline enrodTopic starter

  • Jr. Member
  • **
  • Posts: 22
  • Activity:
    0%
  • Reputation Power: 1
  • enrod has no influence.
  • Respect: +6
  • Referrals: 0
    • View Profile
Pet gheal potion script (requesting help)
« on: December 11, 2011, 12:09:37 PM »
0
I'd like to start off by saying that I'm not an experienced scripter, but I am just a guy who can usually get his scripts to work looking for a fairly simple script through easyuo, instead of razor. What I'm looking for, is a simple action of using a pet greater heal potion on my pet when it's health is below 100%. No need for vet/bandies, just the potion! Any help would be greatly appreciated :)

Offline Khameleon

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: Pet gheal potion script (requesting help)
« Reply #1 on: December 11, 2011, 01:20:39 PM »
0
unfortunately, this sounds like a non osi shard, we would need some information how how the process works to use potions on a pet.

Offline enrodTopic starter

  • Jr. Member
  • **
  • Posts: 22
  • Activity:
    0%
  • Reputation Power: 1
  • enrod has no influence.
  • Respect: +6
  • Referrals: 0
    • View Profile
Re: Pet gheal potion script (requesting help)
« Reply #2 on: December 11, 2011, 01:33:32 PM »
0
The process is straight forward. You double click a "pet greater heal potion", a target hand comes up, and you select your pet. I could easily find ID's for both the potion, and my pet if needed for this script. Add an additional if statement, if health<100%, use potion ID on pet ID. That's the theory, I just don't know how to script it :P

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Pet gheal potion script (requesting help)
« Reply #3 on: December 11, 2011, 04:08:48 PM »
0
To do this, You would need to Find code for Checking the Healthbar of a pet (Pixel Scanning through EUO), and then after that its pretty straight forward

set %Pet XXXXX ; Id for pet
While Penguins <> Leprachauns
{
Gosub Get_Health ; <- The code to actually check health you would have to get from someone else.
if %Pet_Hits < 80
{
Finditem (Heal Potion Type) C_ , #Backpackid
if #findcnt = 0
Halt
set #lobjectid #Findid
event macro 17 0
Target 30
set #ltargetid %Pet
set #ltargetkind 1
Event macro 22 0
wait 20
}
}

Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Pet gheal potion script (requesting help)
« Reply #4 on: December 11, 2011, 04:12:56 PM »
0
Looks like EN Has a Sub for Checking Health Bars.

http://www.scriptuo.com/index.php?topic=1513.0;highlight=pet+health+bar

I have never Personally Used it, but EN's stuff is always Top Notch.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Pet gheal potion script (requesting help)
« Reply #5 on: December 12, 2011, 05:06:08 AM »
0
You can easily adapt something from our tutorials to do this for you.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline enrodTopic starter

  • Jr. Member
  • **
  • Posts: 22
  • Activity:
    0%
  • Reputation Power: 1
  • enrod has no influence.
  • Respect: +6
  • Referrals: 0
    • View Profile
Re: Pet gheal potion script (requesting help)
« Reply #6 on: December 12, 2011, 12:48:22 PM »
0
Hmm I must not be as good with these scripts as I thought if it should be easily adaptable :P. It's also possible that the OSI subs for pulling healthbars is different than the freeshard I currently play on. Is there a way to go around pulling the health bar? Maybe something along the lines of view health of current health bar pulled and heal petid with potionid?

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Pet gheal potion script (requesting help)
« Reply #7 on: December 12, 2011, 02:14:50 PM »
0
Pixel Scan?
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline enrodTopic starter

  • Jr. Member
  • **
  • Posts: 22
  • Activity:
    0%
  • Reputation Power: 1
  • enrod has no influence.
  • Respect: +6
  • Referrals: 0
    • View Profile
Re: Pet gheal potion script (requesting help)
« Reply #8 on: December 12, 2011, 02:41:45 PM »
0
I'm not quite familiar with pixel scanning  :-[

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13305
  • Activity:
    0.8%
  • 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: Pet gheal potion script (requesting help)
« Reply #9 on: December 12, 2011, 02:44:19 PM »
0
Here's another example of pet gump healing.  I used this on a freeshard that was post-AOS.  It's not really supported, but it might give you some ideas along with ENs work.

http://www.scriptuo.com/index.php?topic=31.msg31#msg31
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline enrodTopic starter

  • Jr. Member
  • **
  • Posts: 22
  • Activity:
    0%
  • Reputation Power: 1
  • enrod has no influence.
  • Respect: +6
  • Referrals: 0
    • View Profile
Re: Pet gheal potion script (requesting help)
« Reply #10 on: December 12, 2011, 05:13:56 PM »
0
That didn't take much to fix to my needs at all. Thanks TrailMyx! :D

It appears to be based off of highlighting the healthbar. Is that how it's supposed to work? I assume that's what is meant by pixel scanning.
« Last Edit: December 12, 2011, 05:39:30 PM by enrod »

Tags: