Assistbot

naimean

Active Member
Curious if anyones working on a bot that will follow you around and assist you on Whatever mobs your grinding on.

i have limited programming skill but i've made a few macroquest scripts from scratch, and have chopped and butchered a few from isx. I'd be willing to help flesh one out.

Having it check too see the character its following had engaged its offensive target and begin attacking after a few seconds, then after the mob is toast, have it begin to follow again. you could have it checking around it for players while your grinding so it would say something in party chat when someone got near.
*though this is kind of moot because of radar, but sometimes i dont always see em sneaking up on me until im half dead*
 

Smyrk

Active Member
Much of the code for something like this can probably be found in VGShaman by Zeek if you wanted an example to start from.
 

Temil2005

Active Member
if ya get it working, and might have time, maybe add in an assist option for pets? .. for example, when a party member (or / and specified target) is attacked, or starts attacking.. it causes your pet to auto responce, by attacking the partys or friends target. This would be helpfull in multiple ways.

1)good for 2nd chars that have pets, and if you are a warrior or something that wants to allow there pet to help, and not have the 2nd char take any angro

2)good for when you send you pet into attack a mob, and you have 3 mobs on you, or the group ..and want your pet to auto help out with fighting

Jut an idea is all.. would like to see a pet specific script implemented, sence noone seems to have done it. figured this was kind of like an assisting script also =)
 

adakos

Active Member
there are already scripts that do this - and if they dont do EXACTLY what you want its just a simple matter of editing them. Can't edit for a damn? well then it's time to learn a little scripting.

you could always use this:
Code:
function main()
{
while !${Me.IsDead} || ${Me.IsDead}
{
vgexecute "/say Lol I'm a mad hacker"
waitframe
vgexecute "/say Pwn, Now im Sending Pets in!"
waitframe

if (${Me.Target.Distance}> 6)&& (${Me.Target.Distance}<25)
{
vgexecute "/assist"
vgexecute "/pet attack"
}
vgexecute "/assist"
}
}
... or not. but you could probably edit the code above to automatically assist and send pets in with a good solid hour of reading about LavishScript.
 

Temil2005

Active Member
well, tool a litle of your advice, alot with a bit of code I found in some other scripts ..merged them together, and added small amount for wiki .. this is what i come up with for a script that will auto defend you and group member 1 in party. it also will use all the pets abilitys, on first turning on script (I dont take credit for this part of the script.. just trying to put it to good use) ..

cons :
1 . cant figure out how to make the pet abilitys wait to be used till the pet is within 5m of mob
2. cant figure out how to loop the pet abilitys to while the pet is in combat, doesnt seem to work again after first time of turning this script on
3. was unable to test out the group being attacked, and pet auto assisting, it was late when I got this done, but no errors. So assuming it targets the correct member and all, it should work.

Once I can test this more, I'll add on all the members, but wanted to see if anyone could give some feedback on this sence i'm not a coder by no means. Very new to the coding scene, so dont laugh at me. =)

Code:
function main()

{
while ${Me.HavePet}
	{
	if ${Me.InCombat}
		{
		if ${Me.Target(exists)} && ${mypet.CombatState} == 0
			{
  			VGExecute "/pet attack"
 			VGExecute "/minions attack"
    			variable int i = 1
    			variable uint Count = 0
			for (${i}<=${Me.Pet.Ability} ; i:Inc)
				{
       				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
       					{
         					Me.Pet.Ability[${i}]:Use
         					wait 1
       					}
				}
			}
		}
	}
	{
	if ${Me.Group[1].InCombat} && ${Math.Calc[${Math.Distance[${Me.Pet.ToPawn.Location.X},${Me.Pet.ToPawn.Location.Y},${Me.Group[1].Location.X},${Me.Group[1].Location.Y}].Int}/100]}<=150
		{
		if ${Me.Group[1].Target(exists)} && ${mypet.CombatState} == 0
			{
  			target ${Me.Group[1]}
			VGExecute "/assist"
			VGExecute "/pet attack"
 			VGExecute "/minions attack"
			}
		}
	}
}
 

Cr4zyb4rd

Active Member
Tips and (hopefully) constructive criticism :)

Code:
			if ${Me.Target(exists)} && ${mypet.CombatState} == 0
What's "mypet"? It's never defined anywhere, which is probably causing this condition to always evaluate true (null == 0). Did you by chance mean Me.Pet?

Code:
				variable uint Count = 0
this variable is never used

1 . cant figure out how to make the pet abilitys wait to be used till the pet is within 5m of mob
Yet you have code in there that's obviously attempting to do just that. If you have a condition that you're not sure is evaluating correctly, either echo the individual components of the comparison or use a hud entry so that you can watch them in real time. From the IS console:
Code:
hud -add Pet2TargetDistance 5,350 ${Math.Calc[${Math.Distance[${Me.Pet.ToPawn.Location.X},${Me.Pet.ToPawn.Location.Y},${Me.Target.Location.X},${Me.Target.Location.Y}].Int}/100]}
2. cant figure out how to loop the pet abilitys to while the pet is in combat, doesnt seem to work again after first time of turning this script on
well, as I said above, I can't see how ${mypet.CombatState} is working at all, unless there's some alias set up or something else going on I don't know about. But if it WERE working, your comparing it to 0 would explicitly rule out the code in those If blocks being executed while the pet is already in combat.
 

Temil2005

Active Member
First off.. thanks for the reply,and yea.. it's all constructive critisisim. I'm a dos coder, but dos is mostly obsolite IMO, and trying to get up on the times! =)
---------------------------------------

1 . cant figure out how to make the pet abilitys wait to be used till the pet is within 5m of mob



Yet you have code in there that's obviously attempting to do just that. If you have a condition that you're not sure is evaluating correctly, either echo the individual components of the comparison or use a hud entry so that you can watch them in real time. From the IS console:
well, the code in this part only causes the pet to attack "IF" its within 5m of the mob, when first runing the script. NOT causeing it to wait till the pet is within 5m to acualy use the skill, and repeat using the skills/abilitys when they are avalible (ex: every 10-15secs). Will that code you posted cause it to repeat, or am I just writing it up wrong to cause it to repeat it's self?

Code:
variable uint Count = 0
this variable is never used
That part of the code isnt mine, that was from another post on here called "pet abilitys [snippits]" or something like that. Unsure exactly what that part of the code it for, but it seems that if you remove it, then the pet abilitys dont work at all.

if ${Me.Target(exists)} && ${mypet.CombatState} == 0
What's "mypet"?
It's never defined anywhere, which is probably causing this condition to always evaluate true (null == 0). Did you by chance mean Me.Pet?
um, i tried
${my.pet.CombatState} == 0
${me.pet.CombatState} == 0

those were my first 2 atempts, and I couldnt get it to work.. didnt get errors, but pet just sat there and did nothing.
--------------------------------------

I look all over the wiki and other posts and all.. but is there a general guide on how to write these scripts, and yes I read the scripting basics on the wiki, but didnt seem to help me much, because I'm obviously missing something in this.

I'll look at it a little more tonight, and maybe remove that math code, and put in a more simple one, just for testing. Like I said, used someones elses code for that, which i give create for it, but unsure exactly how the variable's come into play or why the looping of the pet abilitys isnt working.

To my understanding, if it comes after the "if pet is in combat" code, then if should work everytime the pet goes into combat, not just the first time. Anyways. thanks for the help!
 

Cr4zyb4rd

Active Member
Will that code you posted cause it to repeat, or am I just writing it up wrong to cause it to repeat it's self?
what I posted was just to create a hud overlay displaying that value, so you could watch it and see what it's doing.

um, i tried
${my.pet.CombatState} == 0
${me.pet.CombatState} == 0
Case is significant. Me.Pet is not the same as me.pet. After looking around at all the wiki and changelogs, the full datatype you need to check is probably ${Me.Pet.ToPawn.CombatState}

Unsure exactly what that part of the code it for, but it seems that if you remove it, then the pet abilitys dont work at all.
That specific line I pasted is "dead code", it defines a variable that's never referenced. There's no way removing it could break anything.

To my understanding, if it comes after the "if pet is in combat" code, then if should work everytime the pet goes into combat, not just the first time.
But you don't HAVE any such code. Your code is checking for CombatState==0, that is to say is my pet NOT in combat. To tell it to do something while it IS in combat, you would have to add another section OUTSIDE of that If {} block.

