SRL Archive - Reflection Help

Couple of things broken?


Infantry001

2009-08-17 13:47:25

R_GetMMLevels does not work for HP or Run/Energy (returns -1 for both).

GetMySkill doesn't seem to be working either. It either returns 0, 1, or a really weird number that doesn't happen to be related to any of my stats.

EDIT: Yes, I have already updated to the latest dev reflection.

mormonman

2009-08-17 17:29:22

R_GetMMLevels is working for me right at this moment for run/energy. What does yours look like?

XRaye

2009-08-17 19:23:53

I use GetSkillLevel('Mining'); and GetXP('Mining'); they both work fine.
As for the running, I had to make my own procedure that used colors because it wouldn't work.
It turns the run on when it's green, yellow, or orange, and off when red. If that's what you wanted.


procedure CheckRunLevels;
begin
if not LoggedIn then LoginPlayer;
if FindColor(X, Y, 65280, 738, 106, 756, 118) or
FindColor(X, Y, 65535, 738, 106, 756, 118) or
FindColor(X, Y, 2070783, 738, 106, 756, 118) then
begin
Status('Turning run on...');
SetRun(True);
end else if FindColor(X, Y, 255, 738, 106, 756, 118) then
begin
Status('Turning run off...');
SetRun(False);
end else
begin
Writeln('Energy level checking failed, turning run on by default...');
Status('Turning run on...');
SetRun(True);
end;
end;

Infantry001

2009-08-17 20:52:46

From: XRaye
I use GetSkillLevel('Mining'); and GetXP('Mining'); they both work fine.
As for the running, I had to make my own procedure that used colors because it wouldn't work.
It turns the run on when it's green, yellow, or orange, and off when red. If that's what you wanted.


procedure CheckRunLevels;
begin
if not LoggedIn then LoginPlayer;
if FindColor(X, Y, 65280, 738, 106, 756, 118) or
FindColor(X, Y, 65535, 738, 106, 756, 118) or
FindColor(X, Y, 2070783, 738, 106, 756, 118) then
begin
Status('Turning run on...');
SetRun(True);
end else if FindColor(X, Y, 255, 738, 106, 756, 118) then
begin
Status('Turning run off...');
SetRun(False);
end else
begin
Writeln('Energy level checking failed, turning run on by default...');
Status('Turning run on...');
SetRun(True);
end;
end;


Thanks, but I'm trying to use reflection =)

From: mormonman
R_GetMMLevels is working for me right at this moment for run/energy. What does yours look like?


R_GetMMLevels('hp') returns -1
R_GetMMLevels('prayer') returns 2 (correct)
R_GetMMLevels('run') returns -1

On a good note, GetMySkill works now =)

Capricorn

2009-08-17 22:51:12

I have had a problem with getting the run values from the MM for like 5 months now? I brought it up in IRC one day and I guess no one ever got around to fixing it.

mormonman

2009-08-18 01:09:23

From: Infintry001

R_GetMMLevels('hp') returns -1
R_GetMMLevels('prayer') returns 2 (correct)
R_GetMMLevels('run') returns -1

On a good note, GetMySkill works now =)


No I mean the function that is in your include.

Infantry001

2009-08-18 01:13:57

function R_GetMMLevels(Which : String) : Integer;

begin
Result := -1;
case LowerCase(Which) of
'hitpoints', 'hp' : Result := 748;
'prayer', 'pp' : Result := 749;
'run', 'energy' : Result := 750;
else
SRL_Warn('R_GetMMLevels', 'Invaild string.', -3);
end;
Result := StrToIntDef(GetInterfaceText(Result, 4 - 2 * Integer(Result = 750)), -1);
end;

mormonman

2009-08-18 01:15:06

function R_GetMMLevels(Which: string): Integer;
begin
Result := -1;
case LowerCase(Which) of
'hitpoints', 'hp': Result := 748;
'prayer', 'pp' : Result := 749;
'run', 'energy' : Result := 750;
else SRL_Warn('R_GetMMLevels', 'Invaild string.', -3);
end;
Result := StrToIntDef(GetInterfaceText(Result, 4 + 1 * Integer(Result <> 749)), -1);
end;
Try that.

Infantry001

2009-08-18 01:41:19

From: mormonman
function R_GetMMLevels(Which: string): Integer;
begin
Result := -1;
case LowerCase(Which) of
'hitpoints', 'hp': Result := 748;
'prayer', 'pp' : Result := 749;
'run', 'energy' : Result := 750;
else SRL_Warn('R_GetMMLevels', 'Invaild string.', -3);
end;
Result := StrToIntDef(GetInterfaceText(Result, 4 + 1 * Integer(Result <> 749)), -1);
end;
Try that.

That did it! Thanks!

mormonman

2009-08-18 01:41:59

that is in the newest developers reflection revision number 152…

Infantry001

2009-08-18 02:09:05

Wow what the hell? I could've sworn I had dev reflection…
My bad, I fail =(

/facepalm

Thanks for the help, Rep+