Results 1 to 22 of 22

Thread: Help Creating First Script

  1. #1
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default Help Creating First Script

    Hello. I am trying to create a script, but I can't run it.
    Here's the code:
    Program VarrockIronMiner;
    {$DEFINE SMART}
    {$I SRL-OSR/SRL.simba}
    {$I SPS/sps-osr.simba}

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

    Players[0].Name := ''; //Your Runescape username goes right here.
    Players[0].Pass := ''; //Your Runescape password goes right here.
    Players[0].Active := True;
    Players[0].Pin := ''; //Bank PIN
    Players[0].Nick := ''; //In-Game-Name
    end;

    begin
    SetupSRL();
    procedure MineIron;
    var x, y: integer;
    begin
    if FindObj(x, y, 'in', 2964321, 10) then
    begin
    Mouse(x, y, 0, begin
    SetupSRL();0, true);
    ChooseOption('ine');
    wait(1500+random(1000));
    end;
    end;


    procedure WalkToBank;
    begin
    if (InvFull) then
    begin
    MakeCompass(180);
    SPS_AnyAngle := True;
    SPS_Setup(runescape_surface, ['12_7']);
    SetRun(True)
    SPS_WalkPath([Point(187, 386), Point(195, 322),Point(194, 257), Point(176, 193),Point(161, 166), Point(118, 167),Point(61, 166), Point(43, 166),Point(44, 194), Point(44, 200)]);
    end;
    end;


    procedure BankIron;
    begin
    WriteLn('Looking for bank.');
    if FindBank('veb') then
    begin
    WriteLn('We have found the bank.');
    if OpenBank('veb', False, True) then
    begin
    WriteLn('Banking...');
    DepositAll;
    CloseBank;
    end;
    end;
    end;


    procedure WalkToMine;
    begin
    MakeCompass(180);
    SPS_AnyAngle := True;
    SPS_Setup(runescape_surface, ['12_7']);
    SetRun(True)
    SPS_WalkPath([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
    end;


    procedure AntiBan;
    begin
    if (not(LoggedIn))then
    Exit;
    case Random(8) of
    0:
    end;
    begin
    HoverSkill('Mining', false);
    wait(1500+Random(150));
    end;
    begin
    MakeCompass('N');
    wait(25+random(100));
    MakeCompass('S');
    wait(30+random(110));
    MakeCompass('N');
    end.
    I get the error:
    [Error] C:\Users\Mikkoz\Desktop\VarrockIronMiner.simba(22: 3): Identifier expected at line 21
    Compiling failed.

  2. #2
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    And this is for oldschool.

  3. #3
    Join Date
    Feb 2012
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You need an end; after SetupSRL; I believe
    Last edited by zNerve; 04-04-2013 at 03:25 PM.

  4. #4
    Join Date
    Apr 2013
    Posts
    395
    Mentioned
    1 Post(s)
    Quoted
    177 Post(s)

    Default

    Simba Code:
    begin
    SetupSRL();
    procedure MineIron;

    Without an end; , you started writing another new procedure.

    Better to do SetupSRL in mainloop.
    Mouse function in MineIron procedure is wrong.
    There's another SetupSRL in MineIron procedure.
    I think you don't have to do SPS_Setup twice if its the same map.
    I think you messed up the case in your Antiban procedure.
    Your mainloop is the below, means it should only do this.
    Simba Code:
    begin
    MakeCompass('N');
    wait(25+random(100));
    MakeCompass('S');
    wait(30+random(110));
    MakeCompass('N');
    end.

    Sorry if I'm wrong, better let the experts teach you
    Last edited by Haxz; 04-04-2013 at 03:28 PM.

  5. #5
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Ok, I fixed the SetupSRL thing and now it looks like this:
    Program VarrockIronMiner;
    {$DEFINE SMART}
    {$I SRL-OSR/SRL.simba}
    {$I SPS/sps-osr.simba}

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

    Players[0].Name := ''; //Your Runescape username goes right here.
    Players[0].Pass := ''; //Your Runescape password goes right here.
    Players[0].Active := True;
    Players[0].Pin := ''; //Bank PIN
    Players[0].Nick := ''; //In-Game-Name
    end;

    begin
    SetupSRL();
    end;

    procedure MineIron;
    var x, y: integer;
    begin
    if FindObj(x, y, 'in', 2964321, 10) then
    begin
    Mouse(x, y, 0, 0, true);
    ChooseOption('ine');
    wait(1500+random(1000));
    end;
    end;


    procedure WalkToBank;
    begin
    if (InvFull) then
    begin
    MakeCompass(180);
    SPS_AnyAngle := True;
    SPS_Setup(runescape_surface, ['12_7']);
    SetRun(True)
    SPS_WalkPath([Point(187, 386), Point(195, 322),Point(194, 257), Point(176, 193),Point(161, 166), Point(118, 167),Point(61, 166), Point(43, 166),Point(44, 194), Point(44, 200)]);
    end;
    end;


    procedure BankIron;
    begin
    WriteLn('Looking for bank.');
    if FindBank('veb') then
    begin
    WriteLn('We have found the bank.');
    if OpenBank('veb', False, True) then
    begin
    WriteLn('Banking...');
    DepositAll;
    CloseBank;
    end;
    end;
    end;


    procedure WalkToMine;
    begin
    MakeCompass(180);
    SPS_AnyAngle := True;
    SPS_Setup(runescape_surface, ['12_7']);
    SetRun(True)
    SPS_WalkPath([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
    end;


    procedure AntiBan;
    begin
    if (not(LoggedIn))then
    Exit;
    case Random(8) of
    0:
    end;
    begin
    HoverSkill('Mining', false);
    wait(1500+Random(150));
    end;
    begin
    MakeCompass('N');
    wait(25+random(100));
    MakeCompass('S');
    wait(30+random(110));
    MakeCompass('N');
    end.
    and I get this error:
    [Error] C:\Users\Mikkoz\Desktop\VarrockIronMiner.simba(22: 4): period ('.') expected at line 21
    Compiling failed.

  6. #6
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    The first version I made was this (I think it's better but it doesn't work either):
    Program VarrockIronMiner;
    {$DEFINE SMART8}
    {$I SRL-OSR/SRL.Simba}
    {$I SPS/sps-osr.simba}

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

    Players[0].Name := ''; //Your Runescape username goes right here.
    Players[0].Pass := ''; //Your Runescape password goes right here.
    Players[0].Active := True;
    Players[0].Pin := ''; //Bank PIN
    Players[0].Nick := ''; //In-Game-Name
    end;


    procedure MineIron;
    var x, y: integer;
    begin
    if FindObj(x, y, 'in', 2964321, 10) then
    begin
    Mouse(x, y, 0, 0, true);
    ChooseOption('ine');
    wait(1500+random(1000));
    end;
    end;


    procedure WalkToBank;
    begin
    if (InvFull) then
    begin
    SetupSRL;
    SPS_Setup(runescape_surface07, ['12_7']);
    ToBank := [Point(187, 386), Point(195, 322),
    Point(194, 257), Point(176, 193),
    Point(161, 166), Point(118, 167),
    Point(61, 166), Point(43, 166),
    Point(44, 194), Point(44, 200)];
    SPS_WalkPath(ToBank);
    end;
    procedure BankIron;
    begin
    WriteLn('Looking for bank.');
    if FindBank('veb') then
    begin
    WriteLn('We have found the bank.');
    if OpenBank('veb', False, True) then
    begin
    WriteLn('Banking...');
    DepositAll;
    CloseBank;
    end;
    end;
    end;


    procedure WalkToMine;
    begin
    WriteIn('Walking back to East Mine.');
    begin
    SetupSRL;
    SPS_Setup(RUNESCAPE_SURFACE07, ['12_7']);
    ToMine := [Point(43, 165), Point(109, 165),
    Point(165, 165), Point(182, 204),
    Point(196, 259), Point(196, 323),
    Point(198, 385), Point(173, 400),
    Point(173, 408)];
    SPS_WalkPath(ToMine);
    end;


    procedure AntiBan;
    begin
    if (not(LoggedIn))then
    Exit;
    case Random(8) of
    0:
    begin
    HoverSkill('Mining', false);
    wait(1500+Random(150));
    end;
    1: PickUpMouse;
    2:
    begin
    MakeCompass('N');
    wait(25+random(100));
    MakeCompass('S');
    wait(30+random(110));
    MakeCompass('N');
    end;
    end;
    end.


  7. #7
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by Mikkoz99 View Post
    Ok, I fixed the SetupSRL thing and now it looks like this:

    and I get this error:
    [Error] C:\Users\Mikkoz\Desktop\VarrockIronMiner.simba(22: 4): period ('.') expected at line 21
    Compiling failed.
    Try to use Simba tags when posting script, it makes it easier to read

    Simba Code:
    Program VarrockIronMiner;
    {$DEFINE SMART}
    {$I SRL-OSR/SRL.simba}
    {$I SPS/sps-osr.simba}

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

      Players[0].Name := ''; //Your Runescape username goes right here.
      Players[0].Pass := ''; //Your Runescape password goes right here.
      Players[0].Active := True;
      Players[0].Pin := ''; //Bank PIN
      Players[0].Nick := ''; //In-Game-Name
    end;

    procedure MineIron;
    var x, y: integer;
    begin
      if FindObj(x, y, 'in', 2964321, 10) then
      begin
        Mouse(x, y, 0, 0, true);
        ChooseOption('ine');
        wait(1500+random(1000));
      end;
    end;


    procedure WalkToBank;
    begin
      if (InvFull) then
      begin
        MakeCompass(180);
        SPS_AnyAngle := True;
        SPS_Setup(runescape_surface, ['12_7']);
        SetRun(True)
        SPS_WalkPath([Point(187, 386), Point(195, 322),Point(194, 257), Point(176, 193),Point(161, 166), Point(118, 167),Point(61, 166), Point(43, 166),Point(44, 194), Point(44, 200)]);
      end;
    end;


    procedure BankIron;
    begin
      WriteLn('Looking for bank.');
      if FindBank('veb') then
      begin
        WriteLn('We have found the bank.');
        if OpenBank('veb', False, True) then
        begin
          WriteLn('Banking...');
          DepositAll;
          CloseBank;
        end;
      end;
    end;


    procedure WalkToMine;
    begin
      MakeCompass(180);
      SPS_AnyAngle := True;
      SPS_Setup(runescape_surface, ['12_7']);
      SetRun(True)
      SPS_WalkPath([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
    end;


    procedure AntiBan;
    begin
      if (not(LoggedIn))then
        Exit;
      case Random(8) of
      0:begin
           HoverSkill('Mining', false);
           wait(1500+Random(150));
           MakeCompass('N');
           wait(25+random(100));
           MakeCompass('S');
           wait(30+random(110));
           MakeCompass('N');
         end;
      end;  //This end is to end your case statement
    end;   //I changed this from a period to a semicolon because you only use a period for the end of your Main Loop.

    //Below is your main loop, it is what will actually be executed :)
    begin
      repeat
        MineIron
        AntiBan;
      until(InvFull);
      WalkToBank;
      BankIron;
      WalkToMine;
    end.

    I tried to piece a mainloop together from your procedures, you'll probably need to change it to your needs though

  8. #8
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Thanks !!! I don't get any errors, but SMART doesn't load either:/ Any suggestions? I tried to change SMART at the beginning to SMART8
    EDIT: I get this: Compiled successfully in 359 ms.
    Quote Originally Posted by BMWxi View Post
    Try to use Simba tags when posting script, it makes it easier to read

    Simba Code:
    Program VarrockIronMiner;
    {$DEFINE SMART}
    {$I SRL-OSR/SRL.simba}
    {$I SPS/sps-osr.simba}

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

      Players[0].Name := ''; //Your Runescape username goes right here.
      Players[0].Pass := ''; //Your Runescape password goes right here.
      Players[0].Active := True;
      Players[0].Pin := ''; //Bank PIN
      Players[0].Nick := ''; //In-Game-Name
    end;

    procedure MineIron;
    var x, y: integer;
    begin
      if FindObj(x, y, 'in', 2964321, 10) then
      begin
        Mouse(x, y, 0, 0, true);
        ChooseOption('ine');
        wait(1500+random(1000));
      end;
    end;


    procedure WalkToBank;
    begin
      if (InvFull) then
      begin
        MakeCompass(180);
        SPS_AnyAngle := True;
        SPS_Setup(runescape_surface, ['12_7']);
        SetRun(True)
        SPS_WalkPath([Point(187, 386), Point(195, 322),Point(194, 257), Point(176, 193),Point(161, 166), Point(118, 167),Point(61, 166), Point(43, 166),Point(44, 194), Point(44, 200)]);
      end;
    end;


    procedure BankIron;
    begin
      WriteLn('Looking for bank.');
      if FindBank('veb') then
      begin
        WriteLn('We have found the bank.');
        if OpenBank('veb', False, True) then
        begin
          WriteLn('Banking...');
          DepositAll;
          CloseBank;
        end;
      end;
    end;


    procedure WalkToMine;
    begin
      MakeCompass(180);
      SPS_AnyAngle := True;
      SPS_Setup(runescape_surface, ['12_7']);
      SetRun(True)
      SPS_WalkPath([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
    end;


    procedure AntiBan;
    begin
      if (not(LoggedIn))then
        Exit;
      case Random(8) of
      0:begin
           HoverSkill('Mining', false);
           wait(1500+Random(150));
           MakeCompass('N');
           wait(25+random(100));
           MakeCompass('S');
           wait(30+random(110));
           MakeCompass('N');
         end;
      end;  //This end is to end your case statement
    end;   //I changed this from a period to a semicolon because you only use a period for the end of your Main Loop.

    //Below is your main loop, it is what will actually be executed :)
    begin
      repeat
        MineIron
        AntiBan;
      until(InvFull);
      WalkToBank;
      BankIron;
      WalkToMine;
    end.

    I tried to piece a mainloop together from your procedures, you'll probably need to change it to your needs though

  9. #9
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Ok, got it to load SMART... Not logging in automatically.

  10. #10
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    The script is still not working, when I start it it opens up a new SMART but doesn't log in.. And if I login manually and then Enable SMART it doesn't do anything. :/

  11. #11
    Join Date
    Apr 2013
    Posts
    395
    Mentioned
    1 Post(s)
    Quoted
    177 Post(s)

    Default

    Because you didn't do SetupSRL and declareplayers in your mainloop.

  12. #12
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Oh thanks, will try now.

  13. #13
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Still not working? It mutes and then just nothing
    Simba Code:
    Program VarrockIronMiner;
    {$DEFINE SMART}
    {$I SRL-OSR/SRL.simba}
    {$I SPS/sps-osr.simba}

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

      Players[0].Name := '@gmail.com'; //Your Runescape username goes right here.
      Players[0].Pass := ''; //Your Runescape password goes right here.
      Players[0].Active := True;
      Players[0].Pin := ''; //Bank PIN
      Players[0].Nick := ''; //In-Game-Name
    end;

    procedure MineIron;
    var x, y: integer;
    begin
      if FindObj(x, y, 'in', 2964321, 10) then
      begin
        Mouse(x, y, 0, 0, true);
        ChooseOption('ine');
        wait(1500+random(1000));
      end;
    end;


    procedure WalkToBank;
    begin
      if (InvFull) then
      begin
        MakeCompass(180);
        SPS_AnyAngle := True;
        SPS_Setup(runescape_surface, ['12_7']);
        SetRun(True)
        SPS_WalkPath([Point(187, 386), Point(195, 322),Point(194, 257), Point(176, 193),Point(161, 166), Point(118, 167),Point(61, 166), Point(43, 166),Point(44, 194), Point(44, 200)]);
      end;
    end;


    procedure BankIron;
    begin
      WriteLn('Looking for bank.');
      if FindBank('veb') then
      begin
        WriteLn('We have found the bank.');
        if OpenBank('veb', False, True) then
        begin
          WriteLn('Banking...');
          DepositAll;
          CloseBank;
        end;
      end;
    end;


    procedure WalkToMine;
    begin
      MakeCompass(180);
      SPS_AnyAngle := True;
      SPS_Setup(runescape_surface, ['12_7']);
      SetRun(True)
      SPS_WalkPath([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
    end;


    procedure AntiBan;
    begin
      if (not(LoggedIn))then
        Exit;
      case Random(8) of
      0:begin
           HoverSkill('Mining', false);
           wait(1500+Random(150));
           MakeCompass('N');
           wait(25+random(100));
           MakeCompass('S');
           wait(30+random(110));
           MakeCompass('N');
         end;
      end;  //This end is to end your case statement
    end;   //I changed this from a period to a semicolon because you only use a period for the end of your Main Loop.

    //Below is your main loop, it is what will actually be executed :)
    begin
    DeclarePlayers
    SetupSRL
      repeat
        MineIron
        AntiBan;
      until(InvFull);
      WalkToBank;
      BankIron;
      WalkToMine;
    end.

  14. #14
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Whoops- left my accout details in

  15. #15
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    YES! FINALLY logged in!

  16. #16
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Trying to make it walk, doesn't work.
    It does do antiban

  17. #17
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    I need help to make it walk.... Lol :/
    This is the procedure to go to mine:
    Simba Code:
    procedure WalkToMine;
    begin
      MakeCompass(180);
      SPS_AnyAngle := False;
      SPS_Setup(runescape_surface, ['12_7']);
      SetRun(True)
      myPath := ([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
      SPS_WalkPath(myPath);
    end;
    Halpppp
    EDIT: Now that I got it to mine, it also mines copper :/ I tried changing the color.
    Last edited by Mikkoz99; 04-04-2013 at 05:08 PM.

  18. #18
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by Mikkoz99 View Post
    I need help to make it walk.... Lol :/
    This is the procedure to go to mine:
    Simba Code:
    procedure WalkToMine;
    begin
      MakeCompass(180);
      SPS_AnyAngle := False;
      SPS_Setup(runescape_surface, ['12_7']);
      SetRun(True)
      myPath := ([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
      SPS_WalkPath(myPath);
    end;
    Halpppp
    EDIT: Now that I got it to mine, it also mines copper :/ I tried changing the color.
    Those coordinates are way to small, they should be near the thousands. You probably made the path from one of the map sections in the runescape_surface folder. This time, make the path using the entire map (It's at the bottom of the runescape_surface folder.)

  19. #19
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Ohthhanks, I used the map 12_7

  20. #20
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Simba Code:
    procedure WalkToMine;
    begin
      SPS_AnyAngle := True;
      SPS_Setup(runescape_surface, ['12_7','12_8']);
      SetRun(True)
      SPS_WalkPath([Point(4842, 2980), Point(4850, 2967), Point(4866, 2967), Point(4884, 2966), Point(4909, 2965),
      Point(4935, 2967), Point(4959, 2970), Point(4975, 2990), Point(4979, 3019), Point(4994, 3074), Point(5000, 3133),
      Point(4995, 3187), Point(4974, 3200)]);
    end;
    Nope.

  21. #21
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    I still need help to make it walk... anyone?
    I tried Mat's SPS Walking (Path?) Guide but I get errors using that, I guess it's because it is for EOC.
    EDIT: I'm re-creating the script and now it mines just Iron perfectly
    I will try to add walking, then banking
    Last edited by Mikkoz99; 04-05-2013 at 03:47 PM.

  22. #22
    Join Date
    Mar 2013
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Finally got it working ! yay
    I use SPS for walking

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
  •