Does this go in randoms bugs?: if i have reflection antirandoms and use random tool, my scripts seem to log me out asap im in a random.
***** STR: FOUND RANDOM: 'Surprise Exam' *****
Screenshot of: Found Surprise Exam random 50 Seconds
***** STR: 'Surprise Exam' RANDOM SOLVING FAILED! *****
tested it with both color randoms and reflection randoms.i have my account in it if you guys need it.
EDIT: after a few days, and no reply, i got out of the random so i could continue botting
Last edited by x[Warrior]x3500; 06-11-2011 at 11:11 PM.
I forgot to comment a while ago, there was a problem with the grog princess random. If you logged in and were already talking to the frog (I restarted the script to watch if a second attempt would solve it) then it would try and find the princess and kiss her immediately. However the herald frog or whatever would say that you hadn't finished talking ( a simple 'ClickToContinue' thing) and he wouldn't let you kiss the princess and get out.
Basically
Log in while talking to herald
see's its talking with herald, runs off to find princess thinking herald part is done
herald says you cant talk to the princess as you haven't been told what to do.
Repeat the last to steps ad infinitum.
I don't know if this was a one off as something went wrong as i haven't had the frogs random since then.
The truth finally came out...
So, because noone pmd me details of acc in pp random i decided to post it without "in random tests" It is only tested on the bmps which i have.
Code was made in delphi, lazarus wasn't working for me :/ and it is compatible with scar. Anyone who want to work on this code, feel free to do it.
With love for You, Iroki
Code:library PrisonPete_scar; uses SysUtils, Classes, Windows, Math, Graphics; {$R *.res} type TSCARPlugFunc = record Name: ansistring; Ptr: Pointer; end; TOneStrProc = procedure(s: ansistring); TSCARWindowHandle = function(): Integer; type TRGB32 = packed record B, G, R, A: Byte; end; TRGB32Array = packed array[0..MaxInt div SizeOf(TRGB32) - 1] of TRGB32; PRGB32Array = ^TRGB32Array; TPointArray = array of TPoint; var Writeln: TOneStrProc; GetClientWindowHandle: TSCARWindowHandle; FillInfo: Boolean; {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Prison Pete By: Iroki ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} type AnimalCorner = record x1, y1, x2, y2: integer; end; function Pete_FindAnimal2(var px, py: Integer; AnimalId: Integer; ClientHDC: HDC): Boolean; stdcall; var BMP: TBitmap; Line: PRGB32Array; x, y, w, h: Integer; c: array of array of Integer; Found1: Boolean; AnimalCorners: AnimalCorner; {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There is no need to describe this procedure. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} procedure ColorAreaInsideBox(x1, y1, x2, y2: integer; Color1, Color2: TColor); var i, j: integer; begin for j := y1 to y2 do for i := x1 to x2 do if(c[i][j] = Color1) then c[i][j] := Color2; end; {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This function, like the name says, counts amount of pixels which are used to create animal. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} function CountAreaInsideBox(x1, y1, x2, y2: integer; Color: TColor): integer; var i, j, Area: integer; begin Area := 0; for j := y1 to y2 do for i := x1 to x2 do if(c[i][j] = Color) then Area := Area + 1; Result := Area; end; {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This function, like the name says, counts colored area inside "animal". Thanks to Nava2 for the little help :P ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} function CountColoredAreaInsideAnimal(x1, y1, x2, y2: integer; Color: TColor): integer; const ax : array[0..7] of ShortInt = (1, 0,-1, 0, 1, 1,-1,-1); ay : array[0..7] of ShortInt = (0, 1, 0,-1,-1, 1, 1,-1); var i, j, k, area: integer; tmp_bool: boolean; begin Area := 0; for j := y1 to y2 do for i := x1 to x2 do if(c[i][j] = Color) then begin tmp_bool := True; for k := 0 to 7 do if (c[i + ax[k]][j + ay[k]] <> Color) then begin tmp_bool := False; break; end; if tmp_bool then area := area + 1; end; Result := area; end; {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This function counts pixels used to create outline of animal. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} function CountOutlineInBox(x1, y1, x2, y2: integer; Color: TColor): integer; begin Result := (CountAreaInsideBox(x1, y1, x2, y2, Color) - CountColoredAreaInsideAnimal(x1, y1, x2, y2, Color)); end; {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ That lines of code was orginally created by Sky Scripter and were named "ScanFill". I have rewrited it completely, and now it SHOULD work properly. This procedure should theoreticaly find coordinates of "box" in which the baloon animal is. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} procedure FloodFillAndFindAnimalBoxCoords(x, y: integer; Color1, Color2: TColor); const xx : array[0..3] of ShortInt = (1, -1, 0, 0); yy : array[0..3] of ShortInt = (0, 0, 1, -1); var i: integer; begin if ((c[x][y] = Color1) and (x > 4) and (x < w - 4) and (y > 4) and (y < h - 4)) then begin c[x][y] := Color2; if (AnimalCorners.x1 > x) then AnimalCorners.x1 := x; if (AnimalCorners.x2 < x) then AnimalCorners.x2 := x; if (AnimalCorners.y1 > y) then AnimalCorners.y1 := y; if (AnimalCorners.y2 < y) then AnimalCorners.y2 := y; for i := 0 to 3 do FloodFillAndFindAnimalBoxCoords(x + xx[i], y + yy[i], Color1, Color2); end; end; {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There is no need to describe this function. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} function FindGoat(Color: TColor): boolean; var Outline, Area: integer; begin Result := False; Area := CountAreaInsideBox(AnimalCorners.x1, AnimalCorners.y1, AnimalCorners.x2, AnimalCorners.y2, Color); Outline := CountOutlineInBox(AnimalCorners.x1, AnimalCorners.y1, AnimalCorners.x2, AnimalCorners.y2, Color); if (InRange(Area,220, 320) and InRange(Outline, 105, 200)) then begin px := AnimalCorners.x1 + Round((AnimalCorners.x2 - AnimalCorners.x1)/2); py := AnimalCorners.y1 + Round((AnimalCorners.y2 - AnimalCorners.y1)/2); Result := True; end; end; {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Same as above. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} function FindCat(x1, y1, x2, y2: integer; Color: TColor): Boolean; var x, y, how, value, lastrowvalue, tvalue, countvalue, ones, twoes: integer; IsLongTail: boolean; begin if ((x2 - x1) > (y2 - y1 + 13)) then how := 1 else if ((x2 - x1) < (y2 - y1 + 13)) then how := 2 else how := 3; IsLongTail := False; lastrowvalue := 1; countvalue := 0; ones := 0; twoes := 0; Result := False; if (how = 1)then begin for x := x1 to x2 do begin value := 0; for y := y1 to y2 do if (c[x][y] = Color) then inc(value); tvalue := 0; if (value <= 5) and (value > 0) then tvalue := 1; if (value > 5) and (value < 20) then tvalue := 2; if not(tvalue <> 1) or not(tvalue <> 2) or not(tvalue <> 0) then begin if (lastrowvalue = tvalue) then begin inc(countvalue); end else begin if (countvalue <> 0) and (lastrowvalue <> 0) then begin if (countvalue > 2) or (lastrowvalue = 2) then begin if (lastrowvalue = 1) then inc(ones); if (lastrowvalue = 1) and (countvalue > 11) then IsLongTail := True; if (lastrowvalue = 2) then inc(twoes); end; countvalue := 1; lastrowvalue := tvalue; end; end; end; end; if (((ones < 3) and (ones > 0) and (twoes = 2)) or ((ones = 3) and (twoes = 2)) or ((ones = 3) and (twoes = 3)) or ((ones = 2) and (twoes = 3)) or ((ones = 1) and (twoes = 4))) and (IsLongTail) then begin px := x1 + Round((x2 - x1)/2); py := y1 + Round((y2 - y1)/2); Result := True; end; end; if (how = 2) then begin for y := y1 to y1 do begin value := 0; for x := x1 to x2 do if (c[x][y] = Color) then inc(value); tvalue := 0; if (value <= 5) and (value > 0) then tvalue := 1; if (value > 5) and (value < 20) then tvalue := 2; if not(tvalue <> 1) or not(tvalue <> 2) or not(tvalue <> 0) then begin if (lastrowvalue = tvalue) then begin inc(countvalue); end else begin if (countvalue <> 0) and (lastrowvalue <> 0) then begin if (countvalue > 2) or (lastrowvalue = 2) then begin if (lastrowvalue = 1) then inc(ones); if (lastrowvalue = 1) and (countvalue > 11) then IsLongTail := True; if (lastrowvalue = 2) then inc(twoes); end; countvalue := 1; lastrowvalue := tvalue; end; end; end; end; if (((ones < 3) and (ones > 0) and (twoes = 2)) or ((ones = 3) and (twoes = 2)) or ((ones = 3) and (twoes = 3)) or ((ones = 2) and (twoes = 3)) or ((ones = 1) and (twoes = 4))) and (IsLongTail) then begin px := x1 + Round((x2 - x1)/2); py := y1 + Round((y2 - y1)/2); Result := True; end; end; end; {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :P ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} function FindDog(x1, y1, x2, y2: integer; Color: TColor): boolean; var x, y,how, value,lastrowvalue, tvalue, countvalue, ones, twoes: integer; IsDog1, IsDog2: boolean; begin if ((x2 - x1) > (y2 - y1 + 13)) then how := 1 else if ((x2 - x1) < (y2 - y1 + 13)) then how := 2 else how := 3; IsDog1 := False; IsDog2 := False; lastrowvalue := 1; countvalue := 0; ones := 0; twoes := 0; Result := False; if (how = 1)then begin for x := x1 to x2 do begin value := 0; for y := y1 to y2 do if (c[x][y] = Color) then inc(value); tvalue := 0; if (value <= 5) and (value > 0) then tvalue := 1; if (value > 5) and (value < 20) then tvalue := 2; if not(tvalue <> 1) or not(tvalue <> 2) or not(tvalue <> 0) then begin if (lastrowvalue = tvalue) then begin inc(countvalue); end else begin if (countvalue <> 0) and (lastrowvalue <> 0) then begin if (countvalue > 2) or (lastrowvalue = 2) then begin if (lastrowvalue = 1) then inc(ones); if (lastrowvalue = 1) and (countvalue > 10) then IsDog1 := True; if (lastrowvalue = 2) and (countvalue > 8) then IsDog2 := True; if (lastrowvalue = 2) then inc(twoes); end; countvalue := 1; lastrowvalue := tvalue; end; end; end; end; if (((ones = 4) and (twoes = 3)) or ((ones = 3) and (twoes = 3)) or ((ones = 3) and (twoes = 2)) or ((ones = 2) and (twoes = 3))) and (not(IsDog1)) and (not(Isdog2)) then begin px := x1 + Round((x2 - x1)/2); py := y1 + Round((y2 - y1)/2); Result := True; end; end; if (how = 2) then begin for y := y1 to y1 do begin value := 0; for x := x1 to x2 do if (c[x][y] = Color) then inc(value); tvalue := 0; if (value <= 5) and (value > 0) then tvalue := 1; if (value > 5) and (value < 20) then tvalue := 2; if not(tvalue <> 1) or not(tvalue <> 2) or not(tvalue <> 0) then begin if (lastrowvalue = tvalue) then begin inc(countvalue); end else begin if (countvalue <> 0) and (lastrowvalue <> 0) then begin if (countvalue > 2) or (lastrowvalue = 2) then begin if (lastrowvalue = 1) then inc(ones); if (lastrowvalue = 1) and (countvalue > 10) then IsDog1 := True; if (lastrowvalue = 2) and (countvalue > 8) then IsDog2 := True; if (lastrowvalue = 2) then inc(twoes); end; countvalue := 1; lastrowvalue := tvalue; end; end; end; end; if (((ones = 4) and (twoes = 3)) or ((ones = 3) and (twoes = 3)) or ((ones = 3) and (twoes = 2)) or ((ones = 2) and (twoes = 3))) and (not(IsDog1)) and (not(Isdog2)) then begin px := x1 + Round((x2 - x1)/2); py := y1 + Round((y2 - y1)/2); Result := True; end; end; end; {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} function FindSheep(var x1, y1, x2, y2: integer; Color: TColor): boolean; var x, y, how, value, lastrowvalue, tvalue, countvalue, ones, twoes: integer; IsBigBody: boolean; begin if ((x2 - x1) > (y2 - y1 + 13)) then how := 1 else if ((x2 - x1) < (y2 - y1 + 13)) then how := 2 else how := 3; IsBigBody := False; lastrowvalue := 1; countvalue := 0; ones := 0; twoes := 0; Result := False; if (how = 1)then begin for x := x1 to x2 do begin value := 0; for y := y1 to y2 do if (c[x][y] = Color) then inc(value); tvalue := 0; if (value <= 5) and (value > 0) then tvalue := 1; if (value > 5) and (value < 15) then tvalue := 2; if (value > 15) and (value < 45) then tvalue := 3; if not(tvalue <> 1) or not(tvalue <> 2) or not(tvalue <> 0) or not(tvalue <> 3) then begin if (lastrowvalue = tvalue) then begin inc(countvalue); end else begin if (countvalue <> 0) and (lastrowvalue <> 0) then begin if (countvalue > 2) or (lastrowvalue = 2) then begin if (lastrowvalue = 1) then inc(ones); if (lastrowvalue = 2) and (countvalue > 11) then IsBigBody := True; if (lastrowvalue = 2) and (countvalue > 27) then IsBigBody := False; if (lastrowvalue = 2) then inc(twoes); end; countvalue := 1; lastrowvalue := tvalue; end; end; end; end; if (((ones < 4) and (ones > 0)) and ((twoes > 0) and(twoes < 3))) and (IsBigBody) and ((y2 - y1) < 27) then begin px := x1 + Round((x2 - x1)/2); py := y1 + Round((y2 - y1)/2); Result := True; end; end; if (how = 2) then begin for y := y1 to y2 do begin value := 0; for x := x1 to x2 do if (c[x][y] = Color) then inc(value); tvalue := 0; if (value <= 5) and (value > 0) then tvalue := 1; if (value > 5) and (value < 15) then tvalue := 2; if (value > 15) and (value < 45) then tvalue := 3; if not(tvalue <> 1) or not(tvalue <> 2) or not(tvalue <> 0) or not(tvalue <> 3) then begin if (lastrowvalue = tvalue) then begin inc(countvalue); end else begin if (countvalue <> 0) and (lastrowvalue <> 0) then begin if (countvalue > 2) or (lastrowvalue = 2) then begin if (lastrowvalue = 1) then inc(ones); if (lastrowvalue = 2) and (countvalue > 11) then IsBigBody := True; if (lastrowvalue = 2) and (countvalue > 27) then IsBigBody := False; if (lastrowvalue = 2) then inc(twoes); end; countvalue := 1; lastrowvalue := tvalue; end; end; end; end; if (((ones < 4) and (ones > 0)) and ((twoes > 0) and(twoes < 3))) and (IsBigBody) and ((x2 - x1) < 27)then begin px := x1 + Round((x2 - x1)/2); py := y1 + Round((y2 - y1)/2); Result := True; end; end; end; {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Main loop (ground detecting) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} begin w := 516; h := 338; Bmp := TBitmap.Create; Bmp.Width := w; Bmp.Height:= h; Bmp.PixelFormat := pf32bit; SetLength(c, w + 1, h + 1); BitBlt(Bmp.Canvas.Handle, 0, 0, w, h, ClientHDC, 0, 0, SRCCOPY); Result := False; //finding animals and coloring red for y := 4 to h - 4 do begin Line := bmp.ScanLine[y]; for x := 4 to w - 4 do begin c[x][y] := RGB(Line[x].R, Line[x].G, Line[x].B); if ((Line[x].G <> 0) and (Line[x].R > 150) and (Line[x].G < 120) and (Line[x].B > 120)) then c[x][y] := clred else c[x][y] := 0; end; end; Found1 := False; for y := 4 to h - 4 do for x := 4 to w - 4 do if (c[x][y] = clred) then begin if not Found1 then begin AnimalCorners.x1 := w - 4; AnimalCorners.x2 := 4; AnimalCorners.y1 := h - 4; AnimalCorners.y2 := 4; FloodFillAndFindAnimalBoxCoords(x, y, clred, clyellow); case AnimalId of 1: if FindGoat(clyellow) then Found1 := True; 2: if FindSheep(AnimalCorners.x1, AnimalCorners.y1, AnimalCorners.x2, AnimalCorners.y2, clyellow) then Found1 := True; 3: if FindCat(AnimalCorners.x1, AnimalCorners.y1, AnimalCorners.x2, AnimalCorners.y2, clyellow) then Found1 := True; 4: if FindDog(AnimalCorners.x1, AnimalCorners.y1, AnimalCorners.x2, AnimalCorners.y2, clyellow) then Found1 := True; end; end; end; Bmp.Free; if Found1 then Result := True; end; {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Prison Pete solver. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} function GetFunctionCount(): Integer; stdcall; export; begin Result := 1; end; function GetFunctionInfo(x: Integer; var ProcAddr: Pointer; var ProcDef: PAnsiChar): Integer; stdcall; begin case x of 0: begin ProcAddr := @Pete_FindAnimal2; StrPCopy(ProcDef, 'function Pete_FindAnimal2(var px, py: Integer; AnimalId: Integer; ClientHDC: HDC): Boolean;'); end; else x := -1; end; Result := x; end; procedure SetFunctions(Funcs: array of TSCARPlugFunc); stdcall; var i: Integer; begin for i := 0 to Length(Funcs) - 1 do begin if Funcs[i].Name = 'Writeln' then Writeln := Funcs[i].Ptr; if Funcs[i].Name = 'GetClientWindowHandle' then GetClientWindowHandle := Funcs[i].Ptr; end; FillInfo := false; end; exports GetFunctionCount; exports GetFunctionInfo; exports SetFunctions; end.
:P
Didn't test but it compiles. Also had to add units and get rid of Windows unit.
Lazarus
Simba Code:library libIroki;
{$mode objfpc}{$H+}
uses
cmem, Interfaces, Classes, Sysutils, {Windows,} Math, Graphics, IntfGraphics, LCLIntf, LCLType;
type
TRGB32 = packed record
B, G, R, A: Byte;
end;
TRGB32Array = packed array[0..MaxInt div SizeOf(TRGB32) - 1] of TRGB32;
PRGB32Array = ^TRGB32Array;
TPointArray = array of TPoint;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Prison Pete
By: Iroki
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
type
AnimalCorner = record
x1, y1, x2, y2: integer;
end;
function Pete_FindAnimal2(var px, py: Integer; AnimalId: Integer; ClientHDC: HDC): Boolean; stdcall;
var
BMP: TBitmap;
Line: PRGB32Array;
x, y, w, h: Integer;
c: array of array of Integer;
Found1: Boolean;
AnimalCorners: AnimalCorner;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There is no need to describe this procedure.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
procedure ColorAreaInsideBox(x1, y1, x2, y2: integer; Color1, Color2: TColor);
var
i, j: integer;
begin
for j := y1 to y2 do
for i := x1 to x2 do
if(c[i][j] = Color1) then c[i][j] := Color2;
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This function, like the name says, counts amount of pixels which are
used to create animal.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
function CountAreaInsideBox(x1, y1, x2, y2: integer; Color: TColor): integer;
var
i, j, Area: integer;
begin
Area := 0;
for j := y1 to y2 do
for i := x1 to x2 do
if(c[i][j] = Color) then Area := Area + 1;
Result := Area;
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This function, like the name says, counts colored area inside "animal".
Thanks to Nava2 for the little help :P
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
function CountColoredAreaInsideAnimal(x1, y1, x2, y2: integer; Color: TColor): integer;
const
ax : array[0..7] of ShortInt = (1, 0,-1, 0, 1, 1,-1,-1);
ay : array[0..7] of ShortInt = (0, 1, 0,-1,-1, 1, 1,-1);
var
i, j, k, area: integer;
tmp_bool: boolean;
begin
Area := 0;
for j := y1 to y2 do
for i := x1 to x2 do
if(c[i][j] = Color) then
begin
tmp_bool := True;
for k := 0 to 7 do
if (c[i + ax[k]][j + ay[k]] <> Color) then
begin
tmp_bool := False;
break;
end;
if tmp_bool then area := area + 1;
end;
Result := area;
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This function counts pixels used to create outline of animal.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
function CountOutlineInBox(x1, y1, x2, y2: integer; Color: TColor): integer;
begin
Result := (CountAreaInsideBox(x1, y1, x2, y2, Color) -
CountColoredAreaInsideAnimal(x1, y1, x2, y2, Color));
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
That lines of code was orginally created by Sky Scripter and were named "ScanFill".
I have rewrited it completely, and now it SHOULD work properly. This procedure should
theoreticaly find coordinates of "box" in which the baloon animal is.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
procedure FloodFillAndFindAnimalBoxCoords(x, y: integer; Color1, Color2: TColor);
const
xx : array[0..3] of ShortInt = (1, -1, 0, 0);
yy : array[0..3] of ShortInt = (0, 0, 1, -1);
var
i: integer;
begin
if ((c[x][y] = Color1) and (x > 4) and (x < w - 4) and (y > 4) and (y < h - 4)) then
begin
c[x][y] := Color2;
if (AnimalCorners.x1 > x) then AnimalCorners.x1 := x;
if (AnimalCorners.x2 < x) then AnimalCorners.x2 := x;
if (AnimalCorners.y1 > y) then AnimalCorners.y1 := y;
if (AnimalCorners.y2 < y) then AnimalCorners.y2 := y;
for i := 0 to 3 do
FloodFillAndFindAnimalBoxCoords(x + xx[i], y + yy[i], Color1, Color2);
end;
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There is no need to describe this function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
function FindGoat(Color: TColor): boolean;
var
Outline, Area: integer;
begin
Result := False;
Area := CountAreaInsideBox(AnimalCorners.x1, AnimalCorners.y1, AnimalCorners.x2, AnimalCorners.y2, Color);
Outline := CountOutlineInBox(AnimalCorners.x1, AnimalCorners.y1, AnimalCorners.x2, AnimalCorners.y2, Color);
if (InRange(Area,220, 320) and InRange(Outline, 105, 200)) then
begin
px := AnimalCorners.x1 + Round((AnimalCorners.x2 - AnimalCorners.x1)/2);
py := AnimalCorners.y1 + Round((AnimalCorners.y2 - AnimalCorners.y1)/2);
Result := True;
end;
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Same as above.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
function FindCat(x1, y1, x2, y2: integer; Color: TColor): Boolean;
var
x, y, how, value, lastrowvalue, tvalue, countvalue, ones, twoes: integer;
IsLongTail: boolean;
begin
if ((x2 - x1) > (y2 - y1 + 13)) then how := 1
else if ((x2 - x1) < (y2 - y1 + 13)) then how := 2
else how := 3;
IsLongTail := False;
lastrowvalue := 1;
countvalue := 0;
ones := 0;
twoes := 0;
Result := False;
if (how = 1)then
begin
for x := x1 to x2 do
begin
value := 0;
for y := y1 to y2 do
if (c[x][y] = Color) then inc(value);
tvalue := 0;
if (value <= 5) and (value > 0) then tvalue := 1;
if (value > 5) and (value < 20) then tvalue := 2;
if not(tvalue <> 1) or not(tvalue <> 2) or not(tvalue <> 0) then
begin
if (lastrowvalue = tvalue) then
begin
inc(countvalue);
end else
begin
if (countvalue <> 0) and (lastrowvalue <> 0) then
begin
if (countvalue > 2) or (lastrowvalue = 2) then
begin
if (lastrowvalue = 1) then inc(ones);
if (lastrowvalue = 1) and (countvalue > 11) then IsLongTail := True;
if (lastrowvalue = 2) then inc(twoes);
end;
countvalue := 1;
lastrowvalue := tvalue;
end;
end;
end;
end;
if (((ones < 3) and (ones > 0) and (twoes = 2)) or ((ones = 3) and (twoes = 2)) or ((ones = 3) and (twoes = 3)) or ((ones = 2) and (twoes = 3)) or ((ones = 1) and (twoes = 4))) and (IsLongTail) then
begin
px := x1 + Round((x2 - x1)/2);
py := y1 + Round((y2 - y1)/2);
Result := True;
end;
end;
if (how = 2) then
begin
for y := y1 to y1 do
begin
value := 0;
for x := x1 to x2 do
if (c[x][y] = Color) then inc(value);
tvalue := 0;
if (value <= 5) and (value > 0) then tvalue := 1;
if (value > 5) and (value < 20) then tvalue := 2;
if not(tvalue <> 1) or not(tvalue <> 2) or not(tvalue <> 0) then
begin
if (lastrowvalue = tvalue) then
begin
inc(countvalue);
end else
begin
if (countvalue <> 0) and (lastrowvalue <> 0) then
begin
if (countvalue > 2) or (lastrowvalue = 2) then
begin
if (lastrowvalue = 1) then inc(ones);
if (lastrowvalue = 1) and (countvalue > 11) then IsLongTail := True;
if (lastrowvalue = 2) then inc(twoes);
end;
countvalue := 1;
lastrowvalue := tvalue;
end;
end;
end;
end;
if (((ones < 3) and (ones > 0) and (twoes = 2)) or ((ones = 3) and (twoes = 2)) or ((ones = 3) and (twoes = 3)) or ((ones = 2) and (twoes = 3)) or ((ones = 1) and (twoes = 4))) and (IsLongTail) then
begin
px := x1 + Round((x2 - x1)/2);
py := y1 + Round((y2 - y1)/2);
Result := True;
end;
end;
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:P
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
function FindDog(x1, y1, x2, y2: integer; Color: TColor): boolean;
var
x, y,how, value,lastrowvalue, tvalue, countvalue, ones, twoes: integer;
IsDog1, IsDog2: boolean;
begin
if ((x2 - x1) > (y2 - y1 + 13)) then how := 1
else if ((x2 - x1) < (y2 - y1 + 13)) then how := 2
else how := 3;
IsDog1 := False;
IsDog2 := False;
lastrowvalue := 1;
countvalue := 0;
ones := 0;
twoes := 0;
Result := False;
if (how = 1)then
begin
for x := x1 to x2 do
begin
value := 0;
for y := y1 to y2 do
if (c[x][y] = Color) then inc(value);
tvalue := 0;
if (value <= 5) and (value > 0) then tvalue := 1;
if (value > 5) and (value < 20) then tvalue := 2;
if not(tvalue <> 1) or not(tvalue <> 2) or not(tvalue <> 0) then
begin
if (lastrowvalue = tvalue) then
begin
inc(countvalue);
end else
begin
if (countvalue <> 0) and (lastrowvalue <> 0) then
begin
if (countvalue > 2) or (lastrowvalue = 2) then
begin
if (lastrowvalue = 1) then inc(ones);
if (lastrowvalue = 1) and (countvalue > 10) then IsDog1 := True;
if (lastrowvalue = 2) and (countvalue > 8) then IsDog2 := True;
if (lastrowvalue = 2) then inc(twoes);
end;
countvalue := 1;
lastrowvalue := tvalue;
end;
end;
end;
end;
if (((ones = 4) and (twoes = 3)) or ((ones = 3) and (twoes = 3)) or ((ones = 3) and (twoes = 2)) or ((ones = 2) and (twoes = 3))) and (not(IsDog1)) and (not(Isdog2)) then
begin
px := x1 + Round((x2 - x1)/2);
py := y1 + Round((y2 - y1)/2);
Result := True;
end;
end;
if (how = 2) then
begin
for y := y1 to y1 do
begin
value := 0;
for x := x1 to x2 do
if (c[x][y] = Color) then inc(value);
tvalue := 0;
if (value <= 5) and (value > 0) then tvalue := 1;
if (value > 5) and (value < 20) then tvalue := 2;
if not(tvalue <> 1) or not(tvalue <> 2) or not(tvalue <> 0) then
begin
if (lastrowvalue = tvalue) then
begin
inc(countvalue);
end else
begin
if (countvalue <> 0) and (lastrowvalue <> 0) then
begin
if (countvalue > 2) or (lastrowvalue = 2) then
begin
if (lastrowvalue = 1) then inc(ones);
if (lastrowvalue = 1) and (countvalue > 10) then IsDog1 := True;
if (lastrowvalue = 2) and (countvalue > 8) then IsDog2 := True;
if (lastrowvalue = 2) then inc(twoes);
end;
countvalue := 1;
lastrowvalue := tvalue;
end;
end;
end;
end;
if (((ones = 4) and (twoes = 3)) or ((ones = 3) and (twoes = 3)) or ((ones = 3) and (twoes = 2)) or ((ones = 2) and (twoes = 3))) and (not(IsDog1)) and (not(Isdog2)) then
begin
px := x1 + Round((x2 - x1)/2);
py := y1 + Round((y2 - y1)/2);
Result := True;
end;
end;
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^^
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
function FindSheep(var x1, y1, x2, y2: integer; Color: TColor): boolean;
var
x, y, how, value, lastrowvalue, tvalue, countvalue,
ones, twoes: integer;
IsBigBody: boolean;
begin
if ((x2 - x1) > (y2 - y1 + 13)) then how := 1
else if ((x2 - x1) < (y2 - y1 + 13)) then how := 2
else how := 3;
IsBigBody := False;
lastrowvalue := 1;
countvalue := 0;
ones := 0;
twoes := 0;
Result := False;
if (how = 1)then
begin
for x := x1 to x2 do
begin
value := 0;
for y := y1 to y2 do
if (c[x][y] = Color) then inc(value);
tvalue := 0;
if (value <= 5) and (value > 0) then tvalue := 1;
if (value > 5) and (value < 15) then tvalue := 2;
if (value > 15) and (value < 45) then tvalue := 3;
if not(tvalue <> 1) or not(tvalue <> 2) or not(tvalue <> 0) or not(tvalue <> 3) then
begin
if (lastrowvalue = tvalue) then
begin
inc(countvalue);
end else
begin
if (countvalue <> 0) and (lastrowvalue <> 0) then
begin
if (countvalue > 2) or (lastrowvalue = 2) then
begin
if (lastrowvalue = 1) then inc(ones);
if (lastrowvalue = 2) and (countvalue > 11) then IsBigBody := True;
if (lastrowvalue = 2) and (countvalue > 27) then IsBigBody := False;
if (lastrowvalue = 2) then inc(twoes);
end;
countvalue := 1;
lastrowvalue := tvalue;
end;
end;
end;
end;
if (((ones < 4) and (ones > 0)) and ((twoes > 0) and(twoes < 3))) and (IsBigBody) and ((y2 - y1) < 27) then
begin
px := x1 + Round((x2 - x1)/2);
py := y1 + Round((y2 - y1)/2);
Result := True;
end;
end;
if (how = 2) then
begin
for y := y1 to y2 do
begin
value := 0;
for x := x1 to x2 do
if (c[x][y] = Color) then inc(value);
tvalue := 0;
if (value <= 5) and (value > 0) then tvalue := 1;
if (value > 5) and (value < 15) then tvalue := 2;
if (value > 15) and (value < 45) then tvalue := 3;
if not(tvalue <> 1) or not(tvalue <> 2) or not(tvalue <> 0) or not(tvalue <> 3) then
begin
if (lastrowvalue = tvalue) then
begin
inc(countvalue);
end else
begin
if (countvalue <> 0) and (lastrowvalue <> 0) then
begin
if (countvalue > 2) or (lastrowvalue = 2) then
begin
if (lastrowvalue = 1) then inc(ones);
if (lastrowvalue = 2) and (countvalue > 11) then IsBigBody := True;
if (lastrowvalue = 2) and (countvalue > 27) then IsBigBody := False;
if (lastrowvalue = 2) then inc(twoes);
end;
countvalue := 1;
lastrowvalue := tvalue;
end;
end;
end;
end;
if (((ones < 4) and (ones > 0)) and ((twoes > 0) and(twoes < 3))) and (IsBigBody) and ((x2 - x1) < 27)then
begin
px := x1 + Round((x2 - x1)/2);
py := y1 + Round((y2 - y1)/2);
Result := True;
end;
end;
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main loop (ground detecting)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
var
t: TLazIntfImage;
begin
w := 516; h := 338;
Bmp := TBitmap.Create;
Bmp.Width := w;
Bmp.Height:= h;
Bmp.PixelFormat := pf32bit;
SetLength(c, w + 1, h + 1);
BitBlt(Bmp.Canvas.Handle, 0, 0, w, h, ClientHDC, 0, 0, SRCCOPY);
Result := False;
//finding animals and coloring red
t := bmp.CreateIntfImage;
try
for y := 4 to h - 4 do
for x := 4 to w - 4 do
begin
c[x][y] := RGB(t.Colors[x, y].red, t.Colors[x, y].green, t.Colors[x, y].blue);
if ((t.Colors[x, y].green <> 0) and (t.Colors[x, y].red > 150) and (t.Colors[x, y].green < 120) and (t.Colors[x, y].blue > 120)) then
c[x][y] := clred
else
c[x][y] := 0;
end;
finally
t.Free;
end;
Found1 := False;
for y := 4 to h - 4 do
for x := 4 to w - 4 do
if (c[x][y] = clred) then
begin
if not Found1 then
begin
AnimalCorners.x1 := w - 4;
AnimalCorners.x2 := 4;
AnimalCorners.y1 := h - 4;
AnimalCorners.y2 := 4;
FloodFillAndFindAnimalBoxCoords(x, y, clred, clyellow);
case AnimalId of
1: if FindGoat(clyellow) then Found1 := True;
2: if FindSheep(AnimalCorners.x1, AnimalCorners.y1, AnimalCorners.x2, AnimalCorners.y2, clyellow) then Found1 := True;
3: if FindCat(AnimalCorners.x1, AnimalCorners.y1, AnimalCorners.x2, AnimalCorners.y2, clyellow) then Found1 := True;
4: if FindDog(AnimalCorners.x1, AnimalCorners.y1, AnimalCorners.x2, AnimalCorners.y2, clyellow) then Found1 := True;
end;
end;
end;
Bmp.Free;
if Found1 then Result := True;
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
End of Prison Pete solver.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
function GetFunctionCount(): Integer; stdcall; export;
begin
Result := 1;
end;
function GetFunctionInfo(x: Integer; var ProcAddr: Pointer; var ProcDef: PChar): Integer; stdcall; export;
begin
case x of
0: begin
ProcAddr := @Pete_FindAnimal2;
StrPCopy(ProcDef, 'function Pete_FindAnimal2(var px, py: Integer; AnimalId: Integer; ClientHDC: HDC): Boolean;');
end;
else
x := -1;
end;
Result := x;
end;
exports GetFunctionCount;
exports GetFunctionInfo;
initialization
end.
Updated the list a bit.
Would be nice to get some more activity towards SRL's solvers!
Feedback is a good place to start![]()
I level'd my guys a bit with an auto fighter recently. So I'll set them up on MSI again to have them get some randoms going...When I get home tonight.... MSI still uses SRL randoms and not Ref Randoms right?
~BraK
"Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."
It actually depends on what you set it to. If you choose to use Reflection walking, then MSI will use Reflection randoms.
You can change this by opening Antiban.simba and changing line 405 to this:
Simba Code:randomDone := FindNormalRandoms //R_FindRandoms
"Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."
I got a ScapeRune account... or is that Evil Bob?
Shows it as working fine with no known problems, but this script was using ref 2. Is there a different dev section for those randoms? Who should I contact with the account?
EDIT: Nvm found the ref 2 thread.
Last edited by Silent; 08-09-2011 at 12:42 AM.
I'm Silent SPYSecret project: 0%Need help? Send me a PM
Player went false saying it failed Drill Demon, but wasn't in the random. Seemed to solve perfectly.
E: PM'ing you ac account in Mordaut Exam.Progress Report:***** STR: FOUND RANDOM: 'Drill Demon' ***** Screenshot of: Found Drill Demon random 15 Hours, 1 Minutes and 24 Seconds Screenshot of: Found Demon 15 Hours, 1 Minutes and 27 Seconds Push 1: Jog mat 2: Sit-up mat 3: Push-up mat 4: Star Jump mat Star 1: Star Jump mat 2: Jog mat 3: Sit-up mat 4: Push-up mat Push DemonCenter - We are at the edge of the random area, fixing position. 1: Star Jump mat 2: Push-up mat 3: Sit-up mat 4: Jog mat Sit 1: Sit-up mat 2: Push-up mat 3: Jog mat 4: Star Jump mat Jog DemonCenter - We are at the edge of the random area, fixing position. 1: Push-up mat 2: Jog mat 3: Sit-up mat 4: Star Jump mat ***** STR: 'Drill Demon' RANDOM SOLVING FAILED! *****
Last edited by Coh3n; 08-10-2011 at 08:58 PM.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
For the demon account, the InRandom function must have returned true for some reason. Hard to tell without being able to watch it solve. :/
I know for a fact that the mordaut solver doesn't work right now and I don't really have an idea that hasn't been attempted, or the time to try that solver right now. However, I can make sure that SRL's detection for the random works and effectively logs the player out so it's at least not just hanging out in the random until the script messes up or anything.
I'll let you know after I have checked it out.![]()
Okay. The Mordaut account was using Reflection randoms, so everything may be okay with the SRL Solver (logging out on detection I mean).
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
Hope your all happy, I sacrificed my bonus XP for you! (Jokes, I'm not really worried about it.)Originally Posted by SRL commit log
Evil Bob is working well again and the others were some tweaks I had made since my last commit that just weren't big enough to commit by themselves.![]()
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
Last edited by NCDS; 11-02-2011 at 12:17 AM.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
Progress Report:[ ] ------ ~ Track Record [ ] ------ ~ ~ TrackObject [ ] ------ ~ ~ Searches: 768 [ ] ------ ~ ~ Successes: 731 [ ] ------ ~ ~ Success %: 95 [ ] ---- MSI_TrackObject: False [ ] ---- MSI_WaitWhileMining [ ] ------ Distance from tracking box to player = 12 [ ] ------ InvCount: 0 [ ] ------ Colours found < Accuracy [ ] ---- MSI_WaitWhileMining: Finished [ ] ---- MSI_FindObjectTPA: ROCK_MITHRIL [ ] ------ Took 78 ms to complete [ ] ---- MSI_FindObjectTPA: False [ ] ------ Scanning for randoms... [ ] ------ MSI_FindRandoms: Finished Random Event! [ ] -- MSI_AutoObjects: False [ ] -- Went inactive somewhere in SRL [ ] -- MSI_UnsetPlayer [ ] ---- Failed to use script: Lumby Swamp West Miner [ ] ------ All players inactive
EDIT: I tried running the script again while I was in the random and it did try to start solving it, except since I canceled the herald's spiel it kept trying to click the princess because it thought I had already talked to him I think. Not sure, I'll keep him in there in case you need him.
EDIT2: I have an account in Leo if anyone is interested.
Last edited by doublex8; 11-03-2011 at 04:28 PM.
Sandwich lady random failed...
Anyone want the account?
There are currently 1 users browsing this thread. (0 members and 1 guests)