SRL Archive - SRL Archives

procedure UseRewardBox: Boolean;


Timer

2010-01-29 23:28:38

{*******************************************************************************
procedure UseRewardBox: Boolean;
by: Nava2, Timer
Description: Finds the reward box, and opens it getting the reward.
*******************************************************************************}

function UseRewardBox: Boolean;
var
I, Time, Height, fx, fy, Index, bDTM: Integer;
Text, TPA: TPointArray;
B: TBox;

begin
Result := False;
if (not LoggedIn) then exit;
GameTab(tab_Inv);
if (not(FindColorTolerance(fX, fY, 5510016, MIX1, MIY1, MIX2, MIY2, 20))) then Exit;
{ DTM updated 10th Januray 2010 - marpis }
bDTM := DTMFromString('78DA63CC61626078C68002DA452219FE03694' +
'620FE0F048C9940355719D00013986484F2187388509300E4DF23' +
'A0A69C083520F77C20C2AED704D45400F96FF1AB0100750B108B');
for I := 1 to 28 do
begin
B := InvBox(I);
if FindItemEx(fx, fy, 'dtm', bDTM, B, []) then
begin
InvMouse(I, 3);
Wait(RandomRange(100, 150));
Result := IsUpText('ando');
if (Result) then Break;
end;
end;
FreeDTM(bDTM);
if (not Result) then exit;

GetMousePos(fx, fy);
Mouse(fx, fy, 0, 0, True);

Result := False;
Text := LoadTextTPA('hoose', UpChars, Height);
Time := GetTimeRunning + 10000;
FindColorsTolerance(TPA, 2070783, 185, 34, 327, 50, 3);
while (not Result and (GetTimeRunning < Time)) do
begin
Wait(RandomRange(80, 100));
FindColorsTolerance(TPA, 2070783, 185, 34, 327, 50, 3);
if (Length(TPA) > 10) then
Result := FindTextTPAinTPA(Height, Text, TPA, TPA);
end;

if (not Result) then
begin
SRL_Warn('OpenRewardBox', 'Could not open Reward Screen', Warn_AllVersions);
Exit;
end;
Wait(Random(100));
if (not FindBoxOption(B, Index)) then
begin
SRL_Warn('UseRewardBox', 'Could not find a usable option.', Warn_AllVersions);
Exit;
end;

Mouse(B.X1, B.Y1, 0, 0, True);
Time := GetTimeRunning + 2000;
Result := False;
while (not Result) and (GetTimeRunning < Time) do
begin
FindColorsTolerance(TPA, 1317148, 35, 70, 362, 311, 3);
Result := Length(TPA) > 50;
Wait(50 + Random(50));
end;
if (not Result) then
begin
CloseWindow;
Exit;
end;
MouseBox(413, 171, 469, 200, 1);
Time := GetSystemTime;
while (CountColorTolerance(1317148, B.x1 - 10, B.y1 - 10, B.x1 + 10, B.y1 + 10, 3) > 50) and (GetSystemTime - Time < 5000) do
begin
if (Pos('thing else', GetChatBoxText(8, clBlack)) > 0) then
begin
CloseWindow;
Wait(500 + Random(500));
SetLength(RB_SkipArray, Length(RB_SkipArray) + 1);
RB_SkipArray[High(RB_SkipArray)] := Index;
Result := UseRewardBox;
Break;
end;
Wait(100 + Random(200));
end;
RB_SkipArray := [];
if (CloseWindow) then
Result := False;
end;

IsUpText cause fail… So yeah here.

Wanted

2010-01-29 23:37:50

There's a lot of very fatal problems with SRL these days… genie lamp doesn't work, pretty much all item DTMs that haven't been updated in the past month are broken from the outline color shift…. random detection/recovery is pretty shaky too… the solvers work pretty good… but it kinda needs an overhaul :(

Timer

2010-01-29 23:38:29

From: IceFire908
There's a lot of very fatal problems with SRL these days… genie lamp doesn't work, pretty much all item DTMs that haven't been updated in the past month are broken from the outline color shift…. random detection/recovery is pretty shaky too… the solvers work pretty good… but it kinda needs an overhaul :(


fixing lamp now..

Wizzup?

2010-01-30 06:32:50

From: IceFire908
There's a lot of very fatal problems with SRL these days… genie lamp doesn't work, pretty much all item DTMs that haven't been updated in the past month are broken from the outline color shift…. random detection/recovery is pretty shaky too… the solvers work pretty good… but it kinda needs an overhaul :(


Sounds like something for SRL 5.

Wanted

2010-01-30 11:34:42

From: Wizzup?
Sounds like something for SRL 5.


SRL 4 needs work too, SRL 5 probably won't be around for ages.

Wizzup?

2010-01-30 12:15:20

From: IceFire908
SRL 4 needs work too, SRL 5 probably won't be around for ages.


Not if I can help it.

Nava2

2010-01-30 13:19:05

Timer, what did you even change..

Wanted

2010-01-30 13:20:46

From: Nava2
Timer, what did you even change..


I think he changed the IsUpText line to Result := IsUpText('ando');

You can always replace this in your SRL folder then use Diff

Nava2

2010-01-30 13:34:44

Thats a pain, especially when I do not have SCAR/SRL4 readily available.