SRL Archive - OSR Help

TPA Autocolor Help


YoHoJo

2011-11-01 12:22:42

Currently in my powerminer script I do some ACA stuff make a TPA and search in 25x25 boxes to see if there are over 10 pixels of proper color found, then move mouse, check uptext, and click. (sorry if I got any of the lingo wrong haven't scripted in a while).

Well in the Dwarven Mines (entering from Falador, just outside of the resource dungeon) there are three iron rocks. Well there aren't many colors to pick from, but I can color and find the rocks just fine; problem is that there is a scorpion there which matches many of the colors and is often found and thr mouse hovers it.

How can I go about restraining my search to only the rocks?

Will add more info later I'd it's needed.


Thanks, oJoHoY

Home

2011-11-01 12:43:47

From: YoHoJo
Currently in my powerminer script I do some ACA stuff make a TPA and search in 25x25 boxes to see if there are over 10 pixels of proper color found, then move mouse, check uptext, and click. (sorry if I got any of the lingo wrong haven't scripted in a while).

Well in the Dwarven Mines (entering from Falador, just outside of the resource dungeon) there are three iron rocks. Well there aren't many colors to pick from, but I can color and find the rocks just fine; problem is that there is a scorpion there which matches many of the colors and is often found and thr mouse hovers it.

How can I go about restraining my search to only the rocks?

Will add more info later I'd it's needed.


Thanks, oJoHoY



You could use MMToMS and create a TBox then scan colors inside it.

(Create DDTM's from rocks in Minimap)

~Home

YoHoJo

2011-11-01 12:49:08

So you're saying to find rocks on the minimap, use mmtoms to restrict my color finding to only around the rocks? That's a pretty slick idea, for mmtoms do I need to keep thr camera at highest angle for it to work properly? That would help a lot in most cases but what about when/if the scorpion gets really close to the rocks? I like your idea though I'll give it a try!

Wanted

2011-11-01 12:55:03

If that doesn't work

FindColors within MSToMM boxes
MergeTPAs into ATPA
SplitTPA (short distance)
Sort through on ATPA arraylength, dimensions, and density.
Go through based on closest to average tendency compared to the above TPA properties
MiddleTPA
UpText
ChooseOption

BraK

2011-11-01 13:00:56

From: Wanted
If that doesn't work

FindColors within MSToMM boxes
MergeTPAs into ATPA
SplitTPA (short distance)
Sort through on ATPA arraylength, dimensions, and density.
Go through based on closest to average tendency compared to the above TPA properties
MiddleTPA
UpText
ChooseOption


That's a good way to do it. I think I used that for my NPC finding in a few scripts in the past. It's a good system I recommend it highly.

YoHoJo

2011-11-01 13:04:29

Sounds sexy.
I'll need more assistance with that once I get started though.
Thanks, I'll try that later today, unfamiliar with some of those things.

Phran6

2011-11-01 14:56:28

can do a double findcolors and keep only color tpa that are similar in both because scorpion are moving and not the rock

YoHoJo

2011-11-01 16:09:42

I currently have something like
GatePtsBox:= TPAtoATPAEx(GatePts,20,20);
SortATPAFrom(GatePtsBox,Point(MSCX,MSCY));
HighGate:=High(GatePtsBox);
For I:=0 To HighGate Do

Which SplitTPA function would I use, and what parameters?
How do I
Sort through on ATPA arraylength, dimensions, and density.

NCDS

2011-11-01 16:44:33

From: YoHoJo
I currently have something like
GatePtsBox:= TPAtoATPAEx(GatePts,20,20);
SortATPAFrom(GatePtsBox,Point(MSCX,MSCY));
HighGate:=High(GatePtsBox);
For I:=0 To HighGate Do

Which SplitTPA function would I use, and what parameters?
How do I


Just like what you've got, but add this: (psuedo)

GatePtsBox:= TPAtoATPAEx(GatePts,20,20);
SortATPAFrom(GatePtsBox,Point(MSCX,MSCY));
HighGate:=High(GatePtsBox);
For I:=0 To HighGate Do
begin
if (not inRange(Length(GatePtsBox[i]), minAvg, maxAvg)) then
Continue;
checkWidth;
checkHeight;
etc.
end;
Just 'Continue' if any of them are false because that's obviously not what you're looking for.

YoHoJo

2011-11-01 16:46:08

    checkWidth;
checkHeight;

I have the minavg magavg stuff (I just check if >10) what exactly would he widthheigth be?
Width/height of what (the pixels of color)?

YoHoJo

2011-11-01 17:29:40

GOD this is really hard :/.
This isn't specific enough keeps finding scorpion as well as rocks
RockPtsBox:= TPAtoATPAEx(RockPts,27,32);
//SortTPAFrom(RockPts, Point(MSCX, MSCY));
SortATPAFrom(RockPtsBox,Point(MSCX,MSCY));
HighRock:=High(RockPtsBox);
For I:=0 To HighRock Do
Begin
If Not(LoggedIn) Then Break;
If (GetArrayLength(RockPtsBox[I]) < 11) And
(GetArrayLength(RockPtsBox[I]) > 8) or
(GetArrayLength(RockPtsBox[I]) > 30) Then

Looks like this

FUUUUUUUUU

BraK

2011-11-01 17:54:54

Search the normal rock color the search the ore color. then compare the 2 TPAs to get points that are with the area of the first TPA. and have the point from the Second. hopefully my half asleep theory helps. I'm going to bed, night.

YoHoJo

2011-11-01 17:55:43

WOO! Sounds NICE!
Not 100% how to do that, but I have an idea!

Can someone tell me how I'd go about doing Braks idea?
The yo dog I heard you like searching in boxes so I put a box in your box so you can search while your search idea?

BraK

2011-11-01 18:19:38

Last piece wife is kicking my butt for being on the computer.

Make it into ATPA's then search each TPA in the ATPA with the FindTPAinTPA function.

That should help. I had to post it after I remembered it.

Gu3st...

2011-11-01 19:06:11

You could also use SmartColors :) Works very well in situations like this

YoHoJo

2011-11-01 21:18:29

Help….
Clean Up and make work…….
Function MineRock(WutRock:Integer):Boolean;
var I,PlusOne,tMine:Integer;
RockInFoI: TIntegerArray;
RockInFoE: TExtendedArray;
RockPts, BigRockPts, Bingo:TPointArray;
RockPtsBox, BigRockPtsBox: T2DPointArray;
RockPt, BingoPt: TPoint;
HighRock:Integer;
Begin
If Not(LoggedIn) Then Exit;
StatsGuise('Searching For Rock: '+ IntToStr(InvCount));
If OreInLast Then Exit;
RockInFoE:=[0.06 , 1.22]; RockInFoI:=[3293028, 5]; //Iron
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(RockInFoE[0],RockInFoE[1]);
FindColorsSpiralTolerance(MSCX,MSCY,RockPts,RockInfoI[0],MSX1,MSY1,MSX2,MSY2,RockInfoI[1]);
SetColorSpeed2Modifiers(0.02, 0.09);
FindColorsSpiralTolerance(MMCX, MMCY, BigRockPts, 3565690, MMX1, MMY1, MMX2, MMY2, 12);
SetColorSpeed2Modifiers(0.2,0.2);
ColorToleranceSpeed(1);
BigRockPtsBox:=TPAtoATPAEx(BigRockPts,30,30);
RockPtsBox:= TPAtoATPAEx(RockPts,27,32);
FindTPAinTPA(RockPts, BigRockPts, Bingo);
SortATPAFrom(Bingo,Point(MSCX,MSCY));
HighRock:=High(Bingo);
For I:=0 To HighRock Do
Begin
If Not(LoggedIn) Then Break;
If (GetArrayLength(Bingo[I]) > 6)
Begin
If YDebug Then DebugATPA(Bingo,'');
BingoPt:= MiddleTPA(Bingo[I]);
If CheckAndClick('ine',BingoPt.x,BingoPt.y) Then
Begin
Result:=True;
MarkTime(tMine);
StatsGuise('Mining Rock: '+ IntToStr(InvCount));
Players[CurrentPlayer].Loc:='Mining';
PlusOne:=InvCount+1;
Repeat
If Not(LoggedIn) Then Break;
Wait(200);
If Random(2) = 0 Then
Begin
RT:=GetSystemTime;
If FindNormalRandoms Then
IncEx(WeMined,GetSystemTime - RT);
End;
If Random(50)=1 Then SleepAndMoveMouse(500+Random(100));
//If (Not(IsMoving)) Then Begin Writeln('a'); Break; End;
Until (InvCount = PlusOne) Or (TimeFromMark(tMine) > ((Players[CurrentPlayer].Integers[2]*1000) + Random(500)));
Exit;
End;
End;
Wait(250+Random(100));
End;
End;

Ask any questions, it's a mess.

NCDS

2011-11-01 21:26:56

From: YoHoJo
    checkWidth;
checkHeight;

I have the minavg magavg stuff (I just check if >10) what exactly would he widthheigth be?
Width/height of what (the pixels of color)?

Yes, the bound of the respective tpa.

From: YoHoJo
GOD this is really hard :/.
This isn't specific enough keeps finding scorpion as well as rocks
RockPtsBox:= TPAtoATPAEx(RockPts,27,32);
//SortTPAFrom(RockPts, Point(MSCX, MSCY));
SortATPAFrom(RockPtsBox,Point(MSCX,MSCY));
HighRock:=High(RockPtsBox);
For I:=0 To HighRock Do
Begin
If Not(LoggedIn) Then Break;
If (GetArrayLength(RockPtsBox[I]) < 11) And
(GetArrayLength(RockPtsBox[I]) > 8) or
(GetArrayLength(RockPtsBox[I]) > 30) Then

Looks like this

FUUUUUUUUU

You should add a max check. Say for instance the rock return 30 occurrences of the color and the scorpion return 60 on average. Checking if the length > 10 won't help distinguish between the two. However, checking if the length was > 25 and < 55 then you probably won't return any scorpions.


Get it?

euphemism

2011-11-01 21:32:30

From: NCDS
Yes, the bound of the respective tpa.


You should add a max check. Say for instance the rock return 30 occurrences of the color and the scorpion return 60 on average. Checking if the length > 10 won't help distinguish between the two. However, checking if the length was > 25 and < 55 then you probably won't return any scorpions.


Get it?


This. Works very well for helping to distinguish objects of mostly constant size.

YoHoJo

2011-11-01 21:37:20

Cleaned up code quite a bit.
Added some comments, any more help, am I doing this correctly now? I think I should have another for loop somewhere but I'm not sure….

Function MineRock(WutRock:Integer):Boolean;
Function MineRock(WutRock:Integer):Boolean;
var I,PlusOne,tMine:Integer;
OrePts, RockPts, Bingo:TPointArray;
OrePtsBox, RockPtsBox, BingoBox: T2DPointArray;
OrePt, BingoPt: TPoint;
HighRock:Integer;
Begin
If Not(LoggedIn) Then Exit;
StatsGuise('Searching For Rock: '+ IntToStr(InvCount));
If OreInLast Then Exit;
//Get Iron Ore and Rock Points
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06,1.22);
FindColorsSpiralTolerance(MSCX,MSCY,OrePts,3293028,MSX1,MSY1,MSX2,MSY2,5);
SetColorSpeed2Modifiers(0.02, 0.09);
FindColorsSpiralTolerance(MSCX, MSCY, RockPts, 3565690, MSX1, MSY1, MSX2, MSY2, 12);
SetColorSpeed2Modifiers(0.2,0.2);
ColorToleranceSpeed(1);
//Split TPA into 30X30 boxes of color
RockPtsBox:=TPAtoATPAEx(RockPts,30,30);
OrePtsBox:= TPAtoATPAEx(OrePts,10,10);
//Seaches within RockPts for OrePts, calls matches Bingo.
FindTPAinTPA(OrePts, RockPts, Bingo);
Writeln('OrePts ' + IntToStr (GetArrayLength(OrePts) ) );
Writeln('RockPts ' + IntToStr (GetArrayLength(RockPts) ) );
Writeln( IntToStr (GetArrayLength(Bingo) ) );
//Creates T2DPointArray called BingoBox
BingoBox:= TPAtoATPAEx(Bingo, 30, 30);
//Sorted BingoBoxes from center of mainscreen outwards
SortATPAFrom(BingoBox,Point(MSCX,MSCY));
HighRock:=High(BingoBox);
For I:=0 To HighRock Do
Begin
If Not(LoggedIn) Then Break;
Writeln( IntToStr (GetArrayLength(BingoBox) ) );
If (GetArrayLength(BingoBox[I]) > 6) Then
Begin
If YDebug Then DebugATPA(BingoBox,'');
BingoPt:= MiddleTPA(BingoBox[I]);
If CheckAndClick('ine',BingoPt.x,BingoPt.y) Then
Begin
Result:=True;
MarkTime(tMine);
StatsGuise('Mining Rock: '+ IntToStr(InvCount));
Players[CurrentPlayer].Loc:='Mining';
PlusOne:=InvCount+1;
Repeat
If Not(LoggedIn) Then Break;
Wait(200);
If Random(2) = 0 Then
Begin
RT:=GetSystemTime;
If FindNormalRandoms Then
IncEx(WeMined,GetSystemTime - RT);
End;
If Random(50)=1 Then SleepAndMoveMouse(500+Random(100));
//If (Not(IsMoving)) Then Begin Writeln('a'); Break; End;
Until (InvCount = PlusOne) Or (TimeFromMark(tMine) > ((Players[CurrentPlayer].Integers[2]*1000) + Random(500)));
Exit;
End;
End;
Wait(250+Random(100));
End;
End;

Cleaned it more, added debug.
OrePts 64 (Finds 64 pixels of iron ore color)
RockPts 4026 (Finds 4026 pixels of rock color)
Bingo 0 ( After calling FindTPAinTPA(OrePts, RockPts, Bingo); the TPA 'Bingo' is still empty, meaning it's not finding any Iron ore pts within rock pts how is this so?)

BraK

2011-11-02 04:23:04

I should have clarified you need to create a Box from the TPA point in the first ATPA because they won't show up in the second TPA they are just nearby. I gave you the half asleep answer last night.

YoHoJo

2011-11-02 17:39:48

Ahh Took me a while to understand what you were saying…. I get it now!!!!
So how would I turn the TPointArray OrePts into a box?
If I made it a box wouldn't it be a T2DPointArray?
And if so the parameters for FindTPAinTPA want's all TPointArrays, not T2DPointArrays.
Getting so close ahhh!

BraK

2011-11-02 17:52:54

GetTPABounds outputs to a TBox. After that just search the Tbox for the Ore color.

Procedure GetAnswer2;
var
TPA, TPA2: TPointArray;
ATPA: T2DPointArray;
I, II, III: Integer;
TP: array of TPoint;
BoxList : Array[0..10] of TBox;
TI: TIntegerArray;
Box: Tbox;
begin
FindColors(TPA,Correct,QX1, QY1, QX2, QY2);
FindColors(TPA2,Wrong,QX1, QY1, QX2, QY2);
TPA2 := CombineTPA(TPA, TPA2);
ATPA := TPAtoATPAEx(TPA2, 13, 13);
SortATPAFromFirstPoint(ATPA, Point(505,1));
DebugATPABounds(ATPA);
II := High(ATPA);
SetArrayLength(TI, II + 1);
for I := 0 to II do
begin
Box := GetTPABounds(ATPA[i]);
if (CountColor(Correct,Box.X1,Box.Y1, Box.X2, box.Y2) > 0) then
TI[i] := Correct
else
TI[i] := Wrong;
end;
for I := 0 to high(TI) do
if TI[i] = correct then
writeln('Correct')
else
Writeln('Wrong');
end;

    Box := GetTPABounds(ATPA[i]);
if (CountColor(Correct,Box.X1,Box.Y1, Box.X2, box.Y2) > 0) then

I used it here in my test taker script for online testing.

YoHoJo

2011-11-02 17:58:40

Is this a proper/another way about going about doing this?
Read the comments, my question is in there.


//Get Rock Points (larger than ore)
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.09);
FindColorsSpiralTolerance(MSCX, MSCY, RockPts, 3565690, MSX1, MSY1, MSX2, MSY2, 12);

//Split TPA into 30X30 boxes of color
RockPtsBox:=TPAtoATPAEx(RockPts,30,30);

SetColorSpeed2Modifiers(0.06,1.22);
For I:=0 To High(RockPtsBox) Do
Begin
{(What I want to do here is search for this ore color ONLY inside of the RockPtsBoxes and add each match to an array called OrePts)
(How do I do that?)}
FindColorsSpiralTolerance(MSCX,MSCY,OrePts,3293028,MSX1,MSY1,MSX2,MSY2,5);
SetColorSpeed2Modifiers(0.2,0.2);
ColorToleranceSpeed(1);

BraK

2011-11-02 18:04:13

For I :=  High(rocksATPA) do
begin
Box := GetTPABounds(rocksATPA[i]);
if findcolors(OreTPA, Orecolor, box.x1, box.y1, box.x2, box.y2) then
//do mining stuffs


Oh yeah might want to sort from closest to you first.

YoHoJo

2011-11-02 18:08:12

Looks great but my brain is melting and my code is so messy, as badly as I want to get this working right now I'm overloaded!! I'll give it a shot later!!

YoHoJo

2011-11-02 18:27:29

Eh I give up I'm going to need some 1 on 1 help on MSN later.
Everyone who wants to help post your MSN here.

BraK

2011-11-02 18:40:44

Just log onto IRC >.>

YoHoJo

2011-11-02 20:37:55

IRC too crazy :) I go there for fun.
I like 1 on 1 help!
Post/PM MSNs :).

