Page 1 of 1

Luck memory address

Posted: Fri Mar 23, 2012 6:42 am
by rock5
I had the idea, today, to look for the luck value in memory. I just thought this would be interesting to find. I found it at 0x9D57CC.

This is how you get it. I use staticEquipBase so it might continue working after a game patch .

Code: Select all

luck = memoryReadFloat(getProc(),addresses.staticEquipBase+0x2AE0)
Update for 6.0.1 and 6.0.2.

Code: Select all

luck = memoryReadFloat(getProc(),addresses.playerCraftLevelBase+0xD00)

Here is a userfunction that searches for the offset so should still work even if the offset changes. To use it just use

GetLuck

Code: Select all

luck = getLuck()

Re: Luck memory address

Posted: Fri Mar 23, 2012 9:17 am
by grande
I'm sitting here trying to understand why this is interesting. I don't doubt there is value but I'm not really seeing the whole picture. My experiments in CE have left me scratching my head as I play with HP values that don't have any real affect since it's just what you see on screen and not the actual HP the character has. Or is there some final memory address that I never made it to? At one point I even started googling different memory location data to see what various three letter codes meant to see if that may help me understand what to change but I was really just spitballing ideas with little understanding of what I was doing... but hey, that's worked for me in the past :P

I'd like to understand better but maybe there's stuff that shouldn't be aired out too much... From time to time I'll look more in the CE tutorials and each time they seem to make a little more sense but so far I still have no real meaningful results from my experiments other than, "gee wiz, that's sort of neat". Then again I know even less about "oly db" and terms other than CE so I'm sure I still have a lot to learn.

Congrats on 5555 posts, nice round number lol

Re: Luck memory address

Posted: Fri Mar 23, 2012 9:55 am
by rock5
Well, we mainly use memory addresses to get info. There is very little memory changing done with the bot. That's what I intended, just to give info. To tell you the truth, I don't know what would happen if you changed the value and I didn't even try. I suspect it wouldn't work.

The reason I thought it was interresting is, maybe you might wonder if certain luck buffs stack or not. Now you can check. For instance, today I used Lucky powder from the house maid, lucky frog and lucky cactus and I had 105 luck (75%+10%+20%). So I know those 3 stack. Maybe they all stack so this is useless, I'm not sure. Or how about this, everyone know Honor parties increase drop rate, maybe with this you could see by how much. I'm pretty sure it's not written anywhere.

Re: Luck memory address

Posted: Fri Mar 23, 2012 10:12 am
by silinky
niice :D
i already see the possibilities. thanks!

Re: Luck memory address

Posted: Fri Mar 23, 2012 2:40 pm
by grande
@silinky, are you seeing something different then what rock posted? What pray tell might that be?

@Rock, thanks. Make sense if I undersand... this memory address would be monitored before/after creation of honor party to see what the actual percentage gain in luck would be. That's pretty cool if that's what you're saying. I can remember tallying up in my head what all the buffs added up to lol. Here's another consideration... aren't there differences between group cumulated luck and overall luck? Maybe there are different addresses for group luck and personal luck and even one for combined personal/group affects which is some how aggregated mathematically... hmmm.......

Re: Luck memory address

Posted: Sat Mar 24, 2012 8:31 am
by rock5
grande wrote:aren't there differences between group cumulated luck and overall luck?
I don't know. Maybe luck gotten from a group is added to your general luck.

Re: Luck memory address

Posted: Wed Apr 04, 2012 6:51 pm
by BillDoorNZ
Just been testing with this a bit. Definitely not showing any change in luck with an honor party - as you mentioned Rock, its prolly group-based-luck so could be a different mem address/offset

Re: Luck memory address

Posted: Wed Apr 04, 2012 11:06 pm
by rock5
Hm... I suspect it's a calculated value so it might not appear anywhere in memory. I'm certainly not interested in searching for it.

Re: Luck memory address

Posted: Sat Apr 07, 2012 8:02 pm
by kkulesza
Thanks for posting this address. The research was interesting.

Fact:
There was a crafting event last summer.
You could craft this item:
http://www.runesdatabase.com/item/20973 ... -rune-dice
if you have trained blacksmithing.
This item is clickable every 30 secs and has a skill that might give you a 3 minut buff.
The buff says "You feel like this is your lucky day" or something like that.
I've tried refining items and buying memento/shell stats with that buff on, but there was no diffrence.
Now i know it adds 100 to luck(drop rate) value.
I wish i had made those dices on every KS-bot alt :)

Re: Luck memory address

Posted: Thu Apr 19, 2012 10:24 pm
by BillDoorNZ
Just thought of a good use for the luck address:

When farming KS etc I regularly use the CleanBag function to drop low value items. I'm thinking that what I might do is auto-adjust the 'drop value' based upon the characters current luck. e.g.

Code: Select all

local luck = ....

if (luck < 50) then
  CleanBag(300,3);
elseif ((luck >= 50) and (luck < 80) then
  CleanBag(500,3);
elseif ((luck >= 80) and (luck < 150) then
  CleanBag(800,3);
else
  CleanBag(1500,3);
end;
forgive the inefficient code - just getting the point across.

Re: Luck memory address

Posted: Fri Apr 20, 2012 6:14 am
by silinky
haha i do exactly the same. and i also check for honor party when i do this :)

Re: Luck memory address

Posted: Wed Apr 25, 2012 3:37 pm
by BillDoorNZ
ended up doing this:

Code: Select all

function KSSetLootValue()
	local luck = memoryReadFloat(getProc(),addresses.staticEquipBase+0x2AE0);
	if (luck) then
		local lootValue = math.floor(luck/50)*KS_LootFactor;
		lootValue = lootValue + KS_LootMin;
		if player:hasBuff("May Establish Honor Party") then
			lootValue = lootValue + KS_HonorPartyMod;
		end;
		ksLog("Changing Loot value from "..tostring(KS_loot_discard_value).." to "..tostring(lootValue).." as luck is "..tostring(luck), LOGLEVEL_INFO);
		KS_loot_discard_value = lootValue;
	end;
end;
and started with:

Code: Select all

KS_LootFactor = 100;
KS_LootMin = 200;
KS_HonorPartyMod = 200;
but found that adjusting loot values this way didn't really improve profit vs time, so ended with:

Code: Select all

KS_LootFactor = 0;
KS_LootMin = 200;
KS_HonorPartyMod = 0;
which basically just throws out anything under value of 200 :) at least it was an interesting exercise :)

Re: Luck memory address

Posted: Thu Apr 26, 2012 3:23 am
by silinky
nice :)
mine actualyy is like this:
if honorparty is on, throw out everything under 900 gold
if it is off, don't.

because when i have honor, i get full at locatha, but without it, drop rate drastically falls. even when i have 320% luck.
honor party is a majot luck buff when you are above lvl 55. but my KS farmers are all lvl 60-70.

Re: Luck memory address

Posted: Thu Apr 26, 2012 3:58 am
by rock5
Actually, when farming t4 items the drop rate is abysmal, but if I create a regular party with another character, my drop rate increases dramatically. I'm not sure of the difference between regular parties and honor parties but regular parties help drop rates a lot too.

Useful to know, if you don't have any low level characters handy for an honor party or you can't be bothered making the trip to go collect the honor party certificates.

Re: Luck memory address

Posted: Sat Sep 21, 2013 12:55 pm
by rock5
Updated the the command to work with 6.0.1 and 6.0.2.

I also added a userfunction that searches for the offset using a pattern so it should last longer.