I look all over the wiki and other posts and all.. but is there a general guide on how to write these scripts, and yes I read the scripting basics on the wiki, but didnt seem to help me much, because I'm obviously missing something in this.
All you can do is keep trying, asking questions, and looking at other people's code until it clicks. By all means join us on irc http://www.isxgames.com/forums/showthread.php?t=9 and ask questions if you get stuck.
 

Temil2005

Active Member
Quote:
To my understanding, if it comes after the "if pet is in combat" code, then if should work everytime the pet goes into combat, not just the first time.


But you don't HAVE any such code. Your code is checking for CombatState==0, that is to say is my pet NOT in combat. To tell it to do something while it IS in combat, you would have to add another section OUTSIDE of that If {} block.
I think I got most of the other stuff ya mentioned, except for this one.. maybe it's just me thinking of other type of coding (mostly dos) but if you use the following command ..
Code:
if ${Me.Target(exists)} && ${mypet.CombatState} == 0
isnt that saying "If my pet is distance of less then 5m,
AND
my pet is not in combat state
THEN
run the following { }
otherwise, keep watching for pet to be in combat to run { }

Also, when you say OUTSIDE.. what would that code outside the backets be or do? .. something such as "if pet is not in combat, do _____ ? .. or something else?
just trying to understand what the reason for it.. sorry for any stupid questions.. I'm a noob at this..trying to understand it all sence most of the requests or ideas of scripts.. noone wants to take on.. figured i would try to make up a simplified version to get my by =) .. figured it couldnt hurt..


sorry if I'm wrong onthat.. and maybe once that is cleared up, I can get more of an understanding.
 

Cr4zyb4rd

Active Member
Your description indicates you have an understanding, but the code you pasted's totally different. :) Maybe an example would be best...here's how I would write it.

Code:
while ${Me.Target(exists)}
{
	; none of this stuff will run if i don't have a target
	if ${Me.Pet.ToPawn.CombatState} == 0
	{
		; my pet isn't attacking
		; here's where i'll insert code to send the pet in
		; ...
	}
	else
	{
		; my pet must be in combat
		; here's where i'll insert code to make my pet use
		; its abilities, make sure it's on the right target
		; and so on
		; ...
	}
	; wait for the next frame, so the loop isn't running
	; 3000 times per second
	waitframe
}
of course all of that hinges on Me.Pet.ToPawn.CombatState being the right thing to check against. I don't have a pet, so I can't test it.
 

Temil2005

Active Member
Really apreciate all the help .. so far, this is what i got put together.. Keep in mind, some of these codes arent mine, and they are choped from some other coders out there.. hope ya guys dont mind =/ .. I give create for anyone that makes them..
Anyways, acualy you put it in an example format.. that helped alot.. there is only a few issues.. first, here is the newest code...

Code:
function main()

{
while ${Me.HavePet}
	{
	while ${Me.InCombat}
		{
		if !${Me.Target.IsDead} && ${Me.Pet.ToPawn.CombatState} == 0
			{
  			VGExecute "/pet attack"
 			VGExecute "/minions attack"
			}
			else
			{
			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]} <= 20
				{
					if ${Me.Pet.Ability[1].IsReady}
					{
					Me.Pet.Ability[1]:Use
					Wait 3
					}
					if ${Me.Pet.Ability[2].IsReady}
					{
					Me.Pet.Ability[2]:Use
					Wait 3
					}
					if ${Me.Pet.Ability[3].IsReady}
					{
					Me.Pet.Ability[3]:Use
					Wait 3
					}
					if ${Me.Pet.Ability[4].IsReady}
					{
					Me.Pet.Ability[4]:Use
					Wait 3
					}
				}
			}
			waitframe
		}
	}
	{
	while ${Group[1].InCombat}
		{
		while !${Group[1].Target.IsDead}
			{
			if ${Me.Pet.ToPawn.CombatState} == 0
				{
				if ${Math.Calc[${Math.Distance[${Me.Pet.ToPawn.Location.X},${Me.Pet.ToPawn.Location.Y},${Group[1].Target.Location.X},${Group[1].Target.Location.Y}].Int}/100]} <= 5000
					{
					target ${Group[1].Target}
					VGExecute "/pet attack"
 					VGExecute "/minions attack"
					}
					else
					{
					if ${Math.Calc[${Math.Distance[${Me.Pet.ToPawn.Location.X},${Me.Pet.ToPawn.Location.Y},${Group[1].Target.Location.X},${Group[1].Target.Location.Y}].Int}/100]} <= 5
						{
							if ${Me.Pet.Ability[1].IsReady}
							{
							Me.Pet.Ability[1]:Use
							Wait 3
							}
							if ${Me.Pet.Ability[2].IsReady}
							{
							Me.Pet.Ability[2]:Use
							Wait 3
							}
							if ${Me.Pet.Ability[3].IsReady}
							{
							Me.Pet.Ability[3]:Use
							Wait 3
							}
							if ${Me.Pet.Ability[4].IsReady}
							{
							Me.Pet.Ability[4]:Use
							Wait 3
							}
						}	
					}
				}
				waitframe			
			}
		}
	}
	{
	while ${Me.Pet.ToPawn.CombatState} == 4
		{
		VGExecute "/pet toggledefendself"
		}
	}
}

now for the issues..

1. if the group commands aren't correct.. havent tested it yet.. have to wait till i get into group to try it.. but dont want to draw atention =P
edit: finaly tested the group part of this, and it doesnt work either.. pet doesnt assist my group member1 .. I'm thinking it's something simple in the code with the Group[1] command I have in there.. I was about to use that to target my group1 by typing it into the console, but when puting the same thing into the script.. it doesnt do anything. I know it's probly something really stupid that i put into there that I'm just not seeing..

2. anyway to cause my pet to target and attack my groups mobs, without me acualy targeting them myself? Want to be able to still target corpses, players, etc, without the script causing me to target a differnt mob.. while my pet run from mob to mob.. helping with killing them..

thanks again.. for all the help
 
Last edited:

Temil2005

Active Member
ok.. finaly got this thing working, mostly anyways..

Working Parts...

-- pet auto attacks mobs that attack you or your group
-- pet auto assists all members of your group (mob they attack, or attack them)
-- pet auto uses all his/her abilitys on mobs after attacking (auto reuses when avalible again)
-- pet checks for distance to group members before attacking (less then 2000m
-- auto assist/target group members mob
-- pet assists/attacks one mob till dead, then changes to other mobs in encounter

ToDo / Need help with ...

-- send pet to assist group members, without loosing focus of own target
-- cause pet to only attack mobs that are on encounter list (in battle)
-- cause pet to focus on and attack mob that attacks you, not current target
-- Being able to click the "backoff" pet button, and have that pause the script for 3mins, in case anything goes wrong with the script
-- once you run it, cause it to stay running, explicily when going from chunk to chunk
-- make it stay runing, or should I say "start running" once you get a pet up

Issues..

-- if you have mob1 targeted, and mob2 attacks you, pet runs and attacks mob1
-- have to have group members mob selected to have pet start assisting (script auto does this for you (targeting part) but it tends to change your target to that mob as well)
-- it stops when going from chunk to chunk
-- script stops when your pet dies, need to to monitor and wait for pet to be summoned


That all being said, I want to thank the ppl that helped. Also, want to ask that any hints, or ideas on any of the features ..or any code mantinence, to make it work better.. plz let me know..
 

Attachments

Last edited:

Cr4zyb4rd

Active Member
Used my new evil-moderator powers to move this to the scripts forum where it belongs.

I'm making some changes to the script that I'll post here shortly.
 

Cr4zyb4rd

Active Member
OK, cleaned things up a bit and here's what I've got. Untested, but hopefully things are close enough that you can at least see what I was going for and fix problems as needed/desired.

-

I took some redundant stuff and moved it into a function or into loops. This is critical if you want to keep a handle on code of any complexity...it's hard enough sorting out the spaghetti of nested if/then logic and loops without having to scroll up and down trying to remember "ok, that's where it does blah...i've already looked at that".

Don't ever be afraid to make a new function, even if it's just a few lines. I can't stress this enough. If it's anything the least bit complex, or something you're doing more than once, Function. If there's the least bit of doubt, Function.

-

Next I boxed up the whole blob into a HandlePet function, which I call from a "while 1" loop inside of main. This is the same as saying "while TRUE" or loop-forever. Of course the only way to stop the script now will be to explicitly endscript, which is less than ideal, but we can patch that up in a future lesson :)

