SRL Archive - SRL Bugs

The state of SRL


Markus

2011-10-28 16:01:59

Hey guys,

So with reflection scripts being dead, we need colour scripts. Luckily for us, we got *lots* of them from the old days, and many can be updated/improved with new technologies like SPS and the relative colour finding.
A few months ago, I tried updating Wizzup's Multiminer which is a great script in itself. But I got extremely frustrated at times: every time I tried using a few functions from the library, be it autocolor or something as trivial as OCR, there was at least one thing broken. After trying to fix the varrock road colour I grew so frustrated I ragequit, leaving a semi-compiling but non-functional Multiminer, which is sad because it is a great, speedy script (I wasn't too impressed by MSI's speed of object finding, it was extremely accurate but just a bit too slow to be functional at my old laptop. Otherwise MSI is a great job, just not functional to my needs).
Because I'm sure I'm not alone in this case, and because the include needs a refresh anyways, I'd like to survey what's working and what's not, so the devs and all others can start developing effectively on the broken parts, as giving a kind of direction to SRL development which it is currently half-lacking.
In order to make it easy for you, because SRL is mostly lazy when it comes to these things (and I am, too), I made this nice list of functionalities based on different parts of the include.
TL;DR, or, Your Task:
Post if a certain item of the list below functions for you fully, not at all, or there are some errors.
I hope that with this large community of scripters we can fill this list in in notime.

Note to other mods and the SRL Public SVN mods: you are free to edit this list as you see fit!

Legend:
Unknown
Working
Working only sometimes
Broken
This feature was scrapped from SRL. Markus you are too lazy to look at the include
Orange items: please add next to it what exactly is missing, or where it seems to be failing at times.
On the choice of functions: I didn't add the entire include, obviously, but the most important functions to scripters. Not too many people are going to look for the colour of a certain cactus, but ladder colours are useful.

Thanks a lot!
Markus

Zeh List:

Amount.scar
  • Counting stack amount in bank/inventory
  • Counting item amount in inventory (like how many iron ores)
  • Counting coins
  • Count total number of items in inventory


Autocolor.scar
  • Find Varrock road colour
  • Find Falador road colour
  • Find Lumbridge road colour
  • Find "generic" road colour (draynor)
  • Find grey stone colour
  • Find brown stone colour
  • Find water colour
  • Find ladder colour


Bank.scar
  • Deposit item at certain bank slot
  • Withdraw item from certain inventory spot
  • [*]Open bank Fast
    [*]Open Bank Glass
    [*]Open Bank NPC
    [*]Open Bank Quiet
    [*]Find Bank
    - works sometimes [*]Bankscreen
    [*]Pin entering
  • Switch tabs

Chat.scar
  • Click to continue
  • Read chat line
  • Find latest black message
  • Save chatlog
  • Set chat

Flag.scar
  • Flag distance
  • Is flag present
  • Mouseflag etc
  • Wait til flag is between certain distance (FFlag?)


Gametab.scar
  • Get skill levels
  • Get HP/Run/Prayer/Summoning status
  • Switch gametabs
  • Set audio/gfx settings
  • Set fightmode
  • Get combat level
  • Resting

Inventory.scar
  • Drop all
  • Move mouse to item
  • Click items
  • Item exists
  • Inventory full/empty


Login.scar
  • Loginplayer
  • ExitToLobby
  • Logout to mainscreen
  • Nextplayer
  • RSReady


Mapwalk.scar
  • Radialwalk
  • MakeCompass
  • RunAway
  • MouseMM
  • SetAngle


rc.scar
  • Read commands
  • Execute commands
  • Respond to commands

Symbol.scar
  • Find symbol
  • Count symbols

Text.scar
  • Choose option from context menu
  • Click text in NPC dialog box
  • Click text on mainscreen
  • Read uptext
  • Read NPC dialog text


Worldswitcher.scar
  • Get current world
  • Switch to world with lowest players/ping
  • Switch to world X (with X being a number of a world)
  • Switch to random world (p2p/f2p)


Newautocolor.scar
  • Basically if most relative values are still correct.

Antirandoms

Thanks for reading this list! Please only post things you confirmed working in the past 2 weeks (MSI users are especially invited to post on the antirandoms because they seem to experience most randoms, and MSI/other script devs might know a lot about the rest). Just a few things per post is fine, we can always fill in the gaps later ;)
/skills/ is ignored for now, it's not used too often.

Yago

2011-10-28 16:09:25

Therpes an srl thread. For the rabdoums were ppl give their inpuit

Markus

2011-10-28 16:10:11

ok but this list is way larger than only randoms and im too lazy to search.

noidea

2011-10-28 16:37:20

