747 Changelog preCodeOnElite event

For changelogs and discussion related to a specific revision.
Post Reply
Message
Author
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

747 Changelog preCodeOnElite event

#1 Post by lisa » Fri Feb 01, 2013 10:38 pm

added in a new profile event.

Code: Select all

	<preCodeOnElite><![CDATA[
		-- code to use before a boss or tough mob
		-- _arg1 is target pawn, _arg1.Name = target's name
	]]></preCodeOnElite>
This event will be triggered if
target.MaxHP > (player.MaxHP * settings.profile.options.AUTO_ELITE_FACTOR)

I added AUTO_ELITE_FACTOR to the default profile so people can see and add it to their other profiles, default value is 7.

So if character MaxHP is 20,000 then an "elite" will be any mob with 140,000+ HP. Obvously changing this value in your profile will alter the calculation.

So if you come up against a mob like this it will do the code BEFORE attacking it, all normal rules apply as to what bot decides to attack or not.

Also added Rock's fixes to the guild bank class.

addresses.lua is updated to game version 5.0.7.2611
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

abron1
Posts: 162
Joined: Wed Feb 22, 2012 12:43 am

Re: 747 Changelog preCodeOnElite event

#2 Post by abron1 » Sat Feb 02, 2013 1:35 am

what about making it like the count mob function? i suggested that a while ago when rock first came out with that function

example: rock userfunction only attack if you have a few 2 or more mobs

Code: Select all

<skill name="WARDEN_FRANTIC_BRIAR"	  			hotkey="MACRO" priority="125" mobcount="2"/>
my example how we could use it:

Code: Select all

<skill name="WARDEN_MORALE_BOOST"				hotkey="MACRO" priority="110" inbattle="true" elite="5"/>
or what ever name you want to use so we could keep it in our profiles and in this example it will only use if inbattle and if elite like you mentioned in our post.

i love your idea btw

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

Re: 747 Changelog preCodeOnElite event

#3 Post by lisa » Sat Feb 02, 2013 2:05 am

Elite factor in skills would only work AFTER attacking the mob, So that won't help you fully buff up before attacking a boss inside an instance.
preCodeOnElite = code before attacking elite mob

This event I added "should" make it so you can use your big buff skills and also items before attacking the mob, since it is set up in your profile then you can set it specifically for each character.

If you want to use specific skills that you wouldn't normally use then just have them in profile skills section with autouse as false and in the new profile event section set autouse to true, you can then set it to false again in onleavecombat.

Guess I could add in a check for onleavecombat that is only done AFTER an elite factor mob kill.

So postCodeOnElite, which would only be used after preCodeOnElite and that mob is dead.

Might think on it a bit, don't want to just start adding lots of things.
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: 747 Changelog preCodeOnElite event

#4 Post by rock5 » Sat Feb 02, 2013 2:37 am

It could be something as simple as a variable. eg. OnEliteEventTriggered = true. Then, if the user wants to, in the onleavecombat they could do

Code: Select all

if OnEliteEventTriggered then
   reset stuff
   OnEliteEventTriggered = false
end
  • 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: 747 Changelog preCodeOnElite event

#5 Post by lisa » Sat Feb 02, 2013 3:05 am

the variable could be set in their profile aswell, no need to add anything to the bot code for it.


Something like this as an example.

Code: Select all

	<preCodeOnElite><![CDATA[
		if _arg1.Id == 103857 or _arg1.Id == 103169 then -- dod first boss
			madman()
		end
		if not player:hasBuff(501647) then --potent luck
			inventory:useItem(202322)
		end
		for i, skill in pairs(settings.profile.skills) do
			if skill.Name == "MAGE_PURGATORY_FIRE" then
				settings.profile.skills[i].AutoUse = false
			end
			if skill.Name == "MAGE_FLAME" then
				settings.profile.skills[i].AutoUse = true
			end	
			if skill.Name == "MAGE_PLASMA_ARROW" then
				settings.profile.skills[i].AutoUse = false
			end
		end		
		precode = true
	]]></preCodeOnElite>

Code: Select all

	<onLeaveCombat><![CDATA[
	if precode == true then 
		for i, skill in pairs(settings.profile.skills) do
			if skill.Name == "MAGE_PURGATORY_FIRE" then
				settings.profile.skills[i].AutoUse = true
			end
			if skill.Name == "MAGE_FLAME" then
				settings.profile.skills[i].AutoUse = false
			end	
			if skill.Name == "MAGE_PLASMA_ARROW" then
				settings.profile.skills[i].AutoUse = true
			end
		end		
		precode = false
	end
	]]></onLeaveCombat>
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: 747 Changelog preCodeOnElite event

#6 Post by rock5 » Sat Feb 02, 2013 4:48 am

True.
  • 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: 747 Changelog preCodeOnElite event

#7 Post by lisa » Sat Feb 02, 2013 8:35 am

Rock and I had a chat earlier trying to work out the best way to deal with the elite factor, it needs to be around 5 for low level chars but when you get to higher levels the amount your HP varies from char to char is quite a lot. In the end we decided there is no magic formula that can be used to effectively use an elite factor for everything.

I had a thought tonight though, it is quite simple for people to do depending on what the character is killing.

We can leave the elite facter at 5, which it has been for ever and people can add in a MaxHP check in the new event.

Code: Select all

if 250000 > _arg1.MaxHP then return end
-- the rest of the code
this would stop the bot from doing the new event code on mobs with HP less than 250,000

