SRL Archive - Test corner

Unfinished Guild Miner


_ChArMz

2010-01-11 14:46:04

I have been making a guild miner, its like 85% complete. I will probably never finish it, so if your up to the task your more than welcome to complete it.

Features:
Very random clicking/walking/banking
Flawless ladder finding
Flawless mining
- Detects the angle of the rock on MS, then if it is north sometimes your charactor can cover up the coal colors, so it will search multiple times for that color with waits
-Updates rocks location
-Checks the Density of the rock to make sure you are not clicking a torch(on guild wall) or player with similar colors
-Checks to see if there is a pixel change around the rock, if so it will not click it (add an option for the player to choose if he wants to have this check)

What needs to be done:
-Autocolor functions for the gray MM rock/MM ladder
-Lots of testing, mainly to see if the ranges I have set in functions like MineRock are "ok" (ranges = if Density > 0.4 then, test to see if that is efficient)
-Improved Rockwalk
-NearGuildDoor function works always?
-Add a check for dropped ore in the mining function, adding the option to either skip it or pick it up

Thats all I can think of ATM :redface:

marpis

2010-01-11 15:12:21

Your PixelChange is exactly the same as my PixelShift which is already in /core/Animation.SCAR ^^

Oh and your flag uses the same IsMoving detection than SRL's current IsMoving.

And "Result := FindColor(tx, ty, 255, x - 5, y - 5, x + 5, y + 5);" can be replaced with "Result := DidRedClick"

I also fixed ChooseOption, you can use SRL's and it's fast now.

Looks fantastic! :) I haven't thought about GetTPABounds and clicking randomly withing (x1, y1), (x2, y2), thanks for nice ideas!

_ChArMz

2010-01-11 15:25:55

From: marpis
Your PixelChange is exactly the same as my PixelShift which is already in /core/Animation.SCAR ^^

Oh and your flag uses the same IsMoving detection than SRL's current IsMoving.

And "Result := FindColor(tx, ty, 255, x - 5, y - 5, x + 5, y + 5);" can be replaced with "Result := DidRedClick"

I also fixed ChooseOption, you can use SRL's and it's fast now.

Looks fantastic! :) I haven't thought about GetTPABounds and clicking randomly withing (x1, y1), (x2, y2), thanks for nice ideas!


I had this PixelChange way before you even made this animation scar thing..

your pixelshift is just an edited Piv's FindGas(just like mine) that was in SRL in like 05-06…and i like my pixelchange better :D, tried using yours and it gave me errors and yours calculates width and height like 6 times

but all in all, i like to use my own stuffs :)

Naum

2010-01-11 15:35:48

From: _ChArMz
I had this PixelChange way before you even made this animation scar thing..

your pixelshift is just an edited FindGas(just like mine) that was in SRL in like 05-06…and i like my pixelchange better :D, tried using yours and it gave me errors and yours calculates width and height like 6 times

but all in all, i like to use my own stuffs :)


Haha Piv's old stuff, love that guy.

Anyhow's your script looks freaking amazing, even though you've been away for a while.
I guess if I get some time, I could merge some of this with my old guildminer, might work well. Knowing me it might not. :p

marpis

2010-01-12 03:21:45


{*******************************************************************************
Function PixelShiftMulti(B: TBoxArray; T: Integer): TIntegerArray;
By: marpis
Description: Calculates how many pixels change in boxes B during time T.
Date: Nov. 29, 2009
*******************************************************************************}
Function PixelShiftMulti(B: TBoxArray; T: Integer): TIntegerArray;
Var
L, I, X, Y: Integer;
BMP, BMP2: TIntegerArray;
Begin
L := Length(B);
SetLength(BMP, L);
SetLength(BMP2, L);
SetLength(Result, L);

For I := 0 To (L - 1) Do
Begin
BMP[I] := BitmapFromString((B[I].X2 - B[I].X1), (B[I].Y2 - B[I].Y1), '');
BMP2[I] := BitmapFromString((B[I].X2 - B[I].X1), (B[I].Y2 - B[I].Y1), '');
SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(BMP[I]), B[I].X1, B[I].Y1, B[I].X2, B[I].Y2, 0, 0, (B[I].X2 - B[I].X1), (B[I].Y2 - B[I].Y1));
End;

Wait(T);

For I := 0 To (L - 1) Do
SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(BMP2[I]), B[I].X1, B[I].Y1, B[I].X2, B[I].Y2, 0, 0, (B[I].X2 - B[I].X1), (B[I].Y2 - B[I].Y1));

For I := 0 To (L - 1) Do
For X := 0 To (B[I].X2 - B[I].X1) Do
For Y := 0 To (B[I].Y2 - B[I].Y1) Do
If FastGetPixel(BMP[I], X, Y) <> FastGetPixel(BMP2[I], X, Y) Then
Inc(Result[I]);

For I := 0 To (L - 1) Do
Begin
FreeBitmap(BMP[I]);
FreeBitmap(BMP2[I]);
End;
End;

{*******************************************************************************
Function PixelShift(B: TBox; Time: Integer): Integer;
By: marpis
Description: Calculates how many pixels change in box B during time T.
Date: Nov. 29, 2009
*******************************************************************************}
Function PixelShift(B: TBox; Time: Integer): Integer;
Var
TIA: TIntegerArray;
Begin
TIA := PixelShiftMulti([B], Time);
Result := TIA[0];
End;
What should be improved here? I don't see any unnecessary calculations? :S

Also I haven't seen that findgas you're talking about.

I wasn't accusing you of anything dude :rolleyes: Just telling that these are already in SRL if you wish to cut down lines in your script.

E: If you're talking about "(B.X2 - B.X1)" then you're talking about nano/piko seconds :rolleyes:

_ChArMz

2010-01-13 17:56:23

my bad marpis, didnt mean to be an ass, but yeah i just like to use my own stuff sometimes