PDA

View Full Version : Updated antirandom solvers



Krazy_Meerkat
12-19-2013, 07:02 AM
Important Note
I am going to continue my work on AntiRandom Solvers, but from now onwards they will only be available to the OSR Reflection include (being actively developed by Elfyyy, NKN, Sirenia and myself) which is available here: http://villavu.com/forum/showthread.php?t=107479
This is for several reasons, the most important of which is that there has been rapid development within the OSR Reflection include allowing better detection and solving methods than SRL's antirandoms are capable of.
I was not confident using reflection before because when the hooks are updated in OSR, it can take many days for people to update the pastebin with new hooks (relying solely on JavaHacking update logs). I have been developing the updater for the reflection include, and we are able to update hooks and post to the gc within 10 minutes of an OSR update. This is thanks to some incredible work by Justin, Elfyyy and even Brandon. NKN and Sirenia are leading the development of our own updater (this is different to the include updater), I'd like to call it a hook-nabber, but it's much more complex than that. Atm, we only use the JH logs to compare our hooks and multipliers. Soon we will have 2 methods to get hooks which don't rely on JavaHacking.com (which is rumoured to be posting less information on hooks anyway due to leechers)
I have also seen other members speak of creating their own OSR includes. While we don't have a development team for OSR, we have a lot of very skilled members who are very passionate about it. There is no reason we can't unite and combine our efforts into one include.
After some testing with the new reflection functions, I made the following:
Flawless Mime random detection & solver.
Flawless Drill Demon detection.
Flawless Prison Pete detection.
Flawless Maze detection.
I'm confident we can detect nearly all randoms using reflection and by using it, we get completely accurate information in order to solve each random (compared to SRL's guess-work using colour techniques).


---------------------------------------------------------------------------------------------


Page 9 of the anti-random development thread was not really the place for this.
I've made edits to some of the core anti-randoms which weren't solving, so I'm posting a thread here which will be updated when a new fix is added. If you have made your own edits to fix a solver then post them here, please explain how you fixed the solver. I will test and add any new fixes posted.
There are 2 sections, Stable and Beta. Stable is for randoms which have been tested and worked everytime, Beta is for solvers which are still being developed.

Stable

Fixed the pinball random's cave exit routine. Added compass handling and updated a few colours.
pinball.simba

(*
Pinball
=======

Stores all the routines to solve the Pinball random. None of these routines
should be used throughout scripts. They only need to be called in SRL's random
detection methods.

This solver uses findGapsTPA to determine which post to click.

*)

//{$DEFINE PB_DEBUG}

const
PB_SCORE_10 = 180; // the tpa length of when the score is 10

(**
* Author: Coh3n
* Description: Detects if a player is in the Pinball random.
*)
function PB_Detect(): boolean;
begin
// makes sure friends tab exists and magic doesn't
if ((not tabExists(TAB_MAGIC)) and (tabExists(TAB_FRIENDS))) then
result := (Trim(GetTextAtExWrap(374, 238, 411, 253, 0, 5, 1,
65535, 5, 'UpChars07')) = 'Score');
end;

(**
* Author: Coh3n
* Description: Returns the length of a tpa found of the yellow color of the
* score at the top of the main screen.
*)
function PB_GetScore(): integer;
var
tpa: TPointArray;
begin
// yellow color of the score
if (findColorsTolerance(tpa, 65535, 373, 239, 434, 258, 30)) then
result := length(tpa);
end;

(**
* Author: SKy Scripter, NCDS, & Coh3n
* Description: Returns true if a flashing pillar is found. Sets coordinates
* to x, y.
*)
const
_PB_FILL_COLOR = 10;
_PB_MIN_LENGTH = 20;

function PB_ScanPost(var x, y: integer): boolean;
var
tpa: TPointArray;
pillarCols: array of integer;
ATPA, pillarGaps: T2DPointArray;
oldTarget, tmpCTS, bmp, i, j, c: integer;
hue, sat, lum: extended;
tmpBox: TBox;
begin
result := false;
bmp := -1;

try
tmpCTS := getColorToleranceSpeed;
setColorToleranceSpeed(3);

// the green of the spinning pillars
findColorsTolerance(tpa, 6011467, MSX1, MMY1, MSX2, MSY2, 38);

setColorToleranceSpeed(tmpCTS);

// if colors aren't found, exit
if (length(tpa) < _PB_MIN_LENGTH) then
exit;

bmp := createBitmap(MSX2 + 5, MSY2 + 5); // creats a bitmap of the MS
fastDrawClear(bmp, _PB_FILL_COLOR); // fill it with a distinct color

c := 0;
pillarCols := getColors(tpa);

// draws a rectangle on the bitmap of the colors that are light enough
for i := 0 to high(tpa) do
begin
colorToHSL(pillarCols[i], hue, sat, lum);

if (lum > 50.0) then
begin
tmpBox := intToBox(max(0, tpa[i].x - 1), max(0, tpa[i].y - 1), tpa[i].x + 1, tpa[i].y + 1);
rectangleBitmap(bmp, tmpBox, clRed);
inc(c);
end;
end;

if (c > _PB_MIN_LENGTH) then
begin
floodFillBitmap(bmp, point(5, 5), _PB_FILL_COLOR, clBlack);

oldTarget := getImageTarget();
setTargetBitmap(bmp);

findColors(tpa, _PB_FILL_COLOR, 0, 0, MSX2 - 5, MSY2 - 5);

setImageTarget(oldTarget); // reset target to RS client

if (length(tpa) > 10) then
begin
ATPA := TPAtoATPA(tpa, 60);
sortATPASize(ATPA, true);

for i := 0 to high(ATPA) do
begin
pillarGaps := findGapsTPA(ATPA[i], 10);

for j := 0 to high(pillarGaps) do
if (length(pillarGaps[j]) > 2) then
begin
middleTPAEx(ATPA[i], x, y);
result := true;
break;
end;

if (result) then
break;
end;
end;
end;

{$IFDEF PB_DEBUG}
displayDebugImgWindow(MSX2, MSY2);
drawBitmapDebugImg(bmp);
{$ENDIF}

finally
if (bmp <> -1) then
freeBitmap(bmp);
end;

if (result) then
addToSRLLog('PB_ScanPost: Found post');
end;

(**
* Author: Coh3n
* Description: Returns true if player clicks a post and the score changes.
*)
function PB_TagPost(): boolean;
var
t, x, y, oldScore: integer;
begin
if (not loggedIn()) then
exit;

oldScore := PB_GetScore();

if (PB_ScanPost(x, y)) then
begin
Mouse(x, y, 5, 5, mouse_right);

if (WaitOptionMulti(['ag', 'g P'], 618)) then
begin
t := (getSystemTime + 6000);
while (getSystemTime < t) do
begin
if (PB_GetScore() <> oldScore) then
begin
addToSRLLog('PB_TagPost: Tagged post');
result := true;
break;
end;

wait(300 + random(200));
end;
end else
MMouse(x, y - 25, 8, 8);
end;
end;

(**
* Author: DemiseScythe & Coh3n
* Description: Uses mainscreen walking to exit the random.
* Updated: Fixed for 07scape. - DannyRS - 23/03/2013
*)
function PB_Exit(): boolean;
var
x, y, t, i: integer;
tpa, tpa_Exit: TPointArray;
ATPA: T2DPointArray;
Deg: Extended;
begin

if (not loggedIn()) then
exit;
addToSRLLog('PB_Exit: Exiting cave');
SetAngle(SRL_ANGLE_HIGH);
Deg := RS_GetCompassAngleDegrees;
Wait(100 + random(50));
MakeCompass('N');
t := (getSystemTime + 25000);
repeat
// the green path color
if (findColorsTolerance(tpa, 4544055, MSX1, MMCY+10, MSX2, MSY2, 35)) then
begin
if (length(tpa) > 0) then
begin
MiddleTPAEx(tpa, x, y);
MMouse(x, y, 5, 5);
Wait(RandomRange(90,150));
if (waitUptextMulti(['Exit', 'xit', 'Cave', 'ave'], 200)) then
begin
ClickMouse2(mouse_left);
if (waitTabExists(TAB_MAGIC, 8000)) then
begin
result := true;
break;
end;
end;
end;
end;
if (findColorsTolerance(tpa, 5734757, MSX1, MMCY, MSX2, MSY2, 35)) then
if (length(tpa) > 0) then
begin
sortTPAFrom(tpa, point(MSCX, MSY2)); // center of the bottom of the MS
x := tpa[0].x;
y := tpa[0].y - 20; // so it's actually on the MS

MMouse(x, y, 5, 5);

// check for the proper uptexts
if (waitUptextMulti(['Walk', 'alk', 'here', 'ere'], 200)) then
begin
ClickMouse2(mouse_left);
end
else if (waitUptextMulti(['Exit', 'xit', 'Cave', 'ave'], 200)) then
begin
ClickMouse2(mouse_left);
if (waitTabExists(TAB_MAGIC, 8000)) then
begin
result := true;
break;
end;
end;
end;
result := tabExists(TAB_MAGIC); // just in case
wait(2000 + random(300));
until ((getSystemTime > t) or (result));
if (result) then
begin
Wait(100 + random(500));
MakeCompass(Deg);
addToSRLLog('PB_Exit: Clicked exit cave')
end else
begin
addToSRLLog('PB_Exit: Took to long to find exit... Looking for backup');
t := (getSystemTime + 20000);
MakeCompass('S');
repeat
if (FindColorsTolerance(tpa_Exit, 4677175, MSX1, MSY1, MSX2, MSY2, 23)) then
ATPA := TPAToATPAEx(tpa_Exit, 70, 5);
if (length(ATPA) > 0) then
begin
SortATPASize(ATPA, True);
for i := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 5, 5);
Wait(RandomRange(90,150));
if (waitUptextMulti(['Exit', 'xit', 'Cave', 'ave'], 200)) then
begin
ClickMouse2(mouse_left);
if (waitTabExists(TAB_MAGIC, 8000)) then
begin
result := true;
break;
end;
end;
end;
end;
result := tabExists(TAB_MAGIC);
wait(2000 + random(300));
until ((getSystemTime > t) or (result));
if (result) then
addToSRLLog('PB_Exit: Clicked exit cave with backup')
else
addToSRLLog('PB_Exit: Failed to exit')
end;
end;

(**
* Author: Coh3n & DemiseScythe
* Description: Solves the Pinball random.
*)
function PB_Solve(): boolean;
var
t: integer;
begin
if (not loggedIn()) then
exit;

t := (getSystemTime + (15 * 60000)); // maximum 15 minutes
doConversation('', false);

repeat
if (PB_GetScore = PB_SCORE_10) then // length of "Score: 10"
begin
if (PB_Exit()) then
begin
result := true;
break;
end;
end else
PB_TagPost();

wait(500 + random(200));
until(result or (getSystemTime > t));
end;
Fixed the text options for the frog random.. Credits to Flight for the conversation-handling (adapted from Frog_Solve2). I re-worked the Frog_WalkCenter method because dtm-finding no longer works on the minimap. Added compass handling. Ran it through a few times to make sure everything worked.
You can make the edits Flight recommends to FindTalk; (which handle frogs before you enter the cave) and they will not clash with the frog solver. Frog_Solve2 method is included and does not use cave-walking (because you will not be in the cave when it gets called).
frog.simba

(*
Frog
====

Stores all the routines to solve the Frog random. None of these routines
should be used throughout scripts. They only need to be called in SRL's random
detection methods.

*)

var
O_MouseSpeed, FROG_ISLAND_DTM, FROG_ISLAND_DTM_BACKUP, FROG_CROWN_BMP, DTM_Royal_Frog: Integer;
Deg : Extended;

const
FROG_YELLOW = 7986172;
FROG_RED = 3097339;
FROG_GREEN = 879885;
FROG_SWAMP = 8031312;
FROG_CROWN = 1095911;
FROG_CROWN_COLOR_BACKUP = 633312;

//function Frog_Speakto: boolean; forward;
function Frog_IsTalkingTo: boolean; forward;
function Frog_FindFrog: boolean; forward;

(*
DoConversationEx
~~~~~~~~~~~~~~

.. code-block:: pascal

function DoConversationEx(resultText: TStringArray; clickresult: boolean): boolean;

Goes through the initial dialog of a random. Will keep clicking to continue
until any of the conversation's 'resultText' is found. Will click to continue when
any 'resultText' is found if 'clickresult' is set to true. Set 'resultText' to ['']
to click continue until conversation is over.

.. note::

Author: Coh3n, Flight
Last Modified: Jun. 15th, 2013 by Flight

Example:

.. code-block:: pascal

if (DoConversationEx(['thank','nk you'], true)) then
writeln('Finished conversation');
*)
function DoConversationEx(resultText: TStringArray): boolean;
var
t,i: integer;
begin
while (t < 25) do // max of 25 "click to continue's"
begin
if (length(resultText) > 0) then
for i:=0 to high(resultText) do
if (findNPCChatText(resultText[i], nothing)) then
begin
result := true;
exit;
end;

// break if there's no more conversation
if (not clickContinue(true)) then
break;

wait(100 + random(200));
inc(t);
end;
end;

(**
* Author: Justin
* Description: Detects if we are in the Frog Random. Small chance it would
* fail to detect due to the frogs being off-screen, checks for Music Track too.
*)
function Frog_Detect(): boolean;
begin
if not (tabExists(TAB_MAGIC)) then
begin
if Length(GetMinimapDots('npc')) >= 4 then
if PercentBlackMM >= 35 then
if (GetMusic = 'Frooland') then
begin
Result := true;
exit;
end;
if (CountColorTolerance(FROG_GREEN, MSX1, MSY1, MSX2, MSY2, 30) >= 100) then
if (CountColorTolerance(FROG_RED, MSX1, MSY1, MSX2, MSY2, 30) >= 20) then
Result := (CountColorTolerance(FROG_YELLOW, MSX1, MSY1, MSX2, MSY2, 30) >= 5);
end;
end;

(**
* Author: Justin
* Description: Gets our player ready to solve the random.
*)
procedure Frog_Setup();
begin
if (not LoggedIn()) then
exit;
SetAngle(SRL_ANGLE_HIGH);
MakeCompass('n');
O_MouseSpeed := MouseSpeed;
MouseSpeed := 26;
end;

(**
* Author: Xtrapsp
* Description: Loads the DTMs that are used within the random.
*)
procedure Frog_Set_DTMS;
begin
FROG_ISLAND_DTM := DTMFromString('mrAAAAHic42BgYDjJxsBwA4qvA/EpID4MxLuAeBMQtwDV9ABxNRAXA3EuEBcBcQkQ1wJxaJAdg3lx Ak4sB1SDDzMSwDAAAMr5E3M=');
FROG_ISLAND_DTM_BACKUP := DTMFromString('maQEAAHicE2RgYLjGxMDwGIjvMEHY54H4NB Sfg+KrQHwTqu4BED8H4idAfAmqfgbQnIlA3AvFE4B4CgNEfB4Q LwLipVA8H8qfDZUHqV8JxIGeNgxmRfFw7ONiARYD4RBvWzAGsf 3dLVHUIWNWoDmUYkYqYAwAAGpfKPw=');
FROG_CROWN_BMP := BitmapFromString(1, 3, 'meJyTOfnD5NxvmaOfARoQBa8=');
DTM_Royal_Frog := DTMFromString('mbQAAAHicY2VgYLgDxLeB+CYQ34OyeRgZGD gZIbQAEPMD8cpOYYbfZ1QZDs4RYziuKcbw+5wxgxxQLTpmxoLB AAB7VQzf');
end;

(**
* Author: Xtrapsp
* Description: Unloads the DTMs that were used within the random.
*)
procedure Frog_Free_DTMS;
begin
FreeDTM(FROG_ISLAND_DTM);
FreeDTM(Frog_ISLAND_DTM_BACKUP);
FreeBitmap(FROG_CROWN_BMP);
FreeDTM(DTM_Royal_Frog);
end;

(**
* Author: Xtrapsp/Justin
* Description: Walks our player to the center of the map where the
* Frog Princess is located. If the DTM fails, will use TPA failsafe.
*)
function Frog_WalkCenter: boolean;
var
TPA: TPointArray;
T, TPAX, TPAY, sx, sy: Integer;
begin
if (not loggedIn()) then
exit;
MakeCompass('N');
MarkTime(T);
repeat
if findcolortolerance(TPAX,TPAY,5861233, MMX1+random(MMX2-MMX1-2), MMY1+random(MMY2-MMY1-2), MMX2, MMY2, 19) then
if (findcolortolerance(sx,sy,FROG_SWAMP, TPAX - 30, TPAY, TPAX - 15, TPAY, 19) and findcolortolerance(sx,sy,FROG_SWAMP, TPAX + 30, TPAY, TPAX + 45, TPAY, 19)) then
begin
Mouse(TPAX, TPAY-4, 4, 2, mouse_Left);
addToSRLLog('Frog_WalkCenter: Moving to center of cave');
wait(600 + Random(120));
FFlag(0);
result := true;
addToSRLLog('Frog_WalkCenter[Main]: result: ' + BoolToStr(result));
break;
end;
wait(100+random(50));
until(timeFromMark(T) > 6000);
if (not(result = true)) then
begin
addToSRLLog('Frog_WalkCenter: Unable to find main DTM, Falling back onto backup');
if (FindColorsTolerance(TPA, FROG_SWAMP, MMX1, MMY1, MMX2, MMY2, 50)) then
begin
MiddleTPAEx(TPA, TPAX, TPAY);
Mouse(TPAX, TPAY, 8, 8, mouse_Left);
wait(600 + Random(120));
FFlag(0);
result := true;
addToSRLLog('Frog_WalkCenter: result: ' + BoolToStr(result));
end;
end;
end;

(**
* Author: Xtrapsp/Justin
* Description: Finds the Frog Princess via DTM with a TPA failsafe.
* If the DTM fails, it will rotate the camera just incase the Frog Princess
* is off the screen.
*)
function Frog_FindFrog: boolean;
var
T, Attempt, tmpCTS, i, fx, fy, arL: integer;
arP: TPointArray;
ararP: T2DPointArray;
P: TPoint;
begin
addToSRLLog('Frog_FindFrog: Attempting to find the Frog Princess');
Marktime(T);
tmpCTS := GetColorToleranceSpeed;
repeat
if FindDTM(DTM_Royal_Frog, fx, fy, MSx1, MSy1, MSx2, MSy2) then
begin
MMouse(fx-2, fy-2, 2, 2);
if WaitUpTextMulti(['Frog','to Fr'], 300) then
begin
Writeln('Frog_Solve2: Found royal frog');
ClickMouse2(mouse_right);
Wait(randomRange(100,250));
result := waitOptionMulti(['Talk-to Frog','to Fr','Frog'], 500);
if result then
begin
Writeln('Frog_Solve2: Talking to royal frog...');
break
end else
MouseBox(MCx1, MCy1, MCx2, MCy2, mouse_move);
end;
end;
if not result then
begin
if FindBitmapToleranceIn(FROG_CROWN_BMP, fx, fy, MSX1, MSY1, MSX2, MSY2, 40) then
begin
MMouse(fx, fy, 4, 4);
addToSRLLog('Frog_FindFrog: Checking multi uptext');
wait(150 + random(100));
if (IsUpTextMultiCustom(['Frog', 'Talk', 'rog'])) then
begin
ClickMouse2(mouse_Right);
Result := WaitOptionMulti(['Talk-to', 'alk-t', 'Frog', 'rog'], 800);
addToSRLLog('Frog_FindFrog[Backup]: result: ' + BoolToStr(result));
wait(600 + Random(120));
FFlag(0);
if (result) then
addToSRLLog('Frog_FindFrog: Found Frog Princess');
exit;
end else
addToSRLLog('Frog_FindFrog: Could not find uptext');
end else
begin
addToSRLLog('Frog_FindFrog: Could not find Frog Princess. Falling onto backup');
MakeCompass(rs_GetCompassAngleDegrees + RandomRange(85, 95));
wait(800+Random(400));
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.76);
if (FindColorsTolerance(arP, FROG_CROWN, MSX1, MSY1, MSX2, MSY2, 12)) then
begin
addToSRLLog('Frog_FindFrog: Found TPA color, Moving mouse to TPA');
SortTPAFrom(arP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arP, 8, 8);
arL := High(ararP);
for i := 0 to arL do
begin
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
addToSRLLog('Frog_FindFrog: Checking multi uptext');
Wait(100 + Random(100));
if (IsUpTextMultiCustom(['Frog', 'Talk', 'rog'])) then
begin
ClickMouse2(mouse_Right);
Result := WaitOptionMulti(['Talk-to', 'alk-t', 'Frog', 'rog'], 500);
addToSRLLog('Frog_FindFrog[Backup]: result: ' + BoolToStr(result));
wait(600 + Random(120));
FFlag(0);
exit;
end else
addToSRLLog('Frog_FindFrog: Could not find uptext');
end;
end else
addToSRLLog('Frog_FindFrog[Backup]: Unable to find TPA');
end;
end;
Inc(Attempt);
addToSRLLog('Frog_FindFrog: Attempt: ' + inttostr(Attempt));
until ((Attempt > 5) or (Result));
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
exit;

