Results 1 to 4 of 4

Thread: How to check if player is active w/ XP Counter

  1. #1
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default How to check if player is active w/ XP Counter

    How to check if your player is active using XP Counter



    This is a short tutorial, but very useful and easy alternative to reflection's player animation.

    Don't know what is a XP Counter?

    All this do is simply check the time since the last exp change, and when it goes over certain time (depends on what your doing) you can determine if your player isn't skilling any more.



    Here is a sample code that you can use, I took this off my clan war fighter. Note that I give script users the option to use this feature or not, although most people does play with it on, there are some ( like me) who play with it off.


    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;

    Enjoy

    Last edited by Main; 01-09-2012 at 12:35 AM.
    Oh Hai Dar

  2. #2
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    I was using this method... but nub accounts this doesn't work well or at all. If you miss twice you get a false positive.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  3. #3
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    I was using this and along with checking the HP increase ( by more than 5) or decrease and whether or not the HP Bar is present.

    I think it covered most of time. But if anyone wants an alternative, there is also the pixel shift thing that cohen used in MSI.
    Oh Hai Dar

  4. #4
    Join Date
    Dec 2011
    Posts
    392
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes! Thank you, exactly what I was looking for today.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •