Siege buff bot

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Message
Author
xplar
Posts: 28
Joined: Thu Sep 08, 2011 2:46 am

Siege buff bot

#1 Post by xplar » Mon Oct 24, 2011 11:23 pm

This is a userfunction for buffing guildies in siege. The best place to set it up is at the revival point, so you need to die first to get there. Just run out the front gate and off the cliff to get there :) I'll add some more things to it tomorrow when I siege like some waypoints to jump off the cliff and auto joining the siege possibly.

Thanks to Lisa for the targeting functions, the bot will now stand in place and target all characters around it instead of just in front of it.

Code: Select all

function SiegeBuffs()
	while(true) do
		local objectList = CObjectList()
		objectList:update()
		local objSize = objectList:size()

		for i = 0,objSize do
			local obj = objectList:getObject(i)
			local distance = distance(player.X, player.Z, obj.X ,obj.Z)
			
			if player.Y >= (obj.Y - 10) and obj.Y >= (player.Y - 10) and 50 > distance then
				player:target(obj)
				player:update();
				
				if (player:haveTarget() ~= nil) then
					player:update();
					
					local target = player:getTarget()
					
					target:update()
					target:updateBuffs()

					player:checkSkills(true)
					player:checkPotions()
				end
			end
		end
	end
end
It is currently set to only target characters that are within 10 coords on the Y axis (up and down) and within a 50 coord radius around the player. This will hopefully stop the bot from running off the edge of the spawn point. I will test it more tomorrow.


The waypoint file looks like this. It shouldn't move from it's spot.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<onLoad>
		SiegeBuffs()
	</onLoad>
</waypoints>
Attachments
userfunction_SiegeBuffs.lua
SiegeBuffs Userfunction 3
(669 Bytes) Downloaded 323 times
SB.xml
SiegeBuffs Waypoint file
(104 Bytes) Downloaded 333 times
Last edited by xplar on Tue Oct 25, 2011 1:36 am, edited 4 times in total.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Siege buff bot

#2 Post by lisa » Tue Oct 25, 2011 12:27 am

Not a bad idea, from memory the tab for enemy and alt+tab for friendly only get objects infront of your view, so not to sides or behind.

I would possibly look into checking pawns in memory area and then do a comparison to range or more important comparison to Y value, if doing it on roof.

Code: Select all

   local objectList = CObjectList();
   objectList:update();
   local objSize = objectList:size()

   for i = 0,objSize do
      local obj = objectList:getObject(i);
local distance = distance(player.X, player.Z, , obj.X ,obj.Z)
if obj.Y == player.Y and 150 > distance then
--all usual check buffs
end
end
Otherwise could just do a check for distance

Code: Select all

   local objectList = CObjectList();
   objectList:update();
   local objSize = objectList:size()

   for i = 0,objSize do
local distance = distance(player.X, player.Z, player.Y, obj.X ,obj.Z, obj.Y)
if 150 > distance then
--usual skill check
end
end
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

xplar
Posts: 28
Joined: Thu Sep 08, 2011 2:46 am

Re: Siege buff bot

#3 Post by xplar » Tue Oct 25, 2011 12:32 am

I fixed the problem with the target key, updated the first post. your idea for checking pawns was my next idea since it wont target people to my sides. I usually position the character just off to the side of the spawn point so everyone spawns in front of it but your way seems much better, I'll work on adding it in. Thanks for the feedback.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Siege buff bot

#4 Post by lisa » Tue Oct 25, 2011 12:39 am

xplar wrote:Thanks for the feedback
Any time

Keep in mind that if in the time it starts to check buffs if the player runs off the bot will still try to buff them and run off the castle in the attempt.
It is to do with trying to cast the skill itself, nothing to do with the bot.
Maybe if you put the character directly on the respawn spot and have 50 > distance, that way you won't get people as they are running away.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

xplar
Posts: 28
Joined: Thu Sep 08, 2011 2:46 am

Re: Siege buff bot

#5 Post by xplar » Tue Oct 25, 2011 1:34 am

Updated OP, works much better now, thanks :) The true test will be in siege tomorrow.

ako ito
Posts: 61
Joined: Sat Sep 17, 2011 8:34 am

Re: Siege buff bot

#6 Post by ako ito » Tue Oct 25, 2011 9:14 am

how about afk while farming crystal in tower.. then stop extracting crystal then fight back when the enemy is coming to defend his self... anyone can do this??

xplar
Posts: 28
Joined: Thu Sep 08, 2011 2:46 am