end;

{(**
* Author: Xtrapsp/Justin
* Description: Handles talking to the Frog Princeess.
*)
function Frog_SpeakTo: boolean;
var
T, Attempt: integer;
TPA: TPointArray;
begin
addToSRLLog('Frog_SpeakTo: Attempting to speak to the Frog Princess');
Marktime(T);
repeat
if ClickDTMRotatedIn(FROG_CROWN_DTM, MSX1, MSY1, MSX2, MSY2, - Pi, Pi, Pi / 30, ['rog'], mouse_Left) then
begin
addToSRLLog('Frog_SpeakTo: Found Frog Princess, Clicking Frog Princess');
result := true;
addToSRLLog('Frog_SpeakTo[Main]: result: ' + BoolToStr(result));
Wait(3500 + Random(1000));
exit;
end
else
begin
addToSRLLog('Frog_SpeakTo: Could not find Frog Princess. Falling onto backup');
if (FindColorsSpiralTolerance(MSCX, MSCY, TPA, FROG_CROWN_COLOR_BACKUP, MSX1, MSY1, MSX2, MSY2, 25)) then
begin
Mouse(TPA[0].X, TPA[0].Y, 2, 2, mouse_Move);
if IsUpTextMultiCustom(['Frog', 'Talk', 'rog']) then
ClickMouse2(mouse_Left);
wait(600 + Random(120));
FFlag(0);
Result := true;
addToSRLLog('Frog_SpeakTo[Backup]: result: ' + BoolToStr(result));
end;
end;
Inc(Attempt);
MakeCompass(rs_GetCompassAngleDegrees + RandomRange(85, 95));
until ((Attempt > 20) or (Frog_IsTalkingTo))
if (Attempt > 20) then
Frog_WalkCenter;
exit;
end;}

(**
* Author: Xtrapsp/Justin
* Description: Detects if we are talking to the Frog Princess or just a Frog.
*)
function Frog_IsTalkingTo: boolean;
var
T, ft, i, Attempt: integer;
responses: TStringArray;
begin
addToSRLLog('Frog_IsTalkingTo: Speaking to the Frog Princess');
responses := ['very','orry','hange','lrigh','Okay','kay.','I supp','pose so','yeah','Yeah','Sure','ure'];
MarkTime(ft);
repeat
if areTalking then break;
wait(100+random(50));
until(timeFromMark(ft) > 6000);
MarkTime(ft);
repeat
if DoConversationEx(responses) then
begin
Writeln('Frog_Solve2: Reached response');
for i:=0 to High(responses) do
if findTextTPA(0, 5, MCx1, MCy1, MCx2, MCy2, responses[i], CharsNPC07, ClickLeft) then
begin
Writeln('Frog_Solve2: Chose correct option');
ClickToContinue;
break;
end;
end;
until(timeFromMark(ft) > 15000);

MarkTime(ft);
repeat
if (not(Frog_Detect())) then
begin
Result := True;
Writeln('Frog_Solve2: Successfully solved the Frog random!');
break;
end;
Wait(100 + Random(50));
until(timeFromMark(ft) > 10000);

if not result then
begin
repeat
Result := FindNPCChatText('Hmph. Have you come to apologize for ignoring me?', Nothing);
if (not(result)) then result:= FindNPCChatText('change', Nothing);
if (Result or (Attempt > 6)) then
begin
addToSRLLog('Frog_IsTalkingTo[backup]: Continuing to chat to Frog Princess');
Wait(1000 + Random(500));
DoConversation('', true);
Wait(1100 + Random(500));
Mouse(137, 399, 252, 7, True);
Wait(1100 + Random(500));
Mouse(153, 449, 130, 5, True);
Wait(1100 + Random(500));
Mouse(243, 450, 130, 4, True);
Wait(2100 + Random(1500));
exit;
end
else
addToSRLLog('Frog_IsTalkingTo[backup]: Could not continue chat with Frog Princess');
until ((Attempt > 7) or (TimefromMark(T) > 50000) or Result);
end;
if (Attempt > 7) then
begin
addToSRLLog('Frog_IsTalkingTo: Attempts are greater than 5');
Wait(3000 + Random(1000));
result := false;
end;
end;

(**
* Author: Justin & Flight
* Modified by: Krazy_Meerkat
* Description: Handles solving the random event.
*)
function Frog_Solve2(): boolean;
begin
if (not loggedIn()) then
exit;
Deg := RS_GetCompassAngleDegrees;
Wait(100 + random(50));
Frog_Setup();
if Frog_FindFrog then
result := Frog_IsTalkingTo;
MouseSpeed := O_MouseSpeed;
if (not result) then
addToSRLLog('Frog_Solve2: Frog solver failed or timed out');
MakeCompass(Deg);
end;

(**
* Author: Justin
* Description: Handles solving the random event.
*)
function Frog_Solve(): boolean;
var
t: integer;
begin
if (not loggedIn()) then
exit;
Deg := RS_GetCompassAngleDegrees;
Wait(100 + random(50));
t := (getSystemTime + (10 * 60000));
Frog_Setup();
repeat
if Frog_WalkCenter then
if Frog_FindFrog then
result := Frog_IsTalkingTo;
until (result or (getSystemTime > t));
MouseSpeed := O_MouseSpeed;
if (not result) then
addToSRLLog('Frog_Solve: Frog solver failed or timed out');
MakeCompass(Deg);
end;

Fixed the pillory cage random. Object scanning was freezing up and returning low values for the locks, added wait times and minimum value requirements. Fixed compass angle issues. Improved cage-finding routine.
pillory.simba

(*
Pillory
=======

Stores all the routines to solve the Pillory random. None of these routines
should be used throughout scripts. They only need to be called in SRL's random
detection methods.

This solver uses color counting to determine the shape
of the lock and which key to use.

*)

procedure PL_Message(Message: string);
begin
addToSRLLog('[Pillory Random] ' + Message);
end;

function PL_LockScreen: Boolean;
begin
Result := (LoggedIn and (GetColor(497, 34) = 65536));
end;

function PL_Detect: boolean;
var
tpa: TPointArray;
begin
if (not TabExists(TAB_OPTIONS)) and (TabExists(TAB_FRIENDS)) then
begin
// red doors of the cages
FindColorsTolerance(tpa, 235, MMCX - 15, MMCY - 15, MMCX + 15, MMCY + 15, 20);
Result := (inRange(length(tpa), 3, 18));
end;
end;

(**
* Author: DannyRS
* Last modified 15/03/2013 By DannyRS
* Description: Opens Cage Interface
*)
function PL_ClickCage: Boolean;
var
t, x, y: Integer;
begin
Result := False;

t := GetSystemTime;

if (not LoggedIn) then Exit;

Result := PL_LockScreen;

if (not Result) then
begin
repeat
x:= MSCX;
y:= MSCY;
if (not(IsUpTextMultiCustom(['Unlock','lock','Cage','age']))) then
if FindColorSpiralTolerance(x, y, 9738912, MSX1, MSY1, MSX2, MSY2, 19) or FindColorSpiralTolerance(x, y, 1118484, MSX1, MSY1, MSX2, MSY2, 19) then
begin
MMouse(x,y,4,4);
end else
MMouse(243,143,80,65);

Wait(RandomRange(90, 270));

if (IsUpTextMultiCustom(['Unlock','lock','Cage','age'])) then
begin
ClickMouse2(mouse_left);
if (waitFunc(@PL_LockScreen, 50, 5000)) then
begin
PL_Message('[PL_ClickCage] Opened Lock Screen');
Wait(RandomRange(190, 270));
Result := True;
end else
PL_Message('[PL_ClickCage] Failed to open Lock Screen');
end else
MMouse(243,143,80,65);
until (Result) or (GetSystemTime - t > 38000);
end;
end;

(**
* Author: DannyRS
* Last modified 15/03/2013 By DannyRS
* Description: Clicks a key 0-2
*)
function PL_ClickKey(Slot: Integer): Boolean;
var
p: TPoint;
begin
Result := False;

if (not PL_LockScreen) then Exit;

p := Point(209 + (Slot*93), 251);

MMouse(RandomRange(p.x - 2, p.x + 2), RandomRange(p.y - 4, p.y + 4), 0, 0);

ClickMouse2(mouse_left);

Result := True;
end;

(**
* Author: DannyRS
* Last modified 9/04/2013 By DannyRS
* Description: Scans for lock type
*)
function PL_GetLock: String;
var
CNum,Count,CountTime,WatchTime: Integer;
begin
Result := '';
WatchTime := RandomRange(9000,10000);
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.21, 2.01);
MarkTime(CountTime);
Count:= 100;
repeat
CNum := CountColorTolerance(1057067, 60, 65, 150, 150, 10);
if (CNum > Count) then
Count := CNum;
wait(50 + random(50));
until (TimeFromMark(CountTime) > WatchTime);
if (Count > 800) and (Count < 1000) then Result := 'square';
if (Count > 570) and (Count < 799) then Result := 'triangle';
if (Count > 400) and (Count < 569) then Result := 'diamond';
if (Count > 1001) and (Count < 1600) then Result := 'circle';
PL_Message('[PL_GetLock] Lock Found: ' + Result + ' [' + ToStr(Count) + ']');
end;

(**
* Author: DannyRS
* Last modified 9/04/2013 By DannyRS
* Description: Scans for key types
*)
function PL_GetKeys: TStringArray;
var
C1,C2,C3,CNum,Count,WatchTime: Integer;
begin
SetLength(Result, 3);

SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.43, 2.81);

MarkTime(WatchTime);
Result[0] := '';
Count := 100; CNum := 0;
repeat
CNum := CountColorTolerance(1516846, 180, 170, 235, 260, 7);

case CNum of
286: Result[0] := 'triangle';
493: Result[0] := 'diamond';
506: Result[0] := 'circle';
729: Result[0] := 'square';
end;

if (CNum > Count) then
Count := CNum;
wait(50 + random(50));

until (not (Result[0] = '')) or (TimeFromMark(WatchTime) > 10000);

if (Result[0] = '') then
begin
if InRange(Count, 250, 350) then Result[0] := 'triangle';
if InRange(Count, 400, 500) then Result[0] := 'diamond';
if InRange(Count, 501, 600) then Result[0] := 'circle';
if InRange(Count, 670, 1300) then Result[0] := 'square';
end;

C1 := Count;

MarkTime(WatchTime);
Result[1] := '';
Count := 100; CNum := 0;
repeat
CNum := CountColorTolerance(1516846, 265, 170, 345, 260, 7);

case CNum of
286: Result[1] := 'triangle';
493: Result[1] := 'diamond';
506: Result[1] := 'circle';
729: Result[1] := 'square';
end;

if (CNum > Count) then
Count := CNum;
wait(50 + random(50));

until (not (Result[1] = '')) or (TimeFromMark(WatchTime) > 10000);

if (Result[1] = '') then
begin
if InRange(Count, 250, 350) then Result[1] := 'triangle';
if InRange(Count, 400, 500) then Result[1] := 'diamond';
if InRange(Count, 501, 600) then Result[1] := 'circle';
if InRange(Count, 670, 1300) then Result[1] := 'square';
end;

C2 := Count;

MarkTime(WatchTime);
Result[2] := '';
Count := 100; CNum := 0;
repeat
CNum := CountColorTolerance(1516846, 365, 170, 430, 260, 7);

case CNum of
286: Result[2] := 'triangle';
493: Result[2] := 'diamond';
506: Result[2] := 'circle';
729: Result[2] := 'square';
end;

if (CNum > Count) then
Count := CNum;
wait(50 + random(50));

until (not (Result[2] = '')) or (TimeFromMark(WatchTime) > 10000);

if (Result[2] = '') then
begin
if InRange(Count, 250, 350) then Result[2] := 'triangle';
if InRange(Count, 400, 500) then Result[2] := 'diamond';
if InRange(Count, 501, 600) then Result[2] := 'circle';
if InRange(Count, 670, 1300) then Result[2] := 'square';
end;

C3 := Count;

PL_Message('[PL_GetKeys] Keys Found: '+
Result[0]+' ['+IntToStr(C1)+']'+' '+
Result[1]+' ['+IntToStr(C2)+']'+' '+
Result[2]+' ['+IntToStr(C3)+']');
end;

(**
* Author: DannyRS
* Last modified 15/03/2013 By DannyRS
* Description: Solves the Pillory Random Event
*)
function PL_Solve: Boolean;
var
i, t, keysolves, tmpCTS: Integer;
tmpHM, tmpSM, Deg: Extended;
lock: String;
keys: TStringArray;
begin
Result := False;
keysolves := 0;

tmpCTS := GetColorToleranceSpeed;
GetToleranceSpeed2Modifiers(tmpHM, tmpSM);

if (not LoggedIn) then Exit;

t := GetSystemTime;

Deg := RS_GetCompassAngleDegrees;
Wait(100 + random(50));
MakeCompass('N');
//if (not PL_ClickCage) then Exit;

repeat

Result := (TabExists(TAB_OPTIONS));
if (Result) then Break;

// open the lock screen if it's not already open
if (not PL_LockScreen) then PL_ClickCage;

lock := PL_GetLock;
keys := PL_GetKeys;

for i := 0 to 2 do
if (keys[i] = '') then
begin
PL_Message('[ERROR] [PL_GetKeys] Failed to get all keys');
Break;
end;

if (lock = '') then
begin
PL_Message('[ERROR] [PL_GetLock] Failed to get lock type');
Continue;
end;

for i := 0 to 2 do
if (keys[i] = lock) then
begin
PL_Message('[PL_Solve] Clicking key : ' + keys[i]);
if PL_ClickKey(i) then
begin
keysolves := keysolves + 1;
Wait(RandomRange(1500, 2000));
end;
end;

Result := ((keysolves > 2) and (not PL_LockScreen)) or
(TabExists(TAB_OPTIONS));

until (Result) or (GetSystemTime - t > 120000);

if (Result) then MakeCompass(Deg);

SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(tmpHM, tmpSM);

if (not Result) then
begin
if (GetSystemTime - t > 120000) then
PL_Message('[ERROR] Pillory solver timed out');
end else
Wait(RandomRange(800, 1200));
end;

Fixed the drill demon random. Added 1 new bitmap for each sign, had no problems detecting all 4. Ran it through a few times, changing worlds to test colour difference.
demon.simba

(*
Drill Demon
===========

Stores all the routines to solve the Drill Demon random. None of these routines
should be used throughout scripts. They only need to be called in SRL's random
detection methods.

This solver uses Deformed BMPs to locate the signs
to solve the Drill Demon (Sergeant Damien) random.

*)

procedure DD_Message(Message: String);
begin
addToSRLLog('[DemonDrill Random] ' + Message);
end;

function DD_Detect(): Boolean;
begin
if (not TabExists(TAB_OPTIONS)) and (not TabExists(TAB_EMOTES)) then
Result := (GetMusic = 'CorPoral Punisbment');
end;

(**
* Author: DannyRS
* Last Modified: 17/03/2013 - DannyRS
* Description: Moves the player back to the center of the random
* Note: Inspired by Le Jingle
*)
function DD_ResetPosition: Boolean;
var
WallTPA: TPointArray;
WallATPA: T2DPointArray;
tb: TBox;
p: TPoint;
//pa: TPointArray;
begin
Result := False;

if (not LoggedIn) then Exit;

SetColorToleranceSpeed(1);
SetToleranceSpeed2Modifiers(0.02, 0.02);
FindColorsTolerance(WallTPA, 15593957, 600, 58, 690, 110, 70);
SplitTPAExWrap(WallTPA, 5, 5, WallATPA);
SortATPASize(WallATPA, True);

if (Length(WallATPA) < 1) then Exit;

//SMART_DrawBoxEx(True, False, WallATPA[0], clGreen);

tb := GetTPABounds(WallATPA[0]);
p := MiddleBox(tb);

//Seems white alone is accurate enough to leave this out - Danny
//pa := GetMiniMapDots('yellow');
//if (Length(pa) < 1) then Exit;
//if (not PointInBox(pa[0], tb)) then Exit;

MMouse(p.x, RandomRange(p.y, p.y + 2), 0, 0);
ClickMouse2(mouse_left);

Wait(RandomRange(300, 400));
Flag;
Wait(RandomRange(800, 1200));

Result := True;
end;

function DD_TalkingToDemon: Boolean;
begin
Result := (Trim(GetNPCChatName) = 'SergeantDamien');
end;

(**
* Author: DannyRS
* Last Modified: 17/03/2013 - DannyRS
* Description: Talks to Sergeant Damien
*)
function DD_TalkDemon: Boolean;
var
DemonTPA: TPointArray;
DemonATPA: T2DPointArray;
x, y, i, Attemps: Integer;
begin
Result := False;

if (DD_TalkingToDemon) then
begin
Result := True;
Exit;
end;

repeat

if (Attemps > 6) then Break;

SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.15, 1.61);
FindColorsTolerance(DemonTPA, 994406, MSX1, MSY1, MSX2, MSY2, 16);
SplitTPAExWrap(DemonTPA, 50, 100, DemonATPA);
SortATPASize(DemonATPA, True);

if (Length(DemonATPA) < 1) then
begin
Attemps := Attemps + 1;
Wait(RandomRange(200, 400));
Continue;
end;

for i := 0 to High(DemonATPA) do
begin
if (Length(DemonATPA[i]) < 50) then Continue;
MiddleTPAEx(DemonATPA[i], x, y);
MMouse(RandomRange(x - 5, x + 5), RandomRange(y - 5, y + 5), 0, 0);
ClickMouse2(mouse_right);
Wait(RandomRange(30, 50));
if (ChooseOptionMulti(['Talk','alk-to'])) then
begin
if (WaitFunc(@DD_TalkingToDemon, 50, 25000)) then
begin
DD_Message('[DD_TalkDemon] Talked to demon');
Result := True;
Exit;
end else
DD_Message('[DD_TalkDemon] Failed to Talked to demon');
end;
end;
Attemps := Attemps + 1;

until (Result) or (Attemps > 6);
end;

(**
* Author: DannyRS
* Last Modified: 17/03/2013 - DannyRS
* Description: Gets the TBoxes of the green signs
*)
function DD_GetSigns: TBoxArray;
var
ESignsTPA: TPointArray;
ESignsATPA: T2DPointArray;
SignsSorted: Boolean;
i: Integer;
begin
SetColorToleranceSpeed(1);
SetToleranceSpeed2Modifiers(0.02, 0.02);
FindColorsTolerance(ESignsTPA, 4553552, MSX1, MSY1, MSX2, MSY2, 30);
SplitTPAExWrap(ESignsTPA, 70, 60, ESignsATPA);

repeat
SignsSorted := True;
for i := 0 to High(ESignsATPA) do
begin
if (Length(ESignsATPA[i]) < 5) then
begin
DeleteValueInATPA(ESignsATPA,i);
SignsSorted := False;
Break;
end;
end;
until (SignsSorted);

SetLength(Result, Length(ESignsATPA));

for i := 0 to high(ESignsATPA) do
begin
Result[i] := GetTPABounds(ESignsATPA[i]);
end;

DD_Message('[DD_GetSigns] Number of signs located : ' +
IntToStr(Length(ESignsATPA)));
end;

(**
* Author: DannyRS
* Last Modified: 17/03/2013 - DannyRS
* Description:
* Compares bitmaps to the signs and tries to
* return it's position, roughly centered
*)
function DD_FindSign(WhichSign: String): TPoint;
var
SB: TBoxArray;
x, y, i, ib, hb: Integer;
Saccuracy: Extended;
SBMP: TIntegerArray;
begin
Result := Point(-1, -1);

SB := DD_GetSigns;
if (Length(SB) < 1) then Exit;

SetLength(SBMP, 5);

hb := High(SBMP);

SetColorToleranceSpeed(1);
SetToleranceSpeed2Modifiers(0.02, 0.02);

