Results 1 to 5 of 5

Thread: SRL Snippets Section

  1. #1
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default SRL Snippets Section

    This section is quite simple. It's for any useful code you've made in your scripts that you wish to share with the community. Not all suggestions can be added to SRL, so whatever isn't fit for the include can be placed in here. If you find a thread that should be in this section, please report it, and a staff member will move it as soon as possible.

    Enjoy,
    The SRL Team

  2. #2
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Yay! I've been waiting for this.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  3. #3
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Awesome, I'll have to go through my code and post some here
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  4. #4
    Join Date
    Jun 2014
    Location
    Lithuania
    Posts
    475
    Mentioned
    27 Post(s)
    Quoted
    200 Post(s)

    Default

    Simba Code:
    ///////////////////////////////////////////////////////////////////
    // function Minimap.RotateToPoint( DotType: integer; MainscreenLocation: integer): boolean;
    //
    //  Rotates the mainscreen to the closest of the selected type minimap point at the selected angle
    //  
    //  top is 0 right 90 bottom 180 left 270
    //
    //   by cosmasjdz 2014-08-09
    //
    // example: Minimap.RotateToPoint(MM_DOT_NPC,0);  this rotates screen so the closest yellow dot on the minimap becomes north of the screen
    //
    ////////////////////////////////////////////////////////////////////
    function TRSMinimap.RotateToPoint( DotType: integer; MainscreenLocation: integer): boolean;
    var
      TPA: TPointArray;
      t: tpoint;
      k,m: extended;
      xv,yv,i,ml: integer;
    begin
    ml:=mainscreenlocation;
    t:=self.getCenterPoint();
    TPA:=self.getdots(DotType,self.getbounds());
    if high(tpa)=-1 then
      begin
        writeln('No such type dots found on the minimap, quiting procedure');
        result:=false;
        exit;
      end;
    SortTPAFrom(TPA, t);
    writeln('Trying to rotate to the closest '+tostring(dottype)+' dot '+'at angle of mainscreen of '+tostring(Mainscreenlocation));
    xv:=tpa[0].x-t.x;
    yv:=t.y-tpa[0].y;
    k:=degrees(ArcTan2(yv,xv));
    m:=(self.getangledegrees());
    self.setangle(trunc(k+m-90+ml));
    result:=true;
    writeln('Succesfully rotated');
    end;

  5. #5
    Join Date
    Dec 2011
    Location
    United States
    Posts
    960
    Mentioned
    21 Post(s)
    Quoted
    504 Post(s)

    Default

    @cosmasjdz;
    You should make a new thread in this section instead of replying to this post.

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
  •