Simba Code:
Program CounterTest;
{$i srl/srl.scar}
Var
OldXP, TimeSinceFight: Integer;
Procedure DeclarePlayers;
Begin
//Blah blah blah
Players[ 0].Booleans[ 1] := True; //Would you like to have the XP Counter on?
//Turn this to false if you don't normally use this.
End;
Begin
SetupSRL;
If Players[ CurrentPlayer].Booleans[ 1] Then
ToggleXPBar( True);
Repeat
If IsXPBarOpen Then
Begin
If Not( GetXPBarTotal = OldXP) Then
Begin
OldXP := GetXPBarTotal;
MarkTime( TimeSinceFight);
End;
End;
// Insert rest of mainloop;
// And add marktime each time after you click on the tree or monster.
FindMonster/Object/Item;
MarkTime( TimeSinceFight);
If TimeFromMark( TimeSinceFight) > 6600 Then
Begin
Writeln( 'You are not in fight any more!');
ProggieProcedure/blahblahblah;
End;
{
6600 is what you should use for fighting, and you should also combine it with check if HP bar present in the vicinity of
player.
Other skills probably have a different time limit, so you need to find this out yourself.
}
Until False;
End;