You're usually going to want your main function to look sparse like this unless the whole thing is just a few commands, especially when doing this type of looping. Now if we decide we want to do more than just handle pets, say add a buffing routine or talk to the "outside world" via command-line arguments or user interface pieces, we have an obvious place to put that handling.

-

Now that things are "cleaner", I can see a lot more of the if/if/while/if skeleton of the script, and how things are nested. Here's a "picture" if you will of just the skeleton by itself.

Code:
if ${Me.HavePet}
	if ${Me.InGroup}
		if ${Me.InCombat}
			if !${Me.Target.IsDead} && ${Me.Pet.ToPawn.CombatState} == 0
			while !${Me.Target.IsDead} && ${Me.Pet.ToPawn.CombatState} == 1
				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]} <= 20
		else
			while ${Me.Pet.ToPawn.CombatState} == 0 && i:Inc<=${Group.Count} && ${Group[i].ToPawn.CombatState} == 1
				if ${Math.Calc[${Math.Distance[${Me.Pet.ToPawn.Location.X},${Me.Pet.ToPawn.Location.Y},${Group[i].ToPawn.Location.X},${Group[i].ToPawn.Location.Y}].Int}/100]} <= 2000
					if ${Math.Calc[${Math.Distance[${Me.Pet.ToPawn.Location.X},${Me.Pet.ToPawn.Location.Y},${Group[i].ToPawn.Location.X},${Group[i].ToPawn.Location.Y}].Int}/100]} <= 5
		if !${Me.InGroup}
			while ${Me.InCombat}
				if !${Me.Target.IsDead} && ${Me.Pet.ToPawn.CombatState} == 0
				else
					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]} <= 20
Now the power of structured programming really shows itself...isn't she pretty? I notice right off that I'm checking !${Me.InGroup} once I've already established that I'm in a group...this code will never run! Looking closer, it seems that I'm doing almost the same things I'd be doing in a group anyway.

I also see some while loops that should probably be simple conditional "ifs". The entire handler is going to be looped, so I have to be careful that my sub-loops aren't going to let the script get "stuck". It might not matter much now, but suppose later I want to write code to take special action if my HP get low. That code would never run if I'm stuck going "am I sill in combat? do I need to send the pet?" over and over. Of course using small sub-handlers that talk to each other is valid as well, but that tends to be a bit more involved and is the type of design decision it's usually best to make early on.

Shifting things around a bit, we have:

Code:
if !${Me.HavePet}
	if ${Me.InCombat}
		if !${Me.Target.IsDead} && ${Me.Pet.ToPawn.CombatState} == 0
		if !${Me.Target.IsDead} && ${Me.Pet.ToPawn.CombatState} == 1
			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]} <= 20
	elseif ${Me.InGroup}
		while ${Me.Pet.ToPawn.CombatState} == 0 && i:Inc<=${Group.Count} && ${Group[i].ToPawn.CombatState} == 1
			if ${Math.Calc[${Math.Distance[${Me.Pet.ToPawn.Location.X},${Me.Pet.ToPawn.Location.Y},${Group[i].ToPawn.Location.X},${Group[i].ToPawn.Location.Y}].Int}/100]} <= 2000
				if ${Math.Calc[${Math.Distance[${Me.Pet.ToPawn.Location.X},${Me.Pet.ToPawn.Location.Y},${Group[i].ToPawn.Location.X},${Group[i].ToPawn.Location.Y}].Int}/100]} <= 5
So the logic seems to be something like this -
Provided that I have a pet, do the following:
- Check that I'm in combat. If so:
-- Send in my pet if needed
-- If the pet's attacking and close enough, cycle through its abilities
- I'm not in combat, so if I'm grouped:
-- Assist my buddies in order, and have my pet do its thing

Attached is my revision, based on the above and probably with a refinement or two I forgot to mention. To be sure, there's still room for improvement (that distance check is just ugly to look at more than once, and the group stuff needs some work) but hopefully it demonstrates some coding practices that will serve you well in the long run if you keep them in mind.

One last note, I changed the name to VGPetAssist.iss, as a lot of people have scripts for multiple games all stuffed into the same directory.
 

Attachments

Temil2005

Active Member
really do apreciate the help..
About the functions, I was unsure how to link it to other functions, such as the GOTO command in dos.. so I just molded all the code together.. LOL!.. bit messy, but it worked =P ..

about the which commands, I added those in the middle / end of areas as to lock the pet to a mob, that the group member is attacking or being attacked by.. when I used IF statments there, and whenever I had group1 attacking mob1, and group2 attacking mob2 .. it would rapidly change targets to the 2 pets..and pet was all over the place, but i see how you would fix that with that break command (somewhat) ..

Had to change one line in here, bcause i was geting..

Dumping script stack
--------------------
-->C:/Program Files/InnerSpace/Scripts/vgpetassist3.iss:4 UsePetAbilities() while i:Inc<=${Me.Pet.Ability}
C:/Program Files/InnerSpace/Scripts/vgpetassist3.iss:36 HandlePet() call UsePetAbilities
C:/Program Files/InnerSpace/Scripts/vgpetassist3.iss:66 main() call HandlePet
Changed this ...
Code:
	while i:Inc<=${Me.Pet.AbilityCount}
  ::: to this :::
	for (${i}<=${Me.Pet.AbilityCount} ; i:Inc)
Then it worked fine.

Changed this ...
Code:
		variable int i=0
		while ${Me.Pet.ToPawn.CombatState} == 0 && i:Inc<=${Group.Count} && ${Group[i].ToPawn.CombatState} == 1
   ::: to this :::
		variable int i=0
		for (${i}<=${Group.Count} ; i:Inc)
		while ${Me.Pet.ToPawn.CombatState} == 0 && (${Group[${i}].ToPawn.CombatState} == 1
Didnt test group part yet, waiting for my testing buddys to come on, but it removed errors when runing, and if i'm reading correctly, it should work.
------------------------
in the code you sent back, it doesnt have a check to test if I'm in group, to check if I'm in combat. It looks like it MIGHT do that altomaticly, sence there is no WHILE in the "in group" command, but would I have to add in another "me.incombat" after it checks for the group, or does it do that check before it checks if I'm in a group, every single time??
Assuming there would have to be an added check into "InGroup" .. it would be the following....
Code:
 ::: Replacing InCombat area of script with this :::
		if ${Me.InCombat}
		{
			if !${Me.Target.IsDead} && ${Me.Pet.ToPawn.CombatState} == 0
			{
				call SendPet
			}
			if !${Me.Target.IsDead} && ${Me.Pet.ToPawn.CombatState} == 1
			{
				call AssistMe
			}
		}

 ::: That would be added into the "InGroup" and "!InGroup" commands, along with a new function... :::

function AssistMe()
{
	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]} <= 20
	{
		call UsePetAbilities
	}
}
Unsureif all that is needed, might be overkill.. just thought i would present it.



Searched all over the wiki and forum, cant seem to find any command to check which pet stance is set to currently (ex: defendme, autoassist, backoff, etc). Is there a command or way for it to check this, as it would make the default pet commands in game acualy control the script behaver, bepending on what option is selected ingame.



Soooo, what's the next leason? =)
one issue that I seem to still have is that it doesnt use the ability unless the mob that pet is attacking, is seleted.. probly have to use some sort of variables of some kind to label the mob IDs, and have it check the mob ID.. if the mob ID is correct, then pet ability is used.. even if mob is not current target. Not sure if this is posable, but just a guess =)

Also, still have issue with groups target being selected to have pet move in.. not to good if using a corpse abilty, that needs corpse targeted, because it auto looses target before you can cast it. But that is a later lesson I assume? =) .. thanks so much for fixing my mess ups .. your great man!
------------------
Including 2 files.. both with modified code to stop the err was I geting, but 1 file is without added check to see if I'm in combat while in group, before all others.. and 2nd one is example of what I was refering to, to see if it is really needed, or if it auto checks for that everytime without added code.
 

Attachments

Last edited:

Cr4zyb4rd

Active Member
Had to change one line in here, bcause i was geting..
Whoops...happens when I write in too many languages on a daily basis :)
You can replace what I had with
Code:
while ${i:Inc}<=${Me.Pet.AbilityCount}
although your for loop should achieve the same thing. (I tend to use while loops where possible, because they seem a bit more clear at-a-glance)
-
I knew the group stuff was still a bit borked, and the extra check you added for CombatState==1 looks like the right direction. I was more concerned with getting the flow right and removing some of the redundant code...I figure at least now if it needs fixed up you're not fixing the same problem in 3 different places. I took it from the way the code was originally written that you didn't WANT to tell the pet to assist groupmates unless you were out of combat (ie. looking for a new target) but if that doesn't work or isn't the behavior you want, by all means put the whole thing inside of an InCombat check, or better yet add that check to the HavePet check so the whole function just bails out if you're not in combat at that point.

