ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: enrod on December 11, 2011, 12:09:37 PM

Title: Pet gheal potion script (requesting help)
Post by: enrod on December 11, 2011, 12:09:37 PM
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 :)
Title: Re: Pet gheal potion script (requesting help)
Post by: Khameleon on December 11, 2011, 01:20:39 PM
unfortunately, this sounds like a non osi shard, we would need some information how how the process works to use potions on a pet.
Title: Re: Pet gheal potion script (requesting help)
Post by: enrod on December 11, 2011, 01:33:32 PM
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
Title: Re: Pet gheal potion script (requesting help)
Post by: manwinc on December 11, 2011, 04:08:48 PM
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
}
}

Title: Re: Pet gheal potion script (requesting help)
Post by: manwinc on December 11, 2011, 04:12:56 PM
Looks like EN Has a Sub for Checking Health Bars.

http://www.scriptuo.com/index.php?topic=1513.0;highlight=pet+health+bar (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.
Title: Re: Pet gheal potion script (requesting help)
Post by: Cerveza on December 12, 2011, 05:06:08 AM
You can easily adapt something from our tutorials to do this for you.
Title: Re: Pet gheal potion script (requesting help)
Post by: enrod on December 12, 2011, 12:48:22 PM
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?
Title: Re: Pet gheal potion script (requesting help)
Post by: Cerveza on December 12, 2011, 02:14:50 PM
Pixel Scan?
Title: Re: Pet gheal potion script (requesting help)
Post by: enrod on December 12, 2011, 02:41:45 PM
I'm not quite familiar with pixel scanning  :-[
Title: Re: Pet gheal potion script (requesting help)
Post by: TrailMyx on December 12, 2011, 02:44:19 PM
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
Title: Re: Pet gheal potion script (requesting help)
Post by: enrod on December 12, 2011, 05:13:56 PM
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.