case LowerCase(WhichSign) of
'jog': begin
SBMP[0] := BitmapFromString(14, 15, 'meJxzrw1KnFAOQe5IbAgXDRGvEo' +
'6y5zQDEVw7Vlk4wm8UmktooRJNMS4PojkVlxq4p5BDDKsaTBu RVWI' +
'qw2UvVmUE44VaiolMEkAEAE9f+0k=');
SBMP[1] := BitmapFromString(26, 17, 'meJxzqwl0w0AJfWUQhMYmD2E1jR' +
'IDIShrdhMQwa2grmlkGwgxB4IodxVaMFLXNGQDKYwRNM+SHcv IQQf' +
'XS57b0CICOQVSYhSmH8k2jSrxOJhNc0PNVhQiKhYdbuQmKgBk SPbW');
SBMP[2] := BitmapFromString(29, 10, 'meJxzrQ5wJRrF9ZUSr3gwGItsMh' +
'qXbJQ5qxGI4EZRxViImRBjIaZRbizcTGR3UmgsmpnUCltcxlI rVKl' +
'rLNxk4tUDAIc3Qs8=');
SBMP[3] := BitmapFromString(14, 17, 'meJxL6C9PACP3msAEJDYmSiBaJR' +
'xlzWkCIoh6girharAqhhgFQQRNQ3MzdVUi+wuPXqyuhYcbXBD NX/D' +
'gxeN9zOjAqpKg77CqxONfYlRiBg7+ACcm2ImMGgCPpxvW');
SBMP[4] := BitmapFromString(15, 18, 'meJxzrwl0rwlM6C+HIHdsXDSELA' +
'tnE1ScNacJiPArhiOIYiCCG4JHDdxk/GaiOYl2itHU4zEBzdm4VGI' +
'GHVaVmIGGK3bQVOJ3AFaV+COOFoqJTDkkRRnxMQtEANqdPtI= ');
end;
'starjumps': begin
SBMP[0] := BitmapFromString(16, 16, 'meJxzrw1yx0CJE8ohCFMKK4Krx9' +
'SSu7AdiEg1H6su/GogXPwIlyHEqMSlnhhH0kg9hS6nonqsyrBqgcQ' +
'7LjOJUY/VXswEhifGkZMfAK38Sfc=');
SBMP[1] := BitmapFromString(33, 17, 'meJxzqwl0Ixol9JUBEfHqSUUQ8+' +
'lmC4Xm5CxohSNaqMeqkSCilo+objhBu6ge0cPAClrHAi4rqGg LHZI' +
'TprHUtQWXsym3Al4Q4XIwsjh5pRa8uMPjWmTzyS4Y4bbgCUZi SngA' +
'a5KX0w==');
SBMP[2] := BitmapFromString(37, 16, 'meJxzrQ5wJR3F9ZXCERnacaHs+S' +
'34raOiXXAbIYjqJhNjKfGIPjbSx5t0C1U6RyI97Ro21tEtNdL HOuR' +
'iCtN8qtuIXDBiNZlGHgQiXMbSIgbh1uGJUyKrJAA7N7QN');
SBMP[3] := BitmapFromString(22, 16, 'meJxzrwl0x4YS+suBCKsUkQhiAj' +
'GG5CxsgyCyTUA2BNMcklQiy+JBxFtBql785pAaCwNuAoUhgCc w6WY' +
'Cpi4iDYGnXqzqiTcBiHAphovjzylwQ3B5EG4RmiEAhx+zZw== ');
SBMP[4] := BitmapFromString(24, 17, 'meJxzrwl0JwIl9JcDETEqCRpCuV' +
'EkGZKzsA2CiDQcrh5TFy5xTF0ELcWlnngTiDeKpLCl3ARc5pA X1zR' +
'yDBnmUCV4qWUOpkYijULOOATTOUFzIIiYTIE/wyKbg8e/eAoQADSU' +
'910=');
end;
'situps': begin
SBMP[0] := BitmapFromString(32, 12, 'meJxzrwl0R0U5C9uAyB1DnCoIYj' +
'gdzCfPCoK6KDGfoC5kw0m1ghgtmOYTaQWRWpAVEG8+msm4tGA qI9I' +
'KrBoJBiDWsCKIsJqf0F8GRJiuJcN8ZKOQDYeLE4xugobDzYew SUoY' +
'xBiObD7QBABMTOo0');
SBMP[1] := BitmapFromString(36, 14, 'meJxzqwl0GwQoZ0ErENHNIgrtIl' +
'I73C7yrCNeL7JFZNhFkl40u0iyjiSNmBYRbxepepHVUBIaboR SMpr' +
'J+O3C6gus2km1i3gE0ZvQV0aMO4lxOR4EtAWCkEXgZqJJUWIX 3CKs' +
'BqLJEh8pBO1C9g6dEQA0UXaL');
SBMP[2] := BitmapFromString(37, 16, 'meJxzrQ5wHRwoe34LENHTLgqtI1' +
'473DqybSReL7Jd5FlHkl4060i1kSSNmHaRZB2pepGVkWojmnq CGtE' +
'MpyRYiLcOf8ASg4hJMJiyZFsX11cKRMhcuJkQKbgswWRDpF3I 1mHa' +
'BZElJpUSaRcEkZSDyLCRVPOHEwIAf3vRcQ==');
SBMP[3] := BitmapFromString(33, 12, 'meJxzrwl0x0A5C9uACFOcWghiPn' +
'2soJEtyOaTbQV+jWhWkGELfl2Y5pNqBUFdyArIsIWgFjQFpFp BjPf' +
'RpEgKLqzOQ1aQ0F8ORJimYY0aggjTCoj5cCsIxj5B8zEDBG4F xBYK' +
'rUBzMIQNAF4A83M=');
SBMP[4] := BitmapFromString(33, 13, 'meJxzrwl0x0A5C9uACFOcWghiPn' +
'2soJEtyOaTZwVBXWhWkGoLQS2Y5pNkCzFakBWQagUxrkJTQJJ HiPQ' +
'7mhSuQCOIsMZIQn85EGHaTp75mK6FmA+3hZjYx4OQjSImEsk2 H24F' +
'kEFFW5DNh9sCsQIAUoImOg==');
end;
'pushups': begin
SBMP[0] := BitmapFromString(37, 16, 'meJxzrw1KnFAOQe61QXRAdLZuYF' +
'HuwnYIoqddyIjO1tHIakwzaWc1HkNoYSlB7VQMZ+K1ELSUGHM ocSF' +
'J9sKLFMpjgZ6pmnaJihJ7aWcjWmTRoQrAtAsAxiXG8w==');
SBMP[1] := BitmapFromString(39, 16, 'meJxzqwl0qwlM6CuDIDcwlz5oYC' +
'2ls73IKGdBKwTR30ZkNCCW0tQBBG2kugOwmkZre/GbQwt7iTeEin6' +
'nRAsZboCUCZSEFalpD7ksonpqHFRZntb2okUina1DthEAClrm ig==');
SBMP[2] := BitmapFromString(43, 16, 'meJxzrQ5wBaO4vlI4coUJ0hMhO2' +
'Cg3ICJsue3ANHA2o6MBtZ2OjuGoANo6hhMk+npBjxm0scNBE2 jaWg' +
'QbwiNkgcZuqiSVuEFICUBOLAZh57phFqOoacb0OJ6AK3GtB0A juAl' +
'9Q==');
SBMP[3] := BitmapFromString(35, 15, 'meJxL6C9P6C93rwmkNUoAW0Qfu9' +
'BQzsI2+tiCiehmEdWtJtIWyu1CM4FGduHSTnUP4ldPUqjit5c Yh5F' +
'qHZq9kAxLhvdJsgheMtA00VJoMjGIPkXcgNgCANcMfTY=');
SBMP[4] := BitmapFromString(30, 13, 'meJxL6C9P6C93rwmkOkoAm0wjw5' +
'FRzsI2IKKRsciIdiZTxQo8xlJoC5ouahmOSwvlhuNXTLb7iXQ GGVF' +
'Ahu9oEdHEW0G2yQRtAQA8T9+u');
end;
end;

for i := 0 to High(SB) do
begin
for ib := 0 to hb do
begin
if (Result.X > 0) or (Result.Y > 0) then Break;
if (SB[i].X1 > SB[i].X2) or (SB[i].Y1 > SB[i].Y2) then Continue;

if FindDeformedBitmapToleranceIn(SBMP[ib], x, y, SB[i].X1-2, SB[i].Y1-2,
SB[i].X2+2, SB[i].Y2+2, 2, 4, False, Saccuracy) then
begin
Result := Point(x + 20, y + 7);
DD_Message('[DD_FindSign] Matching sign found at : ' + ToStr(Result));
Break;
end;
end;
end;

for ib := 0 to hb do
FreeBitmap(SBMP[ib]);
end;

(**
* Author: DannyRS
* Last Modified: 17/03/2013 - DannyRS
* Description: Attemps to solve the Drill Demon random
*)
function DD_Solve(): boolean;
var
p: TPoint;
t, tmpCompass, tmpCTS, MMoves, debugColorCount: Integer;
tmpHM, tmpSM: Extended;
MatName, LastMatt: String;
begin
Result := False;

if (not LoggedIn) then Exit;

t := GetSystemTime;

tmpCTS := GetColorToleranceSpeed;
GetToleranceSpeed2Modifiers(tmpHM, tmpSM);
tmpCompass := Round(rs_GetCompassAngleDegrees);

SetAngle(SRL_ANGLE_LOW);
MakeCompass('N');

repeat

Result := TabExists(TAB_MAGIC);

if (Result) then Break;

if (not DD_TalkDemon) then
begin
DD_ResetPosition;
Continue;
end;

Wait(RandomRange(1200, 1600));

debugColorCount := CountColor(0, MCX1, MCY1, MCX2, MCY2);
case debugColorCount of
687,988,691 : MatName := 'jog';
707,711 : MatName := 'starjumps';
569,573 : MatName := 'situps';
637,938,641 : MatName := 'pushups';
else
begin
ClickToContinue;
Wait(RandomRange(1200, 1500));
Continue;
end;
end;
DD_Message('[DD_Solve] Last color count: ' + inttostr(debugColorCount));
LastMatt := '';
if (LastMatt = MatName) then
begin
MMoves := 0;

DD_Message('[DD_Solve] Already standing on the matt : ' + MatName);
DD_Message('[DD_Solve] Using matt : ' + MatName + ' again');

repeat
MMouse(246, 184, 40, 30);
MMoves := MMoves + 1;
Wait(RandomRange(90, 340));
if (IsUpTextMultiCustom(['Use','xercise','mat'])) then
begin
ClickMouse2(mouse_right);
Wait(RandomRange(40, 90));
if (ChooseOptionMulti(['Use'])) then
begin
Wait(RandomRange(1200, 1500));
if (WaitFunc(@DD_TalkingToDemon, 50, 15000)) then
begin
DD_Message('[DD_Solve] Used matt successfully');
LastMatt := MatName;
Break;
end else
begin
DD_Message('[ERROR] Failed to use matt');
Break;
end;
end;
end;
until (MMoves > 10);

Continue;
end;

DD_Message('[DD_Solve] Walking to center to search for sign');

if (not DD_ResetPosition) then
begin
DD_Message('[ERROR] Failed to walk to center');
Continue;
end;

DD_Message('[DD_Solve] Searching for sign : ' + MatName);

p := DD_FindSign(MatName);

if (p.x < 0) or (p.y < 0) then
begin
DD_Message('[ERROR] Failed to find sign : ' + MatName);
Continue;
end;

MMoves := 0;

DD_Message('[DD_Solve] Searching for matt : ' + MatName);

repeat

MMouse(p.x - 10, p.y + 64, 50, 30);

//SMART_DrawBoxEx(True,False,IntToBox(p.x-10,p.y+64,p.x+40,p.y+94),clGreen);

MMoves := MMoves + 1;
Wait(RandomRange(90, 340));
if (IsUpTextMultiCustom(['Use','xercise','mat'])) then
begin
ClickMouse2(mouse_right);
Wait(RandomRange(40, 90));
if (ChooseOptionMulti(['Use'])) then
begin
Wait(RandomRange(1200, 1500));
if (WaitFunc(@DD_TalkingToDemon, 50, 15000)) then
begin
DD_Message('[DD_Solve] Used matt successfully');
LastMatt := MatName;
Break;
end else
begin
DD_Message('[ERROR] Failed to use matt');
Break;
end;
end;
end;
until (MMoves > 10);

Result := TabExists(TAB_MAGIC);

until (Result) or (GetSystemTime - t > 240000);

if (not Result) then
begin
if (GetSystemTime - t > 240000) then
DD_Message('[ERROR] DrillDemon solver timed out');
end else
Wait(RandomRange(1200, 1600));

SetAngle(SRL_ANGLE_HIGH);
MakeCompass(tmpCompass);

SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(tmpHM, tmpSM);
end;

[B]Beta fixes
Use at your own risk.

Fixing the strange box random. Changed dtm-finding to bmptol-finding for the box item, fast and accurate. Added wait times and score requirements to the item and number scanning, getting a much higher solve rate, roughly 80% and significantly less extra boxes from in-game time-outs. Call it with SolveBox; because it's not included in the normal random-finding routines.
Known issues: Circle and stars are sometimes confused, as are pentagons and squares (not as commonly). Numberscan has problems reading 6 and 9 sometimes. Numbers and shapes will sometimes be incorrect, around 4/7 boxes will read all shapes and numbers perfectly, the rest are made up of partially correct scans and fast-spinning boxes. Client was lagging-out after doing a few full inventories of boxes, needs more testing. I accidentally left the loadshapes and loadnumbers calls inside a loop and was caching a ton of dtm's. Pretty sure it's fixed now..
box.simba

//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- ? Box Routines --//
//-----------------------------------------------------------------//
// * function GambleBox: Boolean; // * by WT-Fakawi
// * function GetBoxSide: Integer; // * by pups/Ashaman88
// * function GetQuestion(var num: Integer; var shape: string): Integer; // * by pups
// * function GetNumber: Integer; // * by Ashaman88
// * function GetShape: String; // * by Ashaman88
// * function OpenBox: Boolean; // * by Ashaman88
// * function SolveBox: Boolean; // * by Ashaman88

//{$I SRL-OSR/SRL/misc/Debug.Simba}
//{$I SRL-OSR/SRL/misc/SmartGraphics.Simba}
var
NumberBounds: TBox;

const
DebugBox=False;

{************************************************* ******************************
function GambleNewBox: Boolean;
by: WT-Fakawi (left this in here just in case we want to guess)
Description: A random box clicker. Will try to solve the box ONCE, by a random click
@ any of the three answers. THIS IS NOT A BOXSOLVER, JUST A BOXCLICKER!
************************************************** *****************************}

function GambleBox: Boolean;
var
xb, yb, Choise: Integer;
begin
//if FindBitmapToleranceIn(Box, xb, yb, MIX1, MIY1, MIX2, MIY2, 40) then
begin
Mouse(xb, yb, 0, 0, True);
Wait(2000);
Choise:= Random(3);
TakeScreen('Gambling box Choise - '+IntToStr(Choise));
case Choise of
0: Mouse(145, 295, 4, 4, True);
1: Mouse(270, 295, 4, 4, True);
2: Mouse(381, 295, 4, 4, True);
end;
IdleTime(4000, 2000, 1.0);
// if FindBitmapToleranceIn(Box, xb, yb, MIX1, MIY1, MIX2, MIY2, 40) then
begin
WriteLn('Box Missed');
// NOnewboxes := NOnewboxes + 1;
Result := False;
repeat
Logout;
until (not (LoggedIn));
Exit;
end
//else
begin
WriteLn('Box solved');
// newboxes := newboxes + 1;
Result := True;
end;
end;
end;

{************************************************* ******************************
function OpenBox: Boolean;
by: Ashaman88
Description: Opens the box.
************************************************** *****************************}

function OpenBox : Boolean;
var
x, y, i : Integer;
SBMP: TIntegerArray;
begin
Result := False;
SetLength(SBMP, 1);
GameTab(Tab_Inv);
Wait(100 + Random(50));
SBMP[0] := BitmapFromString(22, 15, 'meJxzdHR3BCMbGycgGR2dTBDp6h' +
'pCtISHxwMRXDsxejG1oyFHmHuwOkZeXhFNb3BwFFZzsBoIR3D ZsrJ' +
'GIMJvAi4E0YtsgpdXILIgENnbu0AQMHwgCKt2PCagISsre/wm+PgG' +
'D7gJfv5hA25CQGDEgJsATJwDYgJcBAD7lYWZ');
if FindBitmapToleranceIn(SBMP[0], x, y, MIX1, MIY1, MIX2, MIY2, 40) then
begin
Mouse(x, y, 4, 4, True);
for i := 0 to 9 do
begin
if (GetColor(487, 39) = 13567) and (GetColor(350, 295) = 2304814) then
begin
Result := True;
Break;
end;
Wait(500 + Random(50));
end;
end;
FreeBitmap(SBMP[0]);
end;

type
NumberRotate = record
Number, DTM, BMin, BMax, WMin, WMax: integer;
end;
NumberRotateArray = array of NumberRotate;

var
NumberArray: NumberRotateArray;

{************************************************* ******************************
procedure LoadNumbers;
by: Ashaman88
Description: Loadsup all the numbers!
************************************************** *****************************}

procedure LoadNumbers;
begin
if Length(NumberArray)<>0 then
Exit;

SetLength(NumberArray,10);

with NumberArray[0] do {Good2}
begin
Number := 0;
DTM := DTMFromString('mYQMAAHic1c5bCsIwFIThExWr9YJ2F766D9 9dhptRRFREii0i7jDgBH8xFIX2TQMfpyQzaWZm1nNmiXvPvqQf hP2xjGRAtiudSEJ2iJDPZIoJ/VfP4KSFNudp1N8rdpJcLlIyc/aP9sycmTvZIu6G3hVlpR++C87uuFVyh+juNTb8w3tf22q5aKzJ/d/M9c5f5/5A7fUAGciE0g==');
BMin := 125;
BMax := 215;
WMin := 160;
WMax := 30;
end;

with NumberArray[1] do {Good}
begin
Number := 1;
DTM := DTMFromString('mggAAAHicY2NgYGBigABmIGaBshmBmA+Iua FYCirOAcT1mXEMf//8AWMQG4aNgHLYMBMODAEARdcMkQ==');
BMin := 85;
BMax := 130;
WMin := 0;
WMax := 100;
end;

with NumberArray[2] do {Good2}
begin
Number := 2;
DTM := DTMFromString('mygMAAHic1c5bCoJQFIXh43uWkdnNaAY9NK OG0Dyigkq7XyypqCkK/dESojepF4WP7dlu1z5dY4xjGVOGi6pUrHe/BBsFVVt9R72XouZraEgdnjLTLE/ffElnWzp3VNuqTWW6+t9XbnoOufsMcyywxh4RYhxwwgZLrLBFg CnGmOg90MwOR5xxwfVLLNHHrpt2hMp6ZQ4/3OUhSZL8bDToZ/KPnT3unkdWTmV7nhL4nss=');
BMin := 0;
BMax := 1000;
WMin := 0;
WMax := 1000;
end;

with NumberArray[3] do {Good2}
begin
Number := 3;
DTM := DTMFromString('mHgQAAHic3c/PDsFAEAbwGZTwOH0eF2cnT+EiJaJII0gJ4gn92/KNfomN7MVN2uSXndmd/drGIvIAUZGalmuB5Sllr1Rwzvi1412r73SDK+csowktaEMnwPY b+sm5MNu+QXlmGRHUKeKef29KKSwhgxVsIYc9Wb2BNc8zzs9oz t6yJjCihL3tL77yLfcAZ4/1JziS9TvO++9NmTkm59zfSQa9oGG/+xY6i/EvVaAV8fvzApQlvTI=');
BMin := 140;
BMax := 220;
WMin := 300;
WMax := 550;
end;

with NumberArray[4] do {Good2}
begin
Number := 4;
DTM := DTMFromString('mygMAAHic1c5dCoJAFAXga1ipRVnto4eWUg uIVhG0loiIDEn7ISSjvQ11Bs7ALXrxoQcHPgauc49nLCKRJ9Kl iAJoQxN8aEGDt3vfhxhG0FPcPFa5HWa6HJ/ZdhZyb8Asa6i4rFDtv9A7hw1sYQd7SCClDE5whotyVbMjHLh7g wJKKjj7dqcHPKnkt4z/TtjJ9luzY8rOxhhZLWaVLefTj/sXm/0vE3SvI6+mqp033MCMjw==');
BMin := 130;
BMax := 300;
WMin := 200;
WMax := 450;
end;

with NumberArray[5] do {Good2}
begin
Number := 5;
DTM := DTMFromString('mXQQAAHic3c9dDsFAFAXg26pWikosRWIZ3i 3DAhBpCFHx/x8RLJMMzo0jGk9Sb23ypbczp/fOVEXkAZYl4oBHDrlgw1009Mq9a8O35nLgQx4KpGtZcsljLoAr fr/Jp58dk2FWc2X2878UqUQBZ+p5tmi5J60XtKZNrNb1OczgAMcY/d4xt4QpTCCCPoTQoZCzNDeiAXS534YmtJjtcU8zQxizp85YcfY JLnAGY0wijXrtL0nn/qKCe6WNlUKJnifIELAH');
BMin := 230;
BMax := 300;
WMin := 340;
WMax := 900;
end;

with NumberArray[6] do {Good2B}
begin
Number := 6;
DTM := DTMFromString('mSAQAAHic3c/bCgFRFAbgtYcijyOXbr2DZ5Gc0yTKYXI+xptw52GUGIxJ/t38w+QOd7Pra7da/9qHlIgklEgM4hT98EDmDEc40QXu4vUMZkR5XGxXcphxAzmHtT9 jBO6KqHf+xjNs3n8IvMFm3z/XYa0zS1jBHKYwgQFY0IE2daEPY5gxv+A+Yq/HnJ4dMmtRk1rQABPqUIMyFCAPJaiyZ5I/azJfgSLkYA0b/kG/IZtJy363fdH1t4Lz//r3jiT+FCYqZH5ZT1UtpIA=');
BMin := 160;
BMax := 440;
WMin := 300;
WMax := 600;
end;

