Results 1 to 10 of 10

Thread: Log in =/

  1. #1
    Join Date
    Nov 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Log in =/

    Okey so this is my first script and im not sure if what i have done is correct =/.
    I have started by attempting a Log In script this is what I have so far.

    HTML Code:
    program LogIn;
    {.include srl/srl.scar}
    Procedure ClickOnExistingUserButton;
    Begin
     Mouse(626, -33887329,1,1,true)
     Wait(1000+Random(2000))
     WriteLn('Clicked Existing User Button')
    end;
    
    Procedure TypeInUserandPass;
    begin
     TypeSend('UsernameHere') // Username here!
     wait(100+Random(200))
     TypeSend('PasswordHere') // Password here!
    end;
    
    Procedure CompleteLogin;
    Begin
    
    end;
    
    begin
    
    end.
    I went to test it, the debug box says:
    Successfully compiled (3240 ms)
    Successfully executed
    But the script does nothing :S.
    Is there a problem with the script or is it my laptop?

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

    Default

    You need to put ClickOnExistingUserButton; and TypeInUserandPass; and SetupSRL; in your main loop, so it knows to run those procedures.

    An easier way to log in is just (it's the standard way of logging the player in, everyone uses, as far as I know.):

    SCAR Code:
    program Login;
      {.include SRL\SRL.scar}

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name := 'Username here';
      Players[0].Pass := 'Password here';
      Players[0].Nick := 'Nickname here';
      Players[0].Active := True;
    end;

    begin
      SetupSRL;
      ActivateClient;//Activates the RS window you chose.
      DeclarePlayers;//Calls on DeclarePlayers procedure.
      LoginPlayer;//Logs the player in.
    end.

    Hopefully I helped.
    Last edited by Coh3n; 06-11-2009 at 11:21 PM.

  3. #3
    Join Date
    Nov 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, I tried that script and that script doesn't work either I wonder whats wrong :S.

  4. #4
    Join Date
    Feb 2009
    Location
    AZ, USA
    Posts
    460
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by DaNkaTa` View Post
    Thanks, I tried that script and that script doesn't work either I wonder whats wrong :S.
    Code:
    program LogIn;
    {.include srl/srl.scar}
    
    Procedure ClickOnExistingUserButton;
    Begin
      Mouse(626, -33887329,1,1,true);
      Wait(1000+Random(2000));
      WriteLn('Clicked Existing User Button');
    end;
    
    Procedure TypeInUserandPass;
    begin
      TypeSend('UsernameHere'); // Username here!
      Wait(100+Random(200));
      TypeSend('PasswordHere'); // Password here!
    end;
    
    
    begin
      SetupSRL; 
      ClickOnExistingUserButton;
      TypeInUserandPass;
    end.
    That should work, I just took out the CompleteLogin procedure (because there was nothing it, and it was pointless pretty much), and added SetupSRL, and your two procedure into the main loop. The script will only run what is in the main loop.
    Is your account in an old-school random? Help SRL-OSR solve randoms!

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

    Default

    Quote Originally Posted by DaNkaTa` View Post
    Thanks, I tried that script and that script doesn't work either I wonder whats wrong :S.
    It should work, it works for me. Did you drag the crosshairs over the RSWindow?

    What does it say when you try and run it?

    ^What Ogre said is what I was trying to get at in my first post.

  6. #6
    Join Date
    Nov 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks that has helped, how do you put something in the main loop? :S

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

    Default

    Quote Originally Posted by DaNkaTa` View Post
    Thanks that has helped, how do you put something in the main loop? :S
    Your main loop is the begin..end when the end has a period (end.):

    SCAR Code:
    program New;

    procedure BlahBlah;
    begin
      Writeln('Hi');
    end;

    begin//this is your main loop.
      BlahBlah;
    end.

    In order to run your procedures, you have to call them in your main loop. The short script I just made will write "Hi" in the debug box.

  8. #8
    Join Date
    Feb 2009
    Location
    AZ, USA
    Posts
    460
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Coh3n, I'm talking to him in irc now, an he understands what the main loop is, and I'm trying to help with some more basic things.
    Is your account in an old-school random? Help SRL-OSR solve randoms!

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

    Default

    Quote Originally Posted by Ogre View Post
    Coh3n, I'm talking to him in irc now, an he understands what the main loop is, and I'm trying to help with some more basic things.
    Awesome. Dankata` - I'm usually in the IRC chat if you have anymore questions.
    Last edited by Coh3n; 06-12-2009 at 12:25 AM.

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

    Default

    Yay! Something from my Tutorial, please be advised that the current example does not work for the new screen

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
  •