Page 2 of 3

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 6:04 am
by lisa
lol when I saw you posted I thought for sure you had worked it out, yaaaaay

new address for items cooldown base

skills is
staticCooldownsBase = 0x9E0064,

items is
0x9E0870

Code: Select all

function tester(item)
	local skillItemId = memoryReadInt( getProc(), item.BaseItemAddress + addresses.realItemIdOffset );
	if ( skillItemId ~= nil and skillItemId ~= 0 ) then
		local skillItemAddress = GetItemAddress( skillItemId );
		if ( skillItemAddress ~= nil and skillItemAddress ~= 0 ) then
			local offset = memoryReadRepeat("int", getProc(), skillItemAddress + addresses.skillRemainingCooldown_offset) or 0
			if offset and offset ~= 0 then
				print("supposed to work")
				local lol = memoryReadRepeat("int", getProc(), 0x9E0870 + (offset+1)*4) or 0
				print("offset: "..offset.." value: "..lol)
				return lol/10
			end
		end
	end
end

Code: Select all

Command> local item = inventory.BagSlot[65] print(tester(item))
supposed to work
offset: 27 value: 1771
177.1
Command> local item = inventory.BagSlot[69] print(tester(item))
supposed to work
offset: 3 value: 115
11.5

It took a lot of stuffing around until I worked out the original code you posted was working but the base address needed changing for items ;)

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 6:27 am
by rock5
Well done! that is exactly it. I don't even think I was close to figuring that out.

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 6:52 am
by lisa
rock5 wrote:Well done! that is exactly it. I don't even think I was close to figuring that out.
What eventually tipped me off was the staticCooldownsBase didn't end in 00, so it got me thinking that it isn't the entire cooldownbase but just the cooldown for skills, when I had that thought I just worked backwards from the addresses I did find for the cooldown of the specific item and it's "offset" value it printed and it all fell into place.

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 7:02 am
by rock5
So maybe add this to the bot

Code: Select all

function CItem:getRemainingCooldown()
   local skillItemId = memoryReadInt( getProc(), self.BaseItemAddress + addresses.realItemIdOffset );
   if ( skillItemId ~= nil and skillItemId ~= 0 ) then
      local skillItemAddress = GetItemAddress( skillItemId );
      if ( skillItemAddress ~= nil and skillItemAddress ~= 0 ) then
         local offset = memoryReadRepeat("int", getProc(), skillItemAddress + addresses.skillRemainingCooldown_offset) or 0
         if offset and offset ~= 0 then
            return (memoryReadRepeat("int", getProc(), addresses.staticCooldownsBase + 0x80C + (offset+1)*4) or 0)/10
         end
      end
   end
end
Maybe I'll put it off because then I'd have to change other code to use it which is a bigger job and I want to commit the changes I have now.

Edit: Does anything else have cooldowns besides skills and items that might have there cooldowns here?

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 7:46 am
by lisa
rock5 wrote:Maybe I'll put it off because then I'd have to change other code to use it which is a bigger job
if you added it as is then you don't need to change anything else, it can be integrated into the rest of the bot later.
rock5 wrote:Edit: Does anything else have cooldowns besides skills and items that might have there cooldowns here?
recall // transport, might come under skills, not sure.

Can't think of anything else off the top of my head.

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 8:14 am
by rock5
I found also wings. It returned a value of 0xD but was just under the item cooldown base. So a different range. It looks like the real cooldowns base is 0x9DEA80. Then for skills its 0x9DEA80 + 0x15E8 + (offset*4) and for items it's 0x9DEA80 + 0x1DF4 + (offset*4).

I might fix it to use the real base so that future cooldown functions can be offset from the real base. It also means I could do pattern matching for 15E8 and 1DF4 because they come up in "what accesses this address" searches.

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 8:23 am
by lisa
Hmm I would have thought it started at 0x9E0000.
0x9DEA80 is even before account name, char name and all sorts of other info.

"what accesses this address" could just be that it is an offset of the base character info, not necesarily the start of the cooldown info.
I found also wings. It returned a value of 0xD
(0xD + 1) * 4 is 0x38,
So it could still be 9e0000 + 0x38 and be under the 9E0064

Tested my wings and they were just under the 9E0870, I figure I just missunderstood.

recall is in the skills area

I wonder about pet skills.

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 9:04 am
by lisa
I think I am starting to understand why usegoodie had so many issues, the buffId's weren't the actual Buff Id's lol

