Results 1 to 11 of 11

Thread: Trying to make a simple login script..getting an error :(

  1. #1
    Join Date
    Jul 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Trying to make a simple login script..getting an error :(

    Hello guys,
    Am trying to make a simple login script, but keep getting an error, anyone know how to solve it?

    Error am getting:
    Line 47: [Error] (47:1): 'BEGIN' expected in script
    and when I add a Begin anywhere..I get:
    Line 48: [Error] (48:4): Semicolon (';') expected in script

    My Code:
    PHP Code:
    program RuneScapeLogin10;

    //Declaring Constants
    const
     
    Username'username'//Put your username here!
     
    Password'password'//put your password here!
     
    FirefoxX207//X coordinate for FF link..Has to be on Taskbar
     
    FirefoxY877//Y coordinate for FF link..Has to be on Taskbar
     
    URLFieldX497//X coordinate for URL Field
     
    URLFieldY56;  //Y coordinate for URL Fiel
     
    MembersButtonX912//X coordinate for Member Button
     
    MembersButtonY552//Y coordinate for Member Button
     
    FreeButtonX727//X coordinate for Free Player Button
     
    FreeButtonY559//Y coordinate for Free Player Button
     
    Member1;//Type 1 if you are, 2 if you are not.

     //Starting Firefox and Locating URL Bar
    procedure StartFirefox;
     
    begin
      MoveMouse
    (FirefoxX,FirefoxY);
      
    ClickMouse(FirefoxX,FirefoxY,true);
      
    Wait(5000);
      
    ClickMouse(URLFieldX,URLFieldY,true);
      
    Wait(2500);
     
    end;
     
    //Typing in http://runescape.com
     
    procedure TypeURL;
     
    begin
      SendKeys
    ('http://runescape.com'+chr(13));
      
    Wait(2500);
     
    end;
     
    //Clicking Member Button
    procedure ClickingMemberButton;
     
    begin
      
    if (Member 1then
        begin
       MoveMouseSmooth
    (MembersButtonX,MembersButtonY);
       
    ClickMouse(MembersButtonX,MembersButtonY,true);
         
    end else
         
    begin
       MoveMouseSmooth
    (FreeButtonX,FreeButtonY);
       
    ClickMouse(FreeButtonX,FreeButtonY,true);
         
    end;
       
    end
    Ongoing Project:
    Treehugger 1.0

  2. #2
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    SCAR Code:
    procedure ClickingMemberButton;
     begin
      if (Member = 1) then
        begin
       MoveMouseSmooth(MembersButtonX,MembersButtonY);
       ClickMouse(MembersButtonX,MembersButtonY,true);
         end else
         begin
       MoveMouseSmooth(FreeButtonX,FreeButtonY);
       ClickMouse(FreeButtonX,FreeButtonY,true);
         end;
       end.

    you have no main loop!

    so far, all it is is a bunch of procedures, not doing any thing. try this out:

    SCAR Code:
    program RuneScapeLogin10;

    //Declaring Constants
    const
     Username= 'username'; //Put your username here!
     Password= 'password'; //put your password here!
     FirefoxX= 207; //X coordinate for FF link..Has to be on Taskbar
     FirefoxY= 877; //Y coordinate for FF link..Has to be on Taskbar
     URLFieldX= 497; //X coordinate for URL Field
     URLFieldY= 56;  //Y coordinate for URL Fiel
     MembersButtonX= 912; //X coordinate for Member Button
     MembersButtonY= 552; //Y coordinate for Member Button
     FreeButtonX= 727; //X coordinate for Free Player Button
     FreeButtonY= 559; //Y coordinate for Free Player Button
     Member= 1;//Type 1 if you are, 2 if you are not.

     //Starting Firefox and Locating URL Bar
    procedure StartFirefox;
     begin
      MoveMouse(FirefoxX,FirefoxY);
      ClickMouse(FirefoxX,FirefoxY,true);
      Wait(5000);
      ClickMouse(URLFieldX,URLFieldY,true);
      Wait(2500);
     end;
     
    //Typing in [url]http://runescape.com[/url]
     procedure TypeURL;
     begin
      SendKeys('http://runescape.com'+chr(13));
      Wait(2500);
     end;
     
    //Clicking Member Button
    procedure ClickingMemberButton;
     begin
      if (Member = 1) then
        begin
       MoveMouseSmooth(MembersButtonX,MembersButtonY);
       ClickMouse(MembersButtonX,MembersButtonY,true);
         end else
         begin
       MoveMouseSmooth(FreeButtonX,FreeButtonY);
       ClickMouse(FreeButtonX,FreeButtonY,true);
         end;
    end;

    //this is your main loop, where every thing comes together and the script functions
    begin
      StartFirefox;
      TypeURL;
      ClickingMemberButton;
    end.

    that should fix it, if you need any further help PM me, or read my basic scripting tut(link in siggy)
    Last edited by Awkwardsaw; 07-11-2009 at 02:56 AM.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  3. #3
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    first of all dont use movemouse and clickmouse use

    Code:
    mouse(FreeButtonX, FreebuttonY, 3, 3, true);
    and no offence but this is already in srl so it kinda a waste of time to make one


    edit ninjaed

  4. #4
    Join Date
    Jul 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    HAHA thanks..can't believe I forgot that.. I knew the first part was only declaring but I seem to have forgot :P.. I added the procedures afterwards
    Ongoing Project:
    Treehugger 1.0

  5. #5
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    also, like J_Piz said, Mouse works better than using movemouse, and clickmouse. and also more efficient. but dont be discuraged about making a "worthless" script. any script is practice and practice is good, no matter what
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  6. #6
    Join Date
    Sep 2008
    Posts
    241
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol, I made an auto fisher once.

    No SRL or SMART.

    Account STILL has not been banned :P

    Just make some pointless functions and scripts, shove them together, and you have a 10000 line monster.

    Good luck!
    PM me if you need any help with math.
    I can try to help you with anything!


  7. #7
    Join Date
    Jul 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    haha. This script is only for me to practice using constants, variables, and if/then statements. I don't need it to have any value other than to learn =D...

    Also... Is there an easier way to insert the x,y coordinates than to separate them into two different constants?

    And..what code do I use to SendKeys if what I am trying to send is declared as a constant?

    Thanks in advance. =]
    Ongoing Project:
    Treehugger 1.0

  8. #8
    Join Date
    Jul 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Solved the SendKey issue...now my only question is the x,y coordinate..
    Ongoing Project:
    Treehugger 1.0

  9. #9
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Crazydictator View Post
    Also... Is there an easier way to insert the x,y coordinates than to separate them into two different constants?
    If I understand the question correctly, you are asking if there is an easier way to have the coordinates then having 2 separate constants for it? No, not if they are constants. If you used variables then it may make more sense by using a TPoint:

    SCAR Code:
    var T: TPoint;
    T.x := 293;
    T.y := 893;

    But if the values are never going to change, then those 2 constants is probably the easiest/best way.

  10. #10
    Join Date
    Jul 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by JAD View Post
    If I understand the question correctly, you are asking if there is an easier way to have the coordinates then having 2 separate constants for it? No, not if they are constants. If you used variables then it may make more sense by using a TPoint:

    SCAR Code:
    var T: TPoint;
    T.x := 293;
    T.y := 893;

    But if the values are never going to change, then those 2 constants is probably the easiest/best way.
    Thanks
    Ongoing Project:
    Treehugger 1.0

  11. #11
    Join Date
    Jul 2009
    Location
    Australia
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    You could try using declare players and OpenWebPage?
    You could try something like this (uber shortened, may have problems getting client). This should open an unsigned free to play client and hopefully login.

    Code:
    program RunescapeLogin10;
    {.include SRL/SRL.scar}
    
    const
    sWait = 130000; //set to how long your computer takes to load a rs client 
    
    procedure DeclarePlayers;
    begin
      NumberOfPlayers(1);
      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
        begin
        if(not(LoggedIn)) then LoginPlayer;
        end;
    end;
    
    begin
      SetUpSRL;
      OpenWebPage('http://world105.runescape.com/a2,m1,j1,o0');
      Wait(sWait);
      ActivateClient;
      DeclarePlayers;
    end.
    Hope it helps!

    ~Caotom

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
  •