Re: Siege buff bot

#7 Post by xplar » Tue Oct 25, 2011 2:51 pm

That shouldn't be too hard to get working, I'll try to do it tonight.

nerdyone255
Posts: 107
Joined: Mon Nov 22, 2010 10:17 am

Re: Siege buff bot

#8 Post by nerdyone255 » Wed Nov 02, 2011 8:44 am

love it

ako ito
Posts: 61
Joined: Sat Sep 17, 2011 8:34 am

Re: Siege buff bot

#9 Post by ako ito » Thu Nov 03, 2011 1:43 am

ako ito wrote:how about afk while farming crystal in tower.. then stop extracting crystal then fight back when the enemy is coming to defend his self... anyone can do this??

hard to do??

Vengefulmilk
Posts: 19
Joined: Wed May 01, 2013 4:55 am

Re: Siege buff bot

#10 Post by Vengefulmilk » Wed May 01, 2013 5:05 am

I thought I would bump this in order to try and figure out a few things.

The first problem I'm having while trying to test this out, is that I can't get the bot to cast skills even though they are all set, not even self buffing, yet my regular bot not using SB.xml runs fine. I could run a priest with Grace of life no problem, but after failing with my warlock, i tried to see what was working in the priest file and now she's not working. Does SiegeBuff only work in siege?

The other problem I'm having, is the bot only checks himself if the buff is a party buff. I would like it to recast the party buff as people die and rez onto castle around it.

I thought about trying to trick the bot into trying to cast something like a temp skill such as GRACE_OF_LIFE and set the VK as 1, but have the 1 slot actually be a macro that casts the party buff, then Grace of life. Would something like this be a working temporary substitute if i can get the bot to actually cast the skills?

Sorry this was so long but I wanted to be thorough with my problem. I also appologize that my first entrance to the forums is with a problem and not an introduction.

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Siege buff bot

#11 Post by ZZZZZ » Wed Apr 16, 2014 8:37 pm

I decided to re-vamp this function so it didn't constantly target players endlessly. Instead only targets and buffs them once when they come within 100 range then again if they leave range and come back in.

The only issue I have with it now, is when targeting players on mounts. If they are not mounted then it works spot on, otherwise it won't target them. I have this as my check for a player.

Code: Select all

if player.Y >= (obj.Y - 10) and obj.Y >= (player.Y - 10) and 100 > distance and obj.Type == PT_PLAYER then
Does the PT_PLAYER part cause it to ignore players on mounts? And if so what could I add to it so it will target them? Thanks :)

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Siege buff bot

#12 Post by lisa » Wed Apr 16, 2014 9:30 pm

simple way to test it.

Start with commandline and mount up

Code: Select all

local tt = player:findNearestNameOrId("charname") print(tt.Type)
It will print a number that will correspond to these.

Code: Select all

PT_NONE = 0;
PT_PLAYER = 1;
PT_MONSTER = 2;
PT_SIGIL = 3;
PT_NPC = 4;
PT_NODE = 4;
My guess it will print 1 and the issue is with the other requirements you set, like .Y
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Siege buff bot

#13 Post by ZZZZZ » Wed Apr 16, 2014 11:20 pm

Ahh right, I didn't even think of the Y value, I adjusted it to 50 and works spot on now :)

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Siege buff bot

#14 Post by ZZZZZ » Tue May 06, 2014 2:57 am

I have another inquiry about buffing other players... its to do with party wide buffs (eg PRIEST_MAGIC_BARRIER). I am trying to adjust the siegebuffs function so that it pulls players to a separate party in a raid, buffs them, then puts them back.

So far I can get it to buff players, but I had to change the target="self" to "friendly" and range="0" to "100" in the skills database, will that have any effects on other functions? I can see it being an issue when it tries to buff a player that isnt in party, so how would I get around that? Is it possible to add another option to skills that are party buffs that tells the bot they only work on the party?


The other question I had is to do with checking buffs in the begining. I don't particularly want the bot to be pulling party members all around the raid group 24/7 if they already have the buffs, how can I use target:checkSkills(true) to make sure it needs a party buff before moving them? or would it be better to make a completely new function to deal with checking buffs and returning if they need a party buff or not before moving?

Probably some easy solution but I have a bad habbit of thinking too much into the small details that I tend to make things overly complicated for myself :S

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Siege buff bot

#15 Post by lisa » Tue May 06, 2014 6:38 am