with NumberArray[7] do {Good2}
begin
Number := 7;
DTM := DTMFromString('mIgMAAHiczc5hCoJAEAXgtyoZQtfwAN2oI3 SD0JCIEiuR8KjiRm/wBUu/8k+48LHsvGFmcwAjwQEJrWWldySQTPWYnGqe10sQ9A6aHbKa9d vMlDaaGe79OGJSSkUXaqiljp7UU0En5Td6KGv1rpVZz1U1y86a a3sOgUKZ7bp/7av3u1m893+x5d+WyC3Ub+cNI6GFkQ==');
BMin := 140;
BMax := 220;
WMin := 200;
WMax := 550;
end;

with NumberArray[8] do {Good2}
begin
Number := 8;
DTM := DTMFromString('mtQMAAHic1c7NCoJAFIbhMyJZVibeR5vuo3 13EAWVVKRUhEVdttA3+AZuhTYKD2eO52dmbmYDZxZJLEPX5CHn CCOZEBPOEX1BS8i87xvTNyXG1HyfiWPXTDKk5CkS3vGbCdhxUL qzJh7lTMzlJg+5c76SV/KSZ6vua6UUuMiJPX7/FvvWPSV7K2LB/5y+jayZ87WPvKWu607y1fLvur5hoXf3jeuhTt8X9gh9aA==');
BMin := 130;
BMax := 400;
WMin := 200;
WMax := 450;
end;

with NumberArray[9] do {Good2}
begin
Number := 9;
DTM := DTMFromString('mdgMAAHic1c7NCgFRGMbxM4U0Jh8TwzVYWs tOuQTltoTEyCShIffAzk15Tv5Tp0aysDH16z3zdOZ5p2uMqXjG VKUuAecyAvJQWtLkXJMG096JnDzkns3a0kFER0inz46SFFB0dv vOtDtW5iWWDTMmW2BJtpUdcy8nOctFrkjJj9xNZE3HTKaOOXnW n/CN7T7QlfL+uN9yxsP+R5PRIJe96/mFrLunf/0H3p/4/nkC/OhyWw==');
BMin := 160;
BMax := 440;
WMin := 300;
WMax := 600;
end;
End;

{************************************************* ******************************
procedure FreeNumbers;
by: Ashaman88
Description: Frees the number dtms!
************************************************** *****************************}

procedure FreeNumbers;
var
I: Integer;
begin
for i := 0 to high(NumberArray) do
FreeDTM(NumberArray[i].DTM);
end;

{************************************************* ******************************
function GetNumber: Integer;
by: Ashaman88.
Description: Gets the number on the side of the box.
************************************************** *****************************}


function GetNumber: Integer;
var
i, maxScore, maxIndex: integer;
CTS,X,Y: Integer;
MidBox: TPoint;
TPA,TPA1,TPA2,TPAW: TPointArray;
ATPA: T2DPointArray;
BrownBox: TBox;
afound: Extended;
scores: TintegerArray;
begin
LoadNumbers;
repeat
result:= -1;
setLength(scores, length(NumberArray));

CTS:= GetColorToleranceSpeed;
ColorToleranceSpeed(2);

SetColorSpeed2Modifiers(0.05, 0.31);
MidBox:=MiddleBox(IntToBox(NumberBounds.X1+5, NumberBounds.Y1+5, NumberBounds.X2-5, NumberBounds.Y2-5));
FindColorsSpiralTolerance(MidBox.X, MidBox.Y, TPA, 6187391, NumberBounds.X1, NumberBounds.Y1, NumberBounds.X2, NumberBounds.Y2, 16);
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);

ATPA:=FloodFillTPA(TPA);

if Length(ATPA)=0 then
begin
Writeln('No brown found');
Exit;
end;

if DebugBox then
begin
// DebugATPABounds(ATPA);
Writeln('Length of Brown Shape: '+ToStr(Length(ATPA[0])));
End;

BrownBox:=GetTPABounds(ATPA[0]);

FindColorsSpiralTolerance(MSCX, MSCY, TPA1, 16579837, BrownBox.X1, BrownBox.Y1, BrownBox.X2, BrownBox.Y2, 5);
FindColorsSpiralTolerance(MSCX, MSCY, TPA2, 12764106, BrownBox.X1, BrownBox.Y1, BrownBox.X2, BrownBox.Y2, 5);
TPAW:=CombineTPA(TPA1,TPA2);


if DebugBox then
Writeln('Length of White TPA in Brown: '+ToStr(Length(TPAW)));

// loop through fields, scoring each item
for i := 0 to high(NumberArray) do
begin
if inRange(Length(ATPA[0]), NumberArray[i].Bmin, NumberArray[i].BMax) then
scores[i] := scores[i] + 1;

if inRange(Length(TPAW), NumberArray[i].Wmin, NumberArray[i].WMax) then
scores[i] := scores[i] + 1;

if findDTMrotated(NumberArray[i].DTM, x, y, BrownBox.X1-3, BrownBox.Y1-3, BrownBox.X2+3, BrownBox.Y2+3,-Pi,Pi,Pi/30,aFound) then
scores[i] := scores[i] + 5;
//wait(1);
end;

// get the item with the highest score
maxScore := -1;
maxIndex := -1;
for i := 0 to high(scores) do
if (scores[i] > maxScore) then
begin
maxScore := scores[i];
maxIndex := i;
end;

if maxindex<>-1 then
begin
if (NumberArray[maxIndex].number = 1) then
begin
if (scores[maxIndex] < 12) then
begin
writeln('NumberScan: '+ToStr(NumberArray[maxIndex].number) + ', with a score of ' + intToStr(scores[maxIndex]));

result := NumberArray[maxIndex].number;
end;
end else
if ((scores[maxIndex] > 10) or (NumberArray[maxIndex].number = 0) or ((scores[maxIndex] > 3) and (NumberArray[maxIndex].number = 8))) then
begin
writeln('NumberScan: '+ToStr(NumberArray[maxIndex].number) + ', with a score of ' + intToStr(scores[maxIndex]));

result := NumberArray[maxIndex].number;
end;
end;
wait(1);

until(result > -1);
SetLength(ATPA,0);
SetLength(TPA,0);
SetLength(TPA1,0);
SetLength(TPA2,0);
SetLength(TPAW,0);
end;

type
ShapeRotate = record
Shape: String;
SMin, SMax, WMin, WMax, BMin, BMax : integer;
end;
ShapeRotateArray = array of ShapeRotate;

var
ShapeArray: ShapeRotateArray;

{************************************************* ******************************
procedure LoadShapes;
by: Ashaman88
Description: Loadsup all the shapes!
************************************************** *****************************}

Procedure LoadShapes;
begin
if Length(ShapeArray)<>0 then
Exit;


SetLength(ShapeArray,5);

with ShapeArray[0] do {Good2}
begin
Shape := 'Triangle';
SMin := 10;
SMax := 13;
WMin := 4600;
WMax := 4900;
BMin := 3200;
BMax := 4500;
end;

with ShapeArray[1] do {Good2}
begin
Shape := 'Square';
SMin := 8;
SMax := 13;
WMin := 5000;
WMax := 5800;
BMin := 100;
BMax := 2500;
end;

with ShapeArray[2] do {Good2}
begin
Shape := 'Star';
SMin := 15;
SMax := 17;
WMin := 4100;
WMax := 4400;
BMin := 7500;
BMax := 8400;
end;

with ShapeArray[3] do {Good2}
begin
Shape := 'Circle';
SMin := 17;
SMax := 20;
WMin := 7000;
WMax := 7500;
BMin := 300;
BMax := 1300;
end;

with ShapeArray[4] do {Good}
begin
Shape := 'Pentagon';
SMin := 8;
SMax := 16;
WMin := 4400;
WMax := 4800;
BMin := 1600;
BMax := 2400;
end;
End;

{************************************************* ******************************
function GetShape: String;
by: Ashaman88.
Description: Gets the shape on the side of the box.
************************************************** *****************************}

Function GetShape: String;
Var
i, maxScore, maxIndex, tries: integer;
CTS: Integer;
TPA,TPA1,TPA2, TPAB: TPointArray;
ATPA,ATPAB: T2DPointArray;
WhiteBox: TBox;
scores: TintegerArray;
begin
LoadShapes;
tries:= 0;
repeat
setLength(scores, length(shapeArray));

Result:='';
FindColorsSpiralTolerance(MSCX, MSCY, TPA1, 16579837, 172, 45, 352, 225, 5);
FindColorsSpiralTolerance(MSCX, MSCY, TPA2, 12764106, 172, 45, 352, 225, 5);
TPA:=CombineTPA(TPA1,TPA2);

ATPA:=FloodFillTPA(TPA);
SortATPASize(ATPA,True);
if DebugBox then
Writeln('Length of Full White ATPA: '+ToStr(Length(ATPA)));
if Length(ATPA)=0 then
begin
Writeln('No white found');
Exit;
End;

//if DebugBox then
// DebugATPABounds(ATPA);

CTS:= GetColorToleranceSpeed;
ColorToleranceSpeed(2);

WhiteBox:=GetTPABounds(ATPA[0]);
NumberBounds:=WhiteBox;

SetColorSpeed2Modifiers(0.05, 0.31);
FindColorsSpiralTolerance(MSCX, MSCY, TPAB, 6187391, WhiteBox.X1, WhiteBox.Y1, WhiteBox.X2, WhiteBox.Y2, 16);
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);

SplitTPAWrap(TPAB,10,ATPAB);
SortATPASize(ATPAB,True);

if DebugBox then
begin
Writeln('Length of Shape: '+ToStr(Length(ATPA[0])));
Writeln('Length of OutterBox: '+ToStr(Length(ATPAB[0])));
end;

// loop through fields, scoring each item
for i := 0 to high(ShapeArray) do
begin
if inRange(Length(ATPA[0]), ShapeArray[i].Wmin, ShapeArray[i].WMax) then
scores[i] := scores[i] + 2;

if inRange(Length(ATPAB[0]), ShapeArray[i].Bmin, ShapeArray[i].BMax) then
scores[i] := scores[i] + 1;

if inRange(Length(ATPA), ShapeArray[i].Smin, ShapeArray[i].SMax) then
scores[i] := scores[i] + 4;
//wait(1);
end;

// get the item with the highest score
maxScore := -1;
maxIndex := -1;
for i := 0 to high(scores) do
if (scores[i] > maxScore) then
begin
maxScore := scores[i];
maxIndex := i;
end;

if maxindex<>-1 then
begin
if (ShapeArray[maxIndex].shape = 'Triangle') then
begin
if (scores[maxIndex] > 4) then
begin
writeln('ShapeScan: '+ShapeArray[maxIndex].shape + ', with a score of ' + intToStr(scores[maxIndex]));

result := ShapeArray[maxIndex].shape;
end;
end else
if (ShapeArray[maxIndex].shape = 'Star') then
begin
if (scores[maxIndex] > 4) then
begin
writeln('ShapeScan: '+ShapeArray[maxIndex].shape + ', with a score of ' + intToStr(scores[maxIndex]));

result := ShapeArray[maxIndex].shape;
end;
end else
if (ShapeArray[maxIndex].shape = 'Circle') then
begin
if (scores[maxIndex] > 6) then
begin
writeln('ShapeScan: '+ShapeArray[maxIndex].shape + ', with a score of ' + intToStr(scores[maxIndex]));

result := ShapeArray[maxIndex].shape;
end;
end else
if ((ShapeArray[maxIndex].shape = 'Pentagon') or (ShapeArray[maxIndex].shape = 'Square')) then
begin
if (scores[maxIndex] > 10) then
begin
writeln('ShapeScan: '+ShapeArray[maxIndex].shape + ', with a score of ' + intToStr(scores[maxIndex]));

result := ShapeArray[maxIndex].shape;
end;
end else
if ((scores[maxIndex] > 5) or (tries > 50)) then
begin
writeln('ShapeScan: '+ShapeArray[maxIndex].shape + ', with a score of ' + intToStr(scores[maxIndex]));

result := ShapeArray[maxIndex].shape;
end;
end;
wait(10 + random(5));
tries:= tries + 1;
until(not(result = ''));

SetLength(ATPA,0);
SetLength(TPA,0);
SetLength(TPA1,0);
SetLength(TPA2,0);
SetLength(ATPAB,0);
SetLength(TPAB,0);
end;

{************************************************* ******************************
function GetBoxSide: Integer;
by: pups/Ashaman88
Description: Gets Box side and freezes client
************************************************** *****************************}

Procedure GetBoxSide;
var
X,Y: Integer;
begin
repeat
wait(100);
if FindColorTolerance(x, y, 16579837, 182, 45, 182, 225, 5) then continue;
if FindColorTolerance(x, y, 16579837, 342, 45, 342, 225, 5) then continue;
if FindColorTolerance(x, y, 16579837, 172, 55, 352, 55, 5) then continue;
if FindColorTolerance(x, y, 16579837, 172, 215, 352, 215, 5) then continue;
if FindColorTolerance(x, y, 12764106, 182, 45, 182, 225, 5) then continue;
if FindColorTolerance(x, y, 12764106, 342, 45, 342, 225, 5) then continue;
if FindColorTolerance(x, y, 12764106, 172, 55, 352, 55, 5) then continue;
if FindColorTolerance(x, y, 12764106, 172, 215, 352, 215, 5) then continue;
Break;
until False;
Freeze;
end;

{************************************************* ******************************
function GetQuestion(var num: Integer; var shape: String): Integer;
by: pups
Description: Returns number and type.
************************************************** *****************************}

function GetQuestion(var num: Integer; var shape: string): Integer;
var
x, y, i: Integer;
text: string;
begin
num := 10;
shape := '';
for i := 0 to 14 do
begin
case i of
0: text := '0'; //Zero
1: text := '1'; //One
2: text := '2'; //Two
3: text := '3'; //Three
4: text := '4'; //Four
5: text := '5'; //Five
6: text := '6'; //Six
7: text := '7'; //Seven
8: text := '8'; //Eight
9: text := '9'; //Nine
10: text := 'Circle'; //Circle
11: text := 'Triangle'; //Triangle
12: text := 'Square'; //Square
13: text := 'Star'; //Star
14: text := 'Pentagon'; //Pentagon
end;
if (FindText(x, y, Text, upchars07, 110, 250, 415, 275)) then
begin
Result := i;
if (i < 10) then
num := i;
if (i >= 10) then
shape := text;
Exit;
end;
end;
end;


{************************************************* ******************************
function SolveBox: Boolean;
by: Ashaman88
Description: Solves the Box!
************************************************** *****************************}

function SolveBox: Boolean;
var
st2: Integer;
shapeQ, shape, ans: string;
numQ, num: Integer;
x, y: Integer;
begin
while OpenBox do
begin
WriteLn('Found a box, solving...');
Wait(1000);
GetQuestion(numQ, shapeQ);
if (shapeQ = '') and (numQ = 10) then
exit;
WriteLn('Question is:');
if shapeQ = '' then
WriteLn('Which shape has number ' + IntToStr(numQ))
else
WriteLn('What number is the ' + shapeQ);
st2 := GetSystemTime;
repeat
GetBoxSide;
Shape:=GetShape;
Num:=GetNumber;
UnFreeze;
if DebugBox then
Wait(2000) Else
if (num = numQ) or (shape = shapeQ) then
begin
if num = numQ then
ans := shape
else
ans := IntToStr(num);
WriteLn('Answer is ' + ans);
if FindText(x, y, ans, upchars07, 116, 286, 183, 311) then
MouseBox(123, 290, 179, 308, mouse_left);
Wait(150 + Random(100));
if FindText(x, y, ans, upchars07, 235, 286, 302, 311) then
MouseBox(240, 291, 298, 310, mouse_left);
Wait(150 + Random(100));
if FindText(x, y, ans, upchars07, 350, 286, 417, 311) then
MouseBox(356, 286, 415, 309, mouse_left);
Wait(150 + Random(100));
//ClickMouse2(mouse_left);
WriteLn('******** SOLVED BOX RANDOM ********');
Result := True;
Break;
end;
until GetSystemTime > st2 + 12000;
Wait(1500 + Random(1000));
end;
if Length(NumberArray)>0 then
begin
FreeNumbers;
SetLength(NumberArray,0);
end;
if Length(ShapeArray)>0 then
SetLength(ShapeArray,0);
end;

On the Agenda
These randoms are either broken or disabled and are very common. Suggest any which aren't working for you.

Forester
Mime
Prison Pete
Molly
Maze
Quiz
Mordaut

Sjoe
12-19-2013, 07:34 PM
Nobody posting on this?????

Very nice btw :) even though I don't play osrs :p

Kyle
12-19-2013, 07:36 PM
I thought I posted on it, must have not hit submit.... :/ Really nice job man! Make a request to update the official antirandoms?

Krazy_Meerkat
12-20-2013, 03:23 AM
Thank you both very much :) I will make a request to update official antirandoms when a few more are solved. I just thought this thread would be a good idea if anyone else wants to help out, or has solved a random which I haven't listed.
I was getting about 3 randoms every 10 mins doing thieving, but now I can test a script for several hours without being logged by a random. I'll update when I get some more done.

Sjoe
12-20-2013, 04:27 AM
Thank you both very much :) I will make a request to update official antirandoms when a few more are solved. I just thought this thread would be a good idea if anyone else wants to help out, or has solved a random which I haven't listed.
I was getting about 3 randoms every 10 mins doing thieving, but now I can test a script for several hours without being logged by a random. I'll update when I get some more done.

you de-repped me by mistake I think :p

Solar
12-20-2013, 08:31 AM
Is there any way someone with minimal scripting knowledge, like me, would be able to help, or perhaps use this as a route to learn some scripting?

Krazy_Meerkat
12-20-2013, 01:33 PM
you de-repped me by mistake I think :p

Ah sorry, I repped you back up now :3

Is there any way someone with minimal scripting knowledge, like me, would be able to help, or perhaps use this as a route to learn some scripting?

Go right ahead :) It would really help if you try them out and let me know how it goes. Just use this script on a noob account with an empty inventory for about an hour and post the proggy report here.

{$DEFINE SMART}
{$I SRL-OSR-PASCAL/SRL.Simba}
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Pin := '';
WorldInfo := [];
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_Thieving;
Active := True;
end;
end;
begin
DeclarePlayers;
SetupSRL;
if not LoggedIn then LogInPlayer;
repeat
FindNormalRandoms;
SolveBox;
Boredhuman;
until(not LoggedIn);
end.

Solar
12-20-2013, 03:14 PM
Ah sorry, I repped you back up now :3


Go right ahead :) It would really help if you try them out and let me know how it goes. Just use this script on a noob account with an empty inventory for about an hour and post the proggy report here.

{$DEFINE SMART}
{$I SRL-OSR-PASCAL/SRL.Simba}
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Pin := '';
WorldInfo := [];
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_Thieving;
Active := True;
end;
end;
begin
DeclarePlayers;
SetupSRL;
if not LoggedIn then LogInPlayer;
repeat
FindNormalRandoms;
SolveBox;
Boredhuman;
until(not LoggedIn);
end.

I know pretty much what the script does, do you think it'll get me banned quite easily?

I changed it so that it has

{$DEFINE SMART}
{$I SRL-OSR/SRL.Simba}
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Pin := '';
WorldInfo := [];
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_slayer;
Active := True;
end;
end;
begin
DeclarePlayers;
SetupSRL;
if not LoggedIn then LogInPlayer;
repeat
if FindNormalRandoms then
writeln('solved normal randoms');
if SolveBox then
writeln('solved box');
Boredhuman;
until(not LoggedIn);
end.
Do you think this will work so I know if the script did solve anything without watching it or will the log be automatically filled if it solves a random?

