I'm having more trouble with my fight monster function. Though I have put others in fight and used it properly it still decides to try and fight the cow even though someone else is attacking it.
I have put InFight and OtherInFight functions in my script to make sure they are working, I have played around with it a bit but cant seem to get it to work properly.Code:Function FightCow: Boolean; var X, Y: Integer; begin if not loggedIn then exit; repeat if InFight then begin x := MSCX; y := MSCY; repeat FindNormalRandoms; until (not (OthersInFight) or (not LoggedIn) or (not InFight)) end; if(FindObject([Colour(8623000, 29, 0.02, 0.16), Colour(12370887, 9, 0.22, 0.46), Colour(5733790, 11, 0.02, 0.23), Colour(6717077, 12, 0.05, 0.82), Colour(5265762, 8, 0.12, 0.44)], ['Attack C', 'ack Cow', 'Attack Cow'], Point(MSCX, MSCY), mouse_Right, 3, 3, 5, False, False))then begin if not (IsFightAt(X, Y) and not InFight) then begin if WaitOptionMulti(['Attack C', 'ack Cow', 'Attack Cow'], 200) then begin Writeln('Fighting') end; Result := True end; end; until (true) end;
Any advice is welcome Im pretty sure I have set it up properly.
I am also using this for the fight and looting in the main loop, I haven't added positioning yet to move around the field when it cant find a cow what do you guys think?
Code:Procedure Mainloop; begin Repeat Repeat Repeat FightCow; Until (True) If (True) then begin wait(RandomRange(5000,7000)); If not (Killing) then FindLoot; end; until (InvFull) if (InvFull) then Begin CowsToBank; BankToCows; end; until(false) FreeDTM(HTele); FreeDTM(LumSymbol); FreeDTM(AlkSymbol); end;


Reply With Quote





