cadet54
2012-06-24 14:10:03
Hi there I am working on a cow fighter/looter with banking features, currently I have got the going to cows and locating the field of and the from cow field to bank and banking complete.
I am struggling with the fighting part I have looked at most fighting scripts and am struggling to get to grips with them, yeah I know im a noob but gotta stop leeching at some stage lol.
I am using the in built functions to detect when im fighting, not fighting and when a mob is already under attack.
The part where I find and attack the cows is that hard part if the cows were all similar colour I would just use the following but modified.
But since theres multiple colours I dont really know were to go I have this but its extremely in accurate.
I am struggling with the fighting part I have looked at most fighting scripts and am struggling to get to grips with them, yeah I know im a noob but gotta stop leeching at some stage lol.
I am using the in built functions to detect when im fighting, not fighting and when a mob is already under attack.
The part where I find and attack the cows is that hard part if the cows were all similar colour I would just use the following but modified.
Function FindGate:Boolean;
Var
a, h: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
tmpCTS : Integer;
Begin
FindNormalRandoms;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.13, 0.44);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 4741737, MSX1, MSY1, MSX2, MSY2, 4);
ATPA := TPAtoATPAEx(TPA, 20, 20);
SortATPASize(ATPA,True);
H := High(ATPA);
for a := 0 to H do
Begin
MiddleTPAEx(atpa[a], X, Y);
MMouse(X, Y, 2, 2);
If (WaitUpTextMulti(['open', 'pen'], 750)) Then
Begin
ClickMouse2(False);
ChooseOption('Open');
writeln('Gate is now open')
Result := True
Exit;
End;
If (WaitUpTextMulti(['close', 'ose', 'lose'], 750)) Then
Begin
writeln('Gate was already open')
Result := True
Exit;
End else
begin
ObjDTM_Walk('73:84:4:1:7:62:101:1:7:49:79:1:7:61:61:3:7:101:66:4:69:79:77:81:76:90:70:88', 0, 100, 80, True);
Wait(500);
FindGate;
Result := True
End;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
End;
end; But since theres multiple colours I dont really know were to go I have this but its extremely in accurate.
Function FightCow: Boolean;
var
X, Y: Integer;
begin
if not loggedIn then exit;
repeat
inc(F1);
if InFight then
begin
repeat
FindNormalRandoms;
until (not (OthersInFight) or (not LoggedIn) or (not InFight))
end;
if FindObjEx(X, Y, ['ttack Co'], CowColours, Tolerance, 50, 1, 5, 689, 390) and not(WaitUpText('Walk', random(50))) then
begin
if not (IsFightAt(X, Y) and not InFight) then
begin
GetMousePos(X, Y);
Mouse(X, Y, 2, 2, false);
if WaitOptionMulti(['ttack Co', 'attack Cow', 'attack Co'], 200)then
begin
//Writeln('You got a kill');
end;
WaitOptionMulti(['ttack Co', 'attack Cow', 'attack Co'], 200);
Wait(1000);
end;
while IsMoving do
begin
Wait(250);
end;
Result := True;
exit;
end;
until (F1=5) or (true)
end;