Edit: I forgot how it reports what it's doing when doing randoms, so my adjustment was a waste.
Edit2: Didn't know when it was in the forester random by the look of it, was just "BoredHuman'ing". I interfered to complete it then left. This is after a short time running.
Not going to run it too much on my account since it isn't a throwaway and the only one I have membership on.
SRL Compiled in 0 msec
Attempting to pair to a smart client..
No free clients to pair to
Failed to pair to any smart previously spawned smart clients
Attempting to spawn a client
Grabbing your best world...
Succesfully spawned a client, attempting to target...
Set SMART[3280] as Simba's target
Welcome to Runescape.
*********
Screenshot of: IP Log 54 Seconds
Found a box, solving...
Question is:
Which shape has number 5
ShapeScan: Square, with a score of 12
NumberScan: 0, with a score of 6
ShapeScan: Pentagon, with a score of 12
NumberScan: 2, with a score of 12
ShapeScan: Square, with a score of 12
NumberScan: 3, with a score of 14
ShapeScan: Pentagon, with a score of 12
NumberScan: 7, with a score of 14
ShapeScan: Pentagon, with a score of 14
NumberScan: 2, with a score of 12
ShapeScan: Square, with a score of 12
NumberScan: 1, with a score of 5
Found a box, solving...
Question is:
What number is the Pentagon
ShapeScan: Star, with a score of 7
NumberScan: 7, with a score of 14
ShapeScan: Star, with a score of 7
NumberScan: 7, with a score of 14
ShapeScan: Square, with a score of 15
NumberScan: 1, with a score of 7
ShapeScan: Star, with a score of 7
NumberScan: 7, with a score of 14
ShapeScan: Star, with a score of 7
NumberScan: 7, with a score of 14
ShapeScan: Pentagon, with a score of 12
NumberScan: 2, with a score of 12
Answer is 2
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 6
ShapeScan: Circle, with a score of 8
NumberScan: 7, with a score of 12
ShapeScan: Triangle, with a score of 7
NumberScan: 9, with a score of 12
ShapeScan: Star, with a score of 6
NumberScan: 1, with a score of 5
ShapeScan: Square, with a score of 12
NumberScan: 1, with a score of 5
ShapeScan: Pentagon, with a score of 14
NumberScan: 1, with a score of 5
ShapeScan: Triangle, with a score of 7
NumberScan: 9, with a score of 14
ShapeScan: Pentagon, with a score of 14
NumberScan: 1, with a score of 5
ShapeScan: Pentagon, with a score of 12
NumberScan: 1, with a score of 5
ShapeScan: Star, with a score of 8
NumberScan: 1, with a score of 5
Found a box, solving...
Question is:
Which shape has number 0
ShapeScan: Square, with a score of 15
NumberScan: 7, with a score of 14
ShapeScan: Star, with a score of 8
NumberScan: 7, with a score of 14
ShapeScan: Square, with a score of 15
NumberScan: 7, with a score of 14
ShapeScan: Pentagon, with a score of 14
NumberScan: 7, with a score of 14
ShapeScan: Pentagon, with a score of 14
NumberScan: 7, with a score of 14
ShapeScan: Circle, with a score of 10
NumberScan: 6, with a score of 14
ShapeScan: Circle, with a score of 10
NumberScan: 6, with a score of 14
ShapeScan: Pentagon, with a score of 14
NumberScan: 7, with a score of 14
ShapeScan: Star, with a score of 8
NumberScan: 7, with a score of 14
ShapeScan: Pentagon, with a score of 14
NumberScan: 7, with a score of 14
Found a box, solving...
Question is:
Which shape has number 5
ShapeScan: Circle, with a score of 12
NumberScan: 3, with a score of 14
ShapeScan: Circle, with a score of 10
NumberScan: 3, with a score of 14
ShapeScan: Star, with a score of 8
NumberScan: 3, with a score of 14
ShapeScan: Pentagon, with a score of 15
NumberScan: 3, with a score of 14
ShapeScan: Pentagon, with a score of 14
NumberScan: 4, with a score of 14
ShapeScan: Star, with a score of 8
NumberScan: 3, with a score of 12
ShapeScan: Pentagon, with a score of 14
NumberScan: 4, with a score of 14
ShapeScan: Circle, with a score of 10
NumberScan: 3, with a score of 14
ShapeScan: Pentagon, with a score of 14
NumberScan: 4, with a score of 14
ShapeScan: Pentagon, with a score of 15
NumberScan: 3, with a score of 14
Found a box, solving...
Question is:
Which shape has number 4
ShapeScan: Square, with a score of 14
NumberScan: 4, with a score of 12
Answer is Square
******** SOLVED BOX RANDOM ********
solved box
Found NickName
******** FOUND TALKING RANDOM TEXT********: Talk-to Mysterious Old Man
Screenshot of: Solving Talking Random - Talk-to Mysterious Old Man 46 Minutes and 15 Seconds
Found OLD MAN random
Solved normal random
Found a box, solving...
Question is:
What number is the Square
ShapeScan: Star, with a score of 7
NumberScan: 1, with a score of 6
ShapeScan: Pentagon, with a score of 12
NumberScan: 1, with a score of 6
ShapeScan: Star, with a score of 6
NumberScan: 1, with a score of 5
ShapeScan: Star, with a score of 6
NumberScan: 1, with a score of 6
ShapeScan: Star, with a score of 7
NumberScan: 1, with a score of 6
ShapeScan: Star, with a score of 7
NumberScan: 1, with a score of 6
ShapeScan: Square, with a score of 14
NumberScan: 2, with a score of 12
Answer is 2
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 5
ShapeScan: Circle, with a score of 12
NumberScan: 5, with a score of 14
Answer is Circle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Star
ShapeScan: Star, with a score of 8
NumberScan: 1, with a score of 6
Answer is 1
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Pentagon
ShapeScan: Square, with a score of 15
NumberScan: 1, with a score of 5
ShapeScan: Pentagon, with a score of 12
NumberScan: 3, with a score of 14
Answer is 3
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Triangle
ShapeScan: Pentagon, with a score of 14
NumberScan: 4, with a score of 14
ShapeScan: Triangle, with a score of 7
NumberScan: 3, with a score of 14
Answer is 3
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 3
ShapeScan: Circle, with a score of 7
NumberScan: 2, with a score of 12
ShapeScan: Pentagon, with a score of 12
NumberScan: 2, with a score of 12
ShapeScan: Square, with a score of 12
NumberScan: 7, with a score of 14
ShapeScan: Square, with a score of 12
NumberScan: 7, with a score of 14
ShapeScan: Square, with a score of 14
NumberScan: 7, with a score of 14
ShapeScan: Square, with a score of 14
NumberScan: 7, with a score of 14
ShapeScan: Square, with a score of 14
NumberScan: 7, with a score of 14
ShapeScan: Square, with a score of 14
NumberScan: 7, with a score of 14
ShapeScan: Square, with a score of 12
NumberScan: 7, with a score of 14
Found a box, solving...
Question is:
What number is the Star
ShapeScan: Circle, with a score of 8
NumberScan: 4, with a score of 14
ShapeScan: Pentagon, with a score of 12
NumberScan: 0, with a score of 6
ShapeScan: Star, with a score of 7
NumberScan: 2, with a score of 12
Answer is 2
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Square
ShapeScan: Circle, with a score of 7
NumberScan: 0, with a score of 6
ShapeScan: Square, with a score of 14
NumberScan: 1, with a score of 6
Answer is 1
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Star
ShapeScan: Circle, with a score of 7
NumberScan: 3, with a score of 12
ShapeScan: Pentagon, with a score of 15
NumberScan: 3, with a score of 14
ShapeScan: Circle, with a score of 8
NumberScan: 2, with a score of 12
ShapeScan: Circle, with a score of 7
NumberScan: 3, with a score of 14
ShapeScan: Star, with a score of 8
NumberScan: 3, with a score of 12
Answer is 3
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Triangle
ShapeScan: Triangle, with a score of 6
NumberScan: 3, with a score of 12
Answer is 3
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 7
ShapeScan: Circle, with a score of 7
NumberScan: 7, with a score of 14
Answer is Circle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Triangle
ShapeScan: Circle, with a score of 12
NumberScan: 8, with a score of 7
ShapeScan: Circle, with a score of 12
NumberScan: 8, with a score of 7
ShapeScan: Triangle, with a score of 7
NumberScan: 2, with a score of 12
Answer is 2
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 9
ShapeScan: Square, with a score of 14
NumberScan: 4, with a score of 14
ShapeScan: Square, with a score of 12
NumberScan: 4, with a score of 14
ShapeScan: Square, with a score of 15
NumberScan: 5, with a score of 12
ShapeScan: Square, with a score of 14
NumberScan: 4, with a score of 14
ShapeScan: Square, with a score of 12
NumberScan: 4, with a score of 14
ShapeScan: Square, with a score of 14
NumberScan: 4, with a score of 14
ShapeScan: Square, with a score of 14
NumberScan: 4, with a score of 14
ShapeScan: Square, with a score of 14
NumberScan: 4, with a score of 12
Found a box, solving...
Question is:
What number is the Pentagon
ShapeScan: Circle, with a score of 7
NumberScan: 1, with a score of 5
ShapeScan: Circle, with a score of 12
NumberScan: 7, with a score of 14
ShapeScan: Star, with a score of 8
NumberScan: 1, with a score of 5
ShapeScan: Pentagon, with a score of 15
NumberScan: 1, with a score of 5
Answer is 1
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Circle
ShapeScan: Circle, with a score of 10
NumberScan: 7, with a score of 12
Answer is 7
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Square
ShapeScan: Pentagon, with a score of 14
NumberScan: 7, with a score of 14
ShapeScan: Square, with a score of 12
NumberScan: 3, with a score of 14
Answer is 3
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Square
ShapeScan: Square, with a score of 12
NumberScan: 7, with a score of 14
Answer is 7
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Square
ShapeScan: Square, with a score of 14
NumberScan: 4, with a score of 14
Answer is 4
******** SOLVED BOX RANDOM ********
solved box
Found NickName
Found a box, solving...
Question is:
Which shape has number 4
ShapeScan: Pentagon, with a score of 12
NumberScan: 4, with a score of 14
Answer is Pentagon
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Star
ShapeScan: Pentagon, with a score of 15
NumberScan: 7, with a score of 14
ShapeScan: Circle, with a score of 12
NumberScan: 7, with a score of 14
ShapeScan: Pentagon, with a score of 12
NumberScan: 2, with a score of 14
ShapeScan: Circle, with a score of 8
NumberScan: 1, with a score of 5
ShapeScan: Circle, with a score of 12
NumberScan: 1, with a score of 5
ShapeScan: Circle, with a score of 8
NumberScan: 2, with a score of 12
ShapeScan: Pentagon, with a score of 15
NumberScan: 1, with a score of 5
ShapeScan: Circle, with a score of 7
NumberScan: 7, with a score of 14
Found a box, solving...
Question is:
Which shape has number 5
ShapeScan: Circle, with a score of 8
NumberScan: 3, with a score of 12
ShapeScan: Circle, with a score of 7
NumberScan: 0, with a score of 6
ShapeScan: Triangle, with a score of 6
NumberScan: 2, with a score of 12
ShapeScan: Circle, with a score of 7
NumberScan: 0, with a score of 6
ShapeScan: Circle, with a score of 7
NumberScan: 0, with a score of 6
ShapeScan: Pentagon, with a score of 12
NumberScan: 5, with a score of 14
Answer is Pentagon
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 0
ShapeScan: Circle, with a score of 7
NumberScan: 8, with a score of 7
ShapeScan: Square, with a score of 11
NumberScan: 8, with a score of 7
ShapeScan: Pentagon, with a score of 14
NumberScan: 0, with a score of 6
Answer is Pentagon
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 4
ShapeScan: Pentagon, with a score of 14
NumberScan: 2, with a score of 14
ShapeScan: Triangle, with a score of 6
NumberScan: 4, with a score of 14
Answer is Triangle
******** SOLVED BOX RANDOM ********
solved box
Found NickName
***** Found Random: Mime *****
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_IdentifyEmote: Didn't identify emote
Mime_Solve: Mime solver exceeded maximum tries
***** Failed Random: Mime *****
Succesfully freed SMART[3280]
Successfully executed.

Krazy_Meerkat
12-21-2013, 01:41 AM
Thanks a lot Solar, you really are helpful :)
That proggy report is telling me that the box solver is still not finished, however it did get rid of the boxes eventually by the look of things.. You definitely updated all the solvers with the ones in the 1st post? (I modified the box solver since it was posted in the antirandoms dev thread). How many uncut gems did you end up with?
That script will not get you banned :p but don't use it without keeping an eye on things (your player might get killed or spoken to). You can replace BoredHuman; with RandomMovement; or RandomRClick; and the script should recognise more randoms because the wait times will be lower between checks, I only left an antiban in there to keep the player logged in. The forester might not have detected because of a change in compass angle, but BoredHuman; should've returned the angle to what it previously was..

Solar
12-21-2013, 09:29 AM
I had three uncut gems IIRC.
I think I had the latest box version but I've just this minute double checked by pasting and saving what you have posted in the OP right now.
I assume you haven't updated any of the other ones.

samerdl
12-21-2013, 01:35 PM
Well done!!!! finally some random solvers!!!!!!!!!!!!!!!!!!!!!!!!!


Much appreciated! thank you!!!!!!

Solar
12-21-2013, 08:37 PM
Seemed to get stuck on the question asking for the shape that has 6. Didn't move the mouse at all, so I'm not sure what happened, looked like it crashed.
Found a box, solving...
Question is:
Which shape has number 8
ShapeScan: Circle, with a score of 7
NumberScan: 8, with a score of 7
Answer is Circle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 6
ShapeScan: Star, with a score of 6
NumberScan: 5, with a score of 12
ShapeScan: Square, with a score of 12
NumberScan: 5, with a score of 14
ShapeScan: Triangle, with a score of 6
NumberScan: 2, with a score of 12
ShapeScan: Square, with a score of 12
NumberScan: 5, with a score of 14
ShapeScan: Circle, with a score of 8
NumberScan: 6, with a score of 14
Answer is Circle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 3
ShapeScan: Star, with a score of 7
NumberScan: 2, with a score of 14
ShapeScan: Triangle, with a score of 6
NumberScan: 3, with a score of 12
Answer is Triangle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 1
ShapeScan: Square, with a score of 12
NumberScan: 5, with a score of 14
ShapeScan: Circle, with a score of 9
NumberScan: 9, with a score of 12
ShapeScan: Square, with a score of 14
NumberScan: 5, with a score of 14
ShapeScan: Square, with a score of 12
NumberScan: 5, with a score of 14
ShapeScan: Square, with a score of 12
NumberScan: 5, with a score of 12
ShapeScan: Square, with a score of 14
NumberScan: 5, with a score of 14
ShapeScan: Square, with a score of 14
NumberScan: 5, with a score of 14
ShapeScan: Circle, with a score of 8
NumberScan: 1, with a score of 2
Answer is Circle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 6
ShapeScan: Star, with a score of 6
NumberScan: 7, with a score of 14
ShapeScan: Square, with a score of 12
NumberScan: 0, with a score of 6
ShapeScan: Square, with a score of 12
NumberScan: 0, with a score of 6
ShapeScan: Square, with a score of 12
NumberScan: 0, with a score of 6
ShapeScan: Circle, with a score of 7
NumberScan: 6, with a score of 14
Answer is Circle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 0
ShapeScan: Square, with a score of 15
NumberScan: 2, with a score of 14
ShapeScan: Pentagon, with a score of 14
NumberScan: 2, with a score of 14
ShapeScan: Pentagon, with a score of 14
NumberScan: 2, with a score of 14
ShapeScan: Circle, with a score of 7
NumberScan: 0, with a score of 6
Answer is Circle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Square
ShapeScan: Square, with a score of 12
NumberScan: 5, with a score of 14
Answer is 5
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 6
ShapeScan: Square, with a score of 11
NumberScan: 3, with a score of 14
ShapeScan: Square, with a score of 12
NumberScan: 8, with a score of 7
Ran it again to log in and continue. Seems like 6's and 9's are mistaken for 1's with a low score.

Sorry for being lazy and not looking through the random solver, but does the box solver use the process of elimination? Maybe this would be an option.

Ashaman88
12-22-2013, 03:41 AM
Seemed to get stuck on the question asking for the shape that has 6. Didn't move the mouse at all, so I'm not sure what happened, looked like it crashed.
Found a box, solving...
Question is:
Which shape has number 8
ShapeScan: Circle, with a score of 7
NumberScan: 8, with a score of 7
Answer is Circle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 6
ShapeScan: Star, with a score of 6
NumberScan: 5, with a score of 12
ShapeScan: Square, with a score of 12
NumberScan: 5, with a score of 14
ShapeScan: Triangle, with a score of 6
NumberScan: 2, with a score of 12
ShapeScan: Square, with a score of 12
NumberScan: 5, with a score of 14
ShapeScan: Circle, with a score of 8
NumberScan: 6, with a score of 14
Answer is Circle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 3
ShapeScan: Star, with a score of 7
NumberScan: 2, with a score of 14
ShapeScan: Triangle, with a score of 6
NumberScan: 3, with a score of 12
Answer is Triangle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 1
ShapeScan: Square, with a score of 12
NumberScan: 5, with a score of 14
ShapeScan: Circle, with a score of 9
NumberScan: 9, with a score of 12
ShapeScan: Square, with a score of 14
NumberScan: 5, with a score of 14
ShapeScan: Square, with a score of 12
NumberScan: 5, with a score of 14
ShapeScan: Square, with a score of 12
NumberScan: 5, with a score of 12
ShapeScan: Square, with a score of 14
NumberScan: 5, with a score of 14
ShapeScan: Square, with a score of 14
NumberScan: 5, with a score of 14
ShapeScan: Circle, with a score of 8
NumberScan: 1, with a score of 2
Answer is Circle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 6
ShapeScan: Star, with a score of 6
NumberScan: 7, with a score of 14
ShapeScan: Square, with a score of 12
NumberScan: 0, with a score of 6
ShapeScan: Square, with a score of 12
NumberScan: 0, with a score of 6
ShapeScan: Square, with a score of 12
NumberScan: 0, with a score of 6
ShapeScan: Circle, with a score of 7
NumberScan: 6, with a score of 14
Answer is Circle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 0
ShapeScan: Square, with a score of 15
NumberScan: 2, with a score of 14
ShapeScan: Pentagon, with a score of 14
NumberScan: 2, with a score of 14
ShapeScan: Pentagon, with a score of 14
NumberScan: 2, with a score of 14
ShapeScan: Circle, with a score of 7
NumberScan: 0, with a score of 6
Answer is Circle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Square
ShapeScan: Square, with a score of 12
NumberScan: 5, with a score of 14
Answer is 5
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 6
ShapeScan: Square, with a score of 11
NumberScan: 3, with a score of 14
ShapeScan: Square, with a score of 12
NumberScan: 8, with a score of 7
Ran it again to log in and continue. Seems like 6's and 9's are mistaken for 1's with a low score.

Sorry for being lazy and not looking through the random solver, but does the box solver use the process of elimination? Maybe this would be an option.

We could totally use the tesseract on this guy! Would solve it much easier I say (at least to get number)

Olly
12-22-2013, 03:49 AM
We could totally use the tesseract on this guy! Would solve it much easier I say (at least to get number)

Also MatrixGetCorners :)

Krazy_Meerkat
12-23-2013, 03:27 AM
We could totally use the tesseract on this guy! Would solve it much easier I say (at least to get number)

Also MatrixGetCorners :)

I wanted to do exactly that! :) I made some edits to call tesseract.simba with the pascal version of the OSR include, but I'm really unsure where to find function information about MatrixGetCorners and TPAExtractShape. I couldn't find anything in the lib files and tesseract.simba only had some of the text-handling calls.. In your Dec 20 update thread Olly, you mention some of the TPA functions. Could you give me a little info on how to call these functions?

Olly
12-23-2013, 04:06 AM
I wanted to do exactly that! :) I made some edits to call tesseract.simba with the pascal version of the OSR include, but I'm really unsure where to find function information about MatrixGetCorners and TPAExtractShape. I couldn't find anything in the lib files and tesseract.simba only had some of the text-handling calls.. In your Dec 20 update thread Olly, you mention some of the TPA functions. Could you give me a little info on how to call these functions?

They are in the libTesseract plugin, {$loadlib libTesseract} and then update the function list (press space or whatever) and you will see it in the function list under plugins

As for using the MatrixGetCorners you will want to convert the bitmap into a matrix, and call it on that such as;

var
bmp: integer;
matrix: T2DIntegerArray;
tpa: TPointArray;
begin
bmp := bitmapFrom....
matrix := bitmapToMatrix(bmp);
MatrixGetCorners(matrix, tpa);
end.

Unfold
12-23-2013, 02:11 PM
Strange Random Box is the only thing that didn't work. The bot kept trying to drop it which duplicated it.

Solar
12-23-2013, 03:48 PM
Strange Random Box is the only thing that didn't work. The bot kept trying to drop it which duplicated it.

Mine never tried to drop the strange box. Not sure what you have done differently. Are you on maximum brightness?

Unfold
12-23-2013, 08:44 PM
Mine never tried to drop the strange box. Not sure what you have done differently. Are you on maximum brightness?

yes

Solar
12-25-2013, 12:04 PM
I'm not sure what's going on, maybe an update messed things up, but even the demon random isn't working now.

Krazy_Meerkat
12-27-2013, 08:12 AM
Which ones aren't working? Progress report?

Unfold
12-28-2013, 09:51 PM
Which ones aren't working? Progress report?

The box never seems to work :P.. but the rest do that you have made, good job :)

It would be awesome if you could update the rest :)

Cheers

Krazy_Meerkat
12-30-2013, 02:06 PM
I'm not sure what's going on, maybe an update messed things up, but even the demon random isn't working now.

I was having troubles with the drill demon too, so I've updated it again with 2 more bmp's for each sign. Check the OP for the new version.


The box never seems to work :P.. but the rest do that you have made, good job :)

