@Justin, your slayer texture is incorrect. See below.
A quick note - those textures share with the skills tab and sometimes monster weakness. The ranged weakness icon is the same as the ranged XP, for example. However, the XP tracker is drawn last and therefore will appear last in the array. So, you're better off using:
Simba Code:
xpIcon[high(xpIcon)].bounds.x1
Edit: However, I got bored...
Simba Code:
function getSkillTexture(funcString:string):int32;
begin
case funcString:=lowercase(funcString) of
'agility':result:=29580;
'attack':result:=16918;
'combat':result:=31110;
'constitution','hitpoints':result:=38262;
'construction':result:=54189;
'cooking':result:=47376;
'crafting':result:=33559;
'defence':result:=41952;
'divination':result:=22933;
'dungeoneering':result:=58390;
'farming':result:=34536;
'firemaking':result:=46008;
'fishing':result:=54626;
'fletching':result:=19315;
'herblore':result:=54427;
'hunter':result:=30306;
'magic':result:=51211;
'mining':result:=16653;
'overall':result:=48705;
'prayer':result:=23912;
'ranged':result:=20999;
'runecrafting':result:=33877;
'slayer':result:=54733;
'strength':result:=39319;
'smithing':result:=31773;
'summoning':result:=37582;
'thieving':result:=25506;
'woodcutting':result:=44243;
end;
end;
function getXPTracker(funcString:string):int32;
var
funcBounds:tBox;
funcID:int32;
funcPointer:pointer;
funcPointerIndex,
funcPointerSize:uInt32=0;
funcText:string;
begin
if funcID:=getSkillTexture(funcString) then
begin
{
Because we know that the skill icon we're looking for is one of the
last drawn textures, we set the pointer to the end and work backward
to save time.
}
funcPointer:=glTextures(funcPointerSize)+(36*(funcPointerSize-1));
if funcPointer<>nil then
begin
{
Again, because we know that the texture we're looking for will
appear very close to the end, it should be safe to only need to
search one fifth of the textures.
}
for funcPointerIndex to funcPointerSize div 5 do
begin
{
funcPointer^ contains the ID of the current texture. Because
glTextures are 36 bytes, (funcPointer-36)^ contains the ID of
the previous texture.
The 0+ tells it ahead of time that we're dealing with an
integer. Without it, we'd get an access violation.
(funcPointer+28)^ and (funcPointer+20)^ contain the X2 and X1
of the current texture.
}
if (funcPointer^=funcID) and ((0+(funcPointer+28)^-(funcPointer+20)^=25)) then
begin
{
(funcPointer+20)^, (funcPointer+24)^, (funcPointer+28)^,
and (funcPointer+32)^ contain the bounds of the current
texture.
}
funcBounds:=[0+(funcPointer+20)^-200,(funcPointer+24)^,(funcPointer+28)^,(funcPointer+32)^];
break;
end;
{
Because glTextures are 36 bytes, and we're working backward,
we subtract 36 from the current pointer to reach the previous
one.
}
funcPointer:=funcPointer-36;
end;
{
If funcPointerIndex were to be greater then one fifth of the
funcPointerSize, odds are we didn't find the texture we were
looking for.
}
if funcPointerIndex<=funcPointerSize div 5 then
begin
{
Again, because we know that the XP tracker is one of the last
drawn interfaces, we can start at the end of the pointer and
work backward to save time.
}
funcPointer:=glFonts(funcPointerSize)+(48*(funcPointerSize-1));
if funcPointer<>nil then
begin
{
See two notes below for why we should only need to search
half of the chars.
}
for funcPointerIndex:=0 to funcPointerSize div 2 do
begin
{
(funcPointer+8)^ and (funcPointer+12)^ contain the X
and Y of the current texture.
}
if pointInBox([(funcPointer+8)^,(funcPointer+12)^],funcBounds) then
begin
funcText:=char((funcPointer+16)^)+funcText;
end
{
If we found text within the area, but the next char
isn't in the desired bounds, we've no reason to
proceed.
}
else if (funcText<>'') and (funcText[1]<>'+') then
begin
result:=explode('+',funcText)[0].parseInt();
break;
end;
{
Although glChars are 48 bytes, we know that the text
drawn by the XP tracker has a shadow, and we can
therefore skip every other char.
}
funcPointer:=funcPointer-96;
end;
end;
end;
end;
end;
exit(result);
end;
Simba Code:
writeLN(getXPTracker('slayer'));
I might just add something like this into ogLib, if you don't mind? Not the progress report, but getting the XP tracker.