I Karma I
12-19-2006, 04:17 AM
Sorry man I can't find it :-|
BUT
Go here:
C:/Program Files/SCAR 2.0.3/includes/SRL/SRL/coreAntiRandoms
Open Box.scar, and edit it all to this:
{ var Newboxes, NONewboxes: Integer;
Description: Variables used during the boxfinding/solving process. }
var
Newboxes, NONewboxes: Integer;
{************************************************* ******************************
function FindNewBox: Boolean;
by: WT-Fakawi
Description: Returns True if Box is found;
************************************************** *****************************}
function FindNewBox: Boolean;
var
xb, yb: integer;
begin
if FindBitMapToleranceIn(NewBox, xb, yb, MIX1, MIY1, MIX2, MIY2, 20) then
begin
Players[CurrentPlayer].loc := 'New Box';
Result := True;
end;
end;
{************************************************* ******************************
function GambleNewBox: Boolean;
by: WT-Fakawi
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 GambleNewBox: Boolean;
var
xb, yb: integer;
begin
if FindBitMapToleranceIn(NewBox, xb, yb, MIX1, MIY1, MIX2, MIY2, 20) then
begin
Mouse(xb, yb, 0, 0, True);
Wait(2000);
case Random(3) 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(NewBox, xb, yb, MIX1, MIY1, MIX2, MIY2, 20) 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 GetBoxSide: Integer;
by: pups
Description: Gets Box side and returns Bitmap
************************************************** *****************************}
{************************************************* ******************************
function GetBoxSide: Integer;
by: pups
Description: Gets Box side and returns Bitmap
************************************************** *****************************}
function GetBoxSide: Integer;
var
Side, x, y: integer;
begin
Side := BitmapFromString(181, 181, '');
repeat
wait(1000) // this is what fixes the lag.
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;
CopyClientToBitmap(Side, 172, 45, 352, 225);
Result := Side;
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, Upchars, 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 OpenBox: Boolean;
by: pups fixed by Cheesehunk.
Description: Opens the box.
************************************************** *****************************}
function OpenBox: Boolean;
var
BoxBmp, i: integer;
begin
result := false;
BoxBmp:= BitmapFromString(17, 19, 'z78DAED95D10AC3200C457FC9E446' +
'AB8F6B56FFFF93E6D4878EAD106C290C34709EE4DC1024E28 9A5D' +
'49E19A954A54F9E4A9D66373B56563C2090ABCC0CCA949B9F 230B' +
'5F66EE7E474ABA9F8F1751D1467C4FAFDD31982951A47864B 6F3A' +
'8871F5D0DF9C7B884B086D5C2DE617D151F8CE0529567FCA6 1EC0' +
'1B6F3365A6CC947F49B1EFB4B194FE4FDDB833DDFBD00B686 DACE' +
'1');
GameTab(4);
wait(100+random(50));
if FindBitmapToleranceIn(BoxBmp, X, Y, 556, 206, 738, 463, 50) then
mouse(x, y, 10, 10, true)
freebitmap(BoxBmp);
i := 0;
repeat
if (getcolor(487, 39) = 13567) and (getcolor(350, 295) = 2304814) then
begin
result := true;
exit;
end;
wait(500);
i := i+1;
until i > 10;
end;
{************************************************* ******************************
function SolveBox: Boolean;
by: pups
Description: Solves the Box!
************************************************** *****************************}
function SolveBox: Boolean;
var
side, st: integer;
shapeQ, shape, ans: string;
numQ, num: integer;
x, y: integer;
c: tcanvas;
begin
while OpenBox do begin
writeln('Found a box, solving...');
wait(1000);
GetQuestion(numQ, shapeQ);
if (shapeQ = '') and (numQ = 10) then
continue;
writeln('Question is:');
if shapeQ = '' then
writeln('Which shape has number ' + IntToStr(numQ))
else
writeln('What number is the ' + shapeQ);
st := GetSystemTime;
repeat
side := GetBoxSide;
c := GetBitmapCanvas(side);
SaveBitmap(side, 'box_debug.bmp');
ProcessPicture(c, shape, num, 0);
freebitmap(side);
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, UpChars, 116, 286, 183, 311) then
mouse(120, 290, 30, 10, true);
if FindText(x, y, ans, UpChars, 235, 286, 302, 311) then
mouse(240, 290, 30, 10, true);
if FindText(x, y, ans, UpChars, 350, 286, 417, 311) then
mouse(355, 290, 30, 10, true);
NewBoxes := NewBoxes + 1;
Writeln('******** SOLVED BOX RANDOM ********');
WriteFileString(TheFile, '******** SOLVED BOX RANDOM ********' + chr(13))
Result := True;
break;
end;
until GetSystemTime > st + 12000;
wait(1500 + random(1000));
end;
end;
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.