Troll
2011-12-31 13:09:25
Ok so i have made a function which i want to use to fight lesser deamons in the resoucre dung, but it is very slow so the demons have moved by the time script find them.
So should i use colour speed 1 or is the way ive scripted slow? Thanks for any input
Also here is the settings
Function Attack(Name:String):Boolean;
Var x,y,I :Integer;
TPA :TPointArray;
MyATPA :Array Of TPointArray;
Mon :Monster;
Begin
If Not LoggedIn Then Exit;
Mon := SetMon(Name);
SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(Mon.Hue,Mon.Sat);
If FindColorsSpiralTolerance(x,y,TPA,Mon.Colour,MSX1,MSY1,MSX2,MSY2,Mon.Toll) Then
Begin
MyATPA := TPAtoATPAEx(TPA,Mon.W,Mon.H)
For I:= 0 To High(MyATPA) Do
If High(MyATPA[I]) > Mon.MinCount Then
Begin
SMART_DrawDotsEx(True,MyATPA[I],clRed);
MMouse(MiddleTPA(MyATPA[I]).x,MiddleTPA(MyATPA[I]).y,3,3);
If WaitUptext(Mon.Name,3000) Then
Begin
GetMousePos(x,y)
If Mon.MustRClick Then
Begin
If Random(100)=5 Then
Begin
Mouse(x,y,0,0,False);
If WaitOption(Mon.RClickOption,3000) Then
Begin
Write('Right clicked and attacked ' + Mon.Name + ' :)');
Result := True;
Exit;
End Else Begin
Write('Right Clicked ' + Mon.Name + ' But could not see option' + Mon.RClickOption);
Result := False;
Exit;
End;
End Else Begin
Mouse(x,y,0,0,True);
Write('Left clicked ' + Mon.Name);
Result := True;
Exit;
End;
Mouse(x,y,0,0,True);
Write('Left clicked ' + Mon.Name);
Result := True;
Exit;
End;
End;
End Else Write('MinCount was too high ');
End Else Begin
Write('No Colours Found for ' + Mon.Name);
Result := False
End;
End;
So should i use colour speed 1 or is the way ive scripted slow? Thanks for any input
Also here is the settings
'lesser':Begin
Result.Colour := 2634828;
Result.H := 30;
Result.Hue := 0.26;
Result.MinCount := 30;
Result.MustRClick := True;
Result.Name := 'Lesser Deamon';
Result.RClickOption := 'ttack';
Result.Sat := 1.26;
Result.Toll := 19;
Result.W := 20;