noidea

2011-11-02 21:32:38

From: YoHoJo
IRC too crazy :) I go there for fun.
I like 1 on 1 help!
Post/PM MSNs :).


there can be 1 on 1 + more depending on how crazy you're feeling.

YoHoJo

2011-11-03 00:54:00

Finds all rock colors, puts into TPA called RockPts.
Splits into T2DPointArray called RockPtsBox (size is 30X30, about the size of a rock).
Finds all ore colors, puts into take called OrePts.
Makes TBoxes out of RockPtsBox called SearchBox.
Searches within SearchBox for OrePts.

That is that this function is supposed to do.
Can someone look through and tell me where I am goofing up?
Am I going about this properly, I've basically just picked an idea(s) posted that seemed to be best way/make most sense.
HELP WHAAA!:confused::mad:



Function MineRock(WutRock:Integer):Boolean;
var I,PlusOne,tMine:Integer;
OrePts, RockPts, Bingo:TPointArray;
OrePtsBox, RockPtsBox, BingoBox: T2DPointArray;
OrePt, BingoPt: TPoint;
HighRock:Integer;
SearchBox: TBox;
Begin
If Not(LoggedIn) Then Exit;
StatsGuise('Searching For Rock: '+ IntToStr(InvCount));
If OreInLast Then Exit;
//Get and Rock Points
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.09);
FindColorsSpiralTolerance(MSCX, MSCY, RockPts, 3565690, MSX1, MSY1, MSX2, MSY2, 12);
SetColorSpeed2Modifiers(0.2,0.2);
ColorToleranceSpeed(1);
RockPtsBox:=TPAtoATPAEx(RockPts,30,30);
Writeln('OrePts ' + IntToStr (GetArrayLength(OrePts) ) );
Writeln('RockPts ' + IntToStr (GetArrayLength(RockPts) ) );
For I:=0 To High(RockPtsBox) Do
Begin
If Not(LoggedIn) Then Break;
SearchBox:= GetTPABounds(RockPtsBox[i]);
If (GetArrayLength(RockPtsBox[I]) > 30) Then
Begin
If YDebug Then DebugATPA(RockPtsBox,'');
SetColorSpeed2Modifiers(0.06,1.22);
FindColorsSpiralTolerance(MSCX,MSCY,OrePts,3293028,SearchBox.x1,SearchBox.y1,SearchBox.x2,SearchBox.y2,5);
If High(OrePts) > 1 Then
Begin
BingoBox:=TPAtoATPAEx(OrePts, 10, 10);
BingoPt:= MiddleTPA(BingoBox[I]);
If CheckAndClick('ine',BingoPt.x,BingoPt.y) Then
Begin
Result:=True;
MarkTime(tMine);
StatsGuise('Mining Rock: '+ IntToStr(InvCount));
Players[CurrentPlayer].Loc:='Mining';
PlusOne:=InvCount+1;
Repeat
If Not(LoggedIn) Then Break;
Wait(200);
If Random(2) = 0 Then
Begin
RT:=GetSystemTime;
If FindNormalRandoms Then
IncEx(WeMined,GetSystemTime - RT);
End;
If Random(50)=1 Then SleepAndMoveMouse(500+Random(100));
//If (Not(IsMoving)) Then Begin Writeln('a'); Break; End;
Until (InvCount = PlusOne) Or (TimeFromMark(tMine) > ((Players[CurrentPlayer].Integers[2]*1000) + Random(500)));
Exit;
End;
End;
End;
Wait(250+Random(100));
End;
End;

