Fixed Quiz today; should be working well now.
Does anyone know if the 'Shears Big' image is still used in the random? That's the only one I couldn't get as it never came up.
Printable View
Fixed Quiz today; should be working well now.
Does anyone know if the 'Shears Big' image is still used in the random? That's the only one I couldn't get as it never came up.
Quiz was actually broken? Wow. What did they change?
E: Also, I think you left DEBUG_QUIZ defined, or was that on purpose? :)
Forrester is broken. InForresterRandom doesn't work and it failed to detect it.
Also, pheasant finding is broken.
"<3 you for creating this list. Was just thinking something like this would be nice earlier. The "SRL devs need accounts in randoms" thread is pretty up to date though as I try to generally keep tabs on those solvers."
We can always ask a private server / set up a private server just to test our randoms. with an "infinite random" mode.
Since noone is testing, I'll check out worldswitcher and possibly add that to my script. :)
E:
This includes the updated worlds.ini file.RandomWorld;
ChooseWorldBy;
ChangeWorld;
OpenWorldScreen;
WS_CurrentWorld;
Notes: World choosing does not work properly. If the world is on the screen, it selects it properly. However, it does not scroll properly. It will scroll to worlds 70-80 for world 100, and 60-70 for world 96. WS_CurrentWorld returns -1, meaning it didn't work at all.
Edit: WS_CurrentWorld always returns -1. ChooseWorldBy fails to sort, but never tries.
Progress Report:-1 Failed to sort the worlds. Choosing random world. Members: False; PVP: False; World: 35, Players: 157, Members: False, PvP: False World 35 selected.
"ExistsItemDTM" and "CountItems" (dtm) both work just fine.
world switcher works properly with updated worlds file that i posted :)
Worlds list was pushed to SRL5, needs to be pushed to 4. :)
@Bolshak25
Just saw that. :)
@Nava2
Does that mean you'll just add the updated list to SRL4?
Okay, just updated my post up there with the updated list. I don't know if it was you, but the latest update added the new list.
New forester.scar
Fixed InForesterRandom and allowed it to start from already killing the pheasant(change in GetTask and SolveForester). All that needs fixing now is the exit portal. I was unsure as to how you devs retrieved those colors.
Simba Code://-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- Freaky Forester Solver Routines --//
//-----------------------------------------------------------------//
// * function ForesterCenter(var x, y: Integer): Boolean; // * by Sumilion
// * function PickUpDroppedItem: Boolean; // * by TRiLeZ
// * function InForesterRandom: Boolean; // * by ZephyrsFury
// * function TalkToFreakyForester: Boolean; // * by IceFire908
// * function forester_GetTask: Integer; // * by Sumilion
// * function KillPheasant(Tails: Integer): Boolean; // * by TRiLeZ
// * function WarningScreen: Boolean; // * by TRiLeZ
// * procedure BringRawPheasant; // * by Sumilion
// * function LeaveForester: Boolean; // * by Sumilion
// * function SolveForester: Boolean; // * by TRiLeZ, Sumilion, SKy Scripter, & IceFire908
{*******************************************************************************
function ForesterCenter(var x, y: Integer): Boolean;
by: Sumilion
Description: Returns position of the center.
*******************************************************************************}
function ForesterCenter(var x, y: Integer): Boolean;
var
arP: TPointArray;
tmpCTS: Integer;
P: TPoint;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(0);
if not(FindColorsTolerance(arP, 195836, MMX1, MMY1, MMX2, MMY2, 25)) then
begin
ColorToleranceSpeed(tmpCTS);
Exit;
end;
P := MiddleTPA(arP);
Result := True;
x := P.x;
y := P.y;
end;
{*******************************************************************************
function PickUpDroppedItem: Boolean;
by: TRiLeZ
Description: Picks up a dropped item.
Date: February 7, 2010
*******************************************************************************}
function PickUpDroppedItem: Boolean;
var
cx, cy: Integer;
begin
if FindColor(cx, cy, 237, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(cx, cy, 0, 0, True);
Flag;
Wait(1500 + Random(500));
MMouse(MSCX, MSCY, 0, 0);
if (not IsUpText('ere')) then
begin
Result := True;
if IsUpText('ake') then Mouse(MSCX, MSCX, 0, 0, True)
else
begin
Mouse(MSCX, MSCY, 0, 0, False);
Wait(250 + Random(100));
Result := ChooseOption('ake');
end;
Wait(500 + Random(250));
end;
end;
end;
{*******************************************************************************
function InForesterRandom: Boolean;
by: TRiLeZ / IceFire908.
Description: Checks if we're in the Freaky Forester Random.
Date: October 8, 2010
*******************************************************************************}
function InForesterRandom: Boolean;
var
Count, fX, fY, CTS: Integer;
Hue, Sat: Extended;
Pts: TPointArray;
begin
GetColorspeed2Modifiers(Hue, Sat);
CTS := GetColorToleranceSpeed;
if (CountColorTolerance(15726327, MMX1, MMY1, MMX2, MMY2, 30) < 40) and //White walls
(not (InBlack)) then
begin
Pts := GetMiniMapDots('npc');
Count := Length(Pts);
if (Count < 10) then
Exit;
if (not (ForesterCenter(fX, fY))) then
Exit;
{$ifdef Simba}
FilterPointsDist(pts,0,50,fx,fy);
{$else}
FilterPointsPie(Pts, 0.0, 360.0, 0.0, 50.0, fX, fY);
{$endif}
if (Length(Pts) = count) then
begin
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.67, 1.68);
if ((PercentColorMM(1397796, 8) > 5) and
(PercentColorMM(3634254, 8) > 3)) then
Result := True;
end;
end;
ColorToleranceSpeed(CTS);
SetColorspeed2Modifiers(Hue, Sat);
end;
{*******************************************************************************
function TalkToFreakyForester: Boolean;
by: IceFire908
Description: Talks to the forester.
*******************************************************************************}
function TalkToFreakyForester: Boolean;
var
TempHue, TempSat: Extended;
TPAA: T2DPointArray;
I, CTS, T: LongInt;
TPA: TPointArray;
TTFF: TPoint;
begin
CTS := GetColorToleranceSpeed;
GetColorspeed2Modifiers(TempHue, TempSat);
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.21);
FindColorsTolerance(TPA, 1262986, MSX1, MSY1, MSX2, MSY2, 8);
SetColorSpeed2Modifiers(TempHue, TempSat);
ColorToleranceSpeed(CTS);
repeat
if (Length(TPA) < 1) then
Break;
TPAA := TPAToATPAEx(TPA, 20, 20);
if (Length(TPAA) < 1) then
Break;
SortATPASize(TPAA, True);
for I := 0 to High(TPAA) do
begin
TTFF := MiddleTPA(TPAA[I]);
MMouse(TTFF.X, TTFF.Y, 0, 0);
Wait(200 + Random(50));
if (CountColorTolerance(648165, 7, 7, 100, 25, 50) > 50) then
begin
Mouse(TTFF.X, TTFF.Y, 0, 0, False);
Wait(100 + Random(200));
if (ChooseOptionMulti(['alk-to', 'o F', 'k-t', 'Talk'])) then
begin
Wait(500);
FFlag(0);
T := GetSystemTime;
while ((not (AreTalking)) and ((GetSystemTime - T) < 5000)) do
Wait(100);
Result := True;
Exit;
end;
end;
end;
until (True);
WriteLn('Did not find Freaky Forester!');
end;
{*******************************************************************************
function forester_GetTask: Integer;
by: Sumilion
Description: Reads what kind of pheasant SRL needs to search for.
*******************************************************************************}
function forester_GetTask: Integer;
var
dx, dy, t: Integer;
begin
if not FindNPCChatText('Freaky Forester', Nothing) then
begin
Writeln('Forester: We should talk to the freaky forester.');
if not ForesterCenter(dx, dy) then
begin
Writeln('Forester: Forester center not found.');
LogOut;
Exit;
end;
Mouse(dx - 2, dy + 2, 0, 0, True);
Flag;
Wait(1500 + Random(500));
MarkTime(t);
repeat;
Wait(100 + Random(100));
until TalkToFreakyForester or (TimeFromMark(t) > 30000);
if (TimeFromMark(t) > 30000) then
begin
Writeln('Forester: Can''t find the Forester.');
LogOut;
Exit;
end;
Flag;
T := GetSystemTime;
while (not(InConvo)) and (GetSystemTime - T < 30000) do Wait(100);
Wait(500 + Random(100));
if (TimeFromMark(t) > 30000) then
begin
Writeln('Forester: Failed to talk to the Forester.');
LogOut;
Exit;
end;
end;
while (InConvo) and (Result = 0) do
begin
if FindNPCChatText('one', Nothing) then
Result := 1;
if FindNPCChatText('two', Nothing) then
Result := 2;
if FindNPCChatText('three', Nothing) then
Result := 3;
if FindNPCChatText('four', Nothing) then
Result := 4;
if FindNPCChatText('portal', Nothing) then
Result := -1;
ClickContinue(True, True);
end;
if (Result = 0) then
begin
Writeln('Forester: Can''t find what the Forester wants us to do.');
LogOut;
Exit;
end;
marktime(t);
while ClickContinue(True, True) and (TimeFromMark(t) < 5000) do Wait(700 + random(500));
if (Result > 0) then
Writeln('Forester: Kill The ' + inttostr(Result) + ' Tailed Pheasant.')
else
Writeln('Forester: Already killed the Pheasant.');
end;
{*******************************************************************************
function KillPheasant(Tails: Integer): Boolean;
by: TRiLeZ
Description: Attempts to kill a pheasant with given tail size.
Date: December 17, 2009
*******************************************************************************}
function KillPheasant(Tails: Integer): Boolean;
var
Tail, D: TPointArray;
Pheasant, NTails: T2DPointArray;
B: TBox;
I, x, y, T, A, TempS: Integer;
begin
MakeCompass(0);
TempS := MouseSpeed;
MouseSpeed := 35;
MarkTime(t);
repeat
Wait(200);
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.37, 0.33);
if FindColorsTolerance(Tail, 9740459, MSX1+20, MSY1+20, MSX2-20, MSY2-20, 2) then //White tail tip
begin
Pheasant := TPAtoATPA(Tail, 25);
SortATPASize(Pheasant, (Tails = 3) or (Tails = 4));
for I := 0 to High(Pheasant) do
begin
B := GetTPABounds(Pheasant[i]);
A := (B.x2 - B.x1) * (B.y2 - B.y1);
case Tails of
1: if not InRange(A, 0, 4) then Continue;
2: if not InRange(A, 2, 12) then Continue;
3: if not InRange(A, 36, 62) then Continue;
4: if not InRange(A, 80, 160) then Continue;
end;
Tail := Pheasant[i];
NTails := TPAtoATPA(Tail, 3);
if (Tails = Length(NTails)) then
begin
SetColorspeed2Modifiers(0.09, 0.74);
case Tails of
1: if not InRange(CountColorTolerance(2641004, b.x1 - 5, b.y1 - 5, b.x2 + 5, b.y2 + 5, 12), 4, 8) then Continue;
2: if not InRange(CountColorTolerance(2641004, b.x1 - 5, b.y1 - 5, b.x2 + 5, b.y2 + 5, 12), 10, 18) then Continue;
3: if not InRange(CountColorTolerance(2641004, b.x1 - 5, b.y1 - 5, b.x2 + 5, b.y2 + 5, 12), 30, 56) then Continue;
4: if not InRange(CountColorTolerance(2641004, b.x1 - 5, b.y1 - 5, b.x2 + 5, b.y2 + 5, 12), 70, 110) then Continue;
end;
MiddleTPAEx(Pheasant[i], x, y);
if FindColorsTolerance(D, 2641004, x - 80, y - 80, x + 80, y + 80, 12) then
begin
SortTPAFrom(D, Point(x, y));
Mouse(D[0].x, D[0].y, 0, 0, False);
Wait(300 + Random(200));
Result := ChooseOption('Attack');
if (not Result) then Break;
end;
end;
end;
end else
Wait(10);
until Result or (TimeFromMark(t) >= 120000) or (not InForesterRandom);
MouseSpeed := TempS;
end;
{*******************************************************************************
function WarningScreen: Boolean;
by: TRiLeZ
Description: Results true if there is a warning screen about dropped items.
Date: December 29, 2009
*******************************************************************************}
function WarningScreen: Boolean;
begin
if (CountColor(0, MSX1, MSY1, MSX2, MSY2) > 1400) then
Result := FindTextTPA(2070783, 20, 240, 48, 300, 66, 'Warning', upchars, Nothing);
end;
{*******************************************************************************
procedure BringRawPheasant;
by: Sumilion
Description: Brings the raw pheasant to the forester.
*******************************************************************************}
procedure BringRawPheasant;
var
rx, ry, t: Integer;
B: Boolean;
{
Objs: T2DPointArray;
Done: Boolean;
I, cts: Integer;
P: TPointArray;
}
begin
{
MarkTime(t);
cts := GetColorToleranceSpeed;
repeat;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.02, 0.09);
FindColorsSpiralTolerance(MSCX, MSCY, P, 2444664, MSCX - 100, MSCY - 100, MSCX + 100, MSCY + 100, 9);
Objs := TPAtoATPA(P, 20);
if (Length(Objs) = 0) then Break;
if ((Length(Objs) = 1) and (Length(Objs[0]) < 40)) then Break;
for I := 0 to High(Objs) do
if (Length(Objs[I]) > 40) then
begin
MiddleTPAEx(Objs[I], rx, ry);
MMouse(rx, ry, 0, 0);
wait(10 + random(20));
ColorToleranceSpeed(1);
if (IsUpText('ake')) then
begin
Mouse(rx, ry, 0, 0, True);
Flag;
Wait(1000 + random(500));
Done := True;
Break;
end;
end;
Wait(500 + random(200));
until (Done) or (TimeFromMark(t) > 30000);
ColorToleranceSpeed(cts);
if (TimeFromMark(t) > 30000) or (not(done)) then
begin
Writeln('Forester: Can''t find the Dead Pheasant.');
LogOut;
Exit;
end; }
Flag;
Wait(500 + Random(500));
if not ForesterCenter(rx, ry) then
begin
Writeln('Forester: Forester center not found.');
LogOut;
Exit;
end;
Mouse(rx, ry, 1, 1, True);
Flag;
Wait(1500 + Random(500));
MarkTime(t);
repeat;
Wait(100 + Random(100));
if TimeFromMark(t) > 20000 then
if not B then
begin
B := True;
Mouse(MSCX, MSCY, 3, 3, False);
end;
until TalkToFreakyForester or
(TimeFromMark(t) > 30000);
if (TimeFromMark(t) > 30000) then
begin
Writeln('Forester: Can''t find the Forester.');
LogOut;
Exit;
end;
Flag;
T := GetSystemTime;
while (not(InConvo)) and (GetSystemTime - T < 10000) do
Wait(100);
Wait(100 + Random(200));
marktime(t);
while ClickContinue(True, True) and (TimeFromMark(t) < 5000) do Wait(700 + random(500));
end;
{*******************************************************************************
function LeaveForester: Boolean;
by: Sumilion
Description: Leaves the random through the portal.
*******************************************************************************}
function LeaveForester: Boolean;
var
PortalInfo: TAutoColorInfo;
fx, fy, t: Integer;
begin
Writeln('Forester: Leaving Forester.');
with PortalInfo do
begin
UpText := 'Enter';
MaxDist := 15;
Color := 4240276;
HueMod := 0.13;
SatMod := 0.47;
LumTol := 9;
MinR := 128; MaxR := 162;
MinG := 147; MaxG := 201;
MinB := 53; MaxB := 84;
MinX := 20.29; MaxX := 36.93;
MinY := 26.09; MaxY := 49.53;
MinZ := 7.44; MaxZ := 15.81;
end;
ForesterCenter(fx, fy);
Mouse(fx + 45, fy, 0, 0, True);
Flag;
MarkTime(t);
repeat;
if FindObjRecordEx(fx, fy, PortalInfo, MSX1, MSY1, MSX2, MSY2, False, True) then
Mouse(fx, fy, 0, 0, False);
Wait(100 + Random(100));
until ChooseOption('Enter') or
(TimeFromMark(t) > 30000);
if (TimeFromMark(t) > 30000) then
begin
Writeln('Forester: Can''t find the portal.');
Exit;
end;
Flag;
Wait(2000);
T := GetSystemTime;
while (GetSystemTime - T < 20000) do
begin
if WarningScreen then MouseBox(144, 195, 392, 204, 1);
Wait(4000 + Random(1000));
Result := (GetMusic <> 'Pheasant Peasant') or (not InForesterRandom);
if (Result) then Break;
Wait(1000);
end;
end;
{*******************************************************************************
function SolveForester: Boolean;
by: TRiLeZ, Sumilion, SKy Scripter, & IceFire908
Description: Main solving procedure.
Date: December 17, 2009
*******************************************************************************}
function SolveForester: Boolean;
var
Task, t, TempCTS: Integer;
TempHue, TempSat: Extended;
ItemDropped: Boolean;
begin
TempCTS := GetColorToleranceSpeed;
GetColorspeed2Modifiers(TempHue, TempSat);
Task := forester_GetTask;
if not InForesterRandom then Exit;
if (Task > 0) then
begin
if InvFull then
begin
DropItem(28);
ItemDropped := True;
end;
if (not KillPheasant(Task)) then
begin
Writeln('Forester: ForesterSolver failed to find the pheasant.');
if ItemDropped then PickUpDroppedItem;
LogOut;
Exit;
end;
Flag;
MarkTime(t);
while (TimeFromMark(t) < 10000) do
begin
Wait(10);
if ClickContinue(True, True) then Break;
end;
Writeln('Forester: Killed Pheasant.');
Wait(1000 + Random(500));
BringRawPheasant;
if ItemDropped then PickUpDroppedItem;
end;
if not InForesterRandom then Exit;
Result := LeaveForester;
if (not Result) then
begin
Mouse(690, 86, 4, 4, True);
Flag;
Wait(3000 + Random(1000));
Result := LeaveForester;
end;
ColorToleranceSpeed(TempCTS);
SetColorspeed2Modifiers(TempHue, TempSat);
if Result then
begin
Writeln('Forester: Forester random solved.');
while ClickContinue(True, True) do Wait(700 + random(500));
end else begin
Writeln('Forester: Failed to exit the forester');
LogOut;
Exit;
end;
end;
Does pheasant detection work fine with this one? (and InForesterRandom isn't in forester.scar)
Excuse me, I'm blind :redface: Keep up the good work!
I committed mormonman's updates, though they are not 100%. It clicked a 3 tailed instead of 2 and failed the random. Then I forgot to fix the portal before I exited... :duh:
MSI uses the following so they should be working:
For randoms, Reward box solving still has issues (still drops it sometimes).
- BankScreen
- InPin
- ClickToContinue
- GetSkillLevels
- GetRun
- Switching gametabs
- Resting
- ChooseOption
- Uptext
- Click text in NPC dialog
Updated the List cause Coh3n is lazy :p
I'm just busy lazy!
N2 Edit: fix'd
Open Bank for edgeville fails...
It's bank test log ,on regular client. Varock West Bank
Simba Code:Compiled successfully in 780 ms.
SRL Compiled in 15 msec
Dimensions: 765, 503
Bank Symbol found!
OpenBankFast works?: False
OpenBankGlass works?: False
OpenBankNPC works?: False
FindBANK works?: False
FindBANK works?: True
OpenBankQuiet works?: True
Done testing. Please post above output!
xxx Markus
Successfully executed.
and Varock East Bank
Simba Code:Compiled successfully in 749 ms.
SRL Compiled in 0 msec
Dimensions: 765, 503
Bank Symbol found!
OpenBankFast works?: False
OpenBankGlass works?: False
OpenBankNPC works?: False
FindBANK works?: False
FindBANK works?: False
OpenBankQuiet works?: True
Done testing. Please post above output!
xxx Markus
Successfully executed.
Cap 'n Arnav and Leo the gravedigger and Don't work! i am 100% sure about that.
Also, about banking, it works rreally rreally slowly, or it doesn't at all.