Results 1 to 21 of 21

Thread: Logout updated

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

    Default Logout updated

    They added and "Exit to logout" button in the logout tab. I've tested this and it works.

    PHP Code:
    function LogoutBoolean;
    var
      
    xytInteger;
    begin
      
    if (SRL_Procs[srl_OnLogOut] <> nilthen
        SRL_Procs
    [srl_OnLogOut]();
      if (
    not GameTab(tab_Logout)) then
        
    Exit
      else
        if (
    FindText(xy'ogin'UpCharsMIX1MIY1MIX2MIY2)) then
        begin
          MouseBox
    (6064166754211);

          
    := GetSystemTime 10000;
          while (
    GetSystemTime t) do
          
    begin
            Wait
    (RandomRange(50100));
            if (
    not LoggedInthen
            begin
              Result 
    := True;
              Exit;
            
    end;
          
    end;
        
    end;
    end
    I was also thinking about adding a wait for the logout text. Not sure if there's a WaitText function or not. Also wasn't sure if it is really needed seeing as it's never been there before.

    Coh3n
    Last edited by Wanted; 04-29-2010 at 11:33 PM.

  2. #2
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you sir. Just noticed it was changed.

  3. #3
    Join Date
    Mar 2007
    Posts
    478
    Mentioned
    4 Post(s)
    Quoted
    4 Post(s)

    Default

    I don't believe there is a WaitText function. Maybe some kind of repeat until function. Another idea is to have is randomly log out to either the lobby then out or just logout.
    Back from the dead.....

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

    Default

    Quote Originally Posted by aran armath View Post
    I don't believe there is a WaitText function. Maybe some kind of repeat until function. Another idea is to have is randomly log out to either the lobby then out or just logout.
    There is; in Timing.scar:
    SCAR Code:
    {*******************************************************************************
    function WaitUptext(S: String; Time: Integer): Boolean;
    By: Marpis edited by N1ke!
    Description: Waits for an UpText, returns true if found
    *******************************************************************************}
    Last edited by Naum; 04-28-2010 at 04:01 PM.

  5. #5
    Join Date
    Mar 2007
    Posts
    478
    Mentioned
    4 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by Naum View Post
    There is; in Timing.scar:
    SCAR Code:
    {*******************************************************************************
    function WaitUptext(S: String; Time: Integer): Boolean;
    By: Marpis edited by N1ke!
    Description: Waits for an UpText, returns true if found
    *******************************************************************************}
    In order to find the UpText, your mouse must be hovering over the area where the logout button is. I guess you could use it, my only thought that we shouldn't is because we have to move the mouse onto where the logout button will appear. My first thought when I looked at it was that it seemed robotic to use it, just moving the mouse to where it should be and waiting for it. Second thoughts, might work, doesn't seem that robotic.
    Back from the dead.....

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

    Default

    Quote Originally Posted by Naum View Post
    There is; in Timing.scar:
    SCAR Code:
    {*******************************************************************************
    function WaitUptext(S: String; Time: Integer): Boolean;
    By: Marpis edited by N1ke!
    Description: Waits for an UpText, returns true if found
    *******************************************************************************}
    Doesn't that only check in the upper left corner though?

    I was talking about if there's lag from when you click the logout tab to when the text appears in the inventory.

  7. #7
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Doesn't that only check in the upper left corner though?

    I was talking about if there's lag from when you click the logout tab to when the text appears in the inventory.
    Maybe try a WaitColor(); or something? I believe there is a WaitColorCount(); as well.

  8. #8
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    There is also a waitFunc last I checked..
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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

    Default

    Quote Originally Posted by Coh3n View Post
    Doesn't that only check in the upper left corner though?
    Yes, yes it does.
    If you want to check for it, just use a wait color count as NCDS mentioned.
    @Nava AFAIK, last time I checked, WaitFunc doesn't allow you to pass parameters.

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

    Default

    Quote Originally Posted by Naum View Post
    @Nava AFAIK, last time I checked, WaitFunc doesn't allow you to pass parameters.
    That's what I thought also, thus why I didn't use it.

  11. #11
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Whats wrong with?

    SCAR Code:
    {*******************************************************************************
    function ExitToLobby: Boolean;
    By: Starblaster100, Raymond, & IceFire908
    Description: Exits to the Lobby (for breaks?)
    *******************************************************************************}

    function ExitToLobby: Boolean;
    var
      x, y, c, i: Integer;
    begin
      Result := LobbyScreen;
      if Result = True then
        Exit;
      if (SRL_Procs[srl_OnExitToLobby] <> nil) then
        SRL_Procs[srl_OnExitToLobby]();
      if (not (GameTab(tab_LogOut))) then
        Exit;
      Wait(200 + Random(100));
      while (LoggedIn) and (c < 10) do
      begin
        Inc(c);
        if(FindText(x, y, 'obb', UpChars, MIX1, MIY1, MIX2, MIY2))then
        begin
          MouseBox(579, 367, 699, 386, 1);
          for i := 0 to 10 do
          begin
            Wait(1000);
            if (LobbyScreen) then
            begin
              Result := True;
              Exit;
            end;
          end;
        end else
        if(FindText(x, y, 'lick', UpChars, MIX1, MIY1, MIX2, MIY2))then
        begin
          MouseBox(579, 367, 699, 386, 1);
          for i := 0 to 10 do
          begin
            Wait(1000);
            if not(LoggedIn) then
            begin
              Result := True;
              Exit;
            end;
          end;
        end
      end;
    end;

    {*******************************************************************************
    function LeaveLobby: Boolean;
    By: IceFire908
    Description: Logs you out from lobby screen.
    *******************************************************************************}

    function LeaveLobby: Boolean;
    var
      T: LongInt;
    begin
      T := GetSystemTime;
      while ((not (Result)) and ((GetSystemTime - T) < 30000)) do
      begin
        MouseBox(678, 24, 699, 43, 1);
        Wait(RandomRange(1000, 2000));
        Result := (not (LobbyScreen));
      end;
    end;

    {*******************************************************************************
    function Logout: Boolean;
    By: IceFire908
    Description: Logs you all the way out from ingame.
    *******************************************************************************}

    function Logout: Boolean;
    begin
      if (SRL_Procs[srl_OnLogOut] <> nil) then
        SRL_Procs[srl_OnLogOut]();
      if (ExitToLobby) then
        Result := LeaveLobby;
    end;

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

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

    Default

    You can logout from the game now... You don't have to go through the Lobby.

  13. #13
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Kool haven't played rs in a long time....

    Here:
    SCAR Code:
    {*******************************************************************************
    function Logout: boolean;
    By: Coh3n
    Description: Logs Out.
    *******************************************************************************}

    function Logout: boolean;
    var
      x, y, t: integer;
    begin
      if (SRL_Procs[srl_OnLogOut] <> nil) then
        SRL_Procs[srl_OnLogOut]();

      if (not (GameTab(tab_Logout))) then
        Exit;

      if FindText(x, y, 'ogin', UpChars, MIX1, MIY1, MIX2, MIY2) then
      begin
        MouseBox(606, 416, 675, 421, 1);
        t := GetSystemTime + 10000;
        while (GetSystemTime < t) do
        begin
          Wait(RandomRange(50, 100));
          if (not LoggedIn) then
          begin
            Result := True;
            Exit;
          end;
        end;
      end;
    end;
    Last edited by Dgby714; 04-28-2010 at 09:08 PM.

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

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

    Default

    I don't see what you changed... other than taking out the else in which case I'd like to ask why?

  15. #15
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Why not have a logout with a param for whether you want to go to the logout screen or the lobby?
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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

    Default

    Quote Originally Posted by Nava2 View Post
    Why not have a logout with a param for whether you want to go to the logout screen or the lobby?
    You could, but that would require everyone to change every logout used in their scripts to make it work which isn't a big deal I guess. I think it's just easier to have separate functions, but that's just me.

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

    Default

    SCAR Code:
    {*******************************************************************************
    function Logout: boolean;
    By: Coh3n
    Description: Logs Out.
    *******************************************************************************}

    function LogoutEx(Lobby : Boolean): boolean;
    var
      x, y, t: integer;
      P : TPoint;
    begin
      if (SRL_Procs[srl_OnLogOut] <> nil) then
        SRL_Procs[srl_OnLogOut]();

      if Lobby then
        P := Point(606, 374)
      else
        P := Point(606, 416);

      if (not (GameTab(tab_Logout))) then
        Exit
      else
      if FindText(x, y, 'ogin', UpChars, MIX1, MIY1, MIX2, MIY2) then
      begin
        MouseBox(P.X, P.Y, P.X+69, P.Y+5, 1);
        t := GetSystemTime + 10000;
        while (GetSystemTime < t) do
        begin
          Wait(RandomRange(50, 100));
          if (not LoggedIn) then
          begin
            Result := True;
            Exit;
          end;
        end;
      end;
    end;

    function Logout;
    begin
      Result := LogoutEx(False);
    end;

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

  19. #19
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Or just use Logout; and ExitToLobby; lol....


    Quote Originally Posted by Coh3n View Post
    I don't see what you changed... other than taking out the else in which case I'd like to ask why?
    Theres no point in adding a else if it exit;'s when true....

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

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

    Default

    Quote Originally Posted by Dgby714 View Post
    Theres no point in adding a else if it exit;'s when true....
    I guess... it was just there before so I kept it (the ExitToLobby function).

  21. #21
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Resolved, basically used Coh3ns but with Tara's unsigned support.

    Quote Originally Posted by Nava2 View Post
    Why not have a logout with a param for whether you want to go to the logout screen or the lobby?
    Edit:
    Originally, there was ExitToLobby which would log you out to the lobby and leave you there (for breaks/world switching ect..) , then Logout would use ExitToLobby in it along with a final logout button clicker, now the two are completely separate.

    So now if they want to do like Logout(False) [I think that's what you're saying] they can simply use ExitToLobby; or Logout;
    Last edited by Wanted; 04-29-2010 at 11:45 PM.

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
  •