It would be awesome if you could update the rest :)

Cheers

I'm working on the box atm. I will likely focus on the mime and forester next.

Hoodz
01-04-2014, 12:05 AM
I was having troubles with the drill demon too, so I've updated it again with 2 more bmp's for each sign. Check the OP for the new version.



I'm working on the box atm. I will likely focus on the mime and forester next.

if you have finished those, i might start my last big project on osr. it could be anything, i think about something like slayer.

Itankbots
01-04-2014, 05:31 PM
Very nice work man, i don't play OSRS but i remember how much fo a pain these were back in the day...Great work :) Definitely going to keep an eye on this so if i do decide to play ill give ya feedback

anth_
01-10-2014, 02:44 PM
Nice stuff man! I should have some free time soon (and learning to script) so if I get stuck in one of those randoms I'll let you know!). Thanks a bunch :D

Solar
01-17-2014, 01:52 PM
SRL Compiled in 15 msec
Attempting to pair to a smart client..
Found 2 free client(s), attempting to pair to one...
Failed to pair to SMART[4080]
Set SMART[5140] as Simba's target
Succesfully paired to a existing client, SMART[5140]
Welcome to Runescape.
******
Screenshot of: IP Log 9 Seconds
Found a box, solving...
Question is:
What number is the Star
ShapeScan: Square, with a score of 12
NumberScan: 8, with a score of 7
ShapeScan: Star, with a score of 6
NumberScan: 1, with a score of 5
Answer is 1
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 3
ShapeScan: Circle, with a score of 12
NumberScan: 7, with a score of 12
ShapeScan: Circle, with a score of 7
NumberScan: 1, with a score of 5
ShapeScan: Circle, with a score of 7
NumberScan: 1, with a score of 5
ShapeScan: Star, with a score of 8
NumberScan: 1, with a score of 5
ShapeScan: Star, with a score of 5
NumberScan: 1, with a score of 5
ShapeScan: Pentagon, with a score of 15
NumberScan: 1, with a score of 5
ShapeScan: Circle, with a score of 10
NumberScan: 1, with a score of 5
Found a box, solving...
Question is:
Which shape has number 9
ShapeScan: Square, with a score of 12
NumberScan: 1, with a score of 5
ShapeScan: Square, with a score of 14
NumberScan: 2, with a score of 14
ShapeScan: Pentagon, with a score of 12
NumberScan: 2, with a score of 12
ShapeScan: Triangle, with a score of 7
NumberScan: 2, with a score of 12
ShapeScan: Square, with a score of 12
NumberScan: 2, with a score of 14
ShapeScan: Square, with a score of 14
NumberScan: 1, with a score of 5
ShapeScan: Square, with a score of 14
NumberScan: 1, with a score of 5
ShapeScan: Pentagon, with a score of 12
NumberScan: 2, with a score of 12
ShapeScan: Square, with a score of 12
NumberScan: 2, with a score of 14
Found a box, solving...
Question is:
What number is the Square
ShapeScan: Pentagon, with a score of 12
NumberScan: 4, with a score of 14
ShapeScan: Circle, with a score of 9
NumberScan: 1, with a score of 5
ShapeScan: Star, with a score of 8
NumberScan: 1, with a score of 5
ShapeScan: Circle, with a score of 7
NumberScan: 1, with a score of 5
ShapeScan: Circle, with a score of 8
NumberScan: 4, with a score of 12
ShapeScan: Circle, with a score of 9
NumberScan: 1, with a score of 5
ShapeScan: Pentagon, with a score of 12
NumberScan: 1, with a score of 5
Found a box, solving...
Question is:
What number is the Square
ShapeScan: Triangle, with a score of 6
NumberScan: 1, with a score of 5
ShapeScan: Triangle, with a score of 7
NumberScan: 5, with a score of 14
ShapeScan: Triangle, with a score of 6
NumberScan: 1, with a score of 5
ShapeScan: Triangle, with a score of 6
NumberScan: 5, with a score of 14
ShapeScan: Star, with a score of 5
NumberScan: 1, with a score of 5
ShapeScan: Triangle, with a score of 7
NumberScan: 5, with a score of 14
ShapeScan: Pentagon, with a score of 14
NumberScan: 2, with a score of 12
Found a box, solving...
Question is:
Which shape has number 2
ShapeScan: Circle, with a score of 7
NumberScan: 2, with a score of 12
Answer is Circle
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Circle
ShapeScan: Star, with a score of 6
NumberScan: 0, with a score of 5
ShapeScan: Pentagon, with a score of 14
NumberScan: 1, with a score of 5
ShapeScan: Circle, with a score of 8
NumberScan: 1, with a score of 5
Answer is 1
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Star
ShapeScan: Star, with a score of 8
NumberScan: 7, with a score of 14
Answer is 7
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
What number is the Circle
ShapeScan: Pentagon, with a score of 14
NumberScan: 1, with a score of 5
ShapeScan: Pentagon, with a score of 12
NumberScan: 1, with a score of 5
ShapeScan: Square, with a score of 14
NumberScan: 1, with a score of 5
ShapeScan: Pentagon, with a score of 12
NumberScan: 2, with a score of 12
ShapeScan: Triangle, with a score of 6
NumberScan: 2, with a score of 14
ShapeScan: Square, with a score of 14
NumberScan: 1, with a score of 5
ShapeScan: Circle, with a score of 10
NumberScan: 1, with a score of 5
Answer is 1
******** SOLVED BOX RANDOM ********
Found a box, solving...
Question is:
Which shape has number 2
ShapeScan: Circle, with a score of 10
NumberScan: 1, with a score of 5
ShapeScan: Circle, with a score of 12
NumberScan: 1, with a score of 5
Succesfully freed SMART[5140]
Successfully executed.
The following DTMs were not freed: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]

Stopped and solved them myself since I started with 3 and ended with about 10 before taking over.

bg5
01-17-2014, 06:40 PM
Sorry guys for offtopic, I haven't played Runescape for like 1,5 year, but in the past I was working on graveyard random solver and I want to continue working on it. Is there any way to play OSR without member account?

Kevin
01-17-2014, 06:47 PM
Sorry guys for offtopic, I haven't played Runescape for like 1,5 year, but in the past I was working on graveyard random solver and I want to continue working on it. Is there any way to play OSR without member account?

By borrowing a member account?

Solar
01-17-2014, 06:55 PM
Sorry guys for offtopic, I haven't played Runescape for like 1,5 year, but in the past I was working on graveyard random solver and I want to continue working on it. Is there any way to play OSR without member account?

You could also get a F2P account and bot enough GP to buy a bond. Then just bot any member methods to get more bonds and membership. :)

Krazy_Meerkat
01-22-2014, 10:07 AM
I had finished work on the strangebox, getting the shapes via the tesseract, but the numbers have proven to be very similar in the tesseract's eyes, I had tried TPASkeleton, TPAExtractShape and MatrixGetCorners with almost no distinction between numbers. I'll finish the other half of this later..

Important Note
I am going to continue my work on AntiRandom Solvers, but from now onwards they will only be available to the OSR Reflection include (being actively developed by Elfyyy, NKN, Sirenia and myself) which is available here: http://villavu.com/forum/showthread.php?t=107479
This is for several reasons, the most important of which is that there has been rapid development within the OSR Reflection include allowing better detection and solving methods than SRL's antirandoms are capable of.
I was not confident using reflection before because when the hooks are updated in OSR, it can take many days for people to update the pastebin with new hooks (relying solely on JavaHacking update logs). I have been developing the updater for the reflection include, and we are able to update hooks and post to the gc within 10 minutes of an OSR update. This is thanks to some incredible work by Justin, Elfyyy and even Brandon. NKN and Sirenia are leading the development of our own updater (this is different to the include updater), I'd like to call it a hook-nabber, but it's much more complex than that. Atm, we only use the JH logs to compare our hooks and multipliers. Soon we will have 2 methods to get hooks which don't rely on JavaHacking.com (which is rumoured to be posting less information on hooks anyway due to leechers)
I have also seen other members speak of creating their own OSR includes. While we don't have a development team for OSR, we have a lot of very skilled members who are very passionate about it. There is no reason we can't unite and combine our efforts into one include.
After some testing with the new reflection functions, I made the following:
Flawless Mime random detection & solver.
Flawless Drill Demon detection.
Flawless Prison Pete detection.
Flawless Maze detection.
I'm confident we can detect nearly all randoms using reflection and by using it, we get completely accurate information in order to solve each random (compared to SRL's guess-work using colour techniques).

Solar
01-22-2014, 10:50 AM
Very excited to hear all of that.
Thanks to you and everyone else working on everything to do with OSR. Perhaps you could talk to Flight about what he has done, maybe he'll be willing to help, even if he is working (what seems to be on his own) on Lape stuff.

Ashaman88
02-05-2014, 05:43 AM
Went ahead and added these randoms updates to OSR

https://github.com/SRL/SRL-OSR/commit/308128624c0285d9ccc365a5bc0e5a95fe66c1de

Flight
02-06-2014, 02:29 AM
Krazy_Meerkat I'm going to use your Drill Demon modifications with the extra bitmaps as I'm working on that solver at the moment. If I get around to the others today (Pillory & Pinball) I'd like to use those as well. I just got my account into the Drill Demon event so I'll use some of your modifications and give you feedback on how it performs.

Edit:
The sign detection in the Drill Demon solver worked fine, nice job.

Ashaman88
02-06-2014, 04:17 AM
Krazy_Meerkat I'm going to use your Drill Demon modifications with the extra bitmaps as I'm working on that solver at the moment. If I get around to the others today (Pillory & Pinball) I'd like to use those as well. I just got my account into the Drill Demon event so I'll use some of your modifications and give you feedback on how it performs.

Edit:
The sign detection in the Drill Demon solver worked fine, nice job.

Let me know if there are anymore updates to push

Krazy_Meerkat
02-06-2014, 04:44 AM
Krazy_Meerkat I'm going to use your Drill Demon modifications with the extra bitmaps as I'm working on that solver at the moment. If I get around to the others today (Pillory & Pinball) I'd like to use those as well. I just got my account into the Drill Demon event so I'll use some of your modifications and give you feedback on how it performs.

Edit:
The sign detection in the Drill Demon solver worked fine, nice job.

Let me know if there are anymore updates to push
I also have this Mime solver for srl which I haven't had the chance to test, but I recorded all new info for each emote, and increased the emotearray size from 8 to 64 (8 different comparisons for each emote during scoring).. Theoretically it should do a lot better to solve, but didn't get the chance to test it sorry:
(*
Mime
====

The Mime file stores the routines to solve the mime random event.

This solver uses pixel shifting to determine which emote the mime is performing.
To compensate for the spotlight, it will get the total pixel shift in a large
box around the mime, and the pixel shift in a small box around the mime. It
then calculates the percentage of the small shift in the big shift. Lastly,
it compares the stored emotes (Mime_GetEmotes) with the scanned emote, resulting
a certain score. If the score is high enough, it's found the right emote.

*)

const
MIME_EMOTE_COUNT = 64;
MIME_EMOTE_THINK = 0;
MIME_EMOTE_BOX = 1;
MIME_EMOTE_WALL = 2;
MIME_EMOTE_DANCE = 3;
MIME_EMOTE_CRY = 4;
MIME_EMOTE_CLIMB = 5;
MIME_EMOTE_LEAN = 6;
MIME_EMOTE_LAUGH = 7;
MIME_EMOTE_THINK2 = 8;
MIME_EMOTE_BOX2 = 9;
MIME_EMOTE_WALL2 = 10;
MIME_EMOTE_DANCE2 = 11;
MIME_EMOTE_CRY2 = 12;
MIME_EMOTE_CLIMB2 = 13;
MIME_EMOTE_LEAN2 = 14;
MIME_EMOTE_LAUGH2 = 15;
MIME_EMOTE_THINK3 = 16;
MIME_EMOTE_BOX3 = 17;
MIME_EMOTE_WALL3 = 18;
MIME_EMOTE_DANCE3 = 19;
MIME_EMOTE_CRY3 = 20;
MIME_EMOTE_CLIMB3 = 21;
MIME_EMOTE_LEAN3 = 22;
MIME_EMOTE_LAUGH3 = 23;
MIME_EMOTE_THINK4 = 24;
MIME_EMOTE_BOX4 = 25;
MIME_EMOTE_WALL4 = 26;
MIME_EMOTE_DANCE4 = 27;
MIME_EMOTE_CRY4 = 28;
MIME_EMOTE_CLIMB4 = 29;
MIME_EMOTE_LEAN4 = 30;
MIME_EMOTE_LAUGH4 = 31;
MIME_EMOTE_THINK5 = 32;
MIME_EMOTE_BOX5 = 33;
MIME_EMOTE_WALL5 = 34;
MIME_EMOTE_DANCE5 = 35;
MIME_EMOTE_CRY5 = 36;
MIME_EMOTE_CLIMB5 = 37;
MIME_EMOTE_LEAN5 = 38;
MIME_EMOTE_LAUGH5 = 39;
MIME_EMOTE_THINK6 = 40;
MIME_EMOTE_BOX6 = 41;
MIME_EMOTE_WALL6 = 42;
MIME_EMOTE_DANCE6 = 43;
MIME_EMOTE_CRY6 = 44;
MIME_EMOTE_CLIMB6 = 45;
MIME_EMOTE_LEAN6 = 46;
MIME_EMOTE_LAUGH6 = 47;
MIME_EMOTE_THINK7 = 48;
MIME_EMOTE_BOX7 = 49;
MIME_EMOTE_WALL7 = 50;
MIME_EMOTE_DANCE7 = 51;
MIME_EMOTE_CRY7 = 52;
MIME_EMOTE_CLIMB7 = 53;
MIME_EMOTE_LEAN7 = 54;
MIME_EMOTE_LAUGH7 = 55;
MIME_EMOTE_THINK8 = 56;
MIME_EMOTE_BOX8 = 57;
MIME_EMOTE_WALL8 = 58;
MIME_EMOTE_DANCE8 = 59;
MIME_EMOTE_CRY8 = 60;
MIME_EMOTE_CLIMB8 = 61;
MIME_EMOTE_LEAN8 = 62;
MIME_EMOTE_LAUGH8 = 63;

(**
* Stores a Mime emote's properties. See Mime_ScanMime for more details.
*)
type
TMimeEmote = record
name: string;
shiftSmall: integer; // total pixel shift in a small box around Mime
shiftBig: integer; // total pixel shift in a big box around Mime
shiftPercent: extended; // percent of small shift in large
textTPACount: integer;
end;
TMimeEmoteArray = array of TMimeEmote;

(**
* Author: Coh3n & NCDS
* Updated 09/03/2013 - Justin
* Description: Returns true if player is in the random.
*)
function Mime_Detect(): boolean;
var
i: integer;
begin
if (not loggedIn()) then
exit;

for i := TAB_COMBAT to TAB_MAGIC do
if (tabExists(i)) then
exit;
Result := (CountDots('npc') = 1) and (not tabExists(TAB_EMOTES)) and (GetMusic = 'Artistry');
end;

(**
* Author: Coh3n
* Description: Returns a TMimeEmoteArray of all the Mime's emotes.
*)
function Mime_GetEmotes(): TMimeEmoteArray;
begin
setLength(result, MIME_EMOTE_COUNT);

with result[MIME_EMOTE_THINK] do
begin
name := 'Think';
shiftSmall := 3238;
shiftBig := 3950;
shiftPercent := 81.9;
textTPACount := 87;
end;

with result[MIME_EMOTE_BOX] do
begin
name := 'Glass Box';
shiftSmall := 6250;
shiftBig := 7975;
shiftPercent := 78.3;
textTPACount := 139;
end;

with result[MIME_EMOTE_WALL] do
begin
name := 'Glass Wall';
shiftSmall := 3062;
shiftBig := 5142;
shiftPercent := 59.5;
textTPACount := 155;
end;

with result[MIME_EMOTE_DANCE] do
begin
name := 'Dance';
shiftSmall := 19717;
shiftBig := 30229;
shiftPercent := 65.2;
textTPACount := 96;
end;

with result[MIME_EMOTE_CRY] do
begin
name := 'Cry';
shiftSmall := 5444;
shiftBig := 5841;
shiftPercent := 93.2;
textTPACount := 54;
end;

with result[MIME_EMOTE_CLIMB] do
begin
name := 'Climb Rope';
shiftSmall := 10701;
shiftBig := 11239;
shiftPercent := 95.2;
textTPACount := 168;
end;

with result[MIME_EMOTE_LEAN] do
begin
name := 'Lean on Air';
shiftSmall := 8819;
shiftBig := 15776;
shiftPercent := 77.9;
textTPACount := 148;
end;

with result[MIME_EMOTE_LAUGH] do
begin
name := 'Laugh';
shiftSmall := 7990;
shiftBig := 8861;
shiftPercent := 90.1;
textTPACount := 101;
end;

with result[MIME_EMOTE_THINK2] do
begin
name := 'Think';
shiftSmall := 2134;
shiftBig := 7367;
shiftPercent := 28.9;
textTPACount := 87;
end;

with result[MIME_EMOTE_BOX2] do
begin
name := 'Glass Box';
shiftSmall := 8302;
shiftBig := 9998;
shiftPercent := 83.0;
textTPACount := 139;
end;

with result[MIME_EMOTE_WALL2] do
begin
name := 'Glass Wall';
shiftSmall := 2128;
shiftBig := 4791;
shiftPercent := 44.4;
textTPACount := 155;
end;

with result[MIME_EMOTE_DANCE2] do
begin
name := 'Dance';
shiftSmall := 11954;
shiftBig := 28850;
shiftPercent := 41.4;
textTPACount := 96;
end;

with result[MIME_EMOTE_CRY2] do
begin
name := 'Cry';
shiftSmall := 4598;
shiftBig := 6113;
shiftPercent := 75.2;
textTPACount := 54;
end;

with result[MIME_EMOTE_CLIMB2] do
begin
name := 'Climb Rope';
shiftSmall := 3174;
shiftBig := 3586;
shiftPercent := 88.5;
textTPACount := 168;
end;

with result[MIME_EMOTE_LEAN2] do
begin
name := 'Lean on Air';
shiftSmall := 16420;
shiftBig := 46284;
shiftPercent := 35.4;
textTPACount := 148;
end;

with result[MIME_EMOTE_LAUGH2] do
begin
name := 'Laugh';
shiftSmall := 6677;
shiftBig := 7422;
shiftPercent := 89.9;
textTPACount := 101;
end;

with result[MIME_EMOTE_THINK3] do
begin
name := 'Think';
shiftSmall := 4564;
shiftBig := 7699;
shiftPercent := 59.2;
textTPACount := 87;
end;

with result[MIME_EMOTE_BOX3] do
begin
name := 'Glass Box';
shiftSmall := 7455;
shiftBig := 8668;
shiftPercent := 86.0;
textTPACount := 139;
end;

with result[MIME_EMOTE_WALL3] do
begin
name := 'Glass Wall';
shiftSmall := 2840;
shiftBig := 4150;
shiftPercent := 68.4;
textTPACount := 155;
end;

with result[MIME_EMOTE_DANCE3] do
begin
name := 'Dance';
shiftSmall := 21034;
shiftBig := 29377;
shiftPercent := 71.6;
textTPACount := 96;
end;

with result[MIME_EMOTE_CRY3] do
begin
name := 'Cry';
shiftSmall := 7075;
shiftBig := 8281;
shiftPercent := 85.4;
textTPACount := 54;
end;

with result[MIME_EMOTE_CLIMB3] do
begin
name := 'Climb Rope';
shiftSmall := 11039;
shiftBig := 13360;
shiftPercent := 82.6;
textTPACount := 168;
end;

with result[MIME_EMOTE_LEAN3] do
begin
name := 'Lean on Air';
shiftSmall := 10045;
shiftBig := 18729;
shiftPercent := 53.6;
textTPACount := 148;
end;

with result[MIME_EMOTE_LAUGH3] do
begin
name := 'Laugh';
shiftSmall := 8006;
shiftBig := 11207;
shiftPercent := 71.4;
textTPACount := 101;
end;

with result[MIME_EMOTE_THINK4] do
begin
name := 'Think';
shiftSmall := 4005;
shiftBig := 4543;
shiftPercent := 88.1;
textTPACount := 87;
end;

with result[MIME_EMOTE_BOX4] do
begin
name := 'Glass Box';
shiftSmall := 8346;
shiftBig := 9198;
shiftPercent := 90.7;
textTPACount := 139;
end;

with result[MIME_EMOTE_WALL4] do
begin
name := 'Glass Wall';
shiftSmall := 3815;
shiftBig := 5149;
shiftPercent := 74.0;
textTPACount := 155;
end;

with result[MIME_EMOTE_DANCE4] do
begin
name := 'Dance';
shiftSmall := 19245;
shiftBig := 26194;
shiftPercent := 73.4;
textTPACount := 96;
end;

with result[MIME_EMOTE_CRY4] do
begin
name := 'Cry';
shiftSmall := 17197;
shiftBig := 30179;
shiftPercent := 56.9;
textTPACount := 54;
end;

