wantonman
2012-02-28 23:24:04
For good reasons… the tpa functions arent calibrated for my needs of this script and i lack the knowledge to do it based entirely off the math functions
with no further adue here is my work






those are my images that i run debug tests on…
here is the script.. hardly any progress yikes…
here is the last debug i was currently working on
here are some of the rest of some of the unadded snippets
lastly some hue and color alternatives for different colors because they change
Thats all, im done working on this, id rather play runescape then spend the time to put this thing together…
ya noe bot as i need to, prolly make a good auto walker or some sheit simple…
with no further adue here is my work






those are my images that i run debug tests on…
here is the script.. hardly any progress yikes…
program new;
{$I SRL\SRL.SIMBA }
//GETTING POISIOND
FUNCTION ISPOISONED : BOOLEAN ;
VAR
A , B , X , Y , I , Z , W , H , J , C , CTS : INTEGER ;
TIA1 : TINTEGERARRAY ;
POINT1 , POINT2 , POINT3 : TPOINT ;
TPA1 , TPA2 , TPA3 , TPA4 : TPOINTARRAY ;
ATPA1 , ATPA2 , ATPA3 , ATPA4 , ATPA5 : T2DPOINTARRAY ;
BOX1 , BOX2 , BOX3 : TBOX ;
TBA1 , TBA2 , TBA3 : TBOXARRAY ;
BEGIN
BOX1 := PointToBox ( POINT ( 682 , 12 ) , POINT ( 723 , 46 ) ) ; //SEARCH BOX
GetClientDimensions ( W , H ) ;
CTS := GetColorToleranceSpeed ;
ColorToleranceSpeed ( 2 ) ;
SetColorspeed2Modifiers ( 0.04 , 0.29 ) ;
FindColorsSpiralTolerance ( x , y , TPA1 , 2603787 , BOX1 . X1 , BOX1 . Y1 , BOX1 . X2 , BOX1 . Y2 , 10 ) ; // GREEN COLOR
SetColorspeed2Modifiers( 0.2 , 0.2 ) ;
ColorToleranceSpeed ( CTS ) ;
IF
LENGTH ( TPA1 ) < 1
THEN
EXIT ;
CTS := GetColorToleranceSpeed ;
ColorToleranceSpeed ( 2 ) ;
SetColorspeed2Modifiers ( 0.07 , 0.42 ) ;
FindColorsSpiralTolerance ( x , y , TPA2 , 204691 , BOX1 . X1 , BOX1 . Y1 , BOX1 . X2 , BOX1 . Y2 , 7 ) ; // RED COLOR
SetColorspeed2Modifiers( 0.2 , 0.2 ) ;
ColorToleranceSpeed ( CTS ) ;
IF
LENGTH ( TPA2 ) < 1
THEN
EXIT ;
CombineTPAWrap ( TPA1 , TPA2 , TPA3 ) ;
IF
LENGTH ( TPA3 ) < 1
THEN
EXIT ;
RESULT := TRUE ;
END;
//
// GETTING ATTACKED
FUNCTION ISATTACKED : BOOLEAN ;
VAR
A , B , X , Y , I , Z , W , H , J , C , CTS : INTEGER ;
TIA1 : TINTEGERARRAY ;
POINT1 , POINT2 , POINT3 : TPOINT ;
TPA1 , TPA2 , TPA3 , TPA4 : TPOINTARRAY ;
ATPA1 , ATPA2 , ATPA3 , ATPA4 , ATPA5 : T2DPOINTARRAY ;
BOX1 , BOX2 , BOX3 : TBOX ;
TBA1 , TBA2 , TBA3 : TBOXARRAY ;
BEGIN
BOX1 := PointToBox ( POINT ( 185 , 95 ) , POINT ( 315 , 170 ) ) ; //SEARCH BOX
GetClientDimensions ( W , H ) ;
CTS := GetColorToleranceSpeed ;
ColorToleranceSpeed ( 2 ) ;
SetColorspeed2Modifiers ( 0.39 , 0.00 ) ;
FindColorsSpiralTolerance ( x , y , TPA1 , 10240 , BOX1 . X1 , BOX1 . Y1 , BOX1 . X2 , BOX1 . Y2 , 17 ) ; // BLACK COLOR
FindColorsSpiralTolerance ( x , y , TPA2 , 52384 , BOX1 . X1 , BOX1 . Y1 , BOX1 . X2 , BOX1 . Y2 , 17 ) ; // GREEN COLOR
SetColorspeed2Modifiers( 0.2 , 0.2 ) ;
ColorToleranceSpeed ( CTS ) ;
IF
LENGTH ( TPA1 ) < 1
THEN
EXIT ;
IF
LENGTH ( TPA2 ) < 1
THEN
EXIT ;
CombineTPAWrap ( TPA1 , TPA2 , TPA3 ) ;
IF
LENGTH ( TPA3 ) < 1
THEN
EXIT ;
RESULT := TRUE ;
END;
//
// MED JUNGLE
FUNCTION
FIND_MEDJUNGLE : BOOLEAN ;
VAR
A , B , X , Y , I , Z , W , H , J , C , CTS : INTEGER ;
TIA1 : TINTEGERARRAY ;
POINT1 , POINT2 , POINT3 : TPOINT ;
TPA1 , TPA2 , TPA3 , TPA4 : TPOINTARRAY ;
ATPA1 , ATPA2 , ATPA3 , ATPA4 , ATPA5 : T2DPOINTARRAY ;
BOX1 , BOX2 , BOX3 : TBOX ;
TBA1 , TBA2 , TBA3 : TBOXARRAY ;
BEGIN
GetClientDimensions ( W , H ) ;
CTS := GetColorToleranceSpeed ;
ColorToleranceSpeed ( 2 ) ;
SetColorspeed2Modifiers ( 0.04 , 0.16 ) ;
FindColorsSpiralTolerance ( x , y , TPA1 , 2848399 , 0 , 0 , W - 1 , H -1 , 3 ) ; // WOOD COLOR
SetColorspeed2Modifiers( 0.2 , 0.2 ) ;
ColorToleranceSpeed ( CTS ) ;
IF
LENGTH ( TPA1 ) < 1
THEN
EXIT ;
CTS := GetColorToleranceSpeed ;
ColorToleranceSpeed ( 2 ) ;
SetColorspeed2Modifiers ( 0.02 , 0.19 ) ;
FindColorsSpiralTolerance ( x , y , TPA2 , 2788453 , 0 , 0 , W - 1 , H -1 , 3 ) ; // LEAF COLOR
SetColorspeed2Modifiers( 0.2 , 0.2 ) ;
ColorToleranceSpeed ( CTS ) ;
IF
LENGTH ( TPA2 ) < 1
THEN
EXIT ;
CombineTPAWrap ( TPA1 , TPA2 , TPA3 ) ;
SplitTPAExWRAP ( TPA3 , 12 , 12 , ATPA1 ) ;
FOR
I := 0
TO
HIGH ( ATPA1 )
DO
BEGIN
SetArrayLength ( TBA1 , I + 1 ) ;
SetArrayLength ( ATPA2 , I + 1 ) ;
SetArrayLength ( TPA4 , I + 1 ) ;
TBA1 [ I ] := GetTPABounds ( ATPA1 [ I ] ) ;
TPAFromBoxWrap ( TBA1 [ I ] , ATPA2 [ I ] ) ;
TPA4 [ I ] := MiddleTPA ( ATPA2 [ I ] ) ;
END ;
WAIT ( 250 + RANDOM ( 150 ) ) ;
MMOUSE ( TPA4 [ 0 ] . X , TPA4 [ 0 ] . Y , 5 , 5 ) ;
RESULT := TRUE ;
END ;
//
PROCEDURE
MAIN ;
VAR
X , Y : INTEGER ;
BEGIN
FIND_MEDJUNGLE ;
WAIT ( 1000 + RANDOM ( 500 ) ) ;
IF
IsUpTextMultiCustom ( [ 'ack' , 'edi' , 'jun' ] )
THEN
BEGIN
WAIT ( 250 + RANDOM ( 150 ) ) ;
ClickMouse2 ( 1 ) ;
REPEAT
IF
ISATTACKED
THEN
BEGIN
WRITELN ( ' MONSTER ' ) ;
REPEAT
IF
ISPOISONED
THEN
BEGIN
WRITELN ( ' POISONED ' ) ;
END ;
UNTIL
NOT
ISATTACKED ;
WRITELN ( ' MONSTER HAS BEEN TROLLED ' ) ;
END ;
UNTIL
FALSE
END ;
END ;
BEGIN
CLEARDEBUG ;
SETUPSRL ;
MAIN ;
END .
here is the last debug i was currently working on
program new;
{$I SRL\SRL.SIMBA }
function DebugATPAEx(aPoints: T2DPointArray; BmpName: string; Colors: TIntegerArray): Boolean;
var
Width, Height, ClientBMP{$ifdef scar}, I, L, h, hh{$endif}: Integer;
{$ifdef Simba} ATPA : T2DPointArray; {$endif}
Box : TBox;
begin
result := false;
if length(aPoints) = 0 then
exit;
Box := GetATPABounds(aPoints);
Width := box.x2 - box.x1 + 1;
Height := box.y2 - box.y1 + 1;
DisplayDebugImgWindow(Width, Height);
{$ifdef Simba}
ClientBMP := BitmapFromClient(box.x1,box.y1,box.x2,box.y2);
ATPA := CopyATPA(aPoints);
OffsetATPA(ATPA,point(-box.x1,-box.y1));
DrawATPABitmap(ClientBMP,ATPA);
DrawBitmapDebugImg(ClientBMP);
{$else}
ClientBMP := BitmapFromString(Width, Height, '');
CopyClientToBitmap(ClientBMP, box.x1, box.y1, box.x2, box.y2);
H := High(aPoints);
for I := 0 to H do
begin
HH := High(aPoints[i]);
for L := 0 to HH do
FastSetPixel(ClientBMP, aPoints[i][L].X - box.x1, aPoints[i][L].Y - box.y1, Colors[I]);
end;
SafeDrawBitmap(ClientBMP, GetDebugCanvas, 0, 0);
{$endif}
if BmpName <> '' then
SaveBitmap(ClientBMP, ScriptPath + BmpName + '.bmp');
FreeBitmap(ClientBMP);
Result := True;
end;
// MED JUNGLE ALGORITH
FUNCTION ONE : T2DPOINTARRAY ;
VAR
A , B , X , Y , I , Z , W , H , J , C , CTS : INTEGER ;
TIA1 : TINTEGERARRAY ;
POINT1 , POINT2 , POINT3 : TPOINT ;
TPA1 , TPA2 , TPA3 , TPA4 : TPOINTARRAY ;
ATPA1 , ATPA2 , ATPA3 , ATPA4 , ATPA5 : T2DPOINTARRAY ;
BOX1 , BOX2 , BOX3 : TBOX ;
TBA1 , TBA2 , TBA3 : TBOXARRAY ;
BEGIN
BOX1 := PointToBox ( POINT ( 247 , 109 ) , POINT ( 334 , 142 ) ) ; //WAZZAII
GetClientDimensions ( W , H ) ;
CTS := GetColorToleranceSpeed ;
ColorToleranceSpeed ( 2 ) ;
SetColorspeed2Modifiers ( 0.02 , 0.07 ) ;
FindColorsSpiralTolerance ( W/2 , H/2 , TPA1 , 2185838 , 0 , 0 , W - 1 , H - 1 , 7 ) ; // HE COLOR
SetColorspeed2Modifiers( 0.2 , 0.2 ) ;
ColorToleranceSpeed ( CTS ) ;
IF
LENGTH ( TPA1 ) < 1
THEN
EXIT ;
SPLITTPAExWrap ( TPA1 , 2 , 2 , ATPA1 ) ;
FOR
I := 0
TO
HIGH ( ATPA1 )
DO
BEGIN
SetArrayLength ( TPA2 , I + 1 ) ;
SetArrayLength ( TBA1 , I + 1 ) ;
SetArrayLength ( TBA2 , I + 1 ) ;
SetArrayLength ( ATPA2 , I + 1 ) ;
TBA1 [ I ] := GetTPABounds ( ATPA1 [ I ] ) ;
TPA2 [ I ] := MiddleBox ( TBA1 [ I ] ) ;
FilterPointsDist ( ATPA1 [ I ] , 2 , 12 , TPA2 [ I ] . X , TPA2 [ I ] . Y ) ;
TBA2 [ I ] := GetTPABounds ( ATPA1 [ I ] ) ;
TPAFromBoxWrap ( TBA2 [ I ] , ATPA2 [ I ] ) ;
SortATPAFromSize ( ATPA2, 42 , TRUE ) ;
WRITELN ( LENGTH ( ATPA2 [ I ] ) ) ;
END ;
RESULT := ATPA2 ;
END;
//
begin
CLEARDEBUG ;
SETUPSRL ;
DebugATPAEx(ONE,'mspaintsimbaex',[CLWHITE ] ) ;
end.
here are some of the rest of some of the unadded snippets
// MED JUNGLE ALGORITH
FUNCTION ONE : T2DPOINTARRAY ;
VAR
A , B , X , Y , I , Z , W , H , CTS : INTEGER ;
TIA1 : TINTEGERARRAY ;
POINT1 , POINT2 , POINT3 : TPOINT ;
TPA1 , TPA2 , TPA3 , TPA4 : TPOINTARRAY ;
ATPA1 , ATPA2 , ATPA3 , ATPA4 , ATPA5 : T2DPOINTARRAY ;
BOX1 , BOX2 , BOX3 : TBOX ;
TBA1 , TBA2 , TBA3 : TBOXARRAY ;
BEGIN
GetClientDimensions ( W , H ) ;
CTS := GetColorToleranceSpeed ;
ColorToleranceSpeed ( 2 ) ;
SetColorspeed2Modifiers ( 0.04 , 0.23 ) ;
FindColorsSpiralTolerance ( x , y , TPA1 , 2649477 , 0 , 0 , W - 1 , H -1 , 3 ) ; // WOOD COLOR
SetColorspeed2Modifiers( 0.2 , 0.2 ) ;
ColorToleranceSpeed ( CTS ) ;
IF
LENGTH ( TPA1 ) < 1
THEN
EXIT ;
CTS := GetColorToleranceSpeed ;
ColorToleranceSpeed ( 2 ) ;
SetColorspeed2Modifiers ( 0.04 , 0.19 ) ;
FindColorsSpiralTolerance ( x , y , TPA2 , 2987115 , 0 , 0 , W - 1 , H -1 , 2 ) ; // LEAF COLOR
SetColorspeed2Modifiers( 0.2 , 0.2 ) ;
ColorToleranceSpeed ( CTS ) ;
SplitTPAExWRAP ( TPA1 , 21 , 21 , ATPA1 ) ;
FOR
I:=0
TO
HIGH(ATPA1)
DO
BEGIN
SetArrayLength ( TBA1 , I + 1 ) ;
SetArrayLength ( ATPA2 , I + 1 ) ;
SetArrayLength ( TPA3 , I + 1 ) ;
SetArrayLength ( ATPA3 , I + 1 ) ;
TBA1 [ I ] := GetTPABounds ( ATPA1 [ I ] ) ;
TPAFromBoxWrap ( TBA1 [ I ] , ATPA2 [I ] ) ;
IF
PointInTPA ( TPA2 [ I ] , ATPA2 [ I ] )
THEN
DeleteValueInATPA ( ATPA2 , I ) ;
END ;
RESULT := ATPA2 ;
END;
//
lastly some hue and color alternatives for different colors because they change
.1
SetColorspeed2Modifiers ( 0.02 , 0.07 ) ;
FindColorsSpiralTolerance ( x , y , TPA1 , 3310752 , 0 , 0 , W - 1 , H -1 , 7 ) ; // WOOD COLOR
.2
SetColorspeed2Modifiers ( 0.04 , 0.16 ) ;
FindColorsSpiralTolerance ( x , y , TPA1 , 2848399 , 0 , 0 , W - 1 , H -1 , 3 ) ; // WOOD COLOR
.1
SetColorspeed2Modifiers ( 0.04 , 0.05 ) ;
FindColorsSpiralTolerance ( x , y , TPA2 , 2786913 , 0 , 0 , W - 1 , H -1 , 5 ) ; // LEAF COLOR
.2
SetColorspeed2Modifiers ( 0.02 , 0.19 ) ;
FindColorsSpiralTolerance ( x , y , TPA2 , 2788453 , 0 , 0 , W - 1 , H -1 , 3 ) ; // LEAF COLOR
Thats all, im done working on this, id rather play runescape then spend the time to put this thing together…
ya noe bot as i need to, prolly make a good auto walker or some sheit simple…