Results 1 to 8 of 8

Thread: Failsafe login

  1. #1
    Join Date
    Feb 2012
    Location
    SRL Jail
    Posts
    1,319
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Failsafe login

    If my script were to log out and I want it to log back in, how do I do that?
    I've tried
    Simba Code:
    If (not loggedin) then
    loginplayer

    but that spouts my name and password, how do I fix this?

  2. #2
    Join Date
    Jan 2012
    Location
    Long Island, NY
    Posts
    413
    Mentioned
    5 Post(s)
    Quoted
    95 Post(s)

    Default

    This is how I do it
    Simba Code:
    if (not(LoggedIn)) then
          if Players[CurrentPlayer].Active then
            LoginPlayer;

    Also get into the practice of following standards when you code, it makes it easier to read. Hope this helps.

  3. #3
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Correct me if I'm wrong Brotein but you indented three times on your second line instead of once = incorrect standards

    I'm sure this would be the way to do it:
    Simba Code:
    if not LoggedIn then //removed unnecessary brakets
      if (Players[CurrentPlayer].Active = True) then // you didn't set Active to true...
            LoginPlayer;

  4. #4
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    Correct me if I'm wrong Brotein but you indented three times on your second line instead of once = incorrect standards

    I'm sure this would be the way to do it:
    Simba Code:
    if not LoggedIn then //removed unnecessary brakets
      if (Players[CurrentPlayer].Active = True) then // you didn't set Active to true...
            LoginPlayer;
    Your Active Player code is sort of correct, but Brotein had it right in his. You're not setting it to True, you're checking if it's True.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  5. #5
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    Your Active Player code is sort of correct, but Brotein had it right in his. You're not setting it to True, you're checking if it's True.
    I didn't mean setting it to true, I meant checking

    But isn't that what you want to do? Check if the player is active before logging him in?
    Last edited by Abu; 04-11-2012 at 01:29 PM.

  6. #6
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Yes, but he was checking if the player is Active.

    Simba Code:
    if(Players[CurrentPlayer].Active = True)then
    is the same as
    Simba Code:
    if(Players[CurrentPlayer].Active)then

    Personally, I like the second method better.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  7. #7
    Join Date
    Feb 2012
    Location
    SRL Jail
    Posts
    1,319
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the help everyone, will be sure to add it into my latest script.

  8. #8
    Join Date
    Jan 2012
    Location
    Long Island, NY
    Posts
    413
    Mentioned
    5 Post(s)
    Quoted
    95 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    Correct me if I'm wrong Brotein but you indented three times on your second line instead of once = incorrect standards
    Whoops, I typed it out inside the simba brackets, couldn't tell how many tabs I put there.

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
  •