Page 1 of 2 12 LastLast
Results 1 to 25 of 33

Thread: Making your first Script!

  1. #1
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Making your first Script!

    Alright, today I'm going to explain and show you how to make your very first script! This may not be the best guide but it'll still be helpful. I'm not the best at writing tutorials so I hope you can understand that after reading this

    Contents
    1. What can a Script do?
    2. How do I make a Script?
    3. Explanation
    4. Antiban, Randoms, Errors
    5. Conclusion

    What can a Script do?
    First off a Script can do almost any task that can be accomplished in any event with dedication put into it. This is useful to have your character progressed while you are out having fun and able to have fun with your game character.

    How do I make a Script?

    Lets start off with defining SRL, SPS, and SMART.
    Simba Code:
    Program BasicScriptTutorial;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$i sps/sps.simba}
    Now what this does is it has Smart loaded up and has SRL in order to accomplish your tasks. SPS stands for SRL.Positioning.System which allows your character to be moving around the world of RuneScape.

    Now we'll be setting up our player form which will allow us to have the script login your account and choose a world that you desire it to be on.
    Simba Code:
    const
    {==========Smart Setup==========}
    World = 0;  // Input the runescape world number right here for it to select. You may leave it as 0 if you would like it to select a random world.
    MEMBERS = False;  // Select False if you are not a member. Select True if you are a member.
    SIGNED = True;  // Select True if you are using single account. Select False if not.
    {===============================}
    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; //Set to True if you want to use this player. Set to False to disable this player.
      Players[0].Pin := ''; //Put your Bank PIN here. Leave blank if you don't have a Bank PIN.
    end;

    Explination
    Now that we have that done we'll be making our script being able to mine and do various things. But for this we'll just be doing the basics to mining.

    Simba Code:
    procedure MineTin;
    var x, y: integer;
    What that has just done is it has made a procedure for our task to be completed. Next we'll have it search for a specific color that corresponds to a certain uptext that we'll be entering.

    Simba Code:
    procedure MineTin;
    var x, y: integer;
    begin  
         if FindObj(x, y, 'in' COLOR, 10) then //This will have the script find an object of your choice
        begin
         Mouse(x, y, 0, 0, true);
          ChooseOption('ine');
          wait(1500+random(1000)); // This will make the script wait for a certain time
          until (InvFull);
      end;
    Now this is just a basic procedure for mining tin but I have not given you the color as we'll have to get that ourselves. You'll have noticed that I have written "end;" which will end that procedure if your inventory is full. Now onto Color finding.

    Now we'll be selecting our own and color and how this is down is by using the "Pick a colour" tool. Now you will have to click on that tool and select the color you would want.


    Now that we have the Color we'll be replacing the "COLOR" text with our color we have selected.

    Simba Code:
    procedure MineTin;
    var x, y: integer;
    begin  
         if FindObj(x, y, 'in' 10658473, 10) then //This will have the script find an object of your choice
        begin
         Mouse(x, y, 0, 0, true);
          ChooseOption('ine');
          wait(1500+random(1000)); // This will make the script wait for a certain time
          until (InvFull);
      end;

    You'll notice that there is a 10 after the color and that my friend is Tolerance. I usually set my Tolerance to 10 for my script to work efiiciently but you can alter it to your liking.

    Okay so we're able to make our script to mine but it will only do this once and that's it. The next thing we would want to do is to make it walk to the bank and walk back efficiently. Now I know what your thinking "god this is hard" but really it's not. It's pretty simple to do it if you have done it multiple times and got the hang of it. First you will want to download this tool.

    Wolygon's Path Creator : http://villavu.com/forum/showthread....highlight=path

    Once you have downloaded it you will want to open it up and click new image and hover to
    C:\Simba\Includes\SPS\img\runescape_surface\runesc ape_surface.png and browse to a certain area.

    You'll want to click the points to a path in which you want your script to walk to. After that is done click the box that has the text of "Click to generate" and you'll be giving some text. You may want to copy and paste this onto notepad. You are also given the SPS Area and in this case I was given 11_7. Keep that number in mind or in notepad.

    Simba Code:
    procedure WalkToBank;
    begin
    if (InvFull) then
    begin
    SetupSRL;
       SPS_Setup(RUNESCAPE_SURFACE, ['11_7']);
       ToBank := [Point(4566, 3145), Point(4566, 3136), Point(4558, 3129),
       Point(4551, 3120), Point(4545, 3109), Point(4532, 3095), Point(4519, 3070),
       Point(4519, 3061), Point(4521, 3038), Point(4518, 3010), Point(4518, 2997),
       Point(4518, 2981), Point(4521, 2953), Point(4525, 2940), Point(4541, 2940),
       Point(4555, 2937), Point(4569, 2933), Point(4581, 2929), Point(4579, 2910),
       Point(4577, 2903)];
       SPS_WalkPath(ToBank);
    end;

    This is what you would want to have in order to make it walk. Now this just walks to the bank and stands there. Now we would want to make it bank. Now we're at Varrock West Bank so we will be using the following 'vwb' as our bank fuction.

    More information about banking over here : http://villavu.com/forum/showthread.php?t=57105

    Simba Code:
    procedure BankTin;
    begin
    WriteLn('Looking for bank.'); // Writes in the Debug Box
    if FindBank('vwb') then // Finds the bank
    begin
    WriteLn('We have found the bank.');
    if OpenBank('vwb', False, True) then // Opens the bank
    begin
    WriteLn('Proceeding to bank Tin');
    DepositAll; // Deposits All items in Inventory
    CloseBank; // Closes the bankscreen
    WriteLn('Banking completed. Proceeding to Rest.');
    RestUntil(100); // Rests character
    end;
    end;
    end;

    Now that we have the banking done I'm going to be introducing Antibans, Randoms, and Errors.

    Antiban, Randoms, Errors
    I'm sure I know what your thinking. "What is Antiban?" Well, glad you asked! Antiban is a way of making your script do something while it mines or chops or any type of task to look like someone who is legit but sometimes antiban can be a little obvious.

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

    Here I have put in a very simple Antiban for all you out there. It's just a basic one so dont go around thinking it'll be the best. Now Randoms are pretty simple. You will just have to incorporate "FindNormalRandoms;" in your procedures so that it will detect Random events most of the time. Now, lets compile our script shall we! Uh oh is right, since we just got an error message.

    Simba Code:
    Program BasicScriptTutorial;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$i sps/sps.simba}

    Var
      WalkToBank:TPointArray;

    const
    {==========Smart Setup==========}
    World = 0;  // Input the runescape world number right here for it to select.You may leave it as 0 if you
    would like it to select a random world.
    MEMBERS = False;  // Select False if you are not a member. Select True if you are a member.
    SIGNED = True;  // Select True if you are using single account. Select False if not.
    {===============================}
    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; //Set to True if you want to use this player. Set to False to disable this player.
      Players[0].Pin := ''; //Put your Bank PIN here. Leave blank if you don't have a Bank PIN.
    end;
    procedure AntiBan;
    begin
      if(not(LoggedIn))then
      Exit;
      case Random(8) of
       0:
       begin
         HoverSkill('Mining', false);
         wait(1500+Random(250));
       end;
       1: PickUpMouse;
       2:
       begin
         MakeCompass('N');
         wait(25+random(150));
         MakeCompass('S');
         wait(75+Random(150));
         MakeCompass('N');
       end;
      end;
    end;
    procedure MineTin;
    var x, y: integer;
    begin
        repeat
        FindNormalRandoms;
        WriteLn('Looking for Tin to Mine.');
        if FindObj(x, y, 'in', 8421770, 10) then //This will have the script find an object of your choice
      begin
        WriteLn('Mining Tin.');
          Mouse(x, y, 0, 0, true);
          ChooseOption('ine');
          wait(1500+random(1000));
          AntiBan;
          until (InvFull);
       end;
    end;
    procedure WalkToTheBank;
    begin
    if (InvFull) then
    begin
       FindNormalRandoms;
       SetupSRL;
       SPS_Setup(RUNESCAPE_SURFACE, ['11_7']);
       WalkToBank := [Point(4566, 3145), Point(4566, 3136), Point(4558, 3129),
       Point(4551, 3120), Point(4545, 3109), Point(4532, 3095), Point(4519, 3070),
       Point(4519, 3061), Point(4521, 3038), Point(4518, 3010), Point(4518, 2997),
       Point(4518, 2981), Point(4521, 2953), Point(4525, 2940), Point(4541, 2940),
       Point(4555, 2937), Point(4569, 2933), Point(4581, 2929), Point(4579, 2910),
       Point(4577, 2903)];
       SPS_WalkPath(WalkToBank);
     end;
    procedure BankTin;
    begin
    FindNormalRandoms;
    WriteLn('Looking for bank.');
    if FindBank('vwb') then
    WriteLn('We have found the bank.');
    if OpenBank('vwb', False, True) then
    WriteLn('Proceeding to bank Tin');
    DepositAll;
    CloseBank;
    WriteLn('Banking completed. Proceeding to Rest.');
    RestUntil(100);
    AntiBan;
    end;
    begin
      Smart_Server := WORLD;  //This here sets up the SMART Minimizing Autoing Resource Thing so you can bot.
      Smart_Members := MEMBERS;
      Smart_Signed := SIGNED;
      Smart_SuperDetail := False;
      SetupSRL; //This here sets up SRL incase you didn't know.

      DeclarePlayers; //This here is so the script knows that the player info is filled in with.
      LoginPlayer; //This here logs in your player you filled in with.

      repeat
      MineTin;
      WalkToTheBank;
      BankTin;
      until AllPlayersInactive;
    end.

    Message : [Error] (77:1): Identifier expected at line 76
    Compiling failed.

    Now line 76 is right before "Procedure BankTin;" and the reason we got an error is because if your script has for an example in this script.
    Simba Code:
    if (InvFull) then
    begin
    FindNormalRandoms;
    You must then put another "end;" at the end of that procedure for every "begin" that you have in that procedure in order for that error to go away.

    Now this is our final result with this tutorial. This script just mines Tin at Varrock West and banks at Varrock West Bank. Your allowed to edit it if you want but dont go around taking credit for work you didn't do.

    Simba Code:
    Program BasicScriptTutorial;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$i sps/sps.simba}

    Var
      WalkToBank:TPointArray;

    const
    {==========Smart Setup==========}
    World = 0;  // Input the runescape world number right here for it to select. You may leave it as 0 if you would like it to select a random world.
    MEMBERS = False;  // Select False if you are not a member. Select True if you are a member.
    SIGNED = True;  // Select True if you are using single account. Select False if not.
    {===============================}
    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; //Set to True if you want to use this player. Set to False to disable this player.
      Players[0].Pin := ''; //Put your Bank PIN here. Leave blank if you don't have a Bank PIN.
    end;
    procedure AntiBan;
    begin
      if(not(LoggedIn))then
      Exit;
      case Random(8) of
       0:
       begin
         HoverSkill('Mining', false);
         wait(1500+Random(250));
       end;
       1: PickUpMouse;
       2:
       begin
         MakeCompass('N');
         wait(25+random(150));
         MakeCompass('S');
         wait(75+Random(150));
         MakeCompass('N');
       end;
      end;
    end;
    procedure MineTin;
    var x, y: integer;
    begin
        repeat
        FindNormalRandoms;
        WriteLn('Looking for Tin to Mine.');
        if FindObj(x, y, 'in', 8421770, 10) then //This will have the script find an object of your choice
        WriteLn('Mining Tin.');
          Mouse(x, y, 0, 0, true);
          ChooseOption('ine');
          wait(1500+random(1000));
          until (InvFull);
       end;
    procedure WalkToTheBank;
    begin
    if (InvFull) then
    begin
       FindNormalRandoms;
       SetupSRL;
       SPS_Setup(RUNESCAPE_SURFACE, ['11_7']);
       WalkToBank := [Point(4566, 3145), Point(4566, 3136), Point(4558, 3129),
       Point(4551, 3120), Point(4545, 3109), Point(4532, 3095), Point(4519, 3070),
       Point(4519, 3061), Point(4521, 3038), Point(4518, 3010), Point(4518, 2997),
       Point(4518, 2981), Point(4521, 2953), Point(4525, 2940), Point(4541, 2940),
       Point(4555, 2937), Point(4569, 2933), Point(4581, 2929), Point(4579, 2910),
       Point(4577, 2903)];
       SPS_WalkPath(WalkToBank);
     end;
    end;
    procedure BankTin;
    begin
    FindNormalRandoms;
    WriteLn('Looking for bank.');
    if FindBank('vwb') then
    WriteLn('We have found the bank.');
    if OpenBank('vwb', False, True) then
    WriteLn('Proceeding to bank Tin');
    DepositAll;
    CloseBank;
    WriteLn('Banking completed. Proceeding to Rest.');
    RestUntil(100);
    AntiBan;
    end;
    begin
      Smart_Server := WORLD;  //This here sets up the SMART Minimizing Autoing Resource Thing so you can bot.
      Smart_Members := MEMBERS;
      Smart_Signed := SIGNED;
      Smart_SuperDetail := False;
      SetupSRL; //This here sets up SRL incase you didn't know.

      DeclarePlayers; //This here is so the script knows that the player info is filled in with.
      LoginPlayer; //This here logs in your player you filled in with.

      repeat
      MineTin;
      WalkToTheBank;
      BankTin;
      until AllPlayersInactive;
    end.

    If you have read this from top to bottom thanks for paying attention. Leave any possible Feedback and Good Luck!
    Last edited by Striken; 06-18-2012 at 04:33 PM.

  2. #2
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Very nice tutorial.

    A few suggestions:

    - Make your images a tad bit smaller
    - Make your headings bigger and coloured
    - Run a spell check, you spell explanation and corresponds wrong
    - Add in PixelShift so they can actually get this script working

    Otherwise good job!

  3. #3
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    Very nice tutorial.

    A few suggestions:

    - Make your images a tad bit smaller
    - Make your headings bigger and coloured
    - Run a spell check, you spell explanation and corresponds wrong
    - Add in PixelShift so they can actually get this script working

    Otherwise good job!
    Thanks for the advice. Not that good at writing scripting tutorials. First time writing one

  4. #4
    Join Date
    Jun 2012
    Location
    THE Students-City of Holland
    Posts
    332
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    thanks

  5. #5
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Bump I guess...?

  6. #6
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Anyone have any feedback?

  7. #7
    Join Date
    Feb 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I always get 'Begin; error line 5 then when i type that it doesnt work

  8. #8
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by deanironman View Post
    I always get 'Begin; error line 5 then when i type that it doesnt work
    Write out your script for me so I know what you have so far.

  9. #9
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    You do know it's not good to double post, right? (I.E, bumping)

  10. #10
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NKN View Post
    You do know it's not good to double post, right? (I.E, bumping)
    I'm sorry

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

    Default

    I gave up but ill try again. I want to make a lobster fishing script that drops them has antibann and solves every random can you help pleasee

  12. #12
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by deanironman View Post
    I gave up but ill try again. I want to make a lobster fishing script that drops them has antibann and solves every random can you help pleasee
    Implanting the random procedure will do the randoms that it is capable of doing which is what they have done. There may be some that wont work but most work. As for script you can change it up to your liking or even to the liking the script should be. Like from 'ine' to 'age'

  13. #13
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    Nicely done I just suggest working on your standards and also something I noticed when you use mouse(x, y, 0, 0, true) then you don't need choose option add that left clicks
    Current Project: Retired

  14. #14
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Gucci View Post
    Nicely done I just suggest working on your standards and also something I noticed when you use mouse(x, y, 0, 0, true) then you don't need choose option add that left clicks
    Aimed for this to be a simple guide so I guess it makes some sense. If I had done more it would've been in intermediate section or something

  15. #15
    Join Date
    Feb 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    How do I make the script just fish then drop then repeat

  16. #16
    Join Date
    Feb 2012
    Posts
    92
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks for the tutorial, can't wait to get started!

  17. #17
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by kazzos View Post
    thanks for the tutorial, can't wait to get started!
    Well you'll get on the right track.

  18. #18
    Join Date
    Jul 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i get this error
    Simba Code:
    [Error] C:\Simba\Includes\sps/sps.simba(125:3): Unknown identifier 'sortTPAByX' at line 124


    i just litterally copy and pasted yours to try it and still got it, because mine didn't work

  19. #19
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Update SPS

  20. #20
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by kilzrus View Post
    i get this error
    Simba Code:
    [Error] C:\Simba\Includes\sps/sps.simba(125:3): Unknown identifier 'sortTPAByX' at line 124


    i just litterally copy and pasted yours to try it and still got it, because mine didn't work
    As NKN said. Update SPS. Update SRL while your at it and check for updates everyday just to make sure on a daily basis.

  21. #21
    Join Date
    Jul 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Phyaskou View Post
    As NKN said. Update SPS. Update SRL while your at it and check for updates everyday just to make sure on a daily basis.
    Yeahh I updated it and it worked for some reason the first time I updated it didnt work

  22. #22
    Join Date
    Sep 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I Need a script for Auto typing.
    Last edited by ninja112; 12-25-2012 at 06:37 AM.

  23. #23
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by ninja112 View Post
    Can you please post the script in one line?
    cant understand wich one to copy
    Then your not ready to use it read the tut again in more detail


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  24. #24
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by ninja112 View Post
    Can you please post the script in one line?
    cant understand wich one to copy
    The finished script is at the bottom of the OP if that's what your asking
    Current Project: Retired

  25. #25
    Join Date
    Mar 2007
    Location
    Finland, Espoo
    Posts
    96
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I do everything "right" but it doesn't walk... when i start the script it works for 2-3 steps and then not walking anymore. The walkpath is not the same tho, im trying it in different location.
    ~.::Alligaattor::.~
    *Forum Lurker*

Page 1 of 2 12 LastLast

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
  •