SRL Archive - SRL Bugs

XP Reward Update Layout


Kyle Undefined

2012-03-28 01:37:17

So I've updated the RD_SolveXP function for the new XP Reward layout that was updated today. I updated the Grid and slot numbers for each skill. I tested it on 4 lamps, and it worked perfectly.

I've sent a pull request through Git.

Here's an image of the new grid:

Here's the code I used to find the correct grid and slot numbers:

program new;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i srl/srl/misc/paintsmart.simba}

var
b : TBox;

begin
Smart_Server := 10;
Smart_Members := True;
Smart_Signed := True;
SetupSRL();
SMART_ClearCanvas();
SMART_DrawBoxes(false, Grid(7, 4, 40, 40, 65, 57, point(64, 104)), clYellow);
b := gridBox(23, 7, 4, 40, 40, 65, 57, point(64, 104));
mouseBox(b.x1, b.y1, b.x2, b.y2, mouse_move);
end.

Here's the debug from the above code:

SRL Compiled in 0 msec
SMART Initialized.
Loaded: Server 10, Members: True, Signed: True, Super Detail: False.
RD_SolveLamp: Found experience lamp
RD_SolveXP: Clicked XP reward
RD_SolveXP: Solved experience reward
Successfully executed.

For those of you who know how to update the include, the following code goes into the /Simba/Includes/SRL/SRL/core/antirandoms/rewards.simba file. Just overwrite the existing function:

function RD_SolveXP(x, y: integer; uptext: string): boolean;
var
slot, skill: integer;
b: TBox;
begin
mmouse(x, y, 3, 3);
if (waitUptext(uptext, 300)) then
begin
getmousePos(x, y);
mouse(x, y, 0, 0, mouse_Left);
addToSRLLog('RD_SolveXP: Clicked XP reward');

// the color of the background (i.e. scroll color)
if (not waitFindColor(x, y, 10803447, MSX1, MSY1, MSX2, MSY2, 5, 5000)) then
begin
addToSRLLog('RD_SolveXP: XP reward didn''t open');
exit;
end;

// in case of runtime out of range
if (length(players) <= 0) then
skill := SKILL_MINING
else
skill := players[currentPlayer].lampSkill;

// slot returned by gridBox below
case skill of
SKILL_ATTACK : slot := 1;
SKILL_DEFENCE : slot := 15;
SKILL_STRENGTH : slot := 8;
SKILL_HITPointS, SKILL_HP : slot := 22;
SKILL_RANGE : slot := 9;
SKILL_PRAYER : slot := 16;
SKILL_MAGIC : slot := 2;
SKILL_COOKING : slot := 24;
SKILL_WOODCUTTING : slot := 4;
SKILL_FLETCHING : slot := 6;
SKILL_FISHING : slot := 17;
SKILL_FIREMAKING : slot := 11;
SKILL_CRAFTING : slot := 18;
SKILL_SMITHING : slot := 10;
SKILL_MINING : slot := 3;
SKILL_HERBLORE : slot := 12;
SKILL_AGILITY : slot := 5;
SKILL_THIEVING : slot := 7;
SKILL_SLAYER : slot := 13;
SKILL_FARMING : slot := 19;
SKILL_RUNECRAFTING : slot := 25;
SKILL_HUNTER : slot := 20;
SKILL_CONSTRUCTION : slot := 14;
SKILL_SUMMONING : slot := 21;
SKILL_DUNGEONEERING : slot := 23;

else
slot := 3; // Mining
end;

b := gridBox(slot, 7, 4, 40, 40, 65, 57, point(64, 104));
mouseBox(b.x1, b.y1, b.x2, b.y2, mouse_Left); // click skill

wait(500 + random(500));
mouse(387, 263, 20, 5, mouse_Left); // click confirm

addToSRLLog('RD_SolveXP: Solved experience reward');
wait(2000 + random(500));
clickContinue(true, true);
result := true;
end;
end;

Coh3n

2012-03-28 02:10:19

Nice work. I like that layout much better than the old one. :)

I'll merge this as soon as I can.

rice

2012-03-28 02:15:26

Nice update I hated the old layout this one is easier to see

begginer

2012-03-28 03:40:49

Well done. And this new update is cool.

Coh3n

2012-03-28 15:14:02

Thanks for sending a pull request. Merged. :)