Pet Abilities! [Snippet]

adakos

Active Member
Do you play a pet class? do you have a macro set up for /pet attack? Do you hate having to cycle through each of your pet's abilities? Do you play a necro and hate having to reconfigure your macros after every graft swap?
Here is the solution in snippet form.
You can put this in an *.iss file and then make a macro to /run it if you want, or put it in part of a larger script.
I hope you enjoy this snippet.

Code:
function PetAttack()
{
  VGExecute "/pet attack"
  VGExecute "/minions attack"
  
     ;-----counting variables, reset them!-----
     variable int i = 1
     variable uint Count = 0
     ;-----let's do all the abilities our pet has!-----
     ;-----when our counter is <= than total pet abilities-----
     for (${i}<=${Me.Pet.Ability} ; i:Inc)
     {
		;-----if my pet is within melee range (<=5)------
       if ${Math.Calc[${Math.Distance[${Me.Pet.ToPawn.Location.X},${Me.Pet.ToPawn.Location.Y},${Me.Target.Location.X},${Me.Target.Location.Y}].Int}/100]}<=5
       {
       ;-----use the ability we have selected-----
         Me.Pet.Ability[${i}]:Use
         wait 1
       }
     }

  
  
 ; The old way of doing things. Now Obsolete!
;---------------------------------------------
;if ${Me.Pet.Ability[Sneer].IsReady}
;{
; vgexecute /cast \"Sneer\"
;}
;---------------------------------------------

}
 

Temil2005

Active Member
copyed code into petattack.iss
created macro in VG that is "/run petattack.iss"
when it runs I get ...

Script doesnt have a main function ... or something along those lines.

Am I doing something wrong or do I need to edit or alter this in some way to get it working? .. the idea is great btw..

anyways, thx in advance..

EDIT::
Got it working, and works as expected and explained.. thx!
heres how I got it working....

changed the following....
Code:
function Petattack()
and replaced with ....
Code:
function main()
that wont screw anything up, right? =)

also, I was wondering if there was a way to have to AUTO run whenever I send the pet in.. so instead of the /pet attack ..being in the code, having some code that will monitor the pet attacking or not attacking..if attacking, then script runs and repeats.. if not attacking, then doesnt try to use skills..
 
Last edited:

Sorenbro

Active Member
Yes it would be nice to be able to run the script ones and then have it detected when your pet is attacking and then auto use skills .
 

Xeon

Active Member
Code:
if ${Math.Calc[${Math.Distance[${Me.Pet.ToPawn.Location.X},${Me.Pet.ToPawn.Location.Y},${Me.Target.Location.X},${Me.Target.Location.Y}].Int}/100]}<=5
Could be written as:
Code:
if ${Math.Calc[${Math.Distance["${Me.Pet.ToPawn.Location}","${Me.Target.Location}"].Int}/100]} <= 5
Notice the " around the Location arguments, which are required because the Location string has a , in it.
 

Cr4zyb4rd

Active Member
I don't know...in many situations the best call is to use 2d distance and exclude things outside of a given Z-range entirely, as something directly over/under you might as well be on the moon many times in a game like VG.
 

Xeon

Active Member
Cr4zyb4rd said:
I don't know...in many situations the best call is to use 2d distance and exclude things outside of a given Z-range entirely, as something directly over/under you might as well be on the moon many times in a game like VG.
Using the Z axis to also compute distance does the right thing in the above code, as they could be 5m from you in the X,Y coords, but 100m above you in the Z.
 

Sorenbro

Active Member
Any updates on this? Is it possible to make this detected when you are attacking an npc and have the pet auto attack and use the grafts?
 

Temil2005

Active Member
Sorenbro said:
Any updates on this? Is it possible to make this detected when you are attacking an npc and have the pet auto attack and use the grafts?
if your look here
http://www.isxgames.com/forums/showthread.php?t=1082
I have been working on a script, that merged together some different petassist scripts to create a basicly one, with group support (pet assists all group members) and also assist your target.. uses all abilitys when avalible (no more spam when not ready) .. some small issues are there, but working on those. Waiting for some isxvg commands to work again, to get it to check all encounter mobs and all ..

let me know if this is what you are looking for.. and want you would like to see added, and I'll see what i can do.. plz post replys about the vgpetassist on the other forum.
 

adakos

Active Member
yeah this is just a snippet. I am putting the code out there so people can incorporate it into other sorts of scripts, and for those with less scripting practice to have something to examine.
there will be no updates to this unless i find a dramatically different way of doing this which is more effective.
 
Top Bottom