I don't see any way right-off to check the pet "stance", you might want to ask around on IRC and/or look at other people's scripts. If all else, you might be forced to just set the stance blindly and use some variable to store what you most-recently set it to. The same goes for telling it to attack or otherwise interact with something you don't have targeted...you *might* be able to do it, but if there's a way I don't know it and can't think of anything to try.
 

Temil2005

Active Member
New version:

-Added in some extra checks to assist me before group members
-Added in auto loot when it range of corpses, assuming there is loot on corpse (fixed minor issue)

Working on:

-adding checks to have pets only attack mobs that are attacking you (removes the risk of attacking wrong targets) **thx for the patch to encounter**
-adding checks to keep pet within 40m (removes risk of pet over pulling running/feared mobs)
 

Attachments

Last edited:

Cr4zyb4rd

Active Member
Code:
	if ${Me.Target.ContainsLoot} && ${Me.Target.Distance} = 3
what's wrong with this picture?

Code:
		return
	}
	return
and this? Come to think of it, that whole loot function's a bit wonky.

Code:
	if !${Me.InCombat} && ${Me.Target.IsDead}
	{
		call Loot
	}
Hrm, I'm going to write a function to handle my pet...what's the first thing for it to do...oh yes, my pet's quite the loot-monkey.

Strictly speaking, does the InGroup section need to do anything more than pick a dtarget and /assist? The rest is going to happen anyway as soon as you have a valid (not dead) target, as you'll be InCombat as long as your group is.
 

Temil2005

Active Member
Cr4zyb4rd said:
Code:
	if ${Me.Target.ContainsLoot} && ${Me.Target.Distance} = 3
what's wrong with this picture?

Code:
		return
	}
	return
and this? Come to think of it, that whole loot function's a bit wonky.

Code:
	if !${Me.InCombat} && ${Me.Target.IsDead}
	{
		call Loot
	}
Hrm, I'm going to write a function to handle my pet...what's the first thing for it to do...oh yes, my pet's quite the loot-monkey.

Strictly speaking, does the InGroup section need to do anything more than pick a dtarget and /assist? The rest is going to happen anyway as soon as you have a valid (not dead) target, as you'll be InCombat as long as your group is.
Ok, about all this..
1.ok, so I forgot the 2nd equal sign..didnt notice it till after i posted, and forgot to update file =P

2.umm, dont like the returns? .. without them .. it didnt seem to revert back to the script, but who knows. I changed a few things in there sence..

3.well, no it doesnt have to do much more then assist.. except for the fact that it does need to make the pet attack and use all spells on target..
doesnt really do much more then that, but does loot, when out of combat..


posting a working version..and a none working version..
none working has a new encounter check that I cant seem to get working. i know the code is probly all fubared, but at least I think i'm making progress? =)
Cra4zy..mind helping me out with that one? thanks alot!

Basicly, the way the code is suposted to work..is that it checks your target's ID, and if it matches an encounters ID (using variables) then it goes to next step of the script, sending in the pet

If the pet isnt on the encounter ID list, then it deselects all targets, adds all mobs on encounter to a encounter list, then reselects past target
if that target is now on encounter list, then sends in pet.. if not, then sends pet to first mob on encounter list.

------------
does this make any sence, of am i over thinking here? It's the only way I could find to get the current mob on the encounter list, to make sure that mob is acualy in combat with me/party/etc.

thanks again for all the help!
 

Attachments

Stardog

Active Member
naimean said:
Curious if anyones working on a bot that will follow you around and assist you on Whatever mobs your grinding on.

i have limited programming skill but i've made a few macroquest scripts from scratch, and have chopped and butchered a few from isx. I'd be willing to help flesh one out.

Having it check too see the character its following had engaged its offensive target and begin attacking after a few seconds, then after the mob is toast, have it begin to follow again. you could have it checking around it for players while your grinding so it would say something in party chat when someone got near.
*though this is kind of moot because of radar, but sometimes i dont always see em sneaking up on me until im half dead*
healbot Does excatly this.
Follows, buffs, assists, heals. will work with any charecter
 

Cr4zyb4rd

Active Member
1.ok, so I forgot the 2nd equal sign..didnt notice it till after i posted, and forgot to update file =P

2.umm, dont like the returns? .. without them .. it didnt seem to revert back to the script, but who knows. I changed a few things in there sence..

3.well, no it doesnt have to do much more then assist.. except for the fact that it does need to make the pet attack and use all spells on target..
doesnt really do much more then that, but does loot, when out of combat..
wrong on all 3 counts. good job.

1. stack up as many equals signs as you like, the chances of the distance from your target being exactly 3 are pretty gosh-darn low.

2. returns are fine. adding an extra one as the last line of a block when the very next command outside of that block isn't.

3. "except for the fact that it does need to make the pet attack..." which is exactly what your script would be doing, which is exactly what I said.

and you seem to have missed my point that you shouldn't be calling your loot check from inside of your PET handler.
 

Temil2005

Active Member
wrong on all 3 counts. good job.
Opps .. well, still learning Mr. yoda .. I'm just a young padawan! =)

1. stack up as many equals signs as you like, the chances of the distance from your target being exactly 3 are pretty gosh-darn low.
yet again, OPPS.. I ment a "<" in there.. so as long as 3 or less.. I fixed it with < in working version, but I typed "=" in my msg.. sorry, at working, and taking tech calls at same time.. so got confused.

2. returns are fine. adding an extra one as the last line of a block when the very next command outside of that block isn't.
hmm, didnt realize what the returns even do, but I saw someone elses loot script that showed return in the last command, so when i didnt use them, and it didnt work correctly.. then I used them (as other coders script) it worked.. unsure 100% on what the returns in there are even doing. and why they arent needed in the last set of {}

and you seem to have missed my point that you shouldn't be calling your loot check from inside of your PET handler.
Umm, point noted, but small issue.. if I remove it from that location
(function HandlePet()
it will only run the loot script while i dont have a pet, have corpse targeted that has loot.. if i target corpse with loot, without doin that check in the
if ${Me.HavePet}
then it wont work when I have a pet..

Not sure why, but sence i moved some things around, if i dont have a pet, it stops the script .. if I do have a pet, it works fine.. do I need to add in a RETURN somewhere in the main function for that, or is it something else needed to make it stay runing? .. again.. not 100% sure on what are requirments to make a script stay runing..
 

Cr4zyb4rd

Active Member
Code:
return
simply exits the current function immediately and returns control to the calling function. (If you do it from the main() function it will end your script) it can also be given a value
Code:
return foo
which will be stored in the ${Return} top-level object (somewhat like an "exit code" in a DOS batch script, though in LS they don't have to be numbers) Sooo, hopefully you can see where having two of these in a row would be redundant (the second one would never be executed) as would having one as the last line of a function (the function's going to end anyway) unless you're actually using it to return a value.

again.. not 100% sure on what are requirments to make a script stay runing..
your while loop should keep on looping ad infinitum until something happens to make it stop, like "return" or "break" or Endscript
 

Temil2005

Active Member
your while loop should keep on looping ad infinitum until something happens to make it stop, like "return" or "break" or Endscript
well, now that I understand what the return is more like, now i understand why it was stoping.. there was an extra return in the first "havepet" check, in I didnt have a pet. .it was looting, then stoping..

thanks for that explination.. at least i understand in more detail what was going on there.
-------

Cr4zy, if ya happen to have a few mins, mind giving any feedback on this script .. let me know what I'm doin wrong?

Code:
variable int CT
variable int MEC1
variable int MEC2
variable int MEC3
variable int MEC4
variable int MEC5
variable int MEC6
variable int MEC7
variable int MEC8

function EncounterCheck()
{
	CT:Set[${Me.Target.ID}]
	variable int ec=0
	while ${ec:Inc}<=${Me.Encounter}
	{
		if ${CT}==${MEC${ec}}
		{
			Pawn[id,${CT}]:Target
		}
		elseif !${CT}==${MEC${ec}}
		{
			VGExecute "/cleartargets"
			${MEC${ec}}:Set[${Me.Encounter[${ec}].ID}]
			Pawn[id,${MEC}${ec}]:Target
		}
	}
}
that code semi works.. when starting combat, it will rapidly deselect my target, and reselect it 100000000 times over it seems .. till I stop it =)
i know your probly going to look at the code and say "what an idiot!" .. but hey, at least I'm trying.. and learning at the same time =)
 