So if you know the kind of HP to expect from what you are killing you can simply adjust the value so it only does the event on the bosses.
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: 747 Changelog preCodeOnElite event

#8 Post by lisa » Sat Feb 02, 2013 9:45 pm

I had to add in a releasekeys at start of the code, otherwise it would just keep walking forward but it is looking pretty good at the moment.

Code: Select all

	<preCodeOnElite><![CDATA[
		print(_arg1.Name)
		lisa_bosses()
	]]></preCodeOnElite>

Code: Select all

Moving to waypoint #87, (2687, 1423)
Stopping waypoint: Target acquired.
Iron Rune Warrior
using: Extinguish Potion
using: Potion: Clear Thought
using: Embrace of the Muse
using: Ancient Spirit Water
using: Cheesecake
using: Meat Sandwich
Engaging enemy [Iron Rune Warrior] in combat.
Is there any reason releaseKeys() is a local in functions.lua and not a global?
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: 747 Changelog preCodeOnElite event

#9 Post by rock5 » Sat Feb 02, 2013 11:48 pm

LoL. I had the same idea. I've already made it global because I thought I might use it in AT.
  • 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: 747 Changelog preCodeOnElite event

#10 Post by lisa » Sun Feb 03, 2013 12:07 am

=)

if you are going to commit any time soon can you add the releasekeys to the event.

player.lua around line 1421

Code: Select all

	if target.MaxHP > (player.MaxHP * settings.profile.options.AUTO_ELITE_FACTOR) then
		-- check if preCodeOnElite event is used in profile
		if( type(settings.profile.events.preCodeOnElite) == "function" ) then
			releaseKeys();
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: 747 Changelog preCodeOnElite event

#11 Post by rock5 » Sun Feb 03, 2013 12:22 am

Ok, done.

I'll try to finish that ignore list then commit. Or maybe I should commit first. I already have a few changes and I wouldn't want it to get out of hand again. :roll:
  • 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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: 747 Changelog preCodeOnElite event

#12 Post by rock5 » Tue Feb 05, 2013 9:12 am

I had an idea about this option. Why didn't you just make it a more general onPreCombat function? Then you could use it for anything, not just boss fights. If you want to buff up for bosss/elites then you could just do a maxHP level check in the event and if too high then buff up, modify skill settings, eat food, etc.
  • 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: 747 Changelog preCodeOnElite event

#13 Post by lisa » Tue Feb 05, 2013 9:29 am

sounds fare but what code would you do before attacking a normal mob?

You are probably thinking about the warning message monitoring but aside from that what would you need to do before attacking a normal mob?
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: 747 Changelog preCodeOnElite event

#14 Post by rock5 » Tue Feb 05, 2013 11:12 am

Anything. I'm not thinking of anything in particular but for instance you could set up your skills for lots of level mobs. Eg. Real easy mobs - no buffs and just low damage instant casts, medium mobs - medium buffs and medium damage not too long casting skills, elites and mobs - all buffs most damage rotation including debuffs and eat food. Or maybe you could cast those troublesome to set up skills like Premeditation or Elemental Catalysis.

I think this has been requested a few times in the past.

And no, I wasn't thinking about my warning/alert messages. They are for during battle so pre battle has nothing to do with it.
  • 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: 747 Changelog preCodeOnElite event

#15 Post by lisa » Tue Feb 05, 2013 8:55 pm

rock5 wrote:And no, I wasn't thinking about my warning/alert messages. They are for during battle so pre battle has nothing to do with it.
I was thinking to start the monitoring and then finish the monitoring onleavecombat but I think you want to just monitor constantly.

Anyway to point at hand, the code is done when bot decides to attack a mob for first time so you could be in combat when the event is done, so people would need to allow for that in their code.

I just think if people need to add "stuff" to make it work effectively it probably won't be used.

So to add in HP checks and other checks would make it "complicated", I am more of the mind now days to keep things people may or may not use as simple as possible ;)
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: 747 Changelog preCodeOnElite event

#16 Post by rock5 » Tue Feb 05, 2013 11:37 pm

lisa wrote:So to add in HP checks and other checks would make it "complicated", I am more of the mind now days to keep things people may or may not use as simple as possible ;)
True but it also makes it less versatile. And, I don't know, but players would in most cases have to modify the elite factor and work out the right value to set it to for it to work properly. And they have to go to another file to modify it. I think that's a bit complicated. If we used the onprecombat we could include an example in the default.xml profile.

Code: Select all

<onPreCombat>
-- Code that is run at the start of a fight.
-- eg. if you want to buff up for boss/elites
--     if target.MaxHP > player.MaxHP * 5 then -- target has 5 times players HP
--         itemBuffs()
--     end
</onPreCombat>
That looks simple to me and easy to modify, just change the number right there. And it leaves it open for other uses.
  • 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: 747 Changelog preCodeOnElite event

#17 Post by lisa » Wed Feb 06, 2013 2:55 am

ohh yeah FYI I added the item cooldown function to item.lua and change inventoryitem.lua to actually use it.

Code: Select all

		local cd, success = self:getRemainingCooldown()
		if success == true and cd ~= 0 then -- Item is on CoolDown we can't use it
It annoyed me that if bot tried to use an item but due to lag or what ever it didn't use the item it would still wait the entire cooldown period and saying can't use item because of cooldown.

So anyway it has been implemented and seems to be working well =)

Just keep in mind with the event thing that you could be in combat when you attack the next mob, so it isn't really a precombat more of a preattackingmobforthefirsttime 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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests