in my script, i want to make it so that the skill to train is the lowest skill they have that they set a goal for, so if their goals were 40 attack 10 def and 50 str, it would train each skill fairly evenly, until that skill reached it's goal, here's what i have so far
SCAR Code:
function AttackMode:boolean;
var
i,att,str,def:integer;
Levels[0..2]: array of integer;
begin
if not(loggedIn) then exit;
result:=true;
if (timefrommark(a)>60000)or(players[currentplayer].skill='') then
begin
GameTab(2);
wait(200);
Levels[0] := 100;
Levels[1] := 100;
Levels[2] := 100;
att:=getskillinfo('attack',false);
str:=getskillinfo('strength',false);
def:=getskillinfo('defence',false);
if Debug then writeln(inttostr(att)+' attack');
if Debug then writeln(inttostr(str)+' strength');
if debug then writeln(inttostr(def)+' defence');
marktime(a);
Players[CurrentPlayer].skill:='';
While (Players[CurrentPlayer].skill:='') do
begin
if att<lowercasE(players[CurrentPlayer].integers[1] then
Levels[0] := att;
if str<lowercasE(players[CurrentPlayer].integers[2] then
Levels[1] := str;
if def<lowercasE(players[CurrentPlayer].integers[3] then
Levels[2] := def;
Players[CurrentPlayer].skill =
end;
end;
GameTab(1);
case lowercase(players[currentplayer].skill) of
'attack': setfightmode(1);
'strength': setfightmode(2);
'defence','defense': setfightmode(4);
else result:=false;
end;
end;
end;
how could i find the lowest integer in the array, or what should i change to make it do this, thanks in advance guys