Results 1 to 8 of 8

Thread: Need help finding bank chest

  1. #1
    Join Date
    Sep 2015
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default Need help finding bank chest

    Hello!

    So I'm making myself a script, nearly finished it already but I have a problem. I'm using color only and the biggest problem I've ever encountered was (still is) finding a banking chest. I've done it in one script before but it was very bad. I will start working on it an hour after I post this but before that I'd like to ask you guys for some help here.

    So to sum it up:
    - What I want to do: make a function that finds bank chest in camelot in PvP world (using only colors)
    - What I expect from you: any help/ideas/methods appreciated

    I know doing this with color is a hard task with all the colors changing but I do not intend to give up.
    I remember doing some things with TPAs, calculating distance and some stuff but this has been a couple of years ago so I don't really remember.

    Edit: I know I haven't tried it yet but please don't see this as an attempt to leech, as I said I did it in my previous script and it didn't go very well. I'm just looking for some advice.

    Edit2: An offtopic question: I'd like to send a string from one script to another so mule would know who and when to trade. What would be the best way of exchanging that information? Scripts aren't on same computer.

    I'll edit this post if/when I come up with something.

    Thanks in advance!
    Last edited by kakadudl; 06-28-2017 at 04:26 PM.

  2. #2
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    There are a few ways to do this depending on the include that you are using.

    If you are using Aerolib, you can simply use the object include (C:\Simba\Includes\AeroLib\entities\object).

    This will allow you to create an object in your script, input the color details and then call on it using the functions built into the include (Find, Findall etc).

    If you look at the link in my signature (Aerolib: Creating your first script), it covers this method of object finding.

    The alternative (and my preferred method) of finding an object in color is using the TPA/ATPA method.

    This is from a bank include that I was developing. The color may need a little adjustment, but it should work. You can either load it in your script, or create an include and call it from your script. This requires Aerolib.

    Simba Code:
    {
    ========
    FindBank
    ========
    }


    type
      TBank = record
        Name : string;
        BankCol : TColEx;
        CountMin, CountMax : integer;
      end;

    Var
      GLOBALBANKS : Array [0..8] of TBank;

    Const
      BANK_VWEST        = 0;
      BANK_CHEST        = 1;
      BANK_VEAST        = 2;
      BANK_SEERS        = 3;
      BANK_FALADOREAST  = 4;
      BANK_LUMBRIDGE    = 5;
      BANK_ALKHARID     = 6;
      BANK_DRAYNOR      = 7;
      BANK_FALADORWEST  = 8;


    procedure defineOurBanks();
    begin
      with GLOBALBANKS[BANK_VWEST] do
      begin
        Name := 'Varrock West';
        BankCol.Create(1850696, 10, 0.07, 0.84);
        countMin := 350;
        countMax := 1400;
      end;
      with GLOBALBANKS[BANK_CHEST] do
      begin
        Name := 'Chest';
        BankCol.Create(6119012, 12, 0.20, 0.08);
        countMin := 400;
        countMax := 600;
      end;
      with GLOBALBANKS[BANK_VEAST] do
      begin
        Name := 'Varrock East';
        BankCol.Create(2574677, 4, 0.12, 0.45);
        countMin := 150;
        countMax := 500;
      end;
      with GLOBALBANKS[BANK_SEERS] do
      begin
        Name := 'Seers Village';
        BankCol.Create(3757412, 1, 0.25, 0.82);
        countMin := 200;
        countMax := 400;
      end;
      with GLOBALBANKS[BANK_FALADOREAST] do
      begin
        Name := 'Falador East';
        BankCol.Create(4020076, 6, 0.07, 0.26);
        countMin := 50;
        countMax := 350;
      end;
      with GLOBALBANKS[BANK_LUMBRIDGE] do
      begin
        Name := 'Lumbridge';
        BankCol.Create(607066, 1, 0.21, 1.86);
        countMin := 40;
        countMax := 300;
      end;
      with GLOBALBANKS[BANK_ALKHARID] do
      begin
        Name := 'Alkharid';
        BankCol.Create(5660003, 6, 0.63, 0.79);
        countMin := 150;
        countMax := 300;
      end;
      with GLOBALBANKS[BANK_DRAYNOR] do
      begin
        Name := 'Draynor Village';
        BankCol.Create(5660003, 6, 0.63, 0.79);
        countMin := 150;
        countMax := 300;
      end;
      with GLOBALBANKS[BANK_FALADORWEST] do
      begin
        Name := 'Falador West';
        BankCol.Create(4151920, 6, 0.07, 0.22);
        countMin := 150;
        countMax := 300;
      end;
    end;

    {
    ========================================
    Function:     TBank.Find(var p:TPoint): boolean
    Description:  Finds the bank specified bank.
    Example:      GLOBALBANKS[BANK_LUMBRIDGE].Find(pnt);
    ========================================
    }

    function TBank.Find(var p:TPoint): boolean;
    var
      i:integer;
      TPA:TPointArray;
      ATPA:T2DPointArray;
      tmpCTS: integer;

    begin
      if IsBankOpen then
        Exit(true);
      if Self.BankCol.FindAllIn(AREA_MS, TPA) then
      begin
        ATPA := ClusterTPAEx(TPA, 1, 1);
        SortATPaFromMidPoint(ATPA, MSCP);
        FilterTPAsBetween(ATPA, 0, Self.CountMin);
        FilterTPAsBetween(ATPA, Self.CountMax, 10000);
        if Length(ATPA) < 1 then Exit;
        for i := 0 to High(ATPA) do
        begin
          p := ATPA[i].MidPnt;
          HumanMMouse(p, -5, 5);
          if waitUpTextMulti(['Bank Ba','Bank bo','booth','eposit','t box','Use Bank chest','ank chest','k Chest', 'chest'], 500) then
            Exit(true);
        end;
      end;
    end;

    {
    ========================================
    Function:     TBank.Interact(var p:TPoint; Click: boolean): boolean;
    Description:  Finds and interacts with the bank using the OpenBankPoint function (..Aerolib/core/bank.simba).
    Example:      GLOBALBANKS[BANK_LUMBRIDGE].Interact(pnt, true); [True = Left click. False = Right click]
    ========================================
    }

    function TBank.Interact(var p:TPoint; Click: boolean): boolean;
    begin
      if isBankOpen() then Exit(true);
      if not Self.find(p) then Exit(false);
      Result := openBankPoint(p, Click);
    end;

    It is pretty simple to use.
    Simba Code:
    begin
      initAL;
      defineOurBanks();
      if GLOBALBANKS[BANK_VWEST].Interact(pnt, true) then
        WriteLn('Opened the bank');
    end.

  3. #3
    Join Date
    Sep 2015
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by Dan the man View Post
    There are a few ways to do this depending on the include that you are using.

    If you are using Aerolib, you can simply use the object include (C:\Simba\Includes\AeroLib\entities\object).

    This will allow you to create an object in your script, input the color details and then call on it using the functions built into the include (Find, Findall etc).
    I'm using my own Include but I guess I could easily copy this function and edit for my use. I'll try this today when I find the time.

    Thanks for the reply!

  4. #4
    Join Date
    Mar 2013
    Location
    Shaolin
    Posts
    863
    Mentioned
    24 Post(s)
    Quoted
    519 Post(s)

    Default

    I think the only way to send a string to another with Simba would be with sending a message via friends chat or clan chat but that is hella risky
    You have permission to steal anything I've ever made...

  5. #5
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    Quote Originally Posted by Wu-Tang Clan View Post
    I think the only way to send a string to another with Simba would be with sending a message via friends chat or clan chat but that is hella risky
    simba1 sends info to database --> simba2 reads info in database

    I'd recommend looking up guides on sending and receiving info w/ a database, if interested in stuff like that. (@both you & OP)

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

    Default

    Quote Originally Posted by acow View Post
    simba1 sends info to database --> simba2 reads info in database

    I'd recommend looking up guides on sending and receiving info w/ a database, if interested in stuff like that. (@both you & OP)
    Yeah I guess this would work :P I asked just because it would send only a string and I find setting up db for just this a bit of an overkill. (plus I suck at it) xD
    I was thinking I could do it with dropbox/onedrive or something like that so script1 would make a file with account name and mule (script2) would just check for new file then I'd just extrace acc name from file name and mule would trade.

  7. #7
    Join Date
    Sep 2014
    Location
    C:\Simba\
    Posts
    565
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    you can also Read/Write to file which is a lot less excessive than using a server as a medium. You'd need a host and a bunch of other stuff just for some simple text...
    Feel free to ask me any questions, I will do my best to answer them!

    Previously known as YouPee.

  8. #8
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    Quote Originally Posted by Joopi View Post
    you can also Read/Write to file which is a lot less excessive than using a server as a medium. You'd need a host and a bunch of other stuff just for some simple text...
    Quote Originally Posted by kakadudl View Post
    Scripts aren't on same computer.

    3char

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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