Results 1 to 15 of 15

Thread: function LoggedInFailsafe: Boolean;

  1. #1
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default function LoggedInFailsafe: Boolean;

    Its mainly made for SMART uses and sometimes when you lag SMART flashes and sometimes scripts say your logged out even if your not, this was just made to reduce the risk of it happening.

    SCAR Code:
    function LoggedInFailsafe: Boolean;
    var
      Tries: Integer;
    begin
      while not (GetColor(532, 74) = 3951443) do
      begin
        wait(500);
        Inc(Tries);
        if (Tries >= 5) then
        begin
          Result := False;
          srl_Warn('LoggedInFailsafe', 'Player is believed to be logged out', warn_Debug);
          exit;
        end;
      end;
      Result := True;
    end;

    Evilchickens posted one:
    SCAR Code:
    function LoggedInFailsafe: Boolean;
    begin
      Result := WaitColor(532, 74, 3951443, 0, 2500);
      if (not Result) then
        srl_Warn('LoggedInFailsafe', 'Player is believed to be logged out', warn_Debug);
    end;

  2. #2
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Does this thing mess up like the one did in your tutorial islander script?
    ~Hermen

  3. #3
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Quote Originally Posted by Hermen View Post
    Does this thing mess up like the one did in your tutorial islander script?
    Well no, that problem was from a loop which didn't break, fixed though. This one was remade .

  4. #4
    Join Date
    May 2008
    Location
    Oregon, USA
    Posts
    154
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I am going to try this out, Good idea and thankyou.

  5. #5
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    It works great, and I've borrowed it for my scripts (with credit of course). Well done.

    You should probably reduce the Writeln spamming, though.

    You don't really need 5+ consecutive Writelns every time you log out or get logged out.


  6. #6
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    function LoggedInFailsafe: Boolean;
    begin
      Result := WaitColor(532, 74, 3951443, 0, 2500);
      if (not Result) then
        srl_Warn('LoggedInFailsafe', 'Player is believed to be logged out', warn_Debug);
    end;

    Would this be doing the same thing?

  7. #7
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    I guess but why, is SRL always going for the shortest procedures?

  8. #8
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by BobboHobbo View Post
    I guess but why, is SRL always going for the shortest procedures?
    Well, Short = Efficient, in most cases.

  9. #9
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by BobboHobbo View Post
    I guess but why, is SRL always going for the shortest procedures?
    Why shouldn't they? The function EC! posted is potentially faster (will find the color faster, right?), and less characters = less things to compile = faster start up, I think. And it's easier to read than yours (no offence <3 ).

    ... I really need to post faster.

  10. #10
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Quote Originally Posted by ian. View Post
    Why shouldn't they? The function EC! posted is potentially faster (will find the color faster, right?), and less characters = less things to compile = faster start up, I think. And it's easier to read than yours (no offence <3 ).

    ... I really need to post faster.
    True, but since did waitcolor exist?

  11. #11
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    When WaitMouse and other Wait___ functions were made.

    (Within the last month or two, I think.

  12. #12
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That's good. Because of the lightning storm here I am experiencing A LOT of lag and my scripts usually get stopped because of it. But seems to me as this one's going to solve my problems
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

  13. #13
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Evilchicken, I tested yours and it does not work.

  14. #14
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Just put that shit in directives for SRL_SMART into LoggedIn, done

  15. #15
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    BH, I took the coords and color from your function.
    If yours works, mine should too.

    And, by the way, it's not a matter of "shortening"; it's more a matter of using available resources instead of making your own.

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
  •