Cr4zyb4rd

Active Member
Code:
elseif !${CT}==${MEC${ec}}
you don't need to list this condition twice, just say else...

Code:
${MEC${ec}}:Set[${Me.Encounter[${ec}].ID}]
a bit wacky, you might need an execute in front of this, see http://www.lavishsoft.com/wiki/index.php/Command:Execute

while there's nothing wrong with what you're trying to do here, you probably said to yourself "there has to be a better way", and you were of course right.

see http://www.lavishsoft.com/wiki/index.php/ObjectType:arrayfor a much easier way of handling all of those variables :)

lastly
Code:
Pawn[id,${MEC}${ec}]:Target
is that what you meant there? not ${MEC${ec}}?
 

Temil2005

Active Member
a bit wacky, you might need an execute in front of this,
Ahh, that could be an issue.. thought I read somewhere about the execute command, but forgot about it. thanks on that one!

while there's nothing wrong with what you're trying to do here, you probably said to yourself "there has to be a better way", and you were of course right.

see http://www.lavishsoft.com/wiki/index...jectType:arrayfor a much easier way of handling all of those variables
well, I'm all up for making it simpler on myself, and just making it into a better working code, but to he honist.. I read over that website, and I'm lost on how that command would work. I think it's just because I dont understand the working, or the method of that code .. or how it would apply for this situation??
 

Temil2005

Active Member
UPDATED RELEASE

-- Pet protects self, and assists self before all others
-- Auto targets to next mob attacking, and sends in pet, so you dont get stuck on corpse (only exception is if target is harvestable - wont count as harvestable till after dies, and you loot)
-- Pet auto protects self if being attacked, and not allready in combat wih mob
-- Pet auto uses all skills with avalible
-- If Death Incarnate I spell is ready, will auto use it when pet going into combat
(will add more pet specific buffs / skills per request)
-- Pet auto protects all group members, starting with group member 1 and goes up from there. (as long as within 100m)

-- Removed auto loot feature, sence this is a petassist script.. not a bot.
 

Attachments

cheasley

Active Member
lol...I think I just sent a copy of that same script I have been working with.

The only thing I may have changed from yours is to add a few more seconds from the time a group pulls or goes into combat until the /pet attack is called. We've had issues where as soon as a group mate pulls the pet rushes off into battle and usually pulls aggro in doing so since he's firing on all cylinders once he engages.

By putting a little bit longer delay, it gives a more natural look and helps the puller gain aggro.
 

Temil2005

Active Member
By putting a little bit longer delay, it gives a more natural look and helps the puller gain aggro.
hmm, I can see how the tanks pulling angro could be a reason for that increasing that.. I never noticed this as an issue, because most of the testing I did with this was with about 1-2 other players in group, mostly being other types of casters, or a tank.. but didnt see the point in having it wait to run in.. because I wanted him to take angro ASAP! =) ..

umm, heading out to work.. i'm going to work on geting a "dont send pet if not in specified range" check added, and also a "if group has a tank" check, as I think that would solve that issue as well.

let me know if any other issues.
 

Cr4zyb4rd

Active Member
Sorry, my internet's been down for a few days. Here's how I would re-write the routine we talked about a few posts up to use an array.

Code:
function EncounterCheck()
{
	variable int CT=${Me.Target.ID}
	variable int MEC[8]
	variable int ec=0
	while ${ec:Inc}<=${Me.Encounter}
	{
		if ${CT}==${MEC[${ec}]}
			Pawn[id,${CT}]:Target
		else
		{
			VGExecute "/cleartargets"
			MEC[${ec}]:Set[${Me.Encounter[${ec}].ID}]
			Pawn[id,${MEC[${ec}]]:Target
		}
	}
}
Not a huge change, but we've made MEC an array instead of declaring 8 items individually. Less typing, and you won't need to use Execute to set them. I've also moved all variable declarations *inside* of the function itself. This is significant, as it defines the "scope" of those variables. Now they all have "local" scope, meaning they only exist inside of that function...no other function will be able to use them, and you can even re-use the same names in another function with no fear of conflicts.
 

Temil2005

Active Member
going to post to a new script forum, to handle updates I do to this a little better..
post ideas, feedback, etc here plz.. thx!
 
Last edited:

Sorenbro

Active Member
Vary nice Temil. This will be quite usefull, one thing I would like to see added is a way to toggel on or off the use of sneer.
 

Temil2005

Active Member
one thing I would like to see added is a way to toggel on or off the use of sneer.
your wish is my command!


NEW VERSION 1.02

- option to pick which pet abilitys to use and not to use
- settings now save after you set them, so you dont have to set them again after reloading game
- abiliy to turn on/off player abilitys that are used during combat (currently, this is limited to only one spell as I'm only a lvl 21 necro myself, and this is currently only buff I have for pet. I'm willing to take requests)
- Seperated settings into multi tabs .. there was to many for only one tab
- fixed minor issue with massive spam of changing targets while grouped, and more then 4 encounters

there are screenshots up on the download post as well. .
Download : http://www.isxgames.com/forums/showt...=8052#post8052
 
Last edited:

Temil2005

Active Member
bug fix - v1.03

-fixed an issue that wouldnt allow you to pull back your pet. When you tried to, it would go threw a constant loop of sending him back in. (What can I say.. pets are very aggesive and dont like to listen! :) ) .. you now have two new check boxs that will auto change when you tell your pet to backup or attack. If the check box for backup is checked, that's telling you that the pet is backed off..and he wont attack till you tell him to again.

Download : http://www.isxgames.com/forums/showt...=8052#post8052
 

Temil2005

Active Member
ok guys, runing into a problem here... trying to send a specified value from UI (xml) over to ISS .. it works for my check boxes ok, but when ading in a text field .. it doesnt seem to work.. adding into the setting file as value of 0 .. instead of value of 25 by default.. also not changin to the value of what I place into the text box.. mind explaining to me where I'm going wrong on here? ..thx!


CODE for UI (XML) :
Code:
<Button Name="SendPetDistance Button" Template="VG.GreenButton">
	<X>190</X>
	<Y>100</Y>
	<Width>35</Width>
	<Height>20</Height>
	<Text>Set</Text>
	<Alignment>Center</Alignment>
	<OnLeftClick>
	Script[VGPetAssist].VariableScope.SendPetDist:Set[${SendPetDistanceSet@Setup@Main@VGPetAssist].Text}]
	UIElement[SendPetDistanceSet@Setup@Main@vgpetassist]:SetText[]
	SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings]:Set[SendPetDist,${Script[VGPetAssist].VariableScope.SendPetDist}]:Save
	</OnLeftClick>
	</Button>
			
	<Textentry Name="SendPetDistanceSet">
	<X>160</X>
	<Y>100</Y>
	<Width>25</Width>
	<Height>18</Height>
	<Color>FFDDBB00</Color>
	</Textentry>

	<Text Name='SendPetDistanceText' Template='VG.BoldText'>
	<X>23</X>
	<Y>102</Y>
	<Width>80%</Width>
	<Height>20</Height>
	<Text>Send pet at distance</Text>
	</Text>

	<Text Name='CurrentSendDistance' Template='VG.BoldText'>
	<X>130</X>
	<Y>122</Y>
	<Width>80%</Width>
	<Height>20</Height>
	<OnLoad>
	if ${SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings].GetInt[SendPetDist,${Script[VGPetAssist].VariableScope.SendPetDist},25]}
	{
	Script[VGPetAssist].VariableScope.SendPetDist:Set[25]
	}
	SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings]:Set[SendPetDist,${Script[VGPetAssist].VariableScope.SendPetDist}]:Save
	</OnLoad>
	<OnRender>
	<Text>Current = ${SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings].GetInt[SendPetDist,${Script[VGPetAssist].VariableScope.SendPetDist}]}</Text>
	</Onrender>
	</Text>
CODE IN ISS :
Code:
variable int SendPetDist
CODE CREATED INTO SETTING FILE :
Code:
<Setting Name="SendPetDist">0</Setting>
 

Xeon

Active Member
Temil2005 said:
Code:
Script[VGPetAssist].VariableScope.SendPetDist:Set[${SendPetDistanceSet@Setup@Main@VGPetAssist].Text}]
Get rid of that line