Code: Select all

	--=== Housemaid Food ===--
	{itemId = 207209, buffId = 506673, types = "physical"},		-- Housekeeper Special Salted Fish with Sauce
	{itemId = 207210, buffId = 506674, types = "magic"},		-- Housekeeper Special Smoked Bacon with Herbs
	{itemId = 207211, buffId = 506675, types = "physical"},		-- Housekeeper Special Caviar Sandwich
	{itemId = 207212, buffId = 506676, types = "magic"},		-- Housekeeper Special Deluxe Seafood
	{itemId = 207213, buffId = 506677, types = "physical"},		-- Housekeeper Special Spicy Meatsauce Burrito
	{itemId = 207214, buffId = 506678, types = "magic"},		-- Housekeeper Special Delicious Swamp Mix
	{itemId = 207215, buffId = 506679, types = "physical"},		-- Housekeeper Special Unimaginable Salad
	{itemId = 207216, buffId = 506680, types = "magic"},		-- Housekeeper Special Cheese Fishcake
turned out I had a housemaid with lvl 80 crafting, no godspeed yet.
The Id prints as it should though.

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 9:18 am
by rock5
Didn't my version compare names instead of ids for that very reason?

So it looks like that was a more general sort of base address. Probably lots of cool info there. I don't get any other offsets though. I could try a pointer search.

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 9:22 am
by lisa
Hmmm got a snag, scarlet love and pungent vileness both say they have a 60 second cooldown, but they actually have no cooldown.
I did a print inventory and the item Id's matched.

Code: Select all

CoolDownTime:   60

Code: Select all

table: 037FC600
RequiredLvl:    1
LastTimeUsed:   0
ObjSubType:     2
Stats:  table: 037FC6C8
InUse:  false
BagId:  83
ItemCount:      12
LastMovedTime:  0
Quality:        1
Icon:
CoolDownTime:   60
Location:       inventory
Empty:  false
Value:  10
ItemShopItem:   false
BoundStatus:    0
ObjSubSubType:  -1
MaxDurability:  0
MaxStack:       100
ItemLink:       |Hitem:32966|h|cff00ff00[Potion: Scarlet Love]|r|h
Bound:  true
Durability:     0
group:  -1
SlotNumber:     83
ObjType:        2
types:  both
buffId: 506690
Id:     207206
BaseItemAddress:        799369472
Address:        10412160
Worth:  1
Available:      true
Color:  4278255360
CanBeSold:      false
Name:   Potion: Scarlet Love

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 9:51 am
by lisa
can't exaplain it so for now just going to over ride the cooldown value.

Code: Select all

	{itemId = 207206, buffId = 506690, types = "both", cooldown = 0},			-- Scarlet Love, increases physical defence
	{itemId = 207207, buffId = 506691, types = "both", cooldown = 0},			-- Pungent Vileness, "tank" increases agro

Code: Select all

if v.cooldown then item.CoolDownTime = v.cooldown end
Working nicely =)
usingbuffs1.png

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 9:52 am
by rock5
495644 says 60s cd but you're not using that id. I see that at an offset of 0x98 from the baseitemaddress it has the 495644 id. So maybe it thinks it gets that buff. If it doesn't, maybe it's a bug.

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 4:18 pm
by Ego95
What I could add is that grassland mix and the other 15 minutes memento food has a cooldown in a special case. It has got a cooldown of 15 seconds (or 20) if you use a phirius potion before. All other bufffood should have a cooldown which you can see if you look at the item.

AlterEgo95

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 7:05 pm
by lisa
AlterEgo95 wrote:if you use a phirius potion before
Do you mean the healing phirius pots ??

I don't see any need to use a phirius just before attacking a boss but I can do some testing to see if it appears in the cooldown or not.

Something I might have to make allowances for is the bot clearing target and then reaquiring target, it would then do the precode again.
So like madman when he jumps, you clear target and get him again.
Another is if the fight goes on too long, which still happens if mob doesn't die within that MAX_FIGHT_TIME.

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 7:52 pm
by lisa
Finally worked out the phirius cooldown.

The cooldown offset was always 0 but you can clearly see in the cooldown section of memory it is there, 0 is actually the value it should be,( 0+1) *4

0x9E0874, 0x9E0870 + 4

I had to remove the check for offset being 0 because the offset should actually be 0 for phirius pot and grasslandmix.

Code: Select all

Command> local item = inventory.BagSlot[89] print(tester(item))
18
Command> local item = inventory.BagSlot[89] print(tester(item))
14.5
Probably need to find some other indicator to see if the item has a cooldown or not.

This would need more testing but it seems ok so far.

skillItemAddress + 0xE0 is always 3 when an item actually has a possible cooldown. Purely for items, haven't checked skills.

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 8:19 pm
by lisa
this seems ok for now, for items

Code: Select all

function tester(item)
	local skillItemId = memoryReadInt( getProc(), item.BaseItemAddress + addresses.realItemIdOffset );
	if ( skillItemId ~= nil and skillItemId ~= 0 ) then
		local skillItemAddress = GetItemAddress( skillItemId );
		if ( skillItemAddress ~= nil and skillItemAddress ~= 0 ) then
			if memoryReadRepeat("int", getProc(), skillItemAddress + 0xE0) == 3 then
				local offset = memoryReadRepeat("int", getProc(), skillItemAddress + addresses.skillRemainingCooldown_offset)
				return (memoryReadRepeat("int", getProc(), addresses.staticCooldownsBase + 0x80C + (offset+1)*4) or 0)/10
			end
		end
	end
