Page 1 of 2
comparing stats of items
Posted: Wed Jan 19, 2011 12:33 am
by lisa
Anyone have anything that compares stats of items?
In the end I want to compare stats and then equip item with better/higher stats.
If the bot can check stats for autosell then it should be able to also do this.
I had a good browse through equipitem.lua, inventory.lua and item.lua. From what I can gather the stats autosell is checking come straight from the memory when looking at the item?
I got a little lost after that lol
Anything like this out there already or anyone have any ideas on how to impliment it?
Re: comparing stats of items
Posted: Wed Jan 19, 2011 7:10 am
by jduartedj
I know what your doing and it aint easy, it'a a lot of compares because it'a a lot of diff stats and classes! But I guess that if item already reads stats comparing ain't much harder.
Re: comparing stats of items
Posted: Wed Jan 19, 2011 7:44 am
by lisa
Yeah if I can get the stat from items then I easy make up a function to give each item a "statscore" with values entered into a database, so each class has diff value for int and so on.
After the calculation is done you get 1 number which would sum up overall benefit of the item to that class, can even add in a comparison for 2nd class, just in case.
Re: comparing stats of items
Posted: Wed Jan 19, 2011 7:45 am
by jduartedj
seems groovie!

Re: comparing stats of items
Posted: Wed Jan 19, 2011 8:24 am
by jduartedj
Here I hope this helps, don't use too big of a range otherwise it spamms MM.
prints the tooltips from min to max slot nrs. (bag I 60-90, etc...)
all you must do now is filter and extract only the stats.
EDIT: OH OH, try this instead!!!
Re: comparing stats of items
Posted: Wed Jan 19, 2011 8:40 am
by jduartedj
I think you should compare Levels (and colors/rarity), then Dura, then Stats. until lvl 45 then Stats might be more meaningful than Levels so Dura,Stats, Level(and colors/rarity).
Re: comparing stats of items
Posted: Wed Jan 19, 2011 9:48 am
by lisa
well it has deff given me a starting point, to give you an idea.
Code: Select all
Durability 110/111
Power Modifier |cff00ff00+20percent|r
Cape
Magical Defense 44.9
Stamina I
Mist I
Spirit I
Energy X
Stamina X
Intellect X
thats from first one you posted
Code: Select all
Stamina I
8
Mist I
9
Spirit I
10
Energy X
11
Stamina X
12
Intellect X
13
thats from second, exact same item.
The i value seems to be just the line number, I added it into your first 1 and was playing around trying to get the stats from left side of item too. Like magic damage and such. I kinda suck and failed at it though.
This could take me a while lol
EDIT: second one only posted stats with I and X in them, I get that bit atleast now lol
Re: comparing stats of items
Posted: Wed Jan 19, 2011 6:23 pm
by jduartedj
It was suppose to print anything with "I" "V" or "X" in the name. easiest way I found....
Re: comparing stats of items
Posted: Wed Jan 19, 2011 6:49 pm
by lisa
I must have been tired last night.
Code: Select all
function CItem:getGameTooltip(_place)
-- _place = Left | Right
I'll test it out using both left and right, I am guessing left will give me the stats on left side, slaps forehead.
I should be able to do what I want to now, might take me a bit of working out though lol
Re: comparing stats of items
Posted: Thu Jan 20, 2011 8:54 am
by jduartedj
:O
ofc I saw that but never thought of that xD
it was commented out never knew why.
Re: comparing stats of items
Posted: Thu Jan 20, 2011 10:48 am
by lisa
Seems to me the commented out bit was to explain some of the usage of the function. A bit further down it has
Code: Select all
= RoMScript("igf_GetTooltip('Right',"..self.BagId..")");
I changed the Right to Left and get values from left side.
I did change 'Right' to _place which gave the value between the () but it was also around the same time I updated MM and rombot and thats when things got messy. Had a few issues to deal with to get it going again.
Haven't had a chance to test it further been busy all day.
Re: comparing stats of items
Posted: Thu Jan 20, 2011 10:59 am
by jduartedj
ok nice!
Re: comparing stats of items
Posted: Thu Jan 20, 2011 12:00 pm
by lisa
I've been noticing a slight flaw in the plan so far, it doesn't seem to be refreshing after each usage. Some stats are still there from last item 'scanned'.
I added an item update into the userfunction, seems to be doing the job.
Code: Select all
for i,v in ipairs(t) do
item:update();
Tried inventory update but it didn't seem to have any affect on the results.
EDIT: spoke to soon, still getting residue stats from previous item.
Re: comparing stats of items
Posted: Thu Jan 20, 2011 3:55 pm
by jduartedj
try wiping table t:
... who knows...
Re: comparing stats of items
Posted: Thu Jan 20, 2011 8:35 pm
by lisa
I spent some time testing out where the stats were coming from today. The extra stats being output are from the last item to be moused over, so actually coming from the last tooltip. I can't see any way to determine what is and isn't on the actual item I am 'scanning'.
So it doesn't appear to be anything to do with the rombot functions themselves, I'm starting to think this is a pipe dream. It might be possible to do this idea as a game addon itself but I doubt I can get it reliable as a userfunction for rombot.
Re: comparing stats of items
Posted: Thu Jan 20, 2011 9:26 pm
by jduartedj
I guess I could run some tests, but it still think it is possible.
Re: comparing stats of items
Posted: Thu Jan 20, 2011 11:08 pm
by rock5
lisa wrote:I spent some time testing out where the stats were coming from today. The extra stats being output are from the last item to be moused over, so actually coming from the last tooltip.
This means you can't use the game and have to igf_GetTooltip return correct values but if the game is left alone while botting it should work ok.
Of course the big issue with igf_GetTooltip is that it is severely affected by the 255 character limit sometimes only returning 8 or 9 lines.
There needs to be better in game functions or a way to return more data from the game.
Re: comparing stats of items
Posted: Fri Jan 21, 2011 1:02 am
by lisa
to give you an idea, I moused over my wings and then did the UF to get tooltip for some shoulders.
Code: Select all
Durability 110/111
Durability 74/75
Shoulders
Magical Defense 34
Back
Energy IV
Mist I
Strike II
Energy X
Stamina X
Intellect X
So it posted "back" and the extra durability from the Wings.
I've also noticed if I last moused over a skill it posts the cooldown for the skill.
I really think making this work is beyond my capabilities.
Re: comparing stats of items
Posted: Fri Jan 21, 2011 1:34 am
by rock5
I don't think there's a problem with the function like that. I suspect more likely there is a bug in your implementation. Any chance of seeing the code you use?
Re: comparing stats of items
Posted: Fri Jan 21, 2011 2:36 am
by lisa
Just found this in igf
Code: Select all
GameTooltip:ClearLines(); -- seems not to work, still sometimes old values there ???
I used mainly what jd added near top of topic but changed things here and there when testing. Last post I used this.
In profile onload I have
Code: Select all
checkitems(61,61)
player:sleep();
userfunction file has
Code: Select all
---stat checker
if( settings == nil ) then
include("settings.lua");
end
function checkitems(minr,maxr)
-- local t = {}
if not minr then minr = 60 end
if not maxr then maxr = 90 end
for slot=minr,maxr do
local item = inventory.BagSlot[slot] --get item
local t = item:getGameTooltip(); -- get tooltip
cprintf(cli.blue,item.Name.."\n")
for i,v in ipairs(t) do
if (v ~= " " or v ~= "" or v ~= " ") then
printf(string.gsub(v,"%%","percent").."\n"); -- print all tooltips
filename = getExecutionPath() .. "/stats.xml";
file, err = io.open(filename, "a+");
if( not file ) then
error(err, 0);
end
file:write(v .. "\n");
file:close();
end
end
end
end