Results 1 to 6 of 6

Thread: 2 New functions for the community =]

  1. #1
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default 2 New functions for the community =]

    Well I don't want to be a leecher, so I made two pretty handy dandy functions for srl. Unfortunately the place I am supposed to submit these isnt open to Registered users. So I decided to place them where they will be tested and reviewed by people, so I chose here =]

    Anyway please note, these are all my work, and I don't want them leeched or posted anywhere else w/o my permission. Thanks =]

    This first function I don't even know if one existed. I looked but I didn't really see anything. (I didn't look that hard ). This function will return the number of Active players if any. It will return 0 if there is none and writeln that there are no more active users. I'm sure there is one out there but meh. I been learning about 'for' statements and this really put what I learned to the test.
    SCAR Code:
    {*******************************************************************************
    function ActivePlayers: integer;
    By: The[Cheese] and HyperSecret
    Description: Finds out how many players are currently active. If none, then
                 returns zero and debugs 'All Players Inactive!'.
    *******************************************************************************}

    function ActivePlayers: integer;
    var
      i, HowManyActive: integer;
    begin
      HowManyActive := 0;
      for i:=0 to High(Players) do
        if (Players[i].active) then
          Inc(HowManyActive)
        else WriteLn('All Players Inactive!');

      Result := HowManyActive;
      WriteLn('There are ' + inttostr(HowManyActive) + ' players active.');
    end;

    This next one is a great little tool for mining scripts that bank. I'm almost positive there isn't one of these . What this does is go through (using my handy dandy 'for' statements i've been learning) and check to see if a slot has an item. It will then mouse over to check if its a pick or not. If its not, then it will deposit all of that item. Basically it deposits everything but your picks.
    SCAR Code:
    {*******************************************************************************
    procedure MinersDeposit;
    By: The[Cheese]
    Description: This aMaZiNg funtion will deposit everything but your picks. It
                 will deposit broken picks too.
    *******************************************************************************}

    procedure MinersDeposit;
    var i: integer;
    begin
      for i := 1 to 28 do
      begin
        if(ExistsItem(i))then
        begin
          MMouseItem(i);
          if(IsUpTextMultiCustom(['roken', 'Brok']))then
          begin
            GetMousePos(x, y);
            Mouse(x, y, 1, 1, false);
            wait(150 + Random(200));
            ChooseOption('All');
            wait(150 + Random(200));
          end;
          if not(IsUpTextMultiCustom(['pic', 'ick', 'pick', 'pickaxe', 'kaxe', 'axe'])) then
          begin
            GetMousePos(x, y);
            Mouse(x, y, 1, 1, false);
            wait(150 + Random(200));
            ChooseOption('All');
            wait(150 + Random(200));
          end;
          wait(500 + Random(250));
        end;
      end;
    end;


    Please tell me what you think, and post any errors. Thanks!

    ~[Cheese]

  2. #2
    Join Date
    Mar 2008
    Location
    Indiana
    Posts
    192
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm sure the bottom one has been made. But the top one I'm not sure.

    But VERY NICE SCRIPTS!
    I probably couldn't do better.

  3. #3
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    the first one is used in many scripts already

    shortened and made alittle faster

    SCAR Code:
    function ActivePlayers: integer;
    var
      i, HowManyActive: integer;
    begin
      HowManyActive := 0;
      for i:=0 to High(Players) do
        if (Players[i].active) then
          Inc(HowManyActive)
        else WriteLn('All Players Inactive!');
     
      Result := HowManyActive;
      WriteLn('There are ' + inttostr(HowManyActive) + ' players active.');
    end;

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  4. #4
    Join Date
    Feb 2008
    Location
    NSW, Australia
    Posts
    149
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  5. #5
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the input, and for the update Hyper =]
    creds to you

    BTW is ActivePlayers actualy in the SRL includes? Because I couldnt find it.

  6. #6
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    {*******************************************************************************
    function DepositAllBut(Title: Array of Strings);
    By: The[Cheese] and Nava2
    Description: This aMaZiNg funtion will deposit everything but items specified.              It will deposit broken picks too.
    *******************************************************************************}

    procedure DepositAllBut;
    var i: integer;
    begin
      for i := 1 to 28 do
      begin
        if(ExistsItem(i))then
        begin
          MMouseItem(i);
          if not(IsUpTextMultiCustom([Title])) then
          begin
            GetMousePos(x, y);
            Mouse(x, y, 1, 1, false);
            wait(150 + Random(200));
            ChooseOption('All');
            wait(150 + Random(200));
          end;
          wait(500 + Random(250));
        end;
      end;
    end;

    Edited into a procedure which will be useful to any; not sure if it compiles but yeah

    The array of Strings allows someone to put in any uptext to search for... I doubt that procedure works but yeah its a start and more customizable.

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Yanix Saying Sorry To SRL Community!!
    By yanix in forum The Bashing Club / BBQ Pit
    Replies: 13
    Last Post: 09-10-2007, 01:39 PM
  2. Hello to this community!
    By Daftpunkas in forum RuneScape News and General
    Replies: 0
    Last Post: 01-27-2007, 09:00 AM
  3. Hello to the SRL community..
    By beautys star in forum News and General
    Replies: 2
    Last Post: 10-03-2006, 06:33 PM
  4. New Community
    By renegadeandy in forum News and General
    Replies: 3
    Last Post: 06-27-2006, 09:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •