Results 1 to 9 of 9

Thread: Getting 'logout;' to work

  1. #1
    Join Date
    May 2007
    Location
    Everywhere
    Posts
    1,428
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Getting 'logout;' to work

    I've been having trouble getting logout; to work.

    Example:

    //{.Include SRL\SRL\Misc\Smart.Scar}
    {.Include SRL\SRL.Scar}
    {.include srl/srl/skill/magic.scar}

    // Load DTMs and stuff here + free DTMs

    procedure MyScriptActionHere;
    begin
    if not LoggedIn then exit;
    if FindDTM(ASD, x, y, 545, 208, 718, 429) then
    begin
    writeln ('You lack what you need to do xyz');
    logout; // THIS DOESNT WORK
    end;
    if FindDTM(ASD2, x, y, 545, 208, 718, 429) then
    begin
    writeln ('Found ');
    end;
    end;


    begin
    SetUpSRL;
    LoadDTMs;
    MyScriptActionHere;
    FreeDTMs;
    end.
    The logout does nothing. I've put test text before it like writeln ('1')... and '2'.
    1 and 2 will be output on the scar module but no logout occurs. What am I doing wrong, or is it out of date?


    tl;dr: I've debugged it and it goes over the logout; code but doesn't trigger it

  2. #2
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Don't think it's you. I have the same problem. Mine just hovers the 'X'.

  3. #3
    Join Date
    Oct 2009
    Location
    Melb, Australia
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I have found it has always been sort of buggy for me (the logout function) so I just use my own and SRL's as a fallback if my own fails.

  4. #4
    Join Date
    Dec 2007
    Location
    Canada
    Posts
    187
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    perhaos you need to set DeclarePlayers i dunno i never have problems with this
    I'm baaaack

  5. #5
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    SCAR Code:
    function Logout: Boolean;
    var
      c, i: Integer;
    begin
      Result := (not (LoggedIn));
      if Result = True then
        Exit;
      if (SRL_Procs[srl_OnLogOut] <> nil) then
        SRL_Procs[srl_OnLogOut]();
      if GameTab(tab_LogOut) = False then
        Exit;
      Wait(200 + Random(100));
      while (LoggedIn) and (c < 10) do
      begin
        Inc(c);
        if(ClickText('here', UpChars, MIX1, MIY1, MIX2, MIY2, True))then
          for i := 0 to 10 do
          begin
            Wait(1000);
            if not(LoggedIn)then
            begin
              Result := True;
              Exit;
            end;
          end;
      end;
    end;

    Based on SRL's function, it'll actually search for UpChars font with the text "here", but that the uptexts are outdated atm, it won't work, so you'll have to make your own i guess for a short period. Just a simple FindColor(or something like that) as a failsafe + mouse on it, would be perfectly, but you could also just make a simple mouse, but a failsafe is always good .

    Good luck.
    Hi

  6. #6
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by Tickyy View Post
    SCAR Code:
    function Logout: Boolean;
    var
      c, i: Integer;
    begin
      Result := (not (LoggedIn));
      if Result = True then
        Exit;
      if (SRL_Procs[srl_OnLogOut] <> nil) then
        SRL_Procs[srl_OnLogOut]();
      if GameTab(tab_LogOut) = False then
        Exit;
      Wait(200 + Random(100));
      while (LoggedIn) and (c < 10) do
      begin
        Inc(c);
        if(ClickText('here', UpChars, MIX1, MIY1, MIX2, MIY2, True))then
          for i := 0 to 10 do
          begin
            Wait(1000);
            if not(LoggedIn)then
            begin
              Result := True;
              Exit;
            end;
          end;
      end;
    end;

    Based on SRL's function, it'll actually search for UpChars font with the text "here", but that the uptexts are outdated atm, it won't work, so you'll have to make your own i guess for a short period. Just a simple FindColor(or something like that) as a failsafe + mouse on it, would be perfectly, but you could also just make a simple mouse, but a failsafe is always good .

    Good luck.
    UpText is working just fine...

  7. #7
    Join Date
    Oct 2009
    Location
    Melb, Australia
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  8. #8
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    UpText is working just fine...
    i still have 3.21 lol.
    Hi

  9. #9
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Update to Prerelease, use Tortuous SVN to do it, really easy, and once installed it makes SCAR work much better, lol at least for me it does.
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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