Results 1 to 10 of 10

Thread: Iron dropper for HD

  1. #1
    Join Date
    Jan 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Smile Iron dropper for resizeable/full screen

    Well lately I found myself power mining while waiting for a certain type of ore to re-spawn .

    As usual, quickly, I got bored of dropping the Iron ore. So decided to use an auto dropper.But to my surprise i was unable find one that suited my needs:
    - Working in HD (more likely with a big screen because i had almost all other "improvements" disabled).
    - Being able to drop just a certain type of ore/item.
    - Dropping when i wanted and not hen inventory is full.


    So in conclusion after many years of leaching (using other people scripts) i start writing one.The "way of thinking" was not a problem, the issue was not knowing the functions in SCAR/SRL.


    Anyway this is it (without the lalala and all other crap)
    Version 1.2 is available to download !
    • In this version the mouse is more "undetectable"
    • The ore check loop is a little simplified
    • More comments are added !
    • Bitmap is cleared at the end of the script too preserve memory


    THANKS CIGUE FOR THE ADVICES !
    Code:
    program DropHD ;
    {.include srl/srl.scar}
    
    const
    
    Tol = 5;                        // Tolerance in finding the Iron ore. During tests with 5 tolerance worked perfectly.
    Speed = 25;                     // Mouse Speed
    TimeBetweenOres = 600 ;         // Time to wait between ore.
    
    var Loads:integer;
    
    procedure Drop;
    var IronOres, x, y: Integer ;
    begin
     IronOres := BitmapFromString(7, 3, 'beNpTkNCTFjGUFTN' +                        //Iron_Ore [10-12-09]
              'XkLBRkQYiSyVJIBsoYiIvDmQjCwJFgCSKIAAisglL');
     while(FindBitmapTolerance(IronOres, x, y,tol)) do
     begin
       MouseItem(CoordsToItem(x, y), false);
       WaitOption('Drop', RandomRange(100, 300));
       Wait(TimeBetweenOres+Random(200));
       Inc(Loads);
     end;
    end;
    
    // Main
    begin
     SetupSRL;
     mousespeed := Speed;
     Loads:=0;
     repeat
      if (IsFunctionKeyDown(0)) then Drop;                                          // Makes the script Drop each time you press the Shift key
     until(IsFunctionKeyDown(8));                                                   // Makes the script STOP, validates the repeat condition
     FreeBitmap(IronOres);
     writeln(IntToStr(Loads) + ' iron ores war droped.');
    end.
    THINGS YOU SHOULD KNOW !

    1) The script was tested and written to work with this setting made in RS :
    2) I know here is room for improvement !!

    Known Issues !!!

    Exception: Can't allocate the DIB handle
    Not due to script !!!
    In order to fix refocus SCAR on RuneScape window !

    Mentions !!!

    Yes i know that i could take the Bitmap straight from SRL but the calling procedure just didn't work for me ... so this was a simple fix !!
    If you can provide any help with that part then PLEASE TELL ME !!! (Its driving me nuts)

    Next !!

    1) Trying to use :
    FindBitmapSpiralTolerance(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; Tolerance: Integer): Boolean;
    but without specifying where to look for the bitmap (resizeable window).
    Again if you could help then PLEASE do ...

    2) After solving the issue with getting bmp's from scar/core/bitmaps.scar i'm thinking to add the option to pick what to drop and what to keep ... (depending on what time i have available...)

    THANKS for your time and PLEASE say something about it (especially if you are a SRL Member...)
    Last edited by dudutzu; 02-14-2010 at 09:08 AM.
    PEOPLE PLEASE AUTO PROPERLY

  2. #2
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    SCAR Code:
    if IsFKeyDown(0) then
    begin
      GetMousePos(x, y);
      TB := PointToInvBox(x, y);
      //Create bmp from TBox
      while (DropBMP) do wait(100+random(50));
      FreeBitmap(BMP);
    end;

    That makes it easy to choose what to drop. Justpu your mosue over t before clicking the FKey

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  3. #3
    Join Date
    Jan 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    1) And is that working in resizeable mode ? ... ? since the menu is in a different position every time ?
    Getting over point 1) ....
    2) I don't think that it gets along with my future plan, being able to select witch ore to drop or witch to keep.
    For an example if I wish to discard iron and coal while kipping Adamant and Mithril ...
    NOT SAYING THAT YOU COULD NOT ADAPT IT 2 FIT this situation !! ( I just findit mor complicated) ...

    P.S. What do you think about the standards ... ? (LOL)
    PEOPLE PLEASE AUTO PROPERLY

  4. #4
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I think you did this script in a very innovative way. I can see you've created a script with an use, which is rare for a first script. The way you comment particular lines really makes it easier to understand too.

    There are only three minor things I could see you improving. First and easiest, standards : always put two spaces after begin and repeat. You already put one, so I figure you know what I mean.

    The second this is the isfunctionkeydown(0) and (8) test. what is it for? it looks like you'd only need to run Drop; once, so why put a repeat..until ?

    Third, you should always free your bitmaps.

    I uploaded a modded version with the changes I suggested and some other stuff.

    MouseItem(CoordsToItem(x, y), False) right clicks the item found in x, y with ± 15 tol, so it's undetectable.

    WaitOption('Drop', RandomRange(100, 300)) waits 100-300 ms and clicks drop.

    FreeBitmap(IronOres) frees bitmap for memory.

    Enjoy !
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  5. #5
    Join Date
    Jan 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Cigue ...
    Specially for the advices ...

    I absolutely forgot about freeing bitmaps ... [UPSS !!]

    The isfunctionkeydown(0) and (8) are Shift and ALT GR keys and the test makes the script to repeat itsealf each time you press the shift key...
    the second key (ALT) validates the repeat condition end finishes the script ...

    In 2 words it removes the burden of starting the script each time you want to drop ... (it more convenient for me this way... )


    ~~ Observation considering the modification you made ~~

    1)
    I see in the modified script that you change the "repeat" to a "while" ...
    And I'm asking where the hell was my mind ... i was not thinking strait ...

    2)
    The variable logs is global because its incremented inside the drop procedure and then printed on the screen in the main program; therefor it need to be global.



    P.S. anything about my questions in the original post ? ... ?

    A and a big THANKS !
    PEOPLE PLEASE AUTO PROPERLY

  6. #6
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What questions? x]
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  7. #7
    Join Date
    Jan 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    1) Bitmap straight from SRL

    2) Implement FindBitmapSpiralTolerance , to make the script drop the ore that is closer to the mouse.
    ( at this moment it drops the ore in the same order every time )
    PEOPLE PLEASE AUTO PROPERLY

  8. #8
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    You said it was for HD yet you are not in HD..
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  9. #9
    Join Date
    Jan 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Happy now sex ?
    PEOPLE PLEASE AUTO PROPERLY

  10. #10
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    1) No, sorry.

    2) You'll need to add functions two that loop, that is

    1. GetMousePos(x,y) puts mouse coords in x, y.
    2. FindBitmapSpiralTolerance(nameofBMP, x, y, MIX1, MIY1, MIX2, MIY2, tolerance) will start search at x, y and record bitmap location at x, y too.
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

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
  •