end

Code: Select all

Command> inventory:update() for i = 61,102 do local item = inventory.BagSlot[i]
local val = tester(item) if val then print(i.." \tcooldown: "..val.."\t "..item.
Name) end end
66      cooldown: 178.3  Potion: Clear Thought
68      cooldown: 178.3  Ancient Spirit Water
69      cooldown: 11.5   Infinite Elemental Stone
70      cooldown: 11.5   Elemental Spirit Stone
71      cooldown: 14.3   Phirius Elixir - Type C
80      cooldown: 14.3   Phirius Potion - Type B
92      cooldown: 0      Invisibility Potion
93      cooldown: 14.3   Phirius Elixir - Type E
94      cooldown: 14.3   Phirius Elixir - Type D
95      cooldown: 14.3   Phirius Potion - Type D
96      cooldown: 14.3   Phirius Potion - Type C
97      cooldown: 14.2   Phirius Special Water - Type D
98      cooldown: 14.2   Phirius Special Water - Type C
99      cooldown: 14.2   Phirius Special Water - Type B
101     cooldown: 14.2   Grassland Mix
All bagslots and cooldowns matched up.

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 9:29 pm
by Ego95
I only mean that if the char has low life and uses a pot and then stands ind front of the boss to use your userfunction it could not cast grassland. It may not happen often, but it could ;)

Re: ISO item/buff info for items people use.

Posted: Sun Feb 03, 2013 9:34 pm
by lisa
abron1 wrote:hero potion level 40
honey cake level 75 pdef food
Smoked Ribs level 75 damage food
Smoked Fish level 75 pattack food
Huge Sandwich level 75 magic damage food
all crafted food

Code: Select all

{itemId = 200277, buffId = 501337, types = "both"},			-- Hero Potion, all attributes +20%
Still no lvl 75 food on AH.

Got the info from memory so it is unconfirmed.

Code: Select all

	--=== Untested, got info from memory ===--
	{itemId = 207656, buffId = 495827, types = "both"},			-- Smoked Ribs
	{itemId = 207607, buffId = 495818, types = "physical"},		-- Smoked Fish
	{itemId = 207665, buffId = 495791, types = "both"},			-- Honey Cake
	{itemId = 207647, buffId = 495809, types = "magic"},		-- Huge Sandwich
AlterEgo95 wrote:I only mean that if the char has low life and uses a pot and then stands ind front of the boss to use your userfunction it could not cast grassland. It may not happen often, but it could ;)
yep and I do thank you for mentioning it, I have now got all item cooldown time remaining from memory because of it =)

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 11:16 pm
by rock5
lisa wrote:skillItemAddress + 0xE0 is always 3 when an item actually has a possible cooldown. Purely for items, haven't checked skills.
I have all skills memory area data collected in an excel spread sheat. 0xE0 for skills is 1 if it has a cooldown and 0 if not. Maybe a more accurate and safer command, instead of "if == 3 then", would be "if ~=0 then". Just nit picking. :)

Re: boss buffing (items only atm)

Posted: Sun Feb 03, 2013 11:28 pm
by lisa
trying to work out the best way to deal with the buff groups.

It would work if I made tables for each group and then go from there but I am trying to leave the table as is and then manipulate the data after adding in the group info, so more items can be just added as needed without the need to find the buff group number first.

I can create empty tables with names matching the groups easy enough, but adding the info to those tables is proving, painful.

Example

item.group == 65
item.group == 68

So I have 2 tables called group65 and group68, I have items that have item.group == 65 and item.group == 68.

table.insert isn't working because I need to use the tablename as arg1 and convincing it to do that from a string is currently beyond me.

At the moment my thought as to how it might actually work is to create tables that the name has nothing to do with the group.
groupbuff1 and add in all item.group65
groupbuff2 and add in all item.group68

In a nutshell the table stuff has me beat for today.
Might have another look at it tomorrow.
It probably sounds very confusing but to post the entire code would take up an entire page and take an hour to work out what it is doing lol

Code: Select all

I have all skills memory area data collected in an excel spread sheat. 0xE0 for skills is 1 if it has a cooldown and 0 if not. Maybe a more accurate and safer command, instead of "if == 3 then", would be "if ~=0 then". Just nit picking.
If we used the same function for items as skills then I could see a need for it, since this function would be just items though then checking for 3 would be better as if something goes wrong, no idea how, and you end up looking at a skills cooldown thingy having ~= 0 would be true even for an item.

I am sure either way would work fine though ;)