with result[MIME_EMOTE_CLIMB4] do
begin
name := 'Climb Rope';
shiftSmall := 11078;
shiftBig := 12655;
shiftPercent := 87.5;
textTPACount := 168;
end;

with result[MIME_EMOTE_LEAN4] do
begin
name := 'Lean on Air';
ShiftSmall:= 10157;
ShiftBig:= 18784;
ShiftPercent:= 54.1;
textTPACount := 148;
end;

with result[MIME_EMOTE_LAUGH4] do
begin
name := 'Laugh';
shiftSmall := 8411;
shiftBig := 8911;
shiftPercent := 94.3;
textTPACount := 101;
end;


with result[MIME_EMOTE_THINK5] do
begin
name := 'Think';
ShiftSmall:= 3031;
ShiftBig:= 7149;
ShiftPercent:= 42.4;
textTPACount := 87;
end;

with result[MIME_EMOTE_BOX5] do
begin
name := 'Glass Box';
ShiftSmall:= 7297;
ShiftBig:= 9936;
ShiftPercent:= 73.4;
textTPACount := 139;
end;

with result[MIME_EMOTE_WALL5] do
begin
name := 'Glass Wall';
ShiftSmall:= 3674;
ShiftBig:= 6021;
ShiftPercent:= 61;
textTPACount := 155;
end;

with result[MIME_EMOTE_DANCE5] do
begin
name := 'Dance';
ShiftSmall:= 18353;
ShiftBig:= 32313;
ShiftPercent:= 56.8;
textTPACount := 96;
end;

with result[MIME_EMOTE_CRY5] do
begin
name := 'Cry';
ShiftSmall:= 5673;
ShiftBig:= 7110;
ShiftPercent:= 79.8;
textTPACount := 54;
end;

with result[MIME_EMOTE_CLIMB5] do
begin
name := 'Climb Rope';
ShiftSmall:= 9791;
ShiftBig:= 12676;
ShiftPercent:= 77.2;
textTPACount := 168;
end;

with result[MIME_EMOTE_LEAN5] do
begin
name := 'Lean on Air';
ShiftSmall:= 10363;
ShiftBig:= 18123;
ShiftPercent:= 57.2;
textTPACount := 148;
end;

with result[MIME_EMOTE_LAUGH5] do
begin
name := 'Laugh';
ShiftSmall:= 6820;
ShiftBig:= 12102;
ShiftPercent:= 56.4;
textTPACount := 101;
end;

with result[MIME_EMOTE_THINK6] do
begin
name := 'Think';
ShiftSmall:= 1797;
ShiftBig:= 2649;
ShiftPercent:= 67.8;
textTPACount := 87;
end;

with result[MIME_EMOTE_BOX6] do
begin
name := 'Glass Box';
ShiftSmall:= 7805;
ShiftBig:= 10047;
ShiftPercent:= 77.7;
textTPACount := 139;
end;

with result[MIME_EMOTE_WALL6] do
begin
name := 'Glass Wall';
ShiftSmall:= 5127;
ShiftBig:= 12233;
ShiftPercent:= 41.9;
textTPACount := 155;
end;

with result[MIME_EMOTE_DANCE6] do
begin
name := 'Dance';
ShiftSmall:= 22654;
ShiftBig:= 37948;
ShiftPercent:= 59.7;
textTPACount := 96;
end;

with result[MIME_EMOTE_CRY6] do
begin
name := 'Cry';
ShiftSmall:= 1636;
ShiftBig:= 2651;
ShiftPercent:= 61.7;
textTPACount := 54;
end;

with result[MIME_EMOTE_CLIMB6] do
begin
name := 'Climb Rope';
ShiftSmall:= 9744;
ShiftBig:= 16798;
ShiftPercent:= 58;
textTPACount := 168;
end;

with result[MIME_EMOTE_LEAN6] do
begin
name := 'Lean on Air';
ShiftSmall:= 10218;
ShiftBig:= 24222;
ShiftPercent:= 42.2;
textTPACount := 148;
end;

with result[MIME_EMOTE_LAUGH6] do
begin
name := 'Laugh';
ShiftSmall:= 7144;
ShiftBig:= 9590;
ShiftPercent:= 74.5;
textTPACount := 101;
end;

with result[MIME_EMOTE_THINK7] do
begin
name := 'Think';
ShiftSmall:= 3933;
ShiftBig:= 6903;
ShiftPercent:= 57;
textTPACount := 87;
end;

with result[MIME_EMOTE_BOX7] do
begin
name := 'Glass Box';
ShiftSmall:= 7592;
ShiftBig:= 8759;
ShiftPercent:= 86.7;
textTPACount := 139;
end;

with result[MIME_EMOTE_WALL7] do
begin
name := 'Glass Wall';
ShiftSmall:= 3802;
ShiftBig:= 5193;
ShiftPercent:= 73.2;
textTPACount := 155;
end;

with result[MIME_EMOTE_DANCE7] do
begin
name := 'Dance';
ShiftSmall:= 23755;
ShiftBig:= 41345;
ShiftPercent:= 57.5;
textTPACount := 96;
end;

with result[MIME_EMOTE_CRY7] do
begin
name := 'Cry';
ShiftSmall:= 7428;
ShiftBig:= 8349;
ShiftPercent:= 89;
textTPACount := 54;
end;

with result[MIME_EMOTE_CLIMB7] do
begin
name := 'Climb Rope';
ShiftSmall:= 8086;
ShiftBig:= 13567;
ShiftPercent:= 59.6;
textTPACount := 168;
end;

with result[MIME_EMOTE_LEAN7] do
begin
name := 'Lean on Air';
ShiftSmall:= 6891;
ShiftBig:= 15115;
ShiftPercent:= 45.6;
textTPACount := 148;
end;

with result[MIME_EMOTE_LAUGH7] do
begin
name := 'Laugh';
ShiftSmall:= 5580;
ShiftBig:= 8655;
ShiftPercent:= 64.5;
textTPACount := 101;
end;

with result[MIME_EMOTE_THINK8] do
begin
name := 'Think';
ShiftSmall:= 3786;
ShiftBig:= 9136;
ShiftPercent:= 41.4;
textTPACount := 87;
end;

with result[MIME_EMOTE_BOX8] do
begin
name := 'Glass Box';
ShiftSmall:= 7930;
ShiftBig:= 10392;
ShiftPercent:= 76.3;
textTPACount := 139;
end;

with result[MIME_EMOTE_WALL8] do
begin
name := 'Glass Wall';
ShiftSmall:= 4014;
ShiftBig:= 5591;
ShiftPercent:= 71.8;
textTPACount := 155;
end;

with result[MIME_EMOTE_DANCE8] do
begin
name := 'Dance';
ShiftSmall:= 21668;
ShiftBig:= 31993;
ShiftPercent:= 67.7;
textTPACount := 96;
end;

with result[MIME_EMOTE_CRY8] do
begin
name := 'Cry';
ShiftSmall:= 1790;
ShiftBig:= 2563;
ShiftPercent:= 69.8;
textTPACount := 54;
end;

with result[MIME_EMOTE_CLIMB8] do
begin
name := 'Climb Rope';
ShiftSmall:= 9407;
ShiftBig:= 14423;
ShiftPercent:= 65.2;
textTPACount := 168;
end;

with result[MIME_EMOTE_LEAN8] do
begin
name := 'Lean on Air';
ShiftSmall:= 8733;
ShiftBig:= 14064;
ShiftPercent:= 62.1;
textTPACount := 148;
end;

with result[MIME_EMOTE_LAUGH8] do
begin
name := 'Laugh';
ShiftSmall:= 7396;
ShiftBig:= 8614;
ShiftPercent:= 85.9;
textTPACount := 101;
end;
end;

