Retrieve Physical or Magical Damage?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Retrieve Physical or Magical Damage?

#1 Post by noobbotter » Thu Jun 04, 2015 9:24 am

Is there a way to read/retrieve the amount of Physical Damage or Magical Damage of the bot? I don't mean damage done to something, but rather the stat that is based primarily on the weapon wielded.

Thanks.

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

Re: Retrieve Physical or Magical Damage?

#2 Post by rock5 » Thu Jun 04, 2015 1:05 pm

Not really. I believe they are calculated values. I actually did some work on a rating function. It turned out to be very complex extracting the information. Here it is if you want to check it out. There are 2 functions, 1 that returns the stats of your actual items and 1 that returns base stats based on an id. When you use the functions it prints out something like this.

Code: Select all

Command> getRaterDataByItem(equipment.BagSlot[15])
=========================================
Forsaken Sword, Id 213360, BaseItemAddress 368A4600
-----------------------------------------
Address 9EE5A8
        Object types    Weapons Swords  Swords
        Required level  65
        Value   33134
        Speed   2.4
        Effects:
                +549    Physical Attack
                +71.28  Defense
                +1338   Damage
                +214.08 Maximum HP
                +586.8  Magical Damage Points
Attachments
userfunction_rater.lua
(7.06 KiB) Downloaded 151 times
  • 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

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Retrieve Physical or Magical Damage?

#3 Post by noobbotter » Thu Jun 04, 2015 2:42 pm

Yeah, Interesting function, but not quite what I was looking for. I'm basically Combining many of my different daily scripts by using one startup script which will call a particular set of dailies based on character HP (and hopefully damage capability). That way I won't send a level 50 Warlock that is used solely for buffing and has no equipment off to Jinner's camp to his death, whereas the lvl 56 Mage or Rogue that has 6000 HP and more than bare hand damage can handle doing some daily quests in those slightly tougher areas.

Ultimately, I'm going to make a large pool of dailies that any of my characters can run and will also allow me to not run 16 characters through a single spot one after another. I just need some checks and balances so I can ensure I don't send weak bots to tough areas.

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#4 Post by BlubBlab » Sun Jun 28, 2015 11:53 pm

I think you forgot to add the additional effect of the ALLATTR to add
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Retrieve Physical or Magical Damage?

#5 Post by noobbotter » Mon Jun 29, 2015 9:32 am

I just found the function GetPlayerAbility in the ROM API list. I'm going to play around with this tonight as it looks like it will give me exactly what I'm looking for.

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#6 Post by BlubBlab » Wed Jul 01, 2015 3:07 am

I realized what I'm missing is the pdmg and the mdmg.(not stats) I'm not sure if it is bug or just missing but I would need those values from the weapons. Can you take a look into it Rock5 (fine dagger +8) ?

I have also another question also about the dagger off-hand at the moment I simple remove items before I equip this will work with everything but the off-hand at least manually it switch place with the main hand when equip instead of the off-hand is there a solution ?
Last edited by BlubBlab on Wed Jul 01, 2015 5:04 am, edited 1 time in total.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

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

Re: Retrieve Physical or Magical Damage?

#7 Post by rock5 » Wed Jul 01, 2015 3:50 am

I have a userfunction that rates weapons. Would you like to look at that? I don't remember exactly why I didn't post it. Probably because the logic to decide which equipment to use was too complex but the functions return all relevant data needed to rate it I think. The table it returns looks like this.

Code: Select all

table: 0A9702C8
Name:   Root of Nightmares
ObjSubType:     4
Address:        10413480
Id:     212500
BaseItemAddress:        116241920
Value:  34020
Effects:        table: 0A970318
        12:     7.8
        25:     2730.6
        191:    2128.8
        14:     10.8
        15:     1166.4
        8:      12
        9:      33.6
        20:     192
        31:     6
RequiredLvl:    60
ObjType:        0
Speed:  3.1
StatCount:      6
ObjSubSubType:  1
You'll notice the 'Effects' are listed my number instead of name. The included printRater function displays the data in a more user friendly output and gets used automatically every time one of the 2 functions are used. The print looks like this.

Code: Select all

