Page 2 of 2 FirstFirst 12
Results 26 to 42 of 42

Thread: [SRL]How To Write Your First Script: Collecting and Banking Cabbages!

  1. #26
    Join Date
    Jun 2018
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Thanks for this guide, its appreciated !

    Do you have any plans of making more guides ?

  2. #27
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    1,158
    Mentioned
    25 Post(s)
    Quoted
    433 Post(s)

    Default

    Quote Originally Posted by Define Define View Post
    Thanks for this guide, its appreciated !

    Do you have any plans of making more guides ?
    I definitely can if you are interested. I am planning on doing one that builds off of this one and is a bit more complex.

  3. #28
    Join Date
    Jun 2018
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by StickToTheScript View Post
    I definitely can if you are interested. I am planning on doing one that builds off of this one and is a bit more complex.
    Yea I am most certainly interested

    This guide really helped me so far. Looking forward to your next guide.

  4. #29
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,205
    Mentioned
    112 Post(s)
    Quoted
    1858 Post(s)

    Default

    Quote Originally Posted by StickToTheScript View Post
    I definitely can if you are interested. I am planning on doing one that builds off of this one and is a bit more complex.
    Our resident SRL Tutorial Writer has been doing lots of good work lately, the forums are the perfect place for documentation and your posts are invaluable. Thanks!
    GitLab projects | Simba for Linux | Find me on IRC or Discord | OSRS scripts | Come play ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  5. #30
    Join Date
    Jun 2007
    Posts
    309
    Mentioned
    0 Post(s)
    Quoted
    84 Post(s)

    Default

    Thank you very much for this. Have linked it to a mate as well... this is how we get more people writing scripts

  6. #31
    Join Date
    Nov 2007
    Posts
    187
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Would be awesome if you made another guide, on different parts of Srl.

  7. #32
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    1,158
    Mentioned
    25 Post(s)
    Quoted
    433 Post(s)

    Default

    Quote Originally Posted by hellian46 View Post
    Would be awesome if you made another guide, on different parts of Srl.
    I plan to make another in about a month or so. Gotta free up some time first.

  8. #33
    Join Date
    Feb 2015
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    12 Post(s)

    Default

    This is a great tutorial! Thanks for sharing

    For those how have troubles with the ACA v3 Extension, I made a quick guide on how to "install" it: https://villavu.com/forum/showthread.php?t=118410

  9. #34
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,205
    Mentioned
    112 Post(s)
    Quoted
    1858 Post(s)

    Default

    I have referenced this tutorial countless times while learning SRL, thank you very much for this valuable resource.
    GitLab projects | Simba for Linux | Find me on IRC or Discord | OSRS scripts | Come play ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  10. #35
    Join Date
    Nov 2018
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Hey man great guide! Really helped me a lot! I'm using this tutorial to make a fishing script, but i'm trouble with finding the fishing spots. Any Suggestions?

  11. #36
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    1,158
    Mentioned
    25 Post(s)
    Quoted
    433 Post(s)

    Default

    Quote Originally Posted by Hellserver View Post
    Hey man great guide! Really helped me a lot! I'm using this tutorial to make a fishing script, but i'm trouble with finding the fishing spots. Any Suggestions?
    @slacky Created a pretty accurate method which did this. You can take a look at what he did below and attempt to replicate it yourself by figuring out what is going on and seeing if you can put your own spin on it. Otherwise, if you plan on using it, please do not forget to give him credit.

    Simba Code:
    // Find fishingspots by finding the edges of the water, over and over again
    // Then do some fancy stuff to remove land->water borders.
    // what's left is an accurate TPA of the fishingspot
    function TFisher.FindFishingSpot(scanTime: Int32=450): T2DPointArray;
    var
      i: Int32;
      SUM,TPA: TPointArray;
      R: TRectangle;
      t: TCountDown;
    begin
      t.Init(scanTime);
      while not t.IsFinished do
      begin
        srl.FindColors(TPA, CTS2(8875103,16,0.2,0.7), Mainscreen.GetBounds);
        SUM += TPA.Edges();
      end;

      SUM.ClearDuplicates();
      SUM := ClearTPAFromTPA(Sum, Sum.Edges());
      Result := SUM.Cluster(5);
      Result.FilterSize(12, __GT__);

      {$ifdecl TWindowOverlay}
      Debug.Clear();
      for i:=0 to High(Result) do
        Debug.DrawTPA(Result[i], Random($FFFFFF));
      {$endif}
    end;
    Last edited by StickToTheScript; 11-09-2018 at 03:37 PM.

  12. #37
    Join Date
    Nov 2016
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    For search reference, you probably got this error or something close to it.
    Simba Code:
    xcorr   := WorldSample.MatchTemplate(mmsample, Self.TMFormula);

    Runtime error: "Access violation" at line 209, column 41 in file "C:\Simba 1.3\Includes\RSWalker\Walker.simba"
    Succesfully executed in 28297 ms.
    The following bitmaps were not freed: [0, Minimap mask, Smart[13256] Image, 3, 4]

    Something that took me a while to figure out, but ended up finding it in the discord (Thanks Olly)
    Is that the init method changed, from now on just call Walker.Init('mapname') and no more parameters.

    In the tutorial there is still a -1 parameter written.
    Simba Code:
    Walk.Init('world.png', -1);    //Setup RSWalker by initializing the map we want to use

    So if you just remove the -1 it works as it is expected from the tutorial.

    Simba Code:
    Walk.Init('world.png');    //Setup RSWalker by initializing the map we want to use

  13. #38
    Join Date
    Jun 2019
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    is there any way to use this on a osrs sourced private server

  14. #39
    Join Date
    Jul 2018
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by bobbersssss View Post
    is there any way to use this on a osrs sourced private server
    If the client and the version is the same as OSRS it should work

  15. #40
    Join Date
    Jun 2019
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by felparers View Post
    If the client and the version is the same as OSRS it should work
    is there a way to define my rsps client instead of the osrs client?

  16. #41
    Join Date
    Jul 2018
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Drag the target( green + on toolbar) on the client you want to use.

  17. #42
    Join Date
    Oct 2010
    Location
    Brasil PR Ponta Grossa
    Posts
    96
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    I've Put You script to kill Flesh crawlers lol, but the mouse is moving to fast, any Ideas to made the mouse move more naturaly, and how to put some antiban?
    program new;
    {$define SMART}
    {$I SRL/OSR.simba}
    {$I RSWalker/Walker.simba}

    const //This is where we declare our constants
    LOGIN_NAME = ''; //Username/Email
    LOGIN_PASS = ''; //Password
    RS_WORLD = -1; //Desired World (-1 = Random)
    IS_MEMBER = false; //True if your player is a Member

    var //This is where we declare our variables
    Walk: TRSWalker; //Used for RSWalker (to walk paths)

    {************************************************* ******************************
    Name: declarePlayers();
    Function: Sets the proper variables using the constants above to allow
    a successful login.
    ************************************************** *****************************}
    procedure declarePlayers();
    begin
    with Players.New()^ do
    begin
    LoginName := LOGIN_NAME;
    Password := LOGIN_PASS;
    IsActive := True;
    IsMember := IS_MEMBER;
    World := RS_WORLD;
    end;
    Players.SetCurrent(0);
    end;

    {************************************************* ******************************
    Name: waitLoop();
    Function: Waits until we have collected our cabbage
    ************************************************** *****************************}
    procedure waitLoop();
    var
    InvCount: Integer;
    T: TTimeMarker;
    begin
    if not SRL.isLoggedIn() then
    Exit;

    InvCount := Inventory.Count(); //Gets the count in our inventory
    T.Start; //Start our timer
    repeat
    wait(randomRange(75, 250)); //Wait a random amount of time
    until((Inventory.Count() > InvCount) or (T.GetTime > 7000)); //Stop repeating once inv count changes or we time out
    end;

    {************************************************* ******************************
    Name: findCabbages();
    Function: Locates cabbage in the field. Will print on screen if using SMART.
    ************************************************** *****************************}
    procedure findCabbages;
    var
    TPA, Cabbage: TPointArray;
    ATPA: T2DPointArray;
    begin
    if not SRL.isLoggedIn() then //If not logged in, then terminate script
    TerminateScript;

    if (SRL.FindColors(TPA, CTS2(6688, 2, 0.29, 0.00), MainScreen.GetBounds) > 0) then //If we find colours at all then...
    begin
    ATPA := TPA.Cluster(2); //Group them within a max pixel distance of 2
    ATPA.FilterSize(100, 500); //Remove and ATPA of size < 100, or > 500.
    ATPA.SortByIndex(MainScreen.GetMiddle); //Sort by closest to Middle of the screen

    {$IFDEF SMART} //If we are using SMART, then...
    Smart.Image.DebugATPA(ATPA);
    {$ENDIF} //End SMART IF

    for Cabbage in ATPA do //For every possible cabbage in our ATPA
    begin
    Mouse.Move(Cabbage[Random(Length(Cabbage))]); //Move the mouse to the cabbage

    if MainScreen.IsUpText('Attack') then //If the uptext is 'Cabbage', try to click it
    begin
    if Mouse.Click(ctRed) then //Clicks the mouse and looks to see if red 'x' appeard when cicked
    begin
    waitLoop(); //Call to our waitLoop because we want to wait while picking.
    Break; //If found red 'x', then break because we clicked it
    end;
    end;
    end;
    end;

    {$IFDEF SMART}
    Smart.Image.Clear; //Clears the ATPA's from screen
    {$ENDIF}
    end;

    {************************************************* ******************************
    Name: setUp();
    Function: Sets up the script by initializing everything and logging player in.
    ************************************************** *****************************}
    function setUp(): boolean;
    begin
    {$IFDEF SMART} //If we are using SMART, then...
    Smart.EnableDrawing := True; //let us draw on SMART
    {$ENDIF} //end SMART IF

    SRL.Setup([]); //Setup SRL to allow us to access it's functions.

    Walk.Init('world.png', -1); //Setup RSWalker by initializing the map we want to use

    declarePlayers(); //Declare the player we are using

    if (not SRL.isLoggedIn) then //If not logged in then..
    begin
    Players.LoginCurrent(); //Log player in
    MainScreen.setAngle(True); //Sets the camera angle to the highest point
    end;
    end;

    begin //Main
    if setUp then //Calls the setup of the script
    writeln('We are set up and ready to go!');
    repeat
    findCabbages(); //Collect Cabbages until inv is full
    until(false); //Repeats forever
    end.
    begin
    FindNormalRandoms;
    case Random(90) of
    0: RandomRClick;
    2: PickUpMouse;
    3: RandomMovement;
    4: BoredHuman;
    5: ExamineInv;
    6: MakeCompass('N');
    7: SetAngle(SRL_ANGLE_HIGH);
    8: Wait(5000+random(2000));
    9: HoverSkill(skill_attack,false);
    end;

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 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
  •