(**
* Author: Coh3n
* Description: Prints the 'emote' to the debug box.
*)
procedure Mime_DebugEmote(emote: TMimeEmote);
begin
addToSRLLog('Name:= '''';');
addToSRLLog(' ShiftSmall:= '+toStr(emote.shiftSmall)+';');
addToSRLLog(' ShiftBig:= '+toStr(emote.shiftBig)+';');
emote.shiftPercent:= (emote.shiftPercent * 10);
emote.shiftPercent:= round(emote.shiftPercent);
emote.shiftPercent:= (emote.shiftPercent / 10); //shorten remainers
addToSRLLog(' ShiftPercent:= '+toStr(emote.shiftPercent)+';');
end;

(**
* Author: Coh3n
* Description: Sets up the screen to solve the random.
*)
procedure Mime_Setup();
begin
if (not loggedIn()) then
exit;

doConversation('', false); // get past GE messages

// click front of stage & move the mouse away from chat box so text can be recognized
mouse(250, 300, 10, 10, mouse_Left);
mouse(MCX2 + 30 + random(100), 170, 100, 100, mouse_Move);
end;

(**
* Author: Coh3n
* Description: Returns true if the Mime is performing an Emote. While the
* Mime is performing, there's always the same black text in the chat box.
*)
function Mime_IsPerforming(): boolean;
var lk, kl: Integer;
begin
result := (findcolortolerance(lk,kl,11503238, MCX1, MCY1, MCX2, MCY2, 19));
if (result = true) then
begin
result:= false;
end else
begin
result:= true;
end;
end;

(**
* Author: Coh3n
* Description: Returns the total pixel shifting over the specified scanning
* time. The results from this are in Mime_GetEmotes, so if scanning constants
* change, the records may need to change as well.
*)
const
_MIME_SCAN_TIME = 3000; // time to scan for pixel shifting
_MIME_SCAN_AFTER = 1500; // wait time AFTER perfomance starts (i.e. Mime_IsPerforming returns true); lessens the affect of the spotlight
_MIME_SCAN_DIV = 15; // determines pixel shift interval

function Mime_ScanMime(): TMimeEmote;
var
t: integer;
shiftBoxes: TBoxArray;
tmpShifts: TIntegerArray;
begin
wait(_MIME_SCAN_AFTER); // wait until after the spotlight appears

t := (getSystemTime + _MIME_SCAN_TIME);

shiftBoxes := [ intToBox(400, 80, 510, 230), // box around the entire Mime
intToBox(440, 82, 510, 145) ]; // box around the upper body of the mime

// get the total pixel shift over the total scanning time
while (getSystemTime < t) do
begin
tmpShifts := pixelShiftMulti(shiftBoxes, _MIME_SCAN_TIME div _MIME_SCAN_DIV);
result.shiftBig := result.shiftBig + tmpShifts[0];
result.shiftSmall := result.shiftSmall + tmpShifts[1];
end;

result.shiftPercent := (result.shiftSmall / extended(result.shiftBig)) * 100;

// waits for performance to be over
t := (getSystemTime + 5000);
while (Mime_IsPerforming() and (getSystemTime < t)) do
wait(50 + random(25));
end;

(**
* Author: Coh3n
* Description: Returns the corresponding Mime's emote constant (see top). Uses
* Wizzup?'s scoring system to decide which emote was found.
*)
function Mime_IdentifyEmote(emotes: TMimeEmoteArray): integer;
var
i, maxScore, maxIndex: integer;
tmpEmote: TMimeEmote;
scores: TIntegerArray;
begin
if (not loggedIn()) then
exit;

result := -1;
setLength(scores, length(emotes));

// wait for the performance to start before scanning
if (waitFunc(@Mime_IsPerforming, 50, 10000)) then
begin
addToSRLLog('Mime_IdentifyEmote: Identifying emote');
tmpEmote := Mime_ScanMime();

{$IFDEF DEBUG_MIME}
tmpEmote.name := 'Scanned Emote';
Mime_DebugEmote(tmpEmote);
{$ENDIF}
end;

// loop through emotes to see which fits
for i := 0 to high(emotes) do
begin
// checks if big/small shifts are in range of emotes[i]
if (inRange(tmpEmote.shiftSmall, emotes[i].shiftSmall - 1500, emotes[i].shiftSmall + 1500)) then
scores[i] := scores[i] + 6;

if (inRange(tmpEmote.shiftBig, emotes[i].shiftBig - 1500, emotes[i].shiftBig + 1500)) then
scores[i] := scores[i] + 6;

// check if pixel shifting is in range of min/max
if (inRange(tmpEmote.shiftBig + tmpEmote.shiftSmall div 2, emotes[i].shiftSmall, emotes[i].shiftBig)) then
scores[i] := scores[i] + 4;

// in range of emote's shiftPercet +/- 3%
if (scores[i] <> 0) then
if (tmpEmote.shiftPercent = emotes[i].shiftPercent) then
scores[i] := scores[i] + 15
else
if ((tmpEmote.shiftPercent > (emotes[i].shiftPercent - 3)) and (tmpEmote.shiftPercent < (emotes[i].shiftPercent + 3))) then
scores[i] := scores[i] + 9;
end;

// get the highest score, set result
maxScore := -1;
maxIndex := -1;
for i := 0 to high(scores) do
if (scores[i] > maxScore) then
begin
maxScore := scores[i];
maxIndex := i;
end;

// didn't ID if score is too low
if (maxScore > 0) then
result := maxIndex;

if (result <> -1) then
addToSRLLog('Mime_IdentifyEmote: Found emote '+emotes[result].name+' with a score of '+toStr(maxScore))
else
addToSRLLog('Mime_IdentifyEmote: Didn''t identify emote');
end;

(**
* Author: Coh3n
* Description: Returns a TBox of the 'Text' slot. Starts at 1 and goes across
* the chat box.
*)
function Mime_TextBox(slot: integer): TBox;
begin
result := gridBox(slot, 4, 2, 90, 20, 90, 40, point(100, 397));
end;

(**
* Author: Coh3n
* Description: Returns the tpa length of the text color for 'text'. See
* Mime_TextBox.
*)
function Mime_GetTextTPA(text: integer): integer;
var
tpa: TPointArray;
b: TBox;
begin
if (not loggedIn()) then
exit;

b := Mime_TextBox(text);

// the colour of the main text (not shadow)
if (findColorsTolerance(tpa, 11174789, b.x1, b.y1, b.x2, b.y2, 10)) then
result := length(tpa);

//addToSRLLog('slot: '+toStr(text)+' length: '+toStr(result));
end;

(**
* Author: Coh3n
* Description: Clicks the text in the chat box for the 'Emote'.
*)
function Mime_ClickText(emote: TMimeEmote): boolean;
var
i, len: integer;
p: TPoint;
begin
if (not loggedIn()) then
exit;

// loop through each "text box" in the chat box to find the correct text
for i := 1 to 8 do
begin
len := Mime_GetTextTPA(i);

// +/- tolerance on TPA count just in case
if (inRange(len, emote.textTPACount - 3, emote.textTPACount + 3)) then
begin
addToSRLLog('Mime_ClickText: Clicked text '+emote.name);
p := middleBox(Mime_TextBox(i));
mouse(p.x, p.y, 10, 3, mouse_Left);
wait(1500 + random(500));

// move the mouse away from text so text color can be found later
mmouse(MCX2 + 30 + random(30), 170, 50, 50);
result := true;
break;
end;
end;

if (not result) then
addToSRLLog('Mime_ClickText: Unable to click text - '+emote.name);
end;

(**
* Author: Coh3n
* Description: Identifies and performs the Mime's emote.
*)
function Mime_DoEmote(emotes: TMimeEmoteArray): boolean;
var
i, t: integer;
begin
if (not loggedIn()) then
exit;

i := Mime_IdentifyEmote(emotes);
if (i <> -1) then
begin
t := (getSystemTime + 5000);
while (getSystemTime < t) do
if (Mime_ClickText(emotes[i])) then
begin
result := true;
break;
end;
end;
end;

(**
* Author: Coh3n
* Description: Solves the random.
*)
function Mime_Solve(): boolean;
var
t: integer;
emotes: TMimeEmoteArray;
begin
if (not loggedIn()) then
exit;

Mime_Setup();
emotes := Mime_GetEmotes();

// perform emotes until finished or tries is exceeded
repeat
Inc(t);
Mime_DoEmote(emotes);
result := (not Mime_Detect() and (loggedIn()));
until(result or (t > 30));

if (not result) then
addToSRLLog('Mime_Solve: Mime solver exceeded maximum tries');
end;

(**
* Author: Coh3n
* Description: Used to gather data for the emote records.
*)
procedure Mime_GatherData(times: integer);
var
i: integer;
tmpEmote: TMimeEmote;
Emote: TMimeEmoteArray;
begin
for i := 1 to times do
begin
// need to reset so properties are accurate
tmpEmote.shiftSmall := 0;
tmpEmote.shiftBig := 0;
tmpEmote.shiftPercent := 0;

if (waitFunc(@Mime_IsPerforming, 50, 10000)) then
begin

//Emote := Mime_GetEmotes();
// Mime_IdentifyEmote(Emote);
tmpEmote.name := toStr(i);
tmpEmote := Mime_ScanMime();
Mime_DebugEmote(tmpEmote);
end;
end;
end;

Flight
02-06-2014, 05:50 AM
I saw a few posts back of trouble with the box solver; have you made progress with that recently? That's one I've yet to work on and it's a very common random event.


Let me know if there are anymore updates to push

If there's any updates to OSRS that have an effect on SRL-OSR I'll probably whip something up for them, but everything else is going into AL.

Ashaman88
02-06-2014, 06:10 AM
I saw a few posts back of trouble with the box solver; have you made progress with that recently? That's one I've yet to work on and it's a very common random event.



If there's any updates to OSRS that have an effect on SRL-OSR I'll probably whip something up for them, but everything else is going into AL.

Hmm what is AL?

The Mayor
02-06-2014, 06:46 AM
Hmm what is AL?

#DatSig (http://villavu.com/forum/usertag.php?do=list&action=hash&hash=DatSig)

Hoodz
02-06-2014, 08:18 AM
I also have this Mime solver for srl which I haven't had the chance to test, but I recorded all new info for each emote, and increased the emotearray size from 8 to 64 (8 different comparisons for each emote during scoring).. Theoretically it should do a lot better to solve, but didn't get the chance to test it sorry:


wow nice job!

Solar
02-06-2014, 08:25 AM
I can't do any testing anymore but the updates look great. Good work guys. :)

Krazy_Meerkat
02-06-2014, 09:51 AM
I saw a few posts back of trouble with the box solver; have you made progress with that recently? That's one I've yet to work on and it's a very common random event.



If there's any updates to OSRS that have an effect on SRL-OSR I'll probably whip something up for them, but everything else is going into AL.

The box solver remains unreleased because it's not safe to use..
I know you'll enjoy solving it just as much as I have, flight ;)
Shouldn't you be posting all your antirandom work to SRL-OSR btw?


Went ahead and added these randoms updates to OSR

https://github.com/SRL/SRL-OSR/commit/308128624c0285d9ccc365a5bc0e5a95fe66c1de

Thanks Ashaman for pushing these to the official include <3

The Mayor
02-06-2014, 10:09 AM
Flight is it your intention that AL will replace SRL-OSR?

Flight
02-06-2014, 10:46 AM
The box solver remains unreleased because it's not safe to use..
I know you'll enjoy solving it just as much as I have, flight ;)
Shouldn't you be posting all your antirandom work to SRL-OSR btw?


Oh I'm thrilled about working on it. :frusty: My work goes to the random solvers in AL actually.


Flight is it your intention that AL will replace SRL-OSR?

For my scripts absolutely, and who ever wants to use it (when released) is more than welcome to. :smile:

Hoodz
02-06-2014, 11:13 AM
Oh I'm thrilled about working on it. :frusty: My work goes to the random solvers in AL actually.



For my scripts absolutely, and who ever wants to use it (when released) is more than welcome to. :smile:

will it be compatible with pascalscript?

lollol012
02-07-2014, 01:33 PM
Hey there. Reporting in with a Pinball bug.

Basically, it solves the puzzle perfectly, but ironically enough, it can't seem to find the exit out of the cave. It tries to find a route, goes to one of the orbs, and just clicks on the tile where the player is standing.



***** Found Random: Pinball *****
PB_ScanPost: Found post
PB_TagPost: Tagged post
PB_ScanPost: Found post
PB_TagPost: Tagged post
PB_ScanPost: Found post
PB_TagPost: Tagged post
PB_ScanPost: Found post
PB_TagPost: Tagged post
PB_ScanPost: Found post
PB_TagPost: Tagged post
PB_ScanPost: Found post
PB_TagPost: Tagged post
PB_ScanPost: Found post
PB_ScanPost: Found post
PB_TagPost: Tagged post
PB_ScanPost: Found post
PB_TagPost: Tagged post
PB_ScanPost: Found post
PB_TagPost: Tagged post
PB_ScanPost: Found post
PB_TagPost: Tagged post
PB_Exit: Exiting cave
PB_Exit: Took to long to find exit... Looking for backup
PB_Exit: Failed to exit
PB_Exit: Exiting cave
PB_Exit: Took to long to find exit... Looking for backup
PB_Exit: Failed to exit
PB_Exit: Exiting cave
PB_Exit: Took to long to find exit... Looking for backup
PB_Exit: Failed to exit
PB_Exit: Exiting cave
PB_Exit: Took to long to find exit... Looking for backup
PB_Exit: Failed to exit
PB_Exit: Exiting cave
PB_Exit: Took to long to find exit... Looking for backup
PB_Exit: Failed to exit
PB_Exit: Exiting cave
PB_Exit: Took to long to find exit... Looking for backup
PB_Exit: Failed to exit
PB_Exit: Exiting cave
PB_Exit: Took to long to find exit... Looking for backup
PB_Exit: Failed to exit
PB_Exit: Exiting cave
PB_Exit: Took to long to find exit... Looking for backup
PB_Exit: Failed to exit
PB_Exit: Exiting cave
PB_Exit: Took to long to find exit... Looking for backup
PB_Exit: Failed to exit
PB_Exit: Exiting cave
(Solved manually from here)



Screenshots of another event today, by the time it solved it and was staggering around the cave:
http://i.imgur.com/oQtyL0q.png
http://i.imgur.com/giUbrQI.png

Hoodz
02-07-2014, 01:46 PM
Hey there. Reporting in with a Pinball bug.

Basically, it solves the puzzle perfectly, but ironically enough, it can't seem to find the exit out of the cave. It tries to find a route, goes to one of the orbs, and just clicks on the tile where the player is standing.




Screenshots of another event today, by the time it solved it and was staggering around the cave:
http://i.imgur.com/oQtyL0q.png
http://i.imgur.com/giUbrQI.png
do you have the latest version of srl-osr?

Ashaman88
02-07-2014, 01:55 PM
Yeah you have to manually update your osr


Oh I'm thrilled about working on it. :frusty: My work goes to the random solvers in AL actually.



For my scripts absolutely, and who ever wants to use it (when released) is more than welcome to. :smile:

I'm confused as to why you don't just work on/change the OSR include, as a dev they would let you on there to change things + other people could help. Or are you making the same kind of huge changes like there were from srl5-6?

From what I understand the osr include should be able to do everything you need it to (apart from randoms) ie I think I fixed all of the broken stuff.

slacky
02-07-2014, 02:41 PM
will it be compatible with pascalscript?
That would be a big drawback, so I really hope not.

Ashaman88, SRL-OSR is not utilizing the capabilities of Lape, so a new include is better (if u ask me).

lollol012
02-07-2014, 04:51 PM
do you have the latest version of srl-osr?

Well, I actually fully reinstalled Simba yesterday (When reflection broke and I didn't read the thread about it having a new update -.-). So I downloaded all the recent versions of Simba, OSR-SRL, etc... Did run any possible updates, too, including SRL.

That being said, I'll try to see if this can be replicated in the same event. It might take some time though, it's not THAT common.



EDIT
Got the event again, and let the Antirandom solve it. After tagging the posts, it made a few attempts to exit the cave, and eventually (after 3 failed tries) managed to get out. Whatever method it uses, while sometimes it can solve the problem, seems very inconsistent.
I honestly think turning the camera South, walking til you hit the wall, and walking right/left til you find the entrance would find the way 100% of the time. Just my opinion though.

Flight
02-08-2014, 02:28 AM
I'm confused as to why you don't just work on/change the OSR include, as a dev they would let you on there to change things + other people could help. Or are you making the same kind of huge changes like there were from srl5-6?

From what I understand the osr include should be able to do everything you need it to (apart from randoms) ie I think I fixed all of the broken stuff.

It's a project I've been working on for quite some time actually. I've made it for many reasons, but the simplest to explain here would be that AeroLib contains my own style which I don't want to force upon the official SRL-OSR. I've made it as up-to-date as possible, it's better organized, and many neat ideas that have been suggested on the forums I've placed in the library. It's intended to be an upgraded version of SRL-OSR, as much difference as SRL-5 to SRL-6.

A good portion of SRL-OSR is still used in AeroLib but the majority of it was written from scratch. It's far too different to apply my changes to the current SRL-OSR include because many of the files are dependent upon one another; how I've personally wanted it to be all along. I've many projects I want to bring to AeroLib that are far from the traditional SRL format. Even if SRL-OSR could support them it'd raise a lot of questions with the other developers and I really prefer to avoid that. This way I don't have to limit my ideas and how I present them, as I'm also much more open to other people's suggestions on development.


That would be a big drawback, so I really hope not.

Ashaman88, SRL-OSR is not utilizing the capabilities of Lape, so a new include is better (if u ask me).

Lape indeed. Although I feel like I've only utilized such a tiny amount of Lape's potential, but it's been fun learning so far. :smile:

slacky
02-08-2014, 02:39 AM
...
I demand that you GitHub it ASAP.

Flight
02-08-2014, 03:02 AM
I demand that you GitHub it ASAP.

I'd like to get a lot more finished before I start uploading to GitHub.

Edit:
The Pinball random solver worked wonderfully. It finished a game smoothly in 80-90 seconds.

Solar
03-18-2014, 11:37 AM
The box.simba random solver now encounters an error, if you are still working on this (which I don't think you are?)
Error: Out Of Range at line 417

Flight
03-20-2014, 09:42 AM
The box.simba random solver now encounters an error, if you are still working on this (which I don't think you are?)
Error: Out Of Range at line 417

Not for SRL-OSR, no.

jhildy
08-10-2014, 01:39 AM
Made a Molly Solver


program R_MollySolve;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/misc/al_functions.simba}
{$I SRL-OSR/SRL/Reflection/Reflection.simba}

VAR
Molly: TNPC;
Fakes: array of TNPC;
StartArea, RandomArea: TBox;
PlayerLoc, CraneLoc, DoorLoc, mousetile: TPoint;
i: Integer;
Twin,t: TNPC;

Function InMollyRoom: Boolean;
begin
if (R_FindNPC('Molly', Molly)) then
begin
writeln('found molly: ' + inttostr(Molly.NPCId));
Result := true;
end;
end;

Procedure WalkOutDoor;
var DoorLoc, Coord: TPoint;

begin
DoorLoc := Point((R_GetTileGlobal.x + 2), R_GetTileGlobal.y);
R_OpenDoor(DoorLoc, 'E');
repeat
wait(100);
until(FindNPCChatText('Molly', Nothing));
clicktoContinue;
ChatWait;
ChatWait;
if FindNPCChatText('Select', Nothing) then
begin
FindNPCChatText('know', ClickLeft);
ChatWait;
ChatWait;
ClickToContinue;
ChatWait;
ChatWait;
ClickToContinue;
wait(2000);
end;
end;

Function GoToControls: Boolean;
var ControlBoxLoc, BoxCoords: TPoint;
begin
MakeCompass('E');
ControlBoxLoc := Point((R_getTileGlobal.x + 5), (R_getTileGlobal.y - 2));
BoxCoords := R_TileToMS(ControlBoxLoc);
MMouse(BoxCoords.x, BoxCoords.y, 3, 3);
wait(200+random(200));
if (IsUpText('panel')) then
begin
clickmouse2(Mouse_left);
end;
end;

Function OnControls: Boolean;
var x, y: Integer;
begin
result := findcolortolerance(x,y,39423,665,212,723,257,1);
end;

Function findEvilTwin: TNPC;
var tempTNPCArray: TNPCArray;
tmp: TNPC;
i, loc, lowestID: integer;
begin
tempTNPCArray := R_GetAllNPCs;
lowestID := 10000000;
for i := 0 to high(tempTNPCArray) do
begin
if (tempTNPCArray[i].Index < lowestID) then
begin
lowestId := tempTNPCArray[i].index;
loc := i;
end;
end;
result := tempTNPCArray[loc];

end;

Procedure ControlArm(dir: String; var Coord: Tpoint);
begin
case dir of
'u': begin
Mouse(640, 290, 1, 1, Mouse_left);
dec(Coord.y);
wait(300+random(500))
end;
'd': begin
Mouse(639, 385, 1, 1, Mouse_left);
inc(Coord.y);
wait(300+random(500))
end;
'l': begin
Mouse(593, 333, 1, 1, Mouse_left);
inc(Coord.x);
wait(300+random(500))
end;
'r': begin
Mouse(693, 330, 1, 1, Mouse_left);
dec(Coord.x);
wait(300+random(500))
end;
end;
end;

Function overFake: boolean;
begin
R_FindNPC(t.NPCID, Twin);
Result:= ((CraneLoc.x = Twin.Tile.x) and (CraneLoc.y = Twin.Tile.y))
end;


Function GoUp:Boolean;
begin
R_FindNPC(t.NPCID, Twin);
Result := (CraneLoc.y > Twin.tile.y);
end;

Function GoDown: Boolean;
begin
R_FindNPC(t.NPCID, Twin);
Result := (CraneLoc.y < Twin.tile.y);
end;

Function GoRight: Boolean;
begin
R_FindNPC(t.NPCID, Twin);
Result := (CraneLoc.x > Twin.tile.x);
end;

Function GoLeft: Boolean;
begin
R_FindNPC(t.NPCID, Twin);
Result := (CraneLoc.x < Twin.tile.x);
end;

Function WaitForControl:boolean;
begin
repeat
wait(100);
until(GetColor(699, 234) = 39423)
result := true;
end;


Function CatchTheFake:Boolean;
var xStart: Tpoint;
dir: String;
i, yDis, xDis:Integer;
begin

CraneLoc.x := R_GetTileGlobal.x;
CraneLoc.y := R_GetTileGlobal.y - 4;
repeat
R_FindNPC(t.NPCID, Twin);
begin
if (overFake) then
begin
Mouse(699,423,2,2,Mouse_left);
continue;
end;
if GoUp then
begin
R_FindNPC(t.NPCID, Twin);
ControlArm('u',CraneLoc);
continue;
end;
if GoDown then
begin
R_FindNPC(t.NPCID, Twin);
ControlArm('d',CraneLoc);
continue;
end;
if GoLeft then
begin
R_FindNPC(t.NPCID, Twin);
ControlArm('l',CraneLoc);
continue;
end else
if GoRight then
begin
R_FindNPC(t.NPCID, Twin);
ControlArm('r',CraneLoc);
continue;
end;

end;
until(FindBlackChatMessage('Evil'));
end;

Procedure BackToDoor;
begin
doorLoc.x:= R_GetTileGlobal.x - 5;
doorLoc.y:= R_GetTileGlobal.y + 1;
R_OpenDoor(doorLoc,'W');
end;

Procedure WaitTilInRoom;
var PlayerLoc: TPoint;
begin
repeat
wait(100);
until(R_FindNPC('Molly',Molly));
PlayerLoc := R_TileToMS(Molly.Tile)
Mouse(playerLoc.x, PlayerLoc.Y, 1, 1, Mouse_Left);
end;

begin
SetupSRL;
SetupReflection;
ActivateClient;
if InMollyRoom then
begin
MakeCompass('N');
WalkOutDoor;
GoToControls;
WaitForControl;
t:= findEvilTwin;
CatchTheFake;
repeat
wait(100);
until(FindNPCCHatText('Molly',nothing));
ClickToContinue;
ChatWait;
ClickToContinue;
makeCompass('w');
doorLoc.x:= R_GetTileGlobal.x - 5;
doorLoc.y:= R_GetTileGlobal.y + 1;
mousetile := R_TileToMS(doorLoc);
Mouse(mouseTile.x, Mousetile.y, 1, 1, Mouse_left)
wait(4000);
R_OpenDoor(R_GetTileGlobal,'W');
waitTilInRoom;
wait(1000);
clicktoContinue;
ChatWait;
ChatWait;
ClickToContinue;
ChatWait;
ChatWait;
ClickToContinue;
end;




end.

Krazy_Meerkat
08-12-2014, 06:49 AM
Made a Molly Solver

Well done for contributing mate, looks like it works, but are you sure that the evil twin's index is always the lowest? How many times have you tested this solver?
You could also post this in the reflection thread, since this thread related to the SRL-OSR include's colour random solvers. Thanks for posting anyways :D

ineedbot
08-12-2014, 08:46 AM
Made a Molly Solver


program R_MollySolve;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/misc/al_functions.simba}
{$I SRL-OSR/SRL/Reflection/Reflection.simba}

VAR
Molly: TNPC;
Fakes: array of TNPC;
StartArea, RandomArea: TBox;
PlayerLoc, CraneLoc, DoorLoc, mousetile: TPoint;
i: Integer;
Twin,t: TNPC;

Function InMollyRoom: Boolean;
begin
if (R_FindNPC('Molly', Molly)) then
begin
writeln('found molly: ' + inttostr(Molly.NPCId));
Result := true;
end;
end;

Procedure WalkOutDoor;
var DoorLoc, Coord: TPoint;

begin
DoorLoc := Point((R_GetTileGlobal.x + 2), R_GetTileGlobal.y);
R_OpenDoor(DoorLoc, 'E');
repeat
wait(100);
until(FindNPCChatText('Molly', Nothing));
clicktoContinue;
ChatWait;
ChatWait;
if FindNPCChatText('Select', Nothing) then
begin
FindNPCChatText('know', ClickLeft);
ChatWait;
ChatWait;
ClickToContinue;
ChatWait;
ChatWait;
ClickToContinue;
wait(2000);
end;
end;

Function GoToControls: Boolean;
var ControlBoxLoc, BoxCoords: TPoint;
begin
MakeCompass('E');
ControlBoxLoc := Point((R_getTileGlobal.x + 5), (R_getTileGlobal.y - 2));
BoxCoords := R_TileToMS(ControlBoxLoc);
MMouse(BoxCoords.x, BoxCoords.y, 3, 3);
wait(200+random(200));
if (IsUpText('panel')) then
begin
clickmouse2(Mouse_left);
end;
end;

Function OnControls: Boolean;
var x, y: Integer;
begin
result := findcolortolerance(x,y,39423,665,212,723,257,1);
end;

Function findEvilTwin: TNPC;
var tempTNPCArray: TNPCArray;
tmp: TNPC;
i, loc, lowestID: integer;
begin
tempTNPCArray := R_GetAllNPCs;
lowestID := 10000000;
for i := 0 to high(tempTNPCArray) do
begin
if (tempTNPCArray[i].Index < lowestID) then
begin
lowestId := tempTNPCArray[i].index;
loc := i;
end;
end;
result := tempTNPCArray[loc];

end;

Procedure ControlArm(dir: String; var Coord: Tpoint);
begin
case dir of
'u': begin
Mouse(640, 290, 1, 1, Mouse_left);
dec(Coord.y);
wait(300+random(500))
end;
'd': begin
Mouse(639, 385, 1, 1, Mouse_left);
inc(Coord.y);
wait(300+random(500))
end;
'l': begin
Mouse(593, 333, 1, 1, Mouse_left);
inc(Coord.x);
wait(300+random(500))
end;
'r': begin
Mouse(693, 330, 1, 1, Mouse_left);
dec(Coord.x);
wait(300+random(500))
end;
end;
end;

Function overFake: boolean;
begin
R_FindNPC(t.NPCID, Twin);
Result:= ((CraneLoc.x = Twin.Tile.x) and (CraneLoc.y = Twin.Tile.y))
end;


Function GoUp:Boolean;
begin
R_FindNPC(t.NPCID, Twin);
Result := (CraneLoc.y > Twin.tile.y);
end;

Function GoDown: Boolean;
begin
R_FindNPC(t.NPCID, Twin);
Result := (CraneLoc.y < Twin.tile.y);
end;

Function GoRight: Boolean;
begin
R_FindNPC(t.NPCID, Twin);
Result := (CraneLoc.x > Twin.tile.x);
end;

Function GoLeft: Boolean;
begin
R_FindNPC(t.NPCID, Twin);
Result := (CraneLoc.x < Twin.tile.x);
end;

Function WaitForControl:boolean;
begin
repeat
wait(100);
until(GetColor(699, 234) = 39423)
result := true;
end;


Function CatchTheFake:Boolean;
var xStart: Tpoint;
dir: String;
i, yDis, xDis:Integer;
begin

CraneLoc.x := R_GetTileGlobal.x;
CraneLoc.y := R_GetTileGlobal.y - 4;
repeat
R_FindNPC(t.NPCID, Twin);
begin
if (overFake) then
begin
Mouse(699,423,2,2,Mouse_left);
continue;
end;
if GoUp then
begin
R_FindNPC(t.NPCID, Twin);
ControlArm('u',CraneLoc);
continue;
end;
if GoDown then
begin
R_FindNPC(t.NPCID, Twin);
ControlArm('d',CraneLoc);
continue;
end;
if GoLeft then
begin
R_FindNPC(t.NPCID, Twin);
ControlArm('l',CraneLoc);
continue;
end else
if GoRight then
begin
R_FindNPC(t.NPCID, Twin);
ControlArm('r',CraneLoc);
continue;
end;

end;
until(FindBlackChatMessage('Evil'));
end;

Procedure BackToDoor;
begin
doorLoc.x:= R_GetTileGlobal.x - 5;
doorLoc.y:= R_GetTileGlobal.y + 1;
R_OpenDoor(doorLoc,'W');
end;

Procedure WaitTilInRoom;
var PlayerLoc: TPoint;
begin
repeat
wait(100);
until(R_FindNPC('Molly',Molly));
PlayerLoc := R_TileToMS(Molly.Tile)
Mouse(playerLoc.x, PlayerLoc.Y, 1, 1, Mouse_Left);
end;

begin
SetupSRL;
SetupReflection;
ActivateClient;
if InMollyRoom then
begin
MakeCompass('N');
WalkOutDoor;
GoToControls;
WaitForControl;
t:= findEvilTwin;
CatchTheFake;
repeat
wait(100);
until(FindNPCCHatText('Molly',nothing));
ClickToContinue;
ChatWait;
ClickToContinue;
makeCompass('w');
doorLoc.x:= R_GetTileGlobal.x - 5;
doorLoc.y:= R_GetTileGlobal.y + 1;
mousetile := R_TileToMS(doorLoc);
Mouse(mouseTile.x, Mousetile.y, 1, 1, Mouse_left)
wait(4000);
R_OpenDoor(R_GetTileGlobal,'W');
waitTilInRoom;
wait(1000);
clicktoContinue;
ChatWait;
ChatWait;
ClickToContinue;
ChatWait;
ChatWait;
ClickToContinue;
end;




end.


Well done for contributing mate, looks like it works, but are you sure that the evil twin's index is always the lowest? How many times have you tested this solver?
You could also post this in the reflection thread, since this thread related to the SRL-OSR include's colour random solvers. Thanks for posting anyways :D

The molly ID is not always the lowest NpcID. You can get the correct suspect NPC by getting the original molly ModelIDs, then checking the suspect's ModelIDs if it equals the original molly's.

jhildy
08-13-2014, 03:14 AM
nah it was the index that was the lowest but apparently that was just a coincidence so nvm lol. Gonna have to test some more times when i get the random. Everything else works though. How do you check model ID?

ineedbot
08-13-2014, 03:36 AM
nah it was the index that was the lowest but apparently that was just a coincidence so nvm lol. Gonna have to test some more times when i get the random. Everything else works though. How do you check model ID?

function R_GetRSNPCModelIDs(NPC_Comp:Integer):TIntegerArray ;
var i, j, _count, _id : integer;
begin
_Count := SmartGetFieldArraySize(SmartCurrentTarget, NPC_Comp, NPCComposite_getModelIDs, 0);
for i:=0 to _Count do begin
_id := SmartGetFieldArrayInt(SmartCurrentTarget, NPC_Comp, NPCComposite_getModelIDs, i);
if(_id <= 0)then
continue;
inc(j);
SetLength(Result, j);
result[j-1] := _id;
end;
end;
The hook and multiplier being 'l'.

Krazy_Meerkat
08-13-2014, 05:59 AM
The molly ID is not always the lowest NpcID. You can get the correct suspect NPC by getting the original molly ModelIDs, then checking the suspect's ModelIDs if it equals the original molly's.

I know you're trying to help, but I was already aware of this my friend. I was just asking if jhildy had tested his method because it's very easy to underestimate reflection antirandom solvers when you first start working on them.. I did my best to suggest the problem without demeaning jhildy's efforts.

Qw4rt6yu9
08-13-2014, 09:18 AM
now there is f2p wouldn't it be easier to get accounts that are in randoms? it would be nice if i could see a color random solver for all sometime soon, but that is an almost impossible task with only a few devs, and I'm just an amateur.

Krazy_Meerkat
08-16-2014, 05:16 AM
now there is f2p wouldn't it be easier to get accounts that are in randoms? it would be nice if i could see a color random solver for all sometime soon, but that is an almost impossible task with only a few devs, and I'm just an amateur.

There is no active development of the OSR include.. The community helps maintain it.

jhildy
08-28-2014, 05:46 AM
Yeah i made this very quickly and only tested it in one instance of the random. There should be a few more failsafes in it and if you can get the model ID added in it does work. The reason the door opening function and controls function were kind of messy was because the tiles are different in every instance of the random. But the claw works perfectly as long as it has the right npc targeted.

Edit: tested it in one instance several times after logging out so the npcs and tiles were different every time.