PDA

View Full Version : AntiRandom - Exploding Rock.



speedster
03-01-2013, 12:33 AM
procedure P07_FindRockBomb;
var
tpa: TPointArray;
begin
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.14, 0.51);
FindColorsTolerance(tpa, 6190211, 217 , 127, 329, 228, 19);
SetColorToleranceSpeed(1);
SetColorspeed2Modifiers(0.2, 0.2);
if Length(tpa) > 70 then
begin
MMouse(P07_MMCX,P07_MMCY,1,1);
wait(95);
ClickMouse2(mouse_left);
wait(RandomRange(35000,60000)); // Edit this as you please.
end;
end;

keerit
03-01-2013, 12:34 AM
rep+

Word
03-01-2013, 12:36 AM
rep+

This.

Word
03-01-2013, 12:38 AM
procedure P07_FindRockBomb;
var
tpa: TPointArray;
begin
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.14, 0.51);
FindColorsTolerance(tpa, 6190211, 217 , 127, 329, 228, 19);
SetColorToleranceSpeed(1);
SetColorspeed2Modifiers(0.2, 0.2);
if Length(tpa) > 65 then
begin
MMouse(P07_MMCX,P07_MMCY,1,1);
wait(95);
ClickMouse2(mouse_left);
wait(RandomRange(35000,60000)); // Edit this as you please.
end;
end;

Also, just forgot the second bracket on wait(RandomRange(35000,60000)), otherwise perfect!

speedster
03-01-2013, 12:38 AM
Thank you word, missed that :) Added the random range within this post, didn't compile it :o
Il do more anti randoms when i get em :) this one was really annoying lol it broke me too many pickaxes lol

rj
03-01-2013, 12:44 AM
Not reliable, it would be better to combine pixel shift and a what I call double TPA, Example:

function Bank: Boolean;
var
i, CTS, c, Timeout: Integer;
TPA, TPA1, TPA2: TPointArray;
ATPA: T2DPointArray;
P: TPoint;
begin
Result := False;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
Timeout := 5000 + Random(1000);
SetColorSpeed2Modifiers(BankHue_1, BankSat_1);
FindColorsTolerance(TPA1, BankCol_1, MSX1, MSY1, MSX2, MSY2, BankTol_1);
SetColorSpeed2Modifiers(BankHue_2, BankSat_2);
FindColorsTolerance(TPA2, BankCol_2, MSX1, MSY1, MSX2, MSY2, BankTol_2);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(CTS);
CombineTPAWrap(TPA1, TPA2, TPA);
SplitTPAWrap(TPA, 5, ATPA);
SortATPASize(ATPA, True);
if Length(TPA) < 1 then
Exit;
for i := 0 to High(ATPA) do
if Length(ATPA[i]) > 30 then
begin
P := MiddleTPA(ATPA[i]);
HumanMMouse(P.X, P.Y, RandomRange( - 5, 5), RandomRange( - 5, 5));
if (P07_IsUpTextMultiCustom(['Use', 'Bank', 'ooth'])) then
begin
case LowerCase(ClickMethod) of
'booth':
Begin
RandomLeftClick;
clickmouse2(mouse_Right);
RandomChooseWait;
P07_ChooseOptionMultiHuman(['Use-q']);
RandomBankWait;
While (IsMoving) Do
FastWait;
If Not P07_BankScreen Then
Begin
Bank;
End;
Exit;
End;
'chest':
Begin
RandomRightClick;
clickmouse2(mouse_Left);
Wait(RandomRange(100, 700));
RandomBankWait;
While (IsMoving) Do
FastWait;
If Not P07_BankScreen Then
Begin
Bank;
End;
Exit;
End;
End;
Exit;
End;
End;
End;

It uses 2 colors for sharp object detection but if this works then it would be ok temporarily

Word
03-01-2013, 12:47 AM
Thank you word, missed that :) Added the random range within this post, didn't compile it :o
Il do more anti randoms when i get em :) this one was really annoying lol it broke me too many pickaxes lol

No problem, you did all the hard work, haha! I'm working on a few myself, but just the combat ones which seem to be simpler so far!

speedster
03-01-2013, 12:51 AM
Well your method would use a ton more CPU power - specially for a function which should be used quite often to check for randoms - you don't have that much time to react either., and I agree there is one bug for this thing, come in some sort of gray armor, but so far it doesn't take in to account Iron or Steel, so I don't know what else would be there to break it. Also pixelshift would have to scan the entire area around the character

Flight
03-01-2013, 12:52 AM
That's a good start mate! Indeed there's multiple ways to go about this.

If it were me I'd use a combination of color and, like rjj95 said, pixelshift, to first detect the gas rock. Then probably walking within a couple of tiles, waiting until we've stopped moving, find that gas rock again, and wait until the color/pixelshift of the 'gas' has gone. It's much better than a static wait of X seconds.

rj
03-01-2013, 12:54 AM
Well your method would use a ton more CPU power - specially for a function which should be used quite often to check for randoms - you don't have that much time to react either., and I agree there is one bug for this thing, come in some sort of gray armor, but so far it doesn't take in to account Iron or Steel, so I don't know what else would be there to break it. Also pixelshift would have to scan the entire area around the character

Pixel shift only takes around 50-100 ms lol

speedster
03-01-2013, 12:55 AM
I still have no idea how pixelshift would work : If pixelshift > number => scan for color ? wait until color or pixelshift disappears.

And i put a simple randomrange because I didn't want my script to use any more of my cpu power. A simple wait will do the trick taken someone could time how long the exploding gas lasts.

And yes 50-100Ms, which should be checked every few miliseconds while mining (swinging pickaxe) causing a ton of lag. It might not be much :D if you are running a single script. I will take in to consideration and try to see how it would work with pixelshift, but so far this has worked for me for the past 2 hours :D

Flight
03-01-2013, 12:58 AM
I still have no idea how pixelshift would work > If pixelshift > number => scan for color ? wait until color or pixelshift disappears.

And i put a simple randomrange because I didn't want my script to use any more of my cpu power. A simple wait will do the trick taken someone could time how long the exploding gas lasts.

And yes 50-100Ms, which should be checked every few miliseconds while mining causing a ton of lag. It might not be much :D if you are running a single script. I will take in to consideration and try to see how it would work with pixelshift, but so far this has worked for me for the past 2 hours :D

I know this tutorial isn't directly related to what you're trying to do here but it should aid you in figuring out how pixelshift works:
http://villavu.com/forum/showthread.php?t=74090

speedster
03-01-2013, 01:34 AM
Thanks :) Will check it out - I will probably personalize my version to search within a dynamic box based on the tpa which is mined, that should save up a lot of cpu and time :)

Still thinking on how to add pixelshift to the function so to work with any other kind of mining. There are usually a lot of pixels shifting around the player to scan the entire area around.

exuals
03-04-2013, 01:54 AM
I use pixelshift in a very small location that the mining animation can't reach.

If there is gas, the result is almost always 360.

Works perfectly for me/

speedster
03-04-2013, 12:15 PM
What do you do when you have different angles and multiple rocks that need to be mined? :) You need to identify that small location dynamically which would be quite hard to achieve.

hulk2106
03-23-2013, 12:30 PM
Thank you very much for this

Riylo69
06-14-2013, 05:51 PM
thank god