and replace it with:
Code:
Script[VGPetAssist].VariableScope.SendPetDist:Set[${UIElement[SendPetDistanceSet@Setup@Main@VGPetAssist].Text}]
echo Pet Distance: ${UIElement[SendPetDistanceSet@Setup@Main@VGPetAssist].Text}
 
Last edited:

Temil2005

Active Member
umm, could you explain why I'm removin and replacing with that? .. I understand the echo that is ther.. is that just showing text before the text box??.. removes the need for adding in the text as a textfield before the textbox .. but that wouldnt fix my issue with the default value not being filled in corrently in setting file, nore would in fix my problem with when clicked, it update into the setting file with new value.?? ..
Am I wrong on my thoughts?

EDIT :
Ahh, I see ya edited that code a little.. I see, I forgot the UIElement in there =P . . thx!
umm, does that echo post before or after the text box when placed at that location??
 
Last edited:

Temil2005

Active Member
thx for the quick reply .. now, here is another one.. not a major issue, but sence you guys are feeling quick on the replys =) ..

Code:
	<Checkbox name='SendPet Checkbox' Template='VG.Checkbox'>
	<X>20</X>
	<Y>80</Y>
	<Width>15</Width>
	<Height>15</Height>
	<Text>Auto Send Pet</Text>
	<OnLoad>
	if ${SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings].GetString[doSendPet,${Script[VGPetAssist].VariableScope.doSendPet},True]}
	{
	       This:SetChecked
	       Script[VGPetAssist].VariableScope.doSendPet:Set[TRUE]
	}
	</OnLoad>
	<OnLeftClick>
	if ${This.Checked}
	{
	       Script[VGPetAssist].VariableScope.doSendPet:Set[TRUE]
	}
	else
	{
	       Script[VGPetAssist].VariableScope.doSendPet:Set[FALSE]
	}
	SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings]:Set[doSendPet,${Script[VGPetAssist].VariableScope.doSendPet}]:Save
	</OnLeftClick>
	</Checkbox>
On that code, setting file is being created, but all values set to false, instead of TRUE which is what I want for default value. So on first creation of file, all false.. after file is created, and working.. it loads from files 100% and works with ISS, but just first time creation is not seting correct value.. something missing or misplaced? .. thanks in advance =) (was working all weeked on this minor issues.. finaly gave in and asked for help )
 
Last edited:

Cr4zyb4rd

Active Member
Code:
${SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings].GetString[doSendPet,${Script[VGPetAssist].VariableScope.doSendPet},True]}
I didn't look at the rest of the code too close, but your GetString doesn't look quite right...i'm pretty sure GetString only takes two arguments (the setting you want to get, and the default value if it doesn't exist).
 

Temil2005

Active Member
After looking at this in more detail... and seeing what ya mean, you seem to be right, but I could have swore I didnt that allready.. so, new code SHOULD look more like this.. being thatit looks for "doSendPet" inside the settings file.. if it doesnt find it, then it sets it to TRUE and does the set actions into the brackets?

Code:
	<OnLoad>
	if ${SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings].GetString[doSendPet,True]}
	{
	    This:SetChecked
	    Script[VGPetAssist].VariableScope.doSendPet:Set[TRUE]
	}
	else
	{
	    This:UnsetChecked
	    Script[VGPetAssist].VariableScope.doSendPet:Set[FALSE]
	}
	</OnLoad>
could have swore I tried that, but didnt seem to work.. but I'll try again when i get home from work tonight
 

Temil2005

Active Member
NEW RELEASE :

- toggle on/off pet assisting while harvesting (just in case anyone having issue with harvesting while assisting)
- Set distance for pet to auto attack or backoff from the target (auto sends pet at specified range, and will pull him back automaticly.. works well with managing inside of cave to keep pet from runing off and pulling angro)
- pet now keeps on using pet abilitys on attacking mob in range, instead of stoping when you target another mob, or stop targeting anything)

Runing out of idea to add into this =) . .got any? let me know!

Download : http://www.isxgames.com/forums/showthread.php?p=8052#post8052
 

Sorenbro

Active Member
Temil2005 said:
NEW RELEASE :

Running out of idea to add into this =) . .got any? let me know!

[/URL]

Hmm how about a button that will swap out all your grafts to an alliterative set. like going from an all Dps graft setup to an all defence and life tap set up?
 

Temil2005

Active Member
Hmm how about a button that will swap out all your grafts to an alliterative set. like going from an all Dps graft setup to an all defence and life tap set up?
Looking into the Graft Bags feature, as someone else mentioned this on another post I have seen before, just happened to forget about that one =) .. If it is going to work, it would probly need an added code to reconized the grafts bags or something like that. Once that is added, then shouldnt be to hard to get that added.
 

Temil2005

Active Member
Adding in abiitys to type in ability/spell names and have it save to an XML settings file, and also send it to the ISS as a variable setting.. anyone able to point out where I'm screwing out? .. it's setting it in the setting file (but with errors) .. and then when I hit the SET button.. it changes to NULL..


XML UI FILE :
Code:
			<Button Name="CombatAbility1 Button" Template="VG.GreenButton">
				<X>190</X>
				<Y>15</Y>
				<Width>35</Width>
				<Height>20</Height>
				<Text>Set</Text>
				<Alignment>Center</Alignment>
				<OnLeftClick>
					Script[VGPetAssist].VariableScope.CombatAbility1:Set[${UIElement[CombatAbil1set@Combat@Abilities@Main@VGPetAssist].Text}]
					UIElement[CombatAbil1set@Combat@Abilities@Main@VGPetAssist]:SetText[]
					SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings]:Set[CombatAbility1,${Script[VGPetAssist].VariableScope.CombatAbility1}]:Save
				</OnLeftClick>
			</Button>
			
			<Textentry Name="CombatAbil1set">
				<X>20</X>
				<Y>15</Y>
				<Width>165</Width>
				<Height>18</Height>
				<Color>FFDDBB00</Color>
			</Textentry>
			
			<Text Name='CombatAbility1Current' Template='VG.Text2'>
				<X>20</X>
				<Y>37</Y>
				<Width>80%</Width>
				<Height>20</Height>
				<Alignment>Center</Alignment>
				<Onload>
				if ${SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings].GetString[CombatAbility1,Not Setup]}
				Script[VGPetAssist].VariableScope.CombatAbility1:Set[${SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings].GetString[CombatAbility1]}]
				</Onload>
				<OnRender>
				This:SetText[Combat Abilty 1 =  ${SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings].GetString[CombatAbility1]}]
				</Onrender>
			</Text>

ISS FILE :
Code:
variable string CombatAbility1
adding in multi options for this, but at least as i can figure out what the deal is with this not saving to the setting file.. well, really apreciate the help.. yet again :)
 

Cr4zyb4rd

Active Member
Code:
if ${SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings].GetString[CombatAbility1,Not Setup]}
				Script[VGPetAssist].VariableScope.CombatAbility1:Set[${SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings].GetString[CombatAbility1]}]
What are you trying to do here? This reads:
if (some setting I'm using a default value for, and thus will always return true)
save the above setting into a variable (or make it null, no default specified)

Seems to me you just want to set the variable to what follows the "if" statement directly...

I'd definitely wrap your arguments to GetString in quotes...otherwise nothing else screaming BUG is jumping out at me
 

Temil2005

Active Member
Cr4zyb4rd said:
What are you trying to do here? This reads:
if (some setting I'm using a default value for, and thus will always return true)
save the above setting into a variable (or make it null, no default specified)

Seems to me you just want to set the variable to what follows the "if" statement directly...

I'd definitely wrap your arguments to GetString in quotes...otherwise nothing else screaming BUG is jumping out at me
umm, guess I'm a little confused.. in that code, isnt "Not Setup" considered the default value, IF the setting isnt located in the setting file allready..
after it finds it in the setting file, or adds it, then it refers to it to set it as a variable in the ISS file?

Also, when I click the button to set it as a diferent spell, it says Null...no mater what. Doesnt show the name, or set it acording to the spell I typed in. I know I'm probly overlooking something, or it's me just not being fimilar with the code.. But tried to troubleshot and searched on forum, and nothing stuck out, so figured Id ask you to critisize the work =)..

If it makes any difference, I'm acualy having them type in the spell name, and suposted to save that to variable, and also send that over to a variable in ISS. Is there some sort of differnt GetString command, for works typed.. different from true or false? or numbers (int)
 

Cr4zyb4rd

Active Member
Code:
umm, guess I'm a little confused.. in that code, isnt "Not Setup" considered the default value, IF the setting isnt located in the setting file allready..
after it finds it in the setting file, or adds it, then it refers to it to set it as a variable in the ISS file?
you have two lines of code there.
Code:
if foo
executes the next line of code or code block if foo evaluates to true. that's ALL it does. your foo contains a default value, and so will ALWAYS evaluate to true (unless you happen to save the string NULL as the setting to be loaded). In the next line, foo appears yet again, save that there's no default value. So I ask again, what purpose is the conditional serving? You could have just set your variable to foo, and provided a default.

Code:
MyVariable:Set[${SettingXML[filename].Set[myset].GetString[mysetting,"Default value"]}]
viola

Also, when I click the button to set it as a diferent spell, it says Null...no mater what. Doesnt show the name, or set it acording to the spell I typed in.
Well, for starters set it to display the contents of the textentry box instead of the XML, just so you know that the box is working. It could just be because you don't have a MaxLength defined or something silly. Then echo the variable to make sure THAT'S being set correctly, and so on
 

Temil2005

Active Member
ok, I guess I'm over doing the code ?? ..
Code:
${SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings].GetString[CombatAbility1,"Not Setup"]}
that code is saying that if "CombatAbility1" is in setting file.. then usei it, otherwise, set it to Not Setup in thesetup xml file.. correct?