I have been trying autocolor() for the last couple days. I have tested srl_watercolor, srl_treecolor, srl_laddercolor, srl_rockcolor, srl_lightdirtroadcolor (tested in lumbridge forest and north of falador), srl_lumbridgeroadcolor, srl_varrockroadcolor, srl_faladorroadcolor. None of them worked. I would like to point out FindTreeColor still works, after 2 years :)

There is also no generic road color listed in the autocolor.scar file. There used to be.. I guess they scrapped it during the autocolor remake.
There seems to be a lot of the generic road color when looking at the rs map. I dont see why there isnt an autocolor for it…

I still dont understand how it was better to rewrite the autocolor file than leave it as it was - perfectly fine at the time. I also dont understand how autocolor() prints it successfully finds the color, returns a color, then it is no where to be found on the minimap.

There are also many missing autocolors from what there used to be, like fishing/water dock colors.

srl_lightdirtroadcolor returned a colour that was on the minimap, but it was wrong - here is a picture of it with debugtpa(). http://i.imgur.com/3p3Wo.png

kingarabian

2011-10-28 16:42:20

From: noidea
I have been trying autocolor() for the last couple days. I have tested srl_watercolor, srl_treecolor, srl_laddercolor, srl_rockcolor, srl_lightdirtroadcolor (tested in lumbridge forest and north of falador), srl_lumbridgeroadcolor, srl_varrockroadcolor, srl_faladorroadcolor. None of them worked. I would like to point out FindTreeColor still works, after 2 years :)

There is also no generic road color listed in the autocolor.scar file. There used to be.. I guess they scrapped it during the autocolor remake.
There seems to be a lot of the generic road color when looking at the rs map. I dont see why there isnt an autocolor for it…

I still dont understand how it was better to rewrite the autocolor file than leave it as it was - perfectly fine at the time. I also dont understand how autocolor() prints it successfully finds the color, returns a color, then it is no where to be found on the minimap.

There are also many missing autocolors from what there used to be, like fishing/water dock colors.

srl_lightdirtroadcolor returned a colour that was on the minimap, but it was wrong - here is a picture of it with debugtpa(). http://i.imgur.com/3p3Wo.png


That could be due to Jagex updating the colors all around Runescape with the last update.

Markus

2011-10-28 16:43:14

Ok, autocolor needs a severe rewrite then. Marked it all broken.
Do you know how MSI manages its colours or does it only use SPS (which isn't depending on them)? Might be a good base to start off.

@kingarabian: doubt it, it was broken a few months ago, too.

kingarabian

2011-10-28 16:45:42

From: Markus
Ok, autocolor needs a severe rewrite then. Marked it all broken.
Do you know how MSI manages its colours or does it only use SPS (which isn't depending on them)? Might be a good base to start off.

@kingarabian: doubt it, it was broken a few months ago, too.


BTW SPS works fine Markus, but verrry frequently you will run into an Access violation error. You may have to restart Simba countless times to get that script to run.

The drill random does everything fine except until the end. It does all the requirements the seargent tells you to do, and when your free to go the script says "random failed etc" and logs out.

NCDS

2011-10-28 23:01:21

<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.

Gu3st...

2011-10-29 06:54:08

All of those functions in amount.scar are working properly.

For anyone that would like to test:
procedure TestAmount;
var
x, y : Integer;
DTM : Integer;
begin
DTM := DTMFromString('mggAAAHicY2NgYHBkYmAwA2I7IPYEYlcgtgfiZ0C5F0D8DogfA/'+
'F9IL4HxFNig4EkExaMHTDiwBAAAAoECEU='); // Raw Salmon
WriteLn(' - Inventory count:');
WriteLn(InvCount);
WriteLn(' - Finding coins (inv):');
WriteLn(ToStr(FindCoins(X, Y, 'inv')) + ': ' + ToStr([x, y]));
WriteLn(' - Finding coins (bank):');
WriteLn(ToStr(FindCoins(X, Y, 'bank')) + ': ' + ToStr([x, y]));
WriteLn(' - Counting item (inv):');
WriteLn(CountItemsIn('inv', 'dtm', DTM, []));
WriteLn(' - Counting item (bank):');
WriteLn(CountItemsIn('bank', 'dtm', DTM, []));
WriteLn(' - Counting stack amount (bank):');
WriteLn(ItemAmount('bank', 'dtm', DTM, []));
WriteLn(' - Counting stack amount (inv):');
WriteLn(ItemAmount('inv', 'dtm', DTM, []));
FreeDTM(DTM);
DTM := DTMFromString('mWAAAAHicY2FgYHBkYmAwZoLQAUD8BCj2GIg/AvFDIG4K8gSSTE'+
'gYFTCiYRAAAGx3BdI='); // Noted Salmon
WriteLn(' - Counting stack amount (inv) (noted):');
WriteLn(ItemAmount('inv', 'dtm', DTM, []));
FreeDTM(DTM);
end;

Compiled successfully in 266 ms.
SRL Compiled in 0 msec
- Inventory count:
16
- Finding coins (inv):
True: [703, 301]
- Finding coins (bank):
True: [185, 198]
- Counting item (inv):
11
- Counting item (bank):
1
- Counting stack amount (bank):
4055
- Counting stack amount (inv):
11
- Counting stack amount (inv) (noted):
74
Successfully executed.

noidea

2011-10-29 09:33:18

I was using GetMiniMapDots yesterday and it didnt always work correctly when trying to find 2 bankers standing next to each other. It would often return there only being 1 npc. I didnt try any of the other dots.

Edit: Im standing in the second closest fishing spot to the draynor bank. I assume its findnormalrandoms, the music tab is being checked a lot. A detectable amount…

Yago

2011-10-29 15:20:11

From: noidea
I was using GetMiniMapDots yesterday and it didnt always work correctly when trying to find 2 bankers standing next to each other. It would often return there only being 1 npc. I didnt try any of the other dots.

Edit: Im standing in the second closest fishing spot to the draynor bank. I assume its findnormalrandoms, the music tab is being checked a lot. A detectable amount…


I believe that was the only way to check for randoms or at least one of the only ways for certain randoms

DeSnob

2011-10-29 15:34:41

I'm gonna test the flag section right now. :) Will post results.

E: Loginplayer, FlagPresent, FFlag, Flag, FlagDistance, FindSymbol all work.

noidea

2011-10-29 15:39:42

From: Yago
I believe that was the only way to check for randoms or at least one of the only ways for certain randoms


Yes its part of what helps decide if youre in a random, but it cant be the only way. Its needs to be checked only when confirming youre in a random. Mad sketch if youre always checking the music tab.

Edit: Mordaut - just logged out. Didnt attempt to solve. Wizzup says its impossible, is it?
Bee keeper works.

Markus

2011-10-30 08:51:39

Thanks guys, keep it going!
Updated the list up to this post.

Oh and NO random is impossible. There used to be times that all randoms were solved with colour, including mordaut by iroki.

Gu3st...

2011-10-30 09:00:51

I can confirm Beekeeper is working flawlessly

DeSnob

2011-10-30 09:09:36

I'll test the rest of the login functions. Be right back! ;)

E: Here's the debug from the script:
[LoginPlayerToLobby] works.
[LoginPlayer] works
[ExitToLobby] works
[LeaveLobby] works.
NextPlayer(False)
SwitchToPlayer(PlayerNo: 1, Active: False);
Welcome to Runescape.
[email]Email@Email.com[/email]
[LogOut] works.
Works fine. :) Also, RSReady works, since it works in the other functions.

NCDS

2011-10-30 10:08:12

From: noidea

Edit: Mordaut - just logged out. Didnt attempt to solve.

That's a feature I just recently added in. Before it wouldn't even know it was in the random and wait for the script to set the player false..

DeSnob

2011-10-30 10:19:14

Now I'll check Mapwalk, love radialwalk so it shouldn't be too hard.

E: Is this considered a double post? :S

E2: SetAngle, MakeCompass, MouseMM, RunAway, and Radialwalk all work. However, when RunAway is returning it slows down SMART quite a bit. (I haz bad computah)

noidea

2011-10-30 14:11:23

From: NCDS
That's a feature I just recently added in. Before it wouldn't even know it was in the random and wait for the script to set the player false..


ok, it also looks like you've done the same for Mime?
***** STR: FOUND RANDOM: 'Mime' *****
Screenshot of: Found Mime random 0 Seconds
Mime solver currently broken.
***** STR: 'Mime' RANDOM SOLVING FAILED! *****

NCDS

2011-10-30 22:33:07

From: noidea
ok, it also looks like you've done the same for Mime?
***** STR: FOUND RANDOM: 'Mime' *****
Screenshot of: Found Mime random 0 Seconds
Mime solver currently broken.
***** STR: 'Mime' RANDOM SOLVING FAILED! *****


Yes sir. That's what I'm doing with all 'unsolved' randoms until I can get a solver working.

noidea

2011-10-30 22:58:43

Abyss Random. I guess it could be green but it could not find a unique appendage and reverted to guessing. It did eventually get out though!

Phran6

2011-10-30 23:06:39

maybe add something that reload smart when there an update, because we can't relog in.

Nava2

2011-10-30 23:12:57

Updated, keep it up :)

kingarabian

2011-10-30 23:47:41

Drill Demon
Happened to me again:
Upon successfully doing everything right and a 'click to continue' click away from solving the random, it says Drill Demon random failed and makes my player false.

Flight

2011-10-30 23:55:06

"GetChatBoxText" and "GetBlackChatMessage" aren't accurate… From lighting a fire this is what SRL read:

From "The fire catches and the logs begin to burn.", to… "l?e fire catc?es an? t?e logs tegin to turn"

I thought it was kinda funny, but just pointing that out.

NCDS

2011-10-31 00:46:21

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.

Wizzup?

2011-10-31 05:43:45

Quiz was actually broken? Wow. What did they change?

E: Also, I think you left DEBUG_QUIZ defined, or was that on purpose? :)

mastaraymond

2011-10-31 06:53:12

From: Flight
"GetChatBoxText" and "GetBlackChatMessage" aren't accurate… From lighting a fire this is what SRL read:

From "The fire catches and the logs begin to burn.", to… "l?e fire catc?es an? t?e logs tegin to turn"

I thought it was kinda funny, but just pointing that out.

Seems like the first row of pixels is 1 off, "T -> l", it doesn't read the - boven the l.

Markus

2011-10-31 07:16:35

Forrester is broken. InForresterRandom doesn't work and it failed to detect it.
Also, pheasant finding is broken.

NCDS

2011-10-31 08:39:40

From: Wizzup?
Quiz was actually broken? Wow. What did they change?

E: Also, I think you left DEBUG_QUIZ defined, or was that on purpose? :)


All the records for the images just needed to be updated; and no I didn't leave it defined on purpose. I could have sworn I deleted that. :redface:

mrpickle

2011-11-04 09:45:41

"<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.

DeSnob

2011-11-04 16:35:03

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.
-1
Failed to sort the worlds. Choosing random world. Members: False; PVP: False;
World: 35, Players: 157, Members: False, PvP: False
World 35 selected.

Flight

2011-11-04 22:18:31

"ExistsItemDTM" and "CountItems" (dtm) both work just fine.

bolshak25

2011-11-06 00:12:51

world switcher works properly with updated worlds file that i posted :)

Nava2

2011-11-06 00:22:08

Worlds list was pushed to SRL5, needs to be pushed to 4. :)

DeSnob

2011-11-06 07:25:41

@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.

NCDS

2011-11-06 07:56:24

From: Nava2
Worlds list was pushed to SRL5, needs to be pushed to 4. :)


From: DeSnob
@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.


I've already added it to SRL4.

mormonman

2011-11-06 16:16:07

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.

//-----------------------------------------------------------------//
//-- 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;

Markus

2011-11-06 16:21:37

Does pheasant detection work fine with this one? (and InForesterRandom isn't in forester.scar)

mormonman

2011-11-06 16:46:41

From: Markus
Does pheasant detection work fine with this one? (and InForesterRandom isn't in forester.scar)


Yes. InForesterRandom is the second function….

Markus

2011-11-06 18:13:53

Excuse me, I'm blind :redface: Keep up the good work!

NCDS

2011-11-07 00:20:02

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:

mormonman

2011-11-07 01:38:56

From: NCDS
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:


Sorry, I didn't even thoroughly test or change the pheasant clicking because I had no issues with it.

Coh3n

2011-11-07 02:05:40

MSI uses the following so they should be working:
  • BankScreen
  • InPin
  • ClickToContinue
  • GetSkillLevels
  • GetRun
  • Switching gametabs
  • Resting
  • ChooseOption
  • Uptext
  • Click text in NPC dialog
For randoms, Reward box solving still has issues (still drops it sometimes).

BraK

2011-11-07 03:29:29

Updated the List cause Coh3n is lazy :p

Coh3n

2011-11-09 02:08:00

I'm just busy lazy!

N2 Edit: fix'd

Yago

2011-11-09 20:11:04

Open Bank for edgeville fails…

Flight

2011-11-09 21:51:13

From: Coh3n
I'm just busy lazy!

N2 Edit: fix'd


Almost didn't catch that. Nice job, Nava.

bg5

2011-11-11 06:00:19

It's bank test log ,on regular client. Varock West Bank

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

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.

Tickyy

2011-11-11 06:03:28

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.

BraK

2011-11-11 06:54:09

Updated with the latest. Thanks to Tickyy and Beginner5 for the updates.

Markus

2011-11-11 06:57:29

Note; be aware the bankfinding was made for falador east I think, so if you tested it somewhere else it would obviously not work as intended.

Markus

2011-11-16 14:52:06

I'm allowed to bump this, feedback please! SRL 5 needs to be working.

NCDS

2011-11-16 15:39:30

Updated to the best of my knowledge right now.

Markus

2011-11-17 08:57:07

Forrester confirmed semi-working, sometimes gets the wrong pheasant..

NCDS

2011-11-17 15:04:38

From: Markus
Forrester confirmed semi-working, sometimes gets the wrong pheasant..


Yeh, it's Camo's (?) fix, I just haven't had time to tweak it yet.

Coh3n

2011-12-08 22:53:47

Stickied and moved to Bugs section.