euphemism

2011-11-03 01:34:48

       
If CheckAndClick('ine',BingoPt.x,BingoPt.y) Then

What is 'CheckAndClick'?

BraK

2011-11-03 01:47:21

@Euph It most likely check the uptext before clicking…

@Yohojo that looks fine have you tested it out yet?

YoHoJo

2011-11-03 01:58:34

@Euph Yeah custom function in my script, checks uptext and clicks.
@Break looks fine huh? Tested it, didn't do anything. I cleaned it up quite a bit, probably still quite messy though but still pretty understandable. I looked over it a few times and I feel like it should work but doesn't :/! Any ideas?!

BraK

2011-11-03 02:45:59

Try throwing in a DebugTPA and DebugATPA just so that you can see what it's doing. That always helps me get things rolling. It'll also let you know where the issue is. You might add like a Wait 5000 after each Debug so you can look at them before it continues.

YoHoJo

2011-11-03 03:28:43

Yeah I was going to do that next, normally when I test scripts I just do them in the browser but I guess I'll need SMART for this stuff.

So, looking though it it seems all good to you right? I'm pretty new at TPA stuff.

BraK

2011-11-03 03:34:06

Yeah it looks fine. TPAs aren't really that hard once you get used to them. They get pretty useful all around. You be hard pressed to find something you can't solve using TPAs. So just keep practicing and go back and reference the TPA tuts for a bit as well. I was continuosly searching TPA in Naum's ut and a few other tuts.

