Results 1 to 7 of 7

Thread: Debugging not going smoothly

  1. #1
    Join Date
    Mar 2009
    Location
    About six feet off the ground.
    Posts
    95
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Unhappy Debugging not going smoothly

    I'm trying to debug this script, and it just isn't working:
    Code:
    {AutoTalker by Shawn Lutch/Zeeky111/Foobylovesyou123/Fooby369.
    Description: This script is mainly to sell stuff on the GE.
    If you are tired of re-typing everything, then this is for you.
    This script will say what you want it to say until you press X,
    and then it will bank at the GE, depositing all items in your
    inventory. Be sure not to delete the "+chr(13)". This tells SCAR
    to hit enter, which will enter the message.  Enjoy! :)
    Note: To enable the banking feature, delete the brackets around
    The procedure "Bank."  Before logging in, make sure the username
    field is selected.}
    
    program AutoTalk;
    {.include SRL/SRL.scar}
    
    var
    i, sum: integer;
    x,y: integer;
    
    procedure Login;
    begin
      ClearDebug;
      Wait(1000);
      MoveMouseSmooth(499, 484);
      Wait(500);
      ClickMouse(499, 484, true);
      Wait(1000);
      SendKeys('username'+chr(13)); //enter your login.
      Wait(500);
      SendKeys('password'+chr(13)); //enter your password.
      Wait(5000);
      MoveMouseSmooth(506, 523);
      Wait(50);
      ClickMouse(506, 523, true);
    end;
    
    procedure Waiting;
    begin
      repeat;
      Wait(10);
      until(false); //This will be changed.
    end;
    
    procedure Sell;
    begin
      SetupSrl;
      ClearDebug;
      i :=0
      repeat;
      SendKeys('Type your message in here'+chr(13)); //Type in your msg.
      sum :=i+1;
      Wait(2000+random(1000));
      WriteLn('Message repeat: '+IntToStr(sum));
      until(false); //This will be changed.
    end;
    
    {procedure Bank;
    begin
      if FindSymbol(x, y, 'bank') then
      MMouse(x, y, 10, 10);
      Wait(1000+random(500));
      Mouse(x, y, 0, 0, true);
      Flag;
      OpenBankFast('feb');
      WriteLn('Opened bank.');
      DepositAll;
      WriteLn('All items deposited.');
      Wait(1000+random(500));
      CloseBank;}
    end.
    Here's the error I've gotten:
    Code:
    [Error] (16275:1): 'BEGIN' expected
    Help?
    ~Zeek
    Last major script: November 2009
    Attempted to rejoin: January 2011
    Rejoining: [][][][][]
    Current task: writing basic alching script

  2. #2
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    you don't have a main loop calling any of your procedures to do. You have procedures made but never use them.

  3. #3
    Join Date
    Mar 2009
    Location
    About six feet off the ground.
    Posts
    95
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, like this? And yes, the bank procedure is in brackets on purpose.
    Oh, btw: how do I get the Wait to where I can make it stop by pressing the letter X?

    Code:
    {AutoTalker by Shawn Lutch/Zeeky111/Foobylovesyou123/Fooby369.
    Description: This script is mainly to sell stuff on the GE.
    If you are tired of re-typing everything, then this is for you.
    This script will say what you want it to say until you press X,
    and then it will bank at the GE, depositing all items in your
    inventory. Be sure not to delete the "+chr(13)". This tells SCAR
    to hit enter, which will enter the message.  Enjoy! :)
    Note: To enable the banking feature, delete the brackets around
    The procedure "Bank."  Before logging in, make sure the username
    field is selected.}
    
    program AutoTalk;
    {.include SRL/SRL.scar}
    
    var
    i, sum: integer;
    x,y: integer;
    
    begin
    
    procedure Login;
    begin
      ClearDebug;
      Wait(1000);
      MoveMouseSmooth(499, 484);
      Wait(500);
      ClickMouse(499, 484, true);
      Wait(1000);
      SendKeys('username'+chr(13)); //enter your login.
      Wait(500);
      SendKeys('password'+chr(13)); //enter your password.
      Wait(5000);
      MoveMouseSmooth(506, 523);
      Wait(50);
      ClickMouse(506, 523, true);
    end;
    
    procedure Waiting;
    begin
      repeat;
      Wait(10);
      until(false); //This will be changed.
    end;
    
    procedure Sell;
    begin
      SetupSrl;
      ClearDebug;
      i :=0
      repeat;
      SendKeys('Type your message in here'+chr(13)); //Type in your msg.
      sum :=i+1;
      Wait(2000+random(1000));
      WriteLn('Message repeat: '+IntToStr(sum));
      until(false); //This will be changed.
    end;
    
    {procedure Bank;
    begin
      if FindSymbol(x, y, 'bank') then
      MMouse(x, y, 10, 10);
      Wait(1000+random(500));
      Mouse(x, y, 0, 0, true);
      Flag;
      OpenBankFast('feb');
      WriteLn('Opened bank.');
      DepositAll;
      WriteLn('All items deposited.');
      Wait(1000+random(500));
      CloseBank;}
    end.
    EDIT: ...But I get this:
    Code:
    Line 21: [Error] (16227:1): Identifier expected in script C:\Program Files\SCAR 3.15\Scripts\RS Scripts\AutoTalk.scar
    Last edited by zeeky111; 03-28-2009 at 07:13 PM. Reason: "EDIT"
    ~Zeek
    Last major script: November 2009
    Attempted to rejoin: January 2011
    Rejoining: [][][][][]
    Current task: writing basic alching script

  4. #4
    Join Date
    Jan 2009
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No, like this:
    Code:
    {AutoTalker by Shawn Lutch/Zeeky111/Foobylovesyou123/Fooby369.
    Description: This script is mainly to sell stuff on the GE.
    If you are tired of re-typing everything, then this is for you.
    This script will say what you want it to say until you press X,
    and then it will bank at the GE, depositing all items in your
    inventory. Be sure not to delete the "+chr(13)". This tells SCAR
    to hit enter, which will enter the message.  Enjoy! :)
    Note: To enable the banking feature, delete the brackets around
    The procedure "Bank."  Before logging in, make sure the username
    field is selected.}
    
    program AutoTalk;
    {.include SRL/SRL.scar}
    
    var
    i, sum: integer;
    x,y: integer;
    
    
    
    procedure Login;
    begin
      ClearDebug;
      Wait(1000);
      MoveMouseSmooth(499, 484);
      Wait(500);
      ClickMouse(499, 484, true);
      Wait(1000);
      SendKeys('username'+chr(13)); //enter your login.
      Wait(500);
      SendKeys('password'+chr(13)); //enter your password.
      Wait(5000);
      MoveMouseSmooth(506, 523);
      Wait(50);
      ClickMouse(506, 523, true);
    end;
    
    procedure Waiting;
    begin
      repeat;
      Wait(10);
      until(false); //This will be changed.
    end;
    
    procedure Sell;
    begin
      SetupSrl;
      ClearDebug;
      i :=0
      repeat;
      SendKeys('Type your message in here'+chr(13)); //Type in your msg.
      sum :=i+1;
      Wait(2000+random(1000));
      WriteLn('Message repeat: '+IntToStr(sum));
      until(false); //This will be changed.
    end;
    
    {procedure Bank;
    begin
      if FindSymbol(x, y, 'bank') then
      MMouse(x, y, 10, 10);
      Wait(1000+random(500));
      Mouse(x, y, 0, 0, true);
      Flag;
      OpenBankFast('feb');
      WriteLn('Opened bank.');
      DepositAll;
      WriteLn('All items deposited.');
      Wait(1000+random(500));
      CloseBank;}
      
    begin
         Login;
         repeat
               waiting
         until iskeydown('x');
         Sell;
    end.
    Cause you see, you where just Creating functions. To make the code execute those functions, you must have a mainloop. I would recommend reading some tutorials in tutorial island.

    By the Way, dont use MoveMouseSmooth, use MMouse or Mouse, dont use SendKeys, use TypeSend, and dont use your login, use SRL declareplayers, and srl loginplayers. For info on this stuff, go to the tutorial island section.

  5. #5
    Join Date
    Jan 2009
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Look at my Post above your last one... I fixed it, it compiled for me.

  6. #6
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Also, change those movemousesmooth and clickmouse to MMouse and Mouse. Less detectable.

  7. #7
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    superbatman, don't double post use the edit button. And DeclarePlayers is not SRL's procedure of function. LoginPlayer is but not DeclarePlayers because it is a procedure you make in the script on your own and if SRL had this in the include you'd get duplicate identifier, I think. But anyway, Zeeky if this is your first script it's a good try and if you need any help or suggestions just PM me.

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
  •