Results 1 to 13 of 13

Thread: [SRL-6] All-in-One Looter (Early Development)

  1. #1
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default [SRL-6] All-in-One Looter (Early Development)

    AIO Looter

    Description

    This is my basic attempt at making a universal looter. I got really bored while visiting family overseas, so in those slow moments, I decided to get off my ass and try to write something which I thought would be a fun challenge and exercise in scripting! I'm actually not too sure if this is even the right place to put this thread because I honestly don't expect that this will ever be that powerful (and never will be as effective as ogLib), but I wanted to have a place where I could just post some updates maybe every once in a while to keep myself motivated.

    I'm looking for feedback and suggestions! Any comments or constructive criticism will be greatly appreciated!

    Features and Function List


    Initializer
    Simba Code:
    procedure TLoot.init(_interface : boolean; _names : TStringArray; _exNames : TStringArray; _radius : integer = 10);

    This is the heart of the looting object. The first parameter is if you will be using the looting interface, the second is a TStringArray that contains the list of objects that you want to loot, the third parameter is a TStringArray that contains the list of objects to excluded, and the fourth parameter is the radius of the biggest TBox that you can search (default is 10).

    Example:

    Simba Code:
    loot.init(false, ['Coins', 'Water orb', 'Seaweed', 'Mithril Ore'], ['Water rune'],  10);

    Issues: Planning to add a parameter that allows you to exclude certain loot, such as bones (because if the mouse over text is bones, then there must be no loot)



    Minimap Red Dot Search
    Simba Code:
    function TLoot.mmCloseSearch() : boolean;

    Description: Searches the minimap for the closest red dot and mouses over that point. If the one of the objects within the 'names' array is found, then it will return true. If the point exists on the minimap, but is not found in the mouse over, then the script will try to search for the loot within the search radius you've passed it.

    Issues: Doesn't work if the dot on the minimap is being covered. Has trouble mousing over loot if another npc is in the way. Potential problem if you are using mage or ranged and the closest red dot on the minimap may not be the most recent loot. It actually messes up in the video one time.




    Mainscreen Point Search
    Simba Code:
    function TLoot.msPointSearch(p : TPoint) : boolean;

    Description: Searches a user granted point (on the mainscreen hopefully) for loot and will try to search for the loot within the search radius you've pass it.

    Issues: Implemented, but not actually tested yet




    Mainscreen Box Search
    Simba Code:
    function TLoot.msBoxSearch(box : TBox;  initialStep : integer; clockwise : boolean = true ) : boolean;
    or
    Simba Code:
    function TLoot.msBoxSearch(box : TBox) : boolean; overload;
    //Default search method

    Description: Searches a box on the mainscreen for loot, check out the spoiler for how it works.
    How it works


    There are two parameters for a box search. The first variable is the direction in which the map will move first whcih can be LOOT_RIGHT, LOOT_LEFT, LOOT_UP, or LOOT_DOWN. The second variable is whether or not to search clockwise or not (will search clockwise by default).



    This is a picture of all the combinations, but the default loot direction (LOOT_RIGHT, clockwise) should be fine anyways. These are just options which are available for the user to decide. The procedure should also work for TBoxes which aren't squares. Look into the code to see how the points are calculated!


    Issues: Only really searches four more points, and won't be very good with large boxes.



    Pick Up Dat Loot
    Simba Code:
    function TLoot.pickLoot() : boolean;

    Description: Can only be used if the loot position has been found and moused over. If useInterface is true, it will try to take the first object. If the looting interface is then open, the function exits and will allow the user to do the rest with lootscreen code.

    If useInterface is set to false, it will pick up everything it can that is inside of your looting options. (I'm actually proud of this, take a look at how at how it works )


    Issues: Implemented, but not fully tested yet. The time inbetween looting objects in a pile may need to be adjusted.



    Setup and Example


    Setup is very simple! Just download the one file, rename it to 'AIOLooter.simba' and place it in the folder /Simba/Includes/yourule97 (You'll need to make the 'yourule97' folder though)

    Simba Code:
    program LootTester;
    {$DEFINE SMART}
    {$i srl-6/srl.simba}
    {$i yourule97/AIOLooter.simba} //Very important this line is here!

    begin
      clearDebug();
      smartPlugins := ['d3d9.dll'];
      smartEnableDrawing := true;
      smartShowConsole := false;
      setupSRL();

      loot.init(false, ['Raw beef', 'Cowhide'], ['Bones'], 20); //You must setup the loot object with your own values. See the features and functions list for more detail

      if loot.mmCloseSearch() then loot.pickLoot();
    end.


    How to use in fighting scripts: This include is still in its infant stage so I don't really know how to answer this either. However, I know that in combat situations, the NPC you are currently fighting will always have a red circle around it. Scripts can detect this circle and pass it to the loot.msBoxSearch() function once the monster is dead. They can also hover over the monster while your character is fighting it and use msPointSearch() after passing it your mouse's current location. More information will follow sometimeTM
    Credit and Thanks

    • Citrus - Hijacked his minimap to mainscreen point conversion code
    • SRL (in general) - Thank god it's open source so I can learn how to make my own includes and stuff.


    DOWNLOAD HERE
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2015
    Posts
    422
    Mentioned
    41 Post(s)
    Quoted
    226 Post(s)

    Default

    This sounds very promising tbh!! Good luck!!

  3. #3
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    Hey thanks man! It's rough around the edges, but I have high hopes!

  4. #4
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Nice! Glad to see MM2MS() getting some use. How has it been working so far?

    I've been thinking about making some looting functions for my fighter but I haven't gotten around to writing anything yet. Maybe this will inspire me

  5. #5
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    180
    Mentioned
    14 Post(s)
    Quoted
    101 Post(s)

    Default

    This looks really cool man!
    It's nice to see how other people would implement things to get a different perspective, and I'm sure with a little more work this will be even better.

    If I make anything that requires looting soon, I'll definitely give this a try and let you know how it goes.

  6. #6
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    Quote Originally Posted by Citrus View Post
    Nice! Glad to see MM2MS() getting some use. How has it been working so far?

    I've been thinking about making some looting functions for my fighter but I haven't gotten around to writing anything yet. Maybe this will inspire me
    It's pretty much perfect when it comes to finding loot, but I haven't tested it with NPCs that drop anything larger thank regular bones and I'm not sure if it will lose effectiveness.

    Quote Originally Posted by Adieux View Post
    This looks really cool man!
    It's nice to see how other people would implement things to get a different perspective, and I'm sure with a little more work this will be even better.

    If I make anything that requires looting soon, I'll definitely give this a try and let you know how it goes.
    Let me know how it goes! I need all the info I can get

  7. #7
    Join Date
    Apr 2015
    Location
    FireFox
    Posts
    528
    Mentioned
    10 Post(s)
    Quoted
    227 Post(s)

    Default

    This looks pretty promising, I'll look over it later and get back to you.
    Scripting with ogLib

  8. #8
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    Update v0.2

    • Added video on how the code can be used in a fighting script
    • Box search has been implemented
    • Spoiler now explains the different search patterns
    • Added 'exclude' capabilities for loot

  9. #9
    Join Date
    Jul 2015
    Posts
    42
    Mentioned
    0 Post(s)
    Quoted
    21 Post(s)

    Default

    this sounds amazing,
    im able to pick up charms?
    this combined with the bonsai fighter sounds amazing
    LV 99 skills so far

    - Fletching 99/99- Divination 99/99
    Defense 99/99 Range 99/99

  10. #10
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    Quote Originally Posted by wingerfinger View Post
    this sounds amazing,
    im able to pick up charms?
    this combined with the bonsai fighter sounds amazing

    Yup, ideally it should be able to pickup charms without too much problem. I was actually testing this script at waterfiends with Bonsai's combat, but I was using a charm collector. I'll probably have to play around with the looting procedure a bit more to get it working better for small objects like charms

  11. #11
    Join Date
    Sep 2015
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by yourule97 View Post
    Yup, ideally it should be able to pickup charms without too much problem. I was actually testing this script at waterfiends with Bonsai's combat, but I was using a charm collector. I'll probably have to play around with the looting procedure a bit more to get it working better for small objects like charms
    Hi,
    You mentioned that you were using your looting script with bonsai's fighter, do you mind telling me how to add it please (: ?

  12. #12
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    Quote Originally Posted by Syndicate View Post
    Hi,
    You mentioned that you were using your looting script with bonsai's fighter, do you mind telling me how to add it please (: ?
    It's a little complicated tbh, but I'll try to write up a short snippet and post it in the main thread soon!

    EDIT: I recently added an SSD and moved everything onto there, and for some reason it's messing up Runescape

    As soon as I fix that, I'll start again!

  13. #13
    Join Date
    Sep 2006
    Posts
    95
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by yourule97 View Post
    It's a little complicated tbh, but I'll try to write up a short snippet and post it in the main thread soon!

    EDIT: I recently added an SSD and moved everything onto there, and for some reason it's messing up Runescape

    As soon as I fix that, I'll start again!
    very interested to see how you managed to get it working with bonsai, ive spent abit of time but have not managed to get it working as yet

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
  •