YoHoJo

2011-11-04 05:29:59

I've solved it! Thanks so much to everyone for the help and ideas it's now working and the debug looks amazing! Just a few days to clear my mind is all it took. Honestly this is one of my happiest moments of scripting, it may not be too advanced or seem like much to some of you but oh man! Making T2DPointArrays of rocks to exclude where to search for ore colors etc etc THIS IS JUST SO COOL! WOO!
I love SRL and the SRL Community!

Here's code for anyone who cares, GOODNIGHT! 2:30AM!

Function MineRock(WutRock:Integer):Boolean;
var I,PlusOne,tMine:Integer;
OrePts, RockPts, Bingo:TPointArray;
OrePtsBox, RockPtsBox, BingoBox: T2DPointArray;
OrePt, BingoPt: TPoint;
HighRock:Integer;
SearchBox: TBox;
Begin
If Not(LoggedIn) Then Exit;
StatsGuise('Searching For Rock: '+ IntToStr(InvCount));
If OreInLast Then Exit;
//Get and Rock Points
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.09);
FindColorsSpiralTolerance(MSCX, MSCY, RockPts, 3565690, MSX1, MSY1, MSX2, MSY2, 12);
SetColorSpeed2Modifiers(0.2,0.2);
ColorToleranceSpeed(1);
//Split TPA into boxes
RockPtsBox:=TPAtoATPAEx(RockPts,35,35);
DebugATPABounds(RockPtsBox);
Writeln('This is RockPtsBox');
//OrePtsBox:= TPAtoATPAEx(OrePts,10,10);
//Seaches within RockPts for OrePts, calls matches Bingo.
// FindTPAinTPA(OrePts, RockPts, Bingo);