Code:
Script[VGPetAssist].VariableScope.CombatAbility1:Set[${SettingXML[./Scripts/vgpetassist/vgpet-setting.xml].Set[Settings].GetString[CombatAbility1]}]
now, this code.. is saying that whatever is in the "CombatAbility1" .. set that into the variable within the ISS .. isnt that correct?

basicly, here is what I'm trying to do..
- check if in setting file
- if is, then dont change
- if isnt, then change to default (aka :Not Setup)
- after it's set or found (either) then...
- pull setting from xml, and use that as variable in ISS


then....
(think i got this part working ok.. shows null, but I think that is becasue it's a null value in the setting file currently)
- if button is pressed
- take text from textbox and save it to setting file, along with sending that setting to ISS as a variable
- also show this text as a text field under this


Is that all you are asking from me? .. from what you are saying, looks like i'm adding in to many checks or something.. I was under the asumtion or understanding that I needed to do both those codes in there, 1 to check for value in setting file, if not there ,then create it. .then another code to acualy access that value and send it over to ISS as a variable.. that's how all my other other buttons/check boxs =P . .lol.. to many ? =)
 

Cr4zyb4rd

Active Member
that code is saying that if "CombatAbility1" is in setting file.. then usei it, otherwise, set it to Not Setup in thesetup xml file.. correct?
No. Wrong. Incorrect.

That code is just *reading* from the file. It's not setting anything. It returns whatever's in the file, and NULL otherwise. Thus (he says, yet again) if used as the condition of an if statement, it will almost certainly just evaluate to TRUE and trigger the next statement.

now, this code.. is saying that whatever is in the "CombatAbility1" .. set that into the variable within the ISS .. isnt that correct?
yes

basicly, here is what I'm trying to do..
- check if in setting file
- if is, then dont change
- if isnt, then change to default (aka :Not Setup)
- after it's set or found (either) then...
- pull setting from xml, and use that as variable in ISS
indeed, and I've indicated that I understand what you're trying to do. unfortunately, as I keep trying to point out :p A) you're doing it wrong, and B) it's totally unnecessary. all you need is the last step, and provide a default (why save the default?)

1 to check for value in setting file, if not there ,then create it. .then another code to acualy access that value and send it over to ISS as a variable.. that's how all my other other buttons/check boxs =P
it's not, at least not in the examples I gave. if I recall it worked something like this
Code:
<OnLoad>
if ${SettingXML[foo].Set[bar].Set[baz,TRUE]}
	This.Checked:Set[TRUE]
else
	This.Checked:Set[FALSE]
SomeVariable:Set[${This.Checked}]
</OnLoad>
<OnClick>
	This.Checked:ToggleChecked
	SettingXML[foo].Set[bar]:Set[baz,${This.Checked}]:Save
	SomeVariable:Set[${This.Checked}]
</OnClick>
that's off the top of my head, and so might not be identical, but notice that I'm reading the XML only once (to determine the initial setting) and writing to it only in the event that something's changed. Really, since I know the contents of the xml are only going to be TRUE, FALSE, I could eliminate the if statement and just set the checkbox directly to the contents of that XML setting (defaulting to TRUE or FALSE as desired) The point though, is that no point do I need to explicitly "check for value in the settings file", that's the entire point of being able to specify a default value.
 

Temil2005

Active Member
Ok, finaly got home, tested out what you were talking about...and i see what ya mean Cr4zy .. I was thinknig that it was seting it, when it wasnt. Also, figured out my issue with the button .. had the wrong blah@blah@blah type of directing in there.. 2 of them backwards.. opps! =) .. anyways.. thx man. .back to working on this...
 
Last edited:

Cr4zyb4rd

Active Member
...and i see what ya mean Cr4zy ..
Thank God...trying to think of yet another way to rephrase the same explanation probably would have proved the better of me and I'd have just wound up calling you an idiot :dazed:

As for GetInt vs GetString, lax has explained elsewhere that GetInt, GetBool, etc are just convenience calls that do the conversion for you...everything in the XML is saved and read in as a string. So
Code:
${SettingXML[somefile].Set[someset].GetString[somesetting,somedefault](int)}
is effectively the same as GetInt. I can't think of a case where GetInt would work and GetString not.
 

Temil2005

Active Member
Cr4zyb4rd said:
and I'd have just wound up calling you an idiot :dazed:
well, ya been waiting say that one to me for a long time..huh? .. :dunce: .. hehe
Only reason i didnt understand is that about 7 post ago, it was explained to me that after the GetString[value,"default"] .. at least that's how i read it.. and when it didnt work, well.. couldnt figure out why.. but now I see ya guys were talking about the SET, not the GETSTRING .. to much similar code, all makes explaining it a bit off =)

Either way, apreciate your patience, with all my stupidity :)

-----

Next project, (well, combined with others) ..
know of any good working loot scripts, or scripts/bots that I can look at the code for looting? .. I know how to get the loot and all working, no biggy.. but got stuck at the "when in group, do a NEED or GREED" type of situaion.. when i was working on it, it was masive spam of open loot, close loot .. but wasnt starting the group roll. I assuming I would have to use an ONEVENT for that? .. not fimilar with them, or how they work really..Point me to a simple example so I can learn it posably? =)

Also, there a simple way to only loop a function set number of times? .. (going to look more on wiki when I get to work.. but looked last night, didnt find anything that stood out)
 
Last edited:

Temil2005

Active Member
Release 1.05

- per request, now has ability to maintain DOT spells, making sure that DOTs/DeBuffs stay on your mob
- Per Request, now has ability to rapid cast specified spells durring combat

(in the new tabs, just click CHANGE, and you will be promted with a text box. Type in the spell you want to cast, and click "SET". Assuming you picked a spell you can acualy cast, it will be added into a specified spell slot)

DOWNLOAD :
http://www.isxgames.com/forums/showthread.php?t=1232
 

Cr4zyb4rd

Active Member
Also, there a simple way to only loop a function set number of times?
Code:
; define a counter variable
variable int i
; use a for loop
for (i:Set[1] ; ${i} <= 10 ; i:Inc)
{
  echo ${i} times and counting.
}

; or use a while loop if you prefer
i:Set[1]
while ${i} <= 10
{
  echo ${i} times and counting.
  i:Inc
}
 

Temil2005

Active Member
thx man =) .. but I acualy got it working shortly before last release =).. after I talked to a few people on irc, and got some ideas on some different ideas and whatnot.
 

DrmChld

Active Member
With the new TargetEffect changes I am getting the spam a lot from this script.

I have tried changing the TargetEffect portions of the script to say TargetBuff, TargetDebuff, TargetMyDebuff etc. However whenever I do the pet doesn't attack anymore.

Does anyone have any ideas on this?

With the way all the other scripts are going the ISXVG extension will be dead and useless in short time.
 

DrmChld

Active Member
All the major developers of scripts have quit VG and are not longer making or updating scripts.

Scripts aren't maintained by Ama, so we depend on the players who make the scripts to keep the community alive.

Without contributions or updates the scripts won't be fixed after patches, etc.
 

IeU

Active Member
don'tdoit said:
Time to learn and step up.

