Results 1 to 12 of 12

Thread: help first script

  1. #1
    Join Date
    Feb 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default help first script

    This is my first script and i don't know what i'm doing wrong, if i'm doing it right. This is what i have so far.

    Code:
    program Fletcher;
    
    {Set Logs in first bank slot, only does long bows}
    
    
    procedure OpenBank2(pin: Integer);
    var
      x, y, fs, fs2: Integer;
    begin
      if not (BankScreen) then
        repeat
          if (FindObject(x, y, 'booth', 2842230, 10, True)) then
            Mouse(x, y, 4, 4, False)
          else
            if (FindObject(x, y, 'booth', 12611, 10, True)) then
              Mouse(x, y, 4, 4, False);
          Wait(250);
          if (ClickOption('quickly', 1)) then
          begin
            Flag;
            repeat
              Wait(100);
              fs := fs + 1;
            until (BankScreen) or (fs >= 50) or ((GetColor(136, 40) = 255) and
              (GetColor(202, 39) = 255));
          end;
          fs2 := fs2 + 1;
        until (BankScreen) or (fs2 >= 5) or ((GetColor(136, 40) = 255) and
          (GetColor(202, 39) = 255));
      InPin(IntToStr(pin));
    end;
    
    procedure QuickFixBank;
    begin
      if (BankScreen) then
      begin
        if not (GetColor(475, 75) = 5531254) then
          Mouse(475, 77, 0, 0, True);
      end;
    end;
    
    procedure Withdraw2(i, Amount: Integer);
    begin
      if (BankScreen) then
      begin
        if (Amount = 0) then
        begin
          BankMouse(i, False);
          Wait(800 + Random(400));
          ClickOption('All', 1);
        end;
        if (Amount = 10) or (Amount = 5) then
        begin
          BankMouse(i, False);
          Wait(800 + Random(400));
          ClickOption(IntToStr(Amount), 1);
        end;
        if (Amount = 1) then
        begin
          BankMouse(i, True);
          Wait(800 + Random(400));
        end;
        if (Amount > 1) and (Amount <> 5) and (Amount <> 10) then
        begin
          BankMouse(i, False);
          Wait(450 + Random(200));
          if (ClickOption('X', 1)) then
          begin
            repeat
              Wait(150 + Random(200));
            until (GetColor(255, 410) = 8388608);
            TypeSend(IntToStr(Amount));
            Wait(800 + Random(400));
          end;
        end;
      end;
    end;
    
    
    end.
    That's what i have so far, and i dont know what to do right now.

  2. #2
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    First of all, you don't even need to copy the SRL procedures. Just include srl right after
    SCAR Code:
    program Fletcher
    {.include SRL/SRL.scar}

    So it looks like this.

    SCAR Code:
    program Fletcher
    {.include SRL/SRL.scar}

    begin
    OpenBank2(pin: Integer);
    QuickFixBank;
    Withdraw2(i, Amount: Integer);
    end.

  3. #3
    Join Date
    Feb 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you i didn't know that. But how would i make it withdrawal the logs, if they're in the first bank slot?

  4. #4
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by busthree View Post
    Thank you i didn't know that. But how would i make it withdrawal the logs, if they're in the first bank slot?

    SCAR Code:
    Withdraw(1,1,27)

    That would withdraw 27 logs from the first bank slot.


  5. #5
    Join Date
    Feb 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, Thanks again, i was trying to find that out too.

    and im getting this when i compile but i don't know what it means.

    Failed when compiling
    Line 8: [Error] (16:1): Semicolon (';') expected in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Globals.scar

  6. #6
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    hmmm, an un-finished line in your includes? Don't think so.

    Must be a script problem.

    Or you fucked around with your includes and took a semicolon off the end of one of the lines. Haha. Check the include but I highly doubt thats the problem unless you've modified it.

  7. #7
    Join Date
    Feb 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yeah i might have, i dont know where to find it at in srl/globals. Its a 400 plus line script.

  8. #8
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    try putting in SetupSRL; It can cause some really weird errors if you don't
    Interested in C# and Electrical Engineering? This might interest you.

  9. #9
    Join Date
    Feb 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    {.include SRL/SetupSRL.scar}


    ? that? or what do i have to do?

  10. #10
    Join Date
    Feb 2007
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by busthree View Post
    {.include SRL/SetupSRL.scar}


    ? that? or what do i have to do?

    Put {.include SRL/SRL.scar} at the top of the script,
    like:

    program Fletcher
    {.include SRL/SRL.scar}
    and put
    SetupSRL
    at the begining of your script.

    it might look something similar to

    Begin
    SetupSRL
    OpenBank2(pin: Integer);
    QuickFixBank;
    Withdraw2(i, Amount: Integer);
    end.
    Now, everytime you run your script, it'll start at 'Begin' and work its way down. The first thing it'll do is 'SetupSRL' then it'll open the bank, ect ect.

  11. #11
    Join Date
    Feb 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ohhh thank you very much sir!

  12. #12
    Join Date
    Mar 2007
    Posts
    82
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this helped a lot. im a noob at scripting, this got me started. ty

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
  •