For something this specific I wouldn't use checkskills, I would just do up a function for it and use the specific skills with macros, which is what checkskills does anyway.


So you would check for if friendly party, then check distance, then check what buffs it already has which will give you a list of what skills you want to use. Check if any need the player to be in your party or not, if so then move party, buff up and move back, if not then just buff up.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Siege buff bot

#16 Post by ZZZZZ » Tue May 06, 2014 7:59 am

ok, guess I'll start looking into it...see what I can sort out.

As for the party buff skills though, I have the same issue when using partyhealer. It'll only cast to buff itself, with those changes I made to the skills database it makes sure everyone is buffed, but the issue with players not being in party is there. in which case the bot will just spam buff forever. Any way this could be altered to only buff party members with those specific skills or is that more of a 'personal preference so make your own function' situation?

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Siege buff bot

#17 Post by lisa » Tue May 06, 2014 6:26 pm

ZZZZZ wrote:So far I can get it to buff players, but I had to change the target="self" to "friendly" and range="0" to "100" in the skills database, will that have any effects on other functions? I can see it being an issue when it tries to buff a player that isnt in party, so how would I get around that? Is it possible to add another option to skills that are party buffs that tells the bot they only work on the party?
Hmm, I guess originally when the skills were added, like 5 years ago, the bot wasn't really suited for party usage which is why it was done to just buff itself and not others. Now days though it is set up to be able to handle working in a party situation so it is probably time to adjust the skills to be used properly.

Would require a new "target" for skills which would be in party which will require a check for if in party and will also need a distance check. It should be easy enough to add in. Might have to do some testing to see what the actual distance is that the buff does get applied since you really cast the skill on yourself and it just applies to other party members around you.

Been a while since I did a commit, hopefully I don't need to remember my password lol
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Siege buff bot

#18 Post by rock5 » Tue May 06, 2014 8:22 pm

That's going to be problematical. When do you decide to cast a "party" skill? It will probably have a cooldown so timing would be vital. Then do you cast the buff even if only one of the nearby party members is missing the buff or do you wait until more of them are missing the buff? Some buffs benefit particular classes more than others, do you take that into account? Doesn't seem that easy but then you're the party expert Lisa. :)
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Siege buff bot

#19 Post by lisa » Tue May 06, 2014 8:28 pm

Hmmm

After lots and lots of debuging I found a fundimental issue with player:canUse.

Pretty much first thing it does is check "if target == nil", target is the second argument, funny thing is target is never nil, ever. So all of the checks are pretty much stuffed from the get go.

It always looked like this.

Code: Select all

Command> player:checkSkills(true)
table: 015C5618
Race:   0
Level:  1
MaxEnergy:      0
Name:   <UNKNOWN>
Harvesting:     false
Type:   -1
Level2: 1
Mounted:        false
Aggressive:     false
Focus:  0
InParty:        false
GUID:   0
Rage:   0
Id:     -1
MaxHP:  1000
Energy: 0
MaxMP2: 1000
Address:        0
Direction:      0
Class2: -1
Lootable:       false
MP:     1000
Speed:  50
TargetIcon:     true
Mana:   0
MaxFocus:       0
Casting:        false
MaxMana:        0
LastHP: 0
X:      0
Swimming:       false
Alive:  true
HP:     1000
MP2:    1000
Attackable:     false
MaxMP:  1000
Buffs:  table: 015C5668
Z:      0
TargetPtr:      0
Y:      0
Class1: -1
Guild:  <UNKNOWN>
MaxRage:        0
So I changed "if target == nil" to "if( target.Race == 0 ) then" and bamm works like a charm.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Siege buff bot

#20 Post by lisa » Tue May 06, 2014 8:34 pm

rock5 wrote:Doesn't seem that easy but then you're the party expert Lisa.
Easy as ;)
I will have to work out the distance the buffs reach though, ohh well time to hit up commandline.

rock5 wrote:Some buffs benefit particular classes more than others, do you take that into account?
Party wide buffs are usually geneneric when it comes to benefit to classes, they add hp or defence or magic resistance, not sure there is any that specifically benefit one type of class.

rock5 wrote:Then do you cast the buff even if only one of the nearby party members is missing the buff or do you wait until more of them are missing the buff?
If a party member is within range and is missing a buff then just cast the buff =)

rock5 wrote: It will probably have a cooldown so timing would be vital.
They are all no cooldown, well global cooldown only. Ones that have a cooldown, like rogue crit buff, I would just leave as they are now being used on the player specifically.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 9 guests