Procedure EatToHeal(FoodColor: Integer);
Var
Sex, Sey: Integer;
Begin
Sex:= 565;
Sey:= 215;
If(FindColorSpiral(Sex, Sey, FoodColor, MIX1, MIY1, MIX2, MIY2)) Then
Begin
Mouse(Sex, Sey, 0, 0, True);
End Else
Begin
WriteLn('You do not have food!');
SetRun(True);
RunAwayDirection('East');
LogOut;
TerminateScript;
End;
End;
You can take out the Sex:= 565; and Sey:= 215; lines, they assign that value to the variables but if it finds the colour then that value is overwritten by the coordinates of the colour. I don't know what the MIX1 etc values are but I guess you're searching in the inventory so replace them with the coordinates of the inventory. Apart from that it looks fine.