JuKKa
2008-07-22 20:26:59
I have noticed that people have a hard time using these function, alot of the times where they FAIL because of that they want a exact location WHERE it should search… ( they ask for (X, Y)) Most of the times where you are not standing exactly by the rock or fishing hole. findgas or findwhirlpool wont simply work, because of when clicking it will move and then the X, Y Values wont represent the place where you clicked. This edit or.. remake of the Whirlpool function shows exactly how we SHOULD make these functions.. By using DISTANCE! It finds all whirlpool on screen, then if one is close enough to be possible that you are fishing or standing close to that one, it will return TRUE. By making these functions use distance we would save alot of nets and pickaxes.
What i have noticed is that alot of NEW scripters have a hardtime understanding this, and it would help ALOT!
If you didnt undetstand what i meant…please post
What i have noticed is that alot of NEW scripters have a hardtime understanding this, and it would help ALOT!
Function FindWhirlPool: Boolean;
Var
CTS, I, X, Y: Integer;
TPA: TPointArray;
aTPA: T2DPointArray;
arC: TIntegerArray;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.78, 0.16);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 10524060, MSX1, MSY1, MSX2, MSY2, 26);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(CTS);
aTPA := TPAtoATPAEx(TPA, 40, 40);
For I:= 0 To High(aTPA) Do
Begin
arC := GetColors(aTPA[I]);
ClearSameIntegers(arC);
MiddleTPAEx(aTPA[I], X, Y);
Result := (High(arC) < 80)And(Distance(X, Y, MSCX, MSCY) > 60);
If(Result)Then
Begin
Writeln('Whirlpool!');
Inc(WhirlPools);
Break;
End;
End;
End;If you didnt undetstand what i meant…please post