=========================================
Root of Nightmares, Id 212500, BaseItemAddress 6EDB600
-----------------------------------------
Address 9EE5A8
        Object types    Weapons Staves  Staves
        Required level  60
        Value   34020
        Speed   3.1
        Effects:
                +7.8    Physical Attack
                +2730.6 Damage
                +2128.8 Magical Damage Points
                +10.8   Magical Defense
                +1166.4 Magical Attack
                +12     Maximum HP
                +33.6   Maximum MP
                +192    Magical Critical Hit Rate
                +6      Light Resistance
Hm... Looks like some of the values are wrong. Maybe some offsets have changed. If you're interested I'll make an effort to fix 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
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#8 Post by BlubBlab » Wed Jul 01, 2015 5:03 am

Yeah I need that^^

With this I can finish my scoring/auto-equip + cleanbag function after this I only need infos about quest-rewards with multiple choices(with this I could than finish my record-userfunction)
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#9 Post by BlubBlab » Thu Jul 02, 2015 10:07 pm

I played a bit around I realized what was missing seems the + level of the weapon.
I remember faintly that you and Lisa couldn't find the addressee for + level ? I tried to simply find the value but I would need some gold on the server to by 'cheap' + stones for searching which byte change(I think it is a byte or even a bit)
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

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

Re: Retrieve Physical or Magical Damage?

#10 Post by lisa » Thu Jul 02, 2015 11:44 pm

http://www.solarstrike.net/phpBB3/viewt ... =20#p32369

Code: Select all

 -- Bag Item Stat Info
 -- level requirement is 0x58
 -- plus value is 0x17 (Byte)
 -- tier +- is 0x16 - 10 (Byte)
http://www.solarstrike.net/phpBB3/viewt ... =20#p32378

If you have an item with high plus value you can see what value you get from memory by placing it in the first bag slot then executing the following line at the commandline. It would be interesting to see what value a +16 item gives.

Code: Select all

print(memoryReadByte( getProc(),inventory.BagSlot[61].Address+ addresses.qualityTierOffset ))
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: Retrieve Physical or Magical Damage?

#11 Post by rock5 » Fri Jul 03, 2015 12:55 am

I do add the plus value in my rater. it looks like this.

Code: Select all

		-- Plus value
		local plus = memoryReadUByte(getProc(), item.Address + 0x17)
		if plus > 0 then
			local tmpid = memoryReadInt(getProc(), item.BaseItemAddress+0x3AC) + plus
			local tmpidaddress = GetItemAddress(tmpid)
			addEffects(tmp.Effects, tmpidaddress, dura)
		end
I don't know if the offsets are still right.

What this does is it gets the plus value from 0x17 offset then uses that to look up the damage, in a round about way, from a table of damages starting from 0x3AC offset of the BaseItemAddress.
  • 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
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#12 Post by BlubBlab » Fri Jul 03, 2015 2:06 am

Okay I got it but I'm not sure what went wrong now.

Command> getItemScore(inventory.BagSlot[61])
plus: 8 (This is right)
tmpid: 740008
tmpidaddress: 847108096
=========================================
Feines Langschwert, Id 210516, BaseItemAddress 39ED1500
-----------------------------------------
Address 9FCFC0
Object types Waffen Schwerter Schwerter
Required level 1
Value 60
Speed 2.5
Effects:
+7 Magieschadenspunkte
+9 Verteidigung
+24 Schaden (PDMG)
+15 Maximale LP

What is wrong is the PDMG it must be 56 also the Patt which came out from the + is missing.
EDIT: It seems really like addEffects comes out with 0 I can calculate the DMG 24* 1,1^9 = 56,590744584
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#13 Post by BlubBlab » Fri Jul 03, 2015 2:45 am

My second print:

Code: Select all

Command> getItemScore(inventory.BagSlot[61])
effectId: 25
effectId: 191
effectId: 3
effect size: 3
plus: 8
tmpid: 740008
tmpidaddress: 847108096
=========================================
Feines Langschwert, Id 210516, BaseItemAddress 39ED1500
-----------------------------------------
Address 9FCFC0
        Object types    Waffen  Schwerter       Schwerter
        Required level  1
        Value   60
        Speed   2.5
        Effects:
                +7      Magieschadenspunkte
                +9      Verteidigung
                +24     Schaden
                +15     Maximale LP
Command>
My best guess is that the effect offset for the + off the gear is wrong with 0x3AC
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#14 Post by BlubBlab » Fri Jul 03, 2015 5:03 am

@Lisa this what it returns with your code.

Code: Select all