kbot, vgalarm, vgshaman (and all my variants) are working fine for me.
that is true, ive just made some changes in kbot and vgcraftbot to fix small issues and speed up it a bit.
 

sylkkdaskr20

Active Member
Time to learn and step up.

kbot, vgalarm, vgshaman (and all my variants) are working fine for me.

I agree. Haha. I wish i didnt have to ask the questions i did because it makes me feel like a mooch.

Im pretty proud of myself for modyfing vgshaman to work on my dsc, bonds and combo's (kinda). I still have kinks to workout, but i wanna try to figure them out on my own. But im close to asking for some help!!... But not yet tho!!!

... not yet!!!... hehe


VGcraftbot, i dont even wanna touch, that thing has way to much mumbo jumbo for me it makes my head hurt. haha
 

mmoaddict

Original Script Author: VGA
assist scripts

assisting scripts have the problem of not really being tailored to individual classes. The difficulty in making one specific to the class is that at lower levels classes lack certain primary abilities. I have been making scripts for a bit for specific classes to assist with. The programming is focused around beginning level programming so it can be more easily modified. Is anyone interested in a very class specific setup like that?
 

Zandros

Script Author: VGA
Specific Scripts - Blood Mage

assisting scripts have the problem of not really being tailored to individual classes. The difficulty in making one specific to the class is that at lower levels classes lack certain primary abilities. I have been making scripts for a bit for specific classes to assist with. The programming is focused around beginning level programming so it can be more easily modified. Is anyone interested in a very class specific setup like that?
Yes, can you share what you have?

I have created a simple healing assist script for BloodMages that is pretty good. The trick to the healing is awsome which will marvel the whole concept of healing the group. It really keeps the group alive using very little Energy.

I put the 1 sec pause in because it takes a while for the Hit Point update and the delay is to slow down spamming of this routine so that my other routines have a chance to run.

;================================================
; This routine is tailored to how you want to
; Nuke your mob.
;
; Because BloodMages can Damage and Heal at the
; same time, this routine scans for the group
; member with the lowest health and then Nuke mob
;================================================
function NukeMob()
{
if (!${doNuke} || ${Me.EnergyPct}<25 || ${LavishScript.RunningTime}<${DelayNuke})
return

if ${Me.HealthPct}<${NukePct}
return

call FaceTarget

call GetLowestHealth
if ${Return}>0
{
Pawn[id,${Group[${Return}].ID}]:Target
wait 5
if ${Me.DTarget.Name.Equal[${Me.FName}]}
{
call CastSpell "${NukeHealSelf}"
if ${Return}
wait 10
}
else
{
call CastSpell "${NukeHealAlly}"
}
}
else
{
call CastSpell "${NukeHealSelf}"
if ${Return}
wait 10
}
DelayNuke:Set[${Math.Calc[${LavishScript.RunningTime}+(1000)]}]
}
 

mmoaddict

Original Script Author: VGA
Cleanup

I will have to clean up a bit of code before i can make it more public. I will work on it this week and see what i can come up with.
 

mmoaddict

Original Script Author: VGA
Sample monk combat

here is just a sample of a monk combat script. There is a main shield that defines the functions like MeCasting and my Defensive target.

Keep in mind i simplified this from the one i had. I am trying to provide a sample that others can use.

;********************************************
function monky()
{
while ${Me.Effect[Feign Death III](exists)}
{
wait 1
}

call pushag
call mkmelee
call jinbuff
call jinattack
call medup
call mkcrit


}
;********************************************
function mkmelee()
{

if ${Pawn[${Me.Target}].Distance} > 1 && ${Me.TargetHealth} > 0 && ${Pawn[${Me.Target}].Distance} < 25 && ${Me.TargetHealth} < ${mtotpct}
{
VGExecute /stand
call assist
call movetomelee
call facemob
if !${Me.TargetDebuff[Feet of the Fire Dragon IV](exists)}
{
Me.Ability[Feet of the Fire Dragon IV]:Use

call MeCasting
call mkcrit
}
if ${Me.Ability[Crescent Kick VI].IsReady}
{
Me.Ability[Crescent Kick VI]:Use

call MeCasting
call mkcrit
}
if ${Me.Ability[Boundless Fist VII].IsReady}
{
Me.Ability[Boundless Fist VII]:Use

call MeCasting
call mkcrit
}
}
elseif ${Pawn[${Me.Target}].Distance} < 2 && ${Me.InCombat} && ${Me.TargetHealth} > 0 && ${Pawn[${Me.Target}].Distance} < 25
{
VGExecute /stand
call assist
call movetomelee
call facemob
}
return

}
;********************************************
function jinbuff()
{

if ${Pawn[${Me.Target}].Distance} > 1 && ${Me.TargetHealth} > 0 && ${Pawn[${Me.Target}].Distance} < 25 && ${Me.TargetHealth} < ${mtotpct}
{
VGExecute /stand
call assist
call movetomelee
call facemob
if !${Me.Effect[Iron Hand VI](exists)} && ${Me.Ability[Iron Hand VI].IsReady}
{
Me.Ability[Iron Hand VI]:Use

call MeCasting
}
if !${Me.Effect[Secret of Flames VI](exists)} && ${Me.Ability[Secret of Flames VI].IsReady}
{
Me.Ability[Secret of Flames VI]:Use

call MeCasting
}
if ${Me.Ability[Fists of Celerity].IsReady}
{
Me.Ability[Fists of Celerity]:Use

call MeCasting
call mkcrit
}
}
return
}
;********************************************
function jinattack()
{

if ${Pawn[${Me.Target}].Distance} > 1 && ${Me.TargetHealth} > 0 && ${Pawn[${Me.Target}].Distance} < 25 && ${Me.TargetHealth} < ${mtotpct}
{
VGExecute /stand
call assist
call movetomelee
call facemob
if ${Me.Ability[Dragon's Rage III].IsReady}
{
Me.Ability[Dragon's Rage III]:Use
call MeCasting
call mkcrit
return
}
if ${Me.Ability[Cloud Dragon's Ruse III].IsReady}
{
Me.Ability[Cloud Dragon's Ruse III]:Use
call MeCasting
call mkcrit
return
}
if ${Me.Ability[Ashen Hand VII].IsReady}
{
Me.Ability[Ashen Hand VII]:Use
call MeCasting
call mkcrit
return
}
}
return
}
;********************************************
function pushag()
{
if ${Pawn[${Me.Target}].Distance} > 1 && ${Me.TargetHealth} > 0 && ${Pawn[${Me.Target}].Distance} < 25 && ${Me.TargetHealth} < ${mtotpct}
{
VGExecute /stand
call assist
call movetomelee
call facemob
if ${Me.Ability[Goading Slap IV].IsReady}
{
Pawn[${assistMember1}]:Target
wait 2
Me.Ability[Goading Slap IV]:Use
call MeCasting
call mkcrit
}
}
return
}
;********************************************
function medup()
{
if ${Pawn[${assistMember1}].CombatState} < 1 && !${Me.InCombat} && !${autofollow}
{
Me.Ability[Meditation]:Use
}
return
}
;********************************************
function mkcrit()
{
If ${Me.Ability[Three Finger Strike].IsReady}
{
Me.Ability[Three Finger Strike]:Use
call MeCasting
}
If ${Me.Ability[Hammer Fist].IsReady}
{
Me.Ability[Hammer Fist]:Use
call MeCasting
}
If ${Me.Ability[Palm Explodes the Heart].IsReady}
{
Me.Ability[Palm Explodes the Heart]:Use
call MeCasting
}
If ${Me.Ability[Thousand Fists IV].IsReady}
{
Me.Ability[Thousand Fists IV]:Use
call MeCasting
}
If ${Me.Ability[Thundering Fists III].IsReady}
{
Me.Ability[Thundering Fists III]:Use
call MeCasting
}
If ${Me.Ability[Gouging Dragon Claw II].IsReady}
{
Me.Ability[Gouging Dragon Claw II]:Use
call MeCasting
{
If ${Me.Ability[Sundering Dragon Claw II].IsReady}
{
Me.Ability[Sundering Dragon Claw II]:Use
call MeCasting
}
If ${Me.Ability[Flying Kick V].IsReady}
{
Me.Ability[Flying Kick V]:Use
call MeCasting
}
If ${Me.Ability[Kick of the Heavens III].IsReady}
{
Me.Ability[Kick of the Heavens III]:Use
call MeCasting
}
}
 
Top Bottom