I am getting the feeling it will not be that hard, but the problem is, Fakawi's Scripts never use tol, he always pick(ed)(s) the color when you login, I either think Tolerance or Some good function will solve it.
PHP Code:
Function FindColor(MaxTol:Integer):Boolean;
Var Tol,Ex,Ey:Integer;
Begin
H:=H+1;
For G := 1 to H do
Begin
Case G Of
1: Begin Color:= Color1; If Debug Then WriteLn('Color1'); End;
2: Begin Color:= Color2; If Debug Then WriteLn('Color2'); End;
3: Begin Color:= Color3; If Debug Then WriteLn('Color3'); End;
End;
End;
If Debug Then WriteLn('FindColor;');
While (Not (FindColorTolerance(Ex,Ey,Color,MSX1,MSY1,MSX2,MSY2,Tol))
And Not (Tol > MaxTol)) Do
Begin
Tol:=Tol+1;
If Debug Then WriteLn('Tol = '+IntToStr(Tol));
End;
If ((FindColorTolerance(Ex,Ey,Color,MSX1,MSY1,MSX2,MSY2,Tol))
And Not (Tol > MaxTol)) Then Result:=True;
Tol:=1;
If Debug Then WriteLn('Color = ' + IntToStr(OreColor));
Wait(10);
End;
MaxTol is a Integer.v putted in the function.
Debug is a Constant I still had in my functions, I didn't took it out.
P and H are global vars.
You might want to make a other function for making diff colors.
You need to put this in the function you use :
Code:
Begin If H>3 Then H:=0; End;
Example.
PHP Code:
Procedure PowerMine;
Var Dx,Dy:Integer;
Begin
If Debug Then WriteLn('PowerMine;');
If Find(Tol) Then
Begin If FindObj(Dx,Dy,'Mine',Color,10) Then
Begin
H:=0;
If Not FindGas(DX,DY) Then
Begin
Mouse(DX, DY, 0, 0, True);
If (FlagPresent) Then
Begin
Flag;
Wait(500 + Random( 500 ) );
End;
MarkTime(Mark);
Repeat
Wait(100);
FindPick;
If FindFight Then Begin Face('N') RunTo(RunDir,False) End;
FindNormalRandoms;
Until ((TimeFromMark(Mark) > (1000 * SecondsToWait))
or (FindColor(x,y,0,51,421,51,421))
or (FindColor(x,y,7981,71,392,71,392)))
If FindColor(x,y,7981,71,392,71,392) Then
Begin
ClicktoContinue;
ClicktoContinue;
End;
End;
End;
End
Else Begin If H>3 Then H:=0; End; // RIGHT HERE.
End;
PHP Code:
Procedure SetOreColor;
Begin
Case Players[CurrentPlayer].String1 Of
'Copper' : Color1:=CopperColor;
'Tin' : Color1:=TinColor;
'Clay' : Color1:=ClayColor;
'Iron' : Color1:=IronColor;
'Silver' : Color1:=SilverColor;
'Coal' : Color1:=CoalColor;
'Gold' : Color1:=GoldColor;
'Mithril' : Color1:=MithrilColor;
'Adamant' : Color1:=AdamantColor;
'Runite' : Color1:=RuniteColor;
End;
Case Players[CurrentPlayer].String2 Of
'Copper' : Color2:=CopperColor;
'Tin' : Color2:=TinColor;
'Clay' : Color2:=ClayColor;
'Iron' : Color2:=IronColor;
'Silver' : Color2:=SilverColor;
'Coal' : Color2:=CoalColor;
'Gold' : Color2:=GoldColor;
'Mithril' : Color2:=MithrilColor;
'Adamant' : Color2:=AdamantColor;
'Runite' : Color2:=RuniteColor;
End;
Case Players[CurrentPlayer].String3 Of
'Copper' : Color3:=CopperColor;
'Tin' : Color3:=TinColor;
'Clay' : Color3:=ClayColor;
'Iron' : Color3:=IronColor;
'Silver' : Color3:=SilverColor;
'Coal' : Color3:=CoalColor;
'Gold' : Color3:=GoldColor;
'Mithril' : Color3:=MithrilColor;
'Adamant' : Color3:=AdamantColor;
'Runite' : Color3:=RuniteColor;
End;
WriteLn('Color1 = '+IntToStr(Color1)+'; and Color2 = '+
IntToStr(Color2)+'; and Color3 = '+IntToStr(Color3)+';');
End;
Color constants.
PHP Code:
Const CopperColor = 4549781;
Const TinColor = 9277080;
Const ClayColor = 4553880;
Const IronColor = 2371664;
Const SilverColor = 12434885;
Const CoalColor = 2834753;
Const GoldColor = 5161431;
Const MithrilColor = 7359564;
Const AdamantColor = 6322272;
Const RuniteColor = 0;
This works fine for me, it will be included in my powerminer that will be posted soon, I will go and experiment with this.
Just to keep you guys updated.