Writeln('RockPts ' + IntToStr (GetArrayLength(RockPts) ) );
//Creates T2DPointArray called BingoBox
// BingoBox:= TPAtoATPAEx(Bingo, 30, 30);
//Sorted BingoBoxes from center of mainscreen outwards
//SortATPAFrom(BingoBox,Point(MSCX,MSCY));
//HighRock:=High(BingoBox);
For I:=0 To High(RockPtsBox) Do
Begin
If Not(LoggedIn) Then Break;
Writeln('Searching Box ' +IntToStr (i));
SearchBox:= GetTPABounds(RockPtsBox[i]);
Writeln( IntToStr(SearchBox.x1) + ',' + IntToStr(SearchBox.y1)+ ',' + IntToStr(SearchBox.x2)+ ',' + IntToStr(SearchBox.y2) );
If (GetArrayLength(RockPtsBox[I]) > 30) Then
Begin
If YDebug Then DebugATPA(RockPtsBox,'');
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07,1.06);
FindColorsSpiralTolerance(MSCX,MSCY,OrePts,3358822,SearchBox.x1,SearchBox.y1,SearchBox.x2,SearchBox.y2,6);
Writeln('OrePts ' + IntToStr (GetArrayLength(OrePts) ) );
SetColorSpeed2Modifiers(0.2,0.2);
ColorToleranceSpeed(1);
If High(OrePts) > 1 Then
Begin
BingoBox:=TPAtoATPAEx(OrePts, 1, 1);
DebugTPA(OrePts,'');
Writeln('This is BingoBox');
If GetArrayLength(BingoBox[i])<1 Then Continue;
BingoPt:= MiddleTPA(BingoBox[I]);
If CheckAndClick('ine',BingoPt.x,BingoPt.y) Then
Begin
Result:=True;
MarkTime(tMine);
StatsGuise('Mining Rock: '+ IntToStr(InvCount));
Players[CurrentPlayer].Loc:='Mining';
PlusOne:=InvCount+1;
Repeat
If Not(LoggedIn) Then Break;
Wait(200);
If Random(2) = 0 Then
Begin
RT:=GetSystemTime;
If FindNormalRandoms Then
IncEx(WeMined,GetSystemTime - RT);
End;
If Random(50)=1 Then SleepAndMoveMouse(500+Random(100));
//If (Not(IsMoving)) Then Begin Writeln('a'); Break; End;
Until (InvCount = PlusOne) Or (TimeFromMark(tMine) > ((Players[CurrentPlayer].Integers[2]*1000) + Random(500)));
Exit;
End;
End Else Continue;
End;
Wait(250+Random(100));
End;
End;

BraK

2011-11-04 06:04:50

I know how you feel man. Your welcome for the help. Have fun making the rest of the script. I take it your updating the PMS script?

YoHoJo

2011-11-04 15:42:34

Actually, I copypastaed it and I'm making it into something new :D!