Command> print(memoryReadByte( getProc(),inventory.BagSlot[61].Address+ addresse
s.qualityTierOffset ))
10
I'm not sure if this is right the tier 1 and it is +8
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#15 Post by BlubBlab » Fri Jul 03, 2015 5:37 am

Okay :D I found it the offset for the + plus level is +0x98 not +0xB8.
I'm not sure it seem there are still bugs at least not much I have 60 PDMG instead of 56.
Geat I will post a new version
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: Retrieve Physical or Magical Damage?

#16 Post by beanybabe » Fri Jul 03, 2015 7:06 am

If you can do these kind of calculations can you make one that could look at the gear you have and list list instance mobs you should be able to kill using the mob stats from the german site. another idea is if you are in pvp it might avoid targeting any player that you cannot kill.

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#17 Post by BlubBlab » Fri Jul 03, 2015 8:01 am

beanybabe wrote:If you can do these kind of calculations can you make one that could look at the gear you have and list list instance mobs you should be able to kill using the mob stats from the german site. another idea is if you are in pvp it might avoid targeting any player that you cannot kill.
I think in that case you should plainly use your DPS, M-Attack and P-Attack and some experience and but that into a table.
In theory you can also use experience + gearscore for your class.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

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

Re: Retrieve Physical or Magical Damage?

#18 Post by rock5 » Fri Jul 03, 2015 10:59 am

Ok lets break this down.

Code: Select all

      -- Plus value
      local plus = memoryReadUByte(getProc(), item.Address + 0x17)
      if plus > 0 then
         local tmpid = memoryReadInt(getProc(), item.BaseItemAddress+0x3AC) + plus
         local tmpidaddress = GetItemAddress(tmpid)
         addEffects(tmp.Effects, tmpidaddress, dura)
      end
On my item with +5 the 0x17 offset gave me 0x25. I tested it by plusing a cheap item and the offset is correct. So it looks like the 2 in 0x25 is not part of the plus. That means that the plus can't be more than 15, unless it's base 32 (ie. 5 bits). So that's the first thing that needs to be fixed. I'll try using modulo 32 and seeing if that works.
item.BaseItemAddress+0x3AC does yield an id. GetItemAddress gives and address that is passed to the addEffects function. This all looks correct.

There seems to be something wrong with the offsets in addEffects. I'm having trouble working it out. I'll keep at 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
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#19 Post by BlubBlab » Fri Jul 03, 2015 9:12 pm

Sry I meant addEffects

Code: Select all

local function addEffects2(tabel, address, dura)
	dura = dura or 1
	local place = 0
	local effectId = memoryReadInt(getProc(),address+0x98)
	
	while effectId > 0 do
	--	print("effectId: "..effectId.."");
		if CLASS_EFFECT[player.Class1][effectId] then
			local size = memoryReadInt(getProc(),address+0x98+place+0x28)
			--print("effect size: "..size.."");
			for eff,mul in pairs (CLASS_EFFECT[player.Class1][effectId]) do
				tabel[eff] = (tabel[eff] or 0) + size * mul * dura
			end
		else
			tabel[effectId] = (tabel[effectId] or 0) + memoryReadInt(getProc(),address+0x98+place+0x28)* dura
		end
		place = place + 4
		effectId = memoryReadInt(getProc(),address+0x98+place)
	end
end
There was also another type 9 one int more address lower but with a value 0
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#20 Post by BlubBlab » Sat Jul 04, 2015 3:57 am

rock5 wrote:Ok lets break this down.

Code: Select all

      -- Plus value
      local plus = memoryReadUByte(getProc(), item.Address + 0x17)
      if plus > 0 then
         local tmpid = memoryReadInt(getProc(), item.BaseItemAddress+0x3AC) + plus
         local tmpidaddress = GetItemAddress(tmpid)
         addEffects(tmp.Effects, tmpidaddress, dura)
      end
On my item with +5 the 0x17 offset gave me 0x25. I tested it by plusing a cheap item and the offset is correct. So it looks like the 2 in 0x25 is not part of the plus. That means that the plus can't be more than 15, unless it's base 32 (ie. 5 bits). So that's the first thing that needs to be fixed. I'll try using modulo 32 and seeing if that works.
item.BaseItemAddress+0x3AC does yield an id. GetItemAddress gives and address that is passed to the addEffects function. This all looks correct.

There seems to be something wrong with the offsets in addEffects. I'm having trouble working it out. I'll keep at it.
AH I forgot the plus level goes until +20
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests