Page 2 of 4 FirstFirst 1234 LastLast
Results 26 to 50 of 95

Thread: [Aerolib] Creating your first script

  1. #26
    Join Date
    Nov 2009
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Borland View Post
    ...
    Thank you Borland. I understand your feedback and it now makes much more sense how they link together.
    The script will now target the correct area but fails to interact/click on it.

    Code:
    openBankPoint(BankPoint, true);
    'true' should left click the BankPoint? Any idea why not clicking?

    Also cleaned up a bit as you suggested.. Thank you

    Code:
    program Bank;
    {$i AeroLib/AeroLib.Simba}
    
    var
      BankObject : TMSObject;
    
    Procedure PlayerSetup;
    begin
      Me.Active := True;
      Me.Name := '';
      Me.Pass := '';
      Me.Member := True;
    
      BankObject.create('Talk-to Banker', ['Talk-to', 'Banker', 'to Banker'], [createCol(871551, 9, 0.02, 0.25)], 50, 0, 0, 0);
    end;
    
    procedure OpenBank;
    var
      BankPoint:TPoint;
    
    begin
      if BankObject.find(BankPoint) then
        begin
        openBankPoint(BankPoint, true);
        end
    end;
    
    
    begin
      ClearDebug;
      initAL;
      PlayerSetup;
      OpenBank;
    end;

  2. #27
    Join Date
    Dec 2011
    Posts
    193
    Mentioned
    5 Post(s)
    Quoted
    51 Post(s)

    Default

    Quote Originally Posted by Grimtoker View Post
    ..
    Your script worked perfectly for me, switched out the BankObject color for a Bank Chest, GE Banker and the GE Bank Counter. Worked with each. Try grabbing a fresh color. Make sure the uptext matches what you want to click. "Bank" gives you the most coverage.

    Quote Originally Posted by Grimtoker View Post
    'true' should left click the BankPoint? Any idea why not clicking?
    Left clicking only works one click open banks, such as chests or booths. If you're targeting the banker NPC as your uptext suggests, you can't simply left click it. The function will realise this and handle it correctly by right clicking even if you passed True as the parameter; the benefits of using include functions, they've often run into every way for it to mess up and have handled it

    Now if you're saying that the mouse moved to the correct object but then didn't proceed to open the bank, it's almost certainly an uptext mismatch.

    OSRS Color Scripts: Borland_Salamanders | Borland_Iron_Ores
    Utilities & Snippets: [Color] OSBuddy Item Looting

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

    Default

    Quote Originally Posted by Grimtoker View Post
    Thank you Borland. I understand your feedback and it now makes much more sense how they link together.
    The script will now target the correct area but fails to interact/click on it.

    Code:
    openBankPoint(BankPoint, true);
    'true' should left click the BankPoint? Any idea why not clicking?

    Also cleaned up a bit as you suggested.. Thank you

    Code:
    program Bank;
    {$i AeroLib/AeroLib.Simba}
    
    var
      BankObject : TMSObject;
    
    Procedure PlayerSetup;
    begin
      Me.Active := True;
      Me.Name := '';
      Me.Pass := '';
      Me.Member := True;
    
      BankObject.create('Talk-to Banker', ['Talk-to', 'Banker', 'to Banker'], [createCol(871551, 9, 0.02, 0.25)], 50, 0, 0, 0);
    end;
    
    procedure OpenBank;
    var
      BankPoint:TPoint;
    
    begin
      if BankObject.find(BankPoint) then
        begin
        openBankPoint(BankPoint, true);
        end
    end;
    
    
    begin
      ClearDebug;
      initAL;
      PlayerSetup;
      OpenBank;
    end;
    If your script is having trouble click on an object once the mouse is over it, simplify your uptext. Instead of ['Talk-to', 'Banker', 'to Banker'], you could have ['bank', 'anker', 'Talk'].

    Well done by the way. It is looking good

  4. #29
    Join Date
    Nov 2009
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Thank you both again for your input.
    Adapting the Col and Uptext seems to have fixed the issue of not clicking.
    My knowledge has taken what feels like a big step however realise that it's really just a tiny step.

    Have so much more to learn. This guide is perfect for beginners to get there head around setting up your first script. Also have used your DTM guide which was perfect. This seemed like a nightmare at first but it's super easy after reading your tutorial. 10/10.. Dan.. you really are the man!

    Will share my first script here for you to see, understand it's still very basic with no fail safes or anti-ban, so please don't use this! Just writing it to learn, obviously it's a work in progress. It crafts Glass Lens while stood near a bank, using what I learnt in this guide.

    Please let me know your thoughts, any ideas how to improve or what to learn next would be hugely appreciated.

    Code:
    program GlassLens;
    {$i AeroLib/AeroLib.Simba}
    
    type
      ScriptState = (BLOW, BANK);
    
    var
      BankObject : TMSObject;
      CurrentTask: ScriptState;
      Pipe:TItem;
      Glass:TItem;
      Lens:TItem;
    
    Procedure PlayerSetup;
    begin
      Me.Active := True;
      Me.Name := '';
      Me.Pass := '';
      Me.Member := True;
    
      BankObject.create('Use Bank chest', ['Bank', 'chest', 'Use'], [createCol(2767439, 12, 0.04, 0.19)], 50, 0, 0, 0);
      CurrentTask := BLOW;
    end;
    
    
    Procedure LoadItems; //Thanks to the DTM guide!
    begin
      Pipe.DTM := DTMFromString('mFQEAAHiclc1LCoAwDEXRp1IQtX6wQgvi1jp0/zvwQjNxmAcng5BPlDRhRECvlsH6Gw4knNgRseJCwY1sM7Ptym4Fu73grZXauTzyx/eh+eUD8p8CoQ==');
      Glass.DTM := DTMFromString('mFQEAAHic42VgYOAHYg4gZmSAAE4g5oGKSwKxFJQWA2JhqDgXVC0zlM0HxIJALARls0HlGKDmsgDx9a0roDzisSTUblIwaTYg/A0HAAVQBMQ=');
      Lens.DTM := DTMFromString('mwQAAAHic42RgYOABYi4gZgViRgYIALH5gVgEiAWhakCACYjZoHLiQCwKxLxAzAzE+kY2UBNwY0kGwgC/CQg3ggEAxM8BhQ==');
    end;
    
    
    procedure Blowing;
    var
      pnt : Tpoint;
    begin
      Writeln('Selecting items');
      Pipe.interact(MOUSE_LEFT);
      wait(750+random(750));
      Glass.interact(MOUSE_LEFT);
      wait(1000+random(750));
      Writeln('Making lens');
      pnt := [295, 210];
      HumanMMouse(pnt, 10, 10);
      FastClick(Mouse_right);
      wait(1750+random(750));
      if WaitOption('Make X', 1000) then
        ChooseOption('Make X');
      wait(1750+random(750));
      SendKeys('88', 100, 30);
      wait(500+random(500));
      KeyDown(13);
      wait(RandomRange(50, 100));
      KeyUp(13);
      Writeln('Blowing started!');
      wait(55000+random(10000));
      CurrentTask := BANK;
    end;
    
    
    procedure Banking;
    var
      BankPoint : TPoint;
      pnt : Tpoint;
    begin
      Writeln('Opening Bank..');
      if BankObject.find(BankPoint) then
        begin
          wait(2000+random(750));
          openBankPoint(BankPoint, true);
          Writeln('Deposting..');
          wait(2000+random(750));
        end
      quickDeposit('inventory');
      Writeln('Withdrawing..');
      wait(1750+random(750));
      withdrawItem(Glass, -1);
      wait(1750+random(750));
      KeyDown(27);
      wait(RandomRange(50, 100));
      KeyUp(27);
      wait(1750+random(750));
      Writeln('Success!');
      CurrentTask := BLOW;
      ClearDebug;
    end;
    
    
    Procedure MainLoop;
    begin
      if not isLoggedIn then
        TerminateScript;
      case CurrentTask of
        BLOW: Blowing();
        BANK: Banking();
      end
    end;
    
    
    begin
      initAL;
      PlayerSetup;
      LoadItems;
      repeat
        MainLoop();
      Until(False);
    end.

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

    Default

    Quote Originally Posted by Grimtoker View Post
    ...
    Really good start mate. Is coming along really well!

    A few things you can do to optimize.

    You have create a variable called pnt and assigned [295, 210] to it. As far as I can see, you only use it on the next line. A more efficient way to do this is to not create a variable called pnt, but rather assign the variables straight into the HumanMMouse function like so:
    Simba Code:
    HumanMMouse(Point(295, 210), 10, 10);
    This means you don't have to spend a line creating a TPoint variable, and then another line assigning values to the variable if it is only going to be used once.

    Also with your glass blowing, you can add a while..do component to the script to speed it up.
    Simba Code:
    procedure Blowing;
    var
      pnt : Tpoint;
      waitCount: integer; //Create a variable that we will be using to count the time its taken to blow the glass.
    begin
      Writeln('Selecting items');
      Pipe.interact(MOUSE_LEFT);
      wait(750+random(750));
      Glass.interact(MOUSE_LEFT);
      wait(1000+random(750));
      Writeln('Making lens');
      HumanMMouse(Point(295, 210), 10, 10);
      FastClick(Mouse_right);
      wait(1750+random(750));
      if WaitOption('Make X', 1000) then
        ChooseOption('Make X');
      wait(1750+random(750));
      SendKeys('88', 100, 30);
      wait(500+random(500));
      KeyDown(13);
      wait(RandomRange(50, 100));
      KeyUp(13);
      Writeln('Blowing started!');
      while Glass.findIn(AREA_Inv, pnt) do //Creates a loop that will continue to see if the glass item is found in our inventory. If it is present, it will fire all items between the begin/end statements.
      begin
        wait(1000); // waits 1000ms
        inc(waitCount); //increases the number assigned to waitCount by 1.
        if (waitCount > 58) then //Checks to see if we have waited our maximum time. In this case 58 seconds.
          Break; //Breaks out of the While..Do loop.
      end; // Once there is no more glass in the inventory, it will break out of the loop and continue on with the script.
      CurrentTask := BANK;
    end;

    The benefit of this will be that if the glass making finishes earlier, it will start banking, rather than waiting the 55 + 10 seconds. We have a 58 second counter there to stop the script from failing and falling into an infinite loop though, so after 58 seconds, if the inventory is still not done, it will bank.
    A more efficient way to do this again would be to count the inventory in smaller times. This allows us to get back to making when we level up or stop blowing glass for whatever reason (less bot like).

    To do this, you would be best off making a separate procedure for monitoring your glass make. See revised script:

    Simba Code:
    program GlassLens;
    {$i AeroLib/AeroLib.Simba}

    type
      ScriptState = (BLOW, BANK, WAITING);

    var
      BankObject : TMSObject;
      CurrentTask: ScriptState;
      Pipe:TItem;
      Glass:TItem;
      Lens:TItem;

    Procedure PlayerSetup;
    begin
      Me.Active := True;
      Me.Name := '';
      Me.Pass := '';
      Me.Member := True;

      BankObject.create('Use Bank chest', ['Bank', 'chest', 'Use'], [createCol(2767439, 12, 0.04, 0.19)], 50, 0, 0, 0);
      CurrentTask := BLOW;
    end;


    Procedure LoadItems; //Thanks to the DTM guide!
    begin
      Pipe.DTM := DTMFromString('mFQEAAHiclc1LCoAwDEXRp1IQtX6wQgvi1jp0/zvwQjNxmAcng5BPlDRhRECvlsH6Gw4knNgRseJCwY1sM7Ptym4Fu73grZXauTzyx/eh+eUD8p8CoQ==');
      Glass.DTM := DTMFromString('mFQEAAHic42VgYOAHYg4gZmSAAE4g5oGKSwKxFJQWA2JhqDgXVC0zlM0HxIJALARls0HlGKDmsgDx9a0roDzisSTUblIwaTYg/A0HAAVQBMQ=');
      Lens.DTM := DTMFromString('mwQAAAHic42RgYOABYi4gZgViRgYIALH5gVgEiAWhakCACYjZoHLiQCwKxLxAzAzE+kY2UBNwY0kGwgC/CQg3ggEAxM8BhQ==');
    end;


    procedure Blowing;
    var
      pnt : Tpoint;

    begin
      Writeln('Selecting items');
      Pipe.interact(MOUSE_LEFT);
      wait(750+random(750));
      Glass.interact(MOUSE_LEFT);
      wait(1000+random(750));
      Writeln('Making lens');
      HumanMMouse(Point(295, 210), 10, 10);
      FastClick(Mouse_right);
      wait(1750+random(750));
      if WaitOption('Make X', 1000) then
        ChooseOption('Make X');
      wait(1750+random(750));
      SendKeys('88', 100, 30);
      wait(500+random(500));
      KeyDown(13);
      wait(RandomRange(50, 100));
      KeyUp(13);
      Writeln('Blowing started!');
      CurrentTask := WAITING;
    end;

    procedure WaitingForGlass;
    var
      waitCount, CurrentInvCount: integer;
      pnt: Tpoint;
    begin
      CurrentInvCount := Glass.getAmount(true); // Sets CurrentInvCount to the number of uncrafted glass we have in our inventory.
      repeat //Starts our repeat statement
        wait(100);
        if (CurrentInvCount = Glass.getAmount(true)) then //Checks to see if our CurrentInvCount variable is still equal to our number of uncrafted glass in our inventory.
          inc(WaitCount); // if so, it increases the waitCount variable.
        if (WaitCount >= 50) then // if WaitCount has a value greater than or equal to 50 (5 seconds), we have stopped crafting glass.
        begin
          WriteLn('We have stopped blowing glass. Starting again.');
          CurrentTask := BLOW; //We set the Current task to the procedure blow to start blowing glass again.
          Exit; //We exit the current procedure, which takes us back to the MainLoop procedure, where it will choose BLOW.
        end;
      Until(CurrentInvCount > Glass.getAmount(true)); // Will finish the repeat/Until statement if our CurrentInvCount variable is more than the current amount of uncrafted glass.
      if Glass.findIn(Area_Inv, pnt) then //Will do a check to see if there is any more glass left.
      begin
        Writeln('We have finished making glass');
        CurrentTask := BANK; // There is no more glass left, so we are setting CurrentTask to BANK.
      end;
    end; //Procedure will pass to BANK or Repeat WAITING depending on the above if/then statement. If we still have glass in our inventory, the script will go back to Mainloop, check the value of CurrentTask, identify its still WAITING, then repeat this procedure again.


    procedure Banking;
    var
      BankPoint : TPoint;
      pnt : Tpoint;
    begin
      Writeln('Opening Bank..');
      if BankObject.find(BankPoint) then
        begin
          wait(2000+random(750));
          openBankPoint(BankPoint, true);
          Writeln('Deposting..');
          wait(2000+random(750));
        end
      quickDeposit('inventory');
      Writeln('Withdrawing..');
      wait(1750+random(750));
      withdrawItem(Glass, -1);
      wait(1750+random(750));
      KeyDown(27);
      wait(RandomRange(50, 100));
      KeyUp(27);
      wait(1750+random(750));
      Writeln('Success!');
      CurrentTask := BLOW;
      ClearDebug;
    end;


    Procedure MainLoop;
    begin
      if not isLoggedIn then
        TerminateScript;
      case CurrentTask of
        BLOW: Blowing();
        BANK: Banking();
        WAITING: WaitingForGlass();
      end
    end;


    begin
      initAL;
      PlayerSetup;
      LoadItems;
      repeat
        MainLoop();
      Until(False);
    end.

    Not sure if I broke it or not, but let me know if it works lol.

  6. #31
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    I'm a little late to the party, but this is a great tutorial. Thank you for taking the time to create it, we definitely needed an AeroLib tutorial to point beginners at.



    New to scripting? Procedures & Functions for Beginners
    Do you use your computer at night? Just get f.lux

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

    Default

    Quote Originally Posted by Incurable View Post
    I'm a little late to the party, but this is a great tutorial. Thank you for taking the time to create it, we definitely needed an AeroLib tutorial to point beginners at.
    Thanks

  8. #33
    Join Date
    Apr 2017
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Code:
    program new;
    {$DEFINE SMART}
    {$i AeroLib/AeroLib.Simba}
    
    Procedure PlayerSetup;
    begin
      Me.Active := True;
      Me.Name := '';
      Me.Pass := '';
      Me.Member := True;
    end;
    
    begin
      initAL;
    end.



    Trying to run this with or without username and pass and all I get is this:

    Code:
    Error: "" is an invalid integer at line 168
    Execution failed.
    
    begin
      sIndex := readINI('ObjectDB_Main', 'Count', PATH_OBJDB);
      if (strToInt(sIndex) < 1) then Exit;

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

    Default

    Quote Originally Posted by Bumbaa2 View Post
    Code:
    program new;
    {$DEFINE SMART}
    {$i AeroLib/AeroLib.Simba}
    
    Procedure PlayerSetup;
    begin
      Me.Active := True;
      Me.Name := '';
      Me.Pass := '';
      Me.Member := True;
    end;
    
    begin
      initAL;
    end.



    Trying to run this with or without username and pass and all I get is this:

    Code:
    Error: "" is an invalid integer at line 168
    Execution failed.
    
    begin
      sIndex := readINI('ObjectDB_Main', 'Count', PATH_OBJDB);
      if (strToInt(sIndex) < 1) then Exit;
    Just pasted that into my Simba and it compiled/worked fine.

    Ensure you have installed Aerolib properly and that you antivirus or firewall isnt removing some of the files like they sometimes do.

  10. #35
    Join Date
    Apr 2017
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    [QUOTE=Dan the man;1385100]Just pasted that into my Simba and it compiled/worked fine.

    My god I placed areolib in the main simba folder and not in includes.

    ...


    And how come I can't access your Barb fisher thread? I don't have enough permission? I am down to try it out.
    And possible to teach how to shift drop?

    Thanks,
    Bumbaa
    Last edited by Bumbaa2; 04-04-2017 at 02:14 AM.

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

    Default

    Quote Originally Posted by Bumbaa2 View Post
    Just pasted that into my Simba and it compiled/worked fine.

    My god I placed areolib in the main simba folder and not in includes.

    ...


    And how come I can't access your Barb fisher thread? I don't have enough permission? I am down to try it out.
    And possible to teach how to shift drop?

    Thanks,
    Bumbaa
    My barb fisher doesn't shift drop. Was made before that was a thing.

    You need to be a Jr member in order to view that section of the forums - 30 days on the forums and 25 posts or something.

  12. #37
    Join Date
    Dec 2011
    Posts
    193
    Mentioned
    5 Post(s)
    Quoted
    51 Post(s)

    Default

    Quote Originally Posted by Bumbaa2 View Post
    And possible to teach how to shift drop?
    Both my iron ore script and my salamander scripts utilises shift click dropping if you want to you can check them for reference.

    OSRS Color Scripts: Borland_Salamanders | Borland_Iron_Ores
    Utilities & Snippets: [Color] OSBuddy Item Looting

  13. #38
    Join Date
    Apr 2017
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Yea,I got it.It's pretty simple.

  14. #39
    Join Date
    Apr 2017
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Hey guys, I think I am missing something completely trivial here. After running the tutorial for logging in, my player will not log in but the actual RS client loads up. I made sure to fill out the information, etc. I ran the test script and that compiled / ran fine. Am I missing something here?

  15. #40
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by DaNoodler View Post
    Hey guys, I think I am missing something completely trivial here. After running the tutorial for logging in, my player will not log in but the actual RS client loads up. I made sure to fill out the information, etc. I ran the test script and that compiled / ran fine. Am I missing something here?
    Did you enter you username and password into the correct fields? It helps if you post the debug box contents + your code

  16. #41
    Join Date
    Apr 2017
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by jstemper View Post
    Did you enter you username and password into the correct fields? It helps if you post the debug box contents
    So sorry! So here are the debug contents:

    Compiled successfully in 1295 ms.
    [=================================]
    | < Aero|Library > |
    | ---------------- |
    | Version : 1.2 |
    | Revision : 6 |
    [=================================]
    [AL] Initiating AeroLib...
    [AL] Checking version...
    [AL] Currently up to date.
    [AL] Loaded 2 MSObjects.
    [AL] Best world found: 6
    [AL] Loading SMART: World 6

    And as to where I entered the username and password, I did that in the PlayerSetup section:

    program new;
    {$DEFINE SMART}
    {$i AeroLib/AeroLib.Simba}

    var
    OurWords: String;

    Procedure PlayerSetup;
    begin
    Me.Active := True;
    Me.Name := '<entered username>';
    Me.Pass := '<entered password>';
    Me.Member := True;
    end;

    begin
    initAL;
    PlayerSetup;
    if (not isLoggedIn()) then
    loginPlayer(false);
    OurWords := 'Hello World!';
    Writeln(OurWords);
    OurWords := 'Goodbye World!';
    Writeln(OurWords);
    end.

  17. #42
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by DaNoodler View Post
    So sorry! So here are the debug contents:

    Compiled successfully in 1295 ms.
    [=================================]
    | < Aero|Library > |
    | ---------------- |
    | Version : 1.2 |
    | Revision : 6 |
    [=================================]
    [AL] Initiating AeroLib...
    [AL] Checking version...
    [AL] Currently up to date.
    [AL] Loaded 2 MSObjects.
    [AL] Best world found: 6
    [AL] Loading SMART: World 6

    And as to where I entered the username and password, I did that in the PlayerSetup section:

    program new;
    {$DEFINE SMART}
    {$i AeroLib/AeroLib.Simba}

    var
    OurWords: String;

    Procedure PlayerSetup;
    begin
    Me.Active := True;
    Me.Name := '<entered username>';
    Me.Pass := '<entered password>';
    Me.Member := True;
    end;

    begin
    initAL;
    PlayerSetup;
    if (not isLoggedIn()) then
    loginPlayer(false);
    OurWords := 'Hello World!';
    Writeln(OurWords);
    OurWords := 'Goodbye World!';
    Writeln(OurWords);
    end.
    Works fine for me, it may have took too long to load SMART. Did you try running it again? It should pair to the existing free client.

  18. #43
    Join Date
    Apr 2017
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by jstemper View Post
    Works fine for me, it may have took too long to load SMART. Did you try running it again? It should pair to the existing free client.
    I let it sit for like 10 minutes with nothing. Does it usually take longer? I also tried running it with the client up and even tried selecting it with the 'Select a client' tool.

  19. #44
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by DaNoodler View Post
    I let it sit for like 10 minutes with nothing. Does it usually take longer? I also tried running it with the client up and even tried selecting it with the 'Select a client' tool.
    It usually takes me 2-3 mins to load SMART. Try running simba as administrator. No need to use the selector, it should automatically pair.

  20. #45
    Join Date
    Apr 2017
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by jstemper View Post
    It usually takes me 2-3 mins to load SMART. Try running simba as administrator. No need to use the selector, it should automatically pair.
    Yea, I did run it as admin. Tried running when the client was up and apparently my OSRS was not detected even though it did pair as shown by the debug:

    Compiled successfully in 1201 ms.
    [=================================]
    | < Aero|Library > |
    | ---------------- |
    | Version : 1.2 |
    | Revision : 6 |
    [=================================]
    [AL] Initiating AeroLib...
    [AL] Checking version...
    [AL] Currently up to date.
    [AL] Loaded 2 MSObjects.
    [AL] Paired with SMART[18880]
    [AL] Could not start up OSRS or RSReady was not detected!
    Successfully executed.

    Edit: Got it working. Sorry for the dumb questions; just new.
    Last edited by DaNoodler; 04-08-2017 at 09:26 PM.

  21. #46
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by DaNoodler View Post
    Yea, I did run it as admin. Tried running when the client was up and apparently my OSRS was not detected even though it did pair as shown by the debug:

    Compiled successfully in 1201 ms.
    [=================================]
    | < Aero|Library > |
    | ---------------- |
    | Version : 1.2 |
    | Revision : 6 |
    [=================================]
    [AL] Initiating AeroLib...
    [AL] Checking version...
    [AL] Currently up to date.
    [AL] Loaded 2 MSObjects.
    [AL] Paired with SMART[18880]
    [AL] Could not start up OSRS or RSReady was not detected!
    Successfully executed.

    Edit: Got it working. Sorry for the dumb questions; just new.
    No such thing as a dumb question, that problem happens to a lot of people. Good luck

  22. #47
    Join Date
    Apr 2017
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    This tutorial was absolutely amazing! Thank you so much for writing this up.

  23. #48
    Join Date
    Apr 2017
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Awesome guide!! I'm new at this, Trying to make a script that counts how many items i have in my inventory and i want the result to show it in the debug window of simba. This is my script atm:

    Code:
    program new;
    {$i AeroLib/AeroLib.Simba}
    
    
    Procedure LetsDoStuff;
    var
      pnt:Tpoint;
    begin
      pnt := [651, 185]; //Cords of the inventory
       HumanMMouse(pnt, 5, 5);
      Wait(RandomRange(90, 160));
      FastClick(Mouse_left); // clicks on the inventory
    //getinvcount, i want it to somehow count how many items i have and show it in the debug.
    
    
        end;
    
    
    begin
      initAL;
      LetsDoStuff;
    end.
    I tried playing around with the "getInvCount" but i just couldn't get it to work. Can anyone give me some tips? THanks!!!

  24. #49
    Join Date
    Dec 2011
    Posts
    193
    Mentioned
    5 Post(s)
    Quoted
    51 Post(s)

    Default

    Quote Originally Posted by psrkallez06 View Post
    Awesome guide!! I'm new at this, Trying to make a script that counts how many items i have in my inventory and i want the result to show it in the debug window of simba. This is my script atm:

    Code:
    program new;
    {$i AeroLib/AeroLib.Simba}
    
    
    Procedure LetsDoStuff;
    var
      pnt:Tpoint;
    begin
      pnt := [651, 185]; //Cords of the inventory
       HumanMMouse(pnt, 5, 5);
      Wait(RandomRange(90, 160));
      FastClick(Mouse_left); // clicks on the inventory
    //getinvcount, i want it to somehow count how many items i have and show it in the debug.
    
    
        end;
    
    
    begin
      initAL;
      LetsDoStuff;
    end.
    I tried playing around with the "getInvCount" but i just couldn't get it to work. Can anyone give me some tips? THanks!!!
    Firstly, you can double click an AeroLib function in the functionlist on the left and it'll open the file it's contained in. Generally the file will have a bunch of other similar functions in there too. For example, double clicking getInvCount will open AeroLibs Items.Simba file. In here you'll find a bunch of ready made functions that will work right out the box. I'll run through a couple related to what you're trying to do.

    Simba Code:
    //Will spit out the number of any item in inventory
    Writeln(getInvCount);

    //if you want to know how many of a particular item you have, then setup the TItem like you did in the other thread with Tinrock, then do the following to debug the amount of that item.
    Writeln(Tinrock.getAmount);

    //Try typing just the TItem name with a period after like: Tinrock. will bring up a list of available pre-made functions
    //some useful ones to do with counting would be
    var
      itemSlots: TIntegerArray; //we set up an array to hold each slot our item is found.

    itemSlots := Tinrock.getSlots; //now itemSlots is filled (if you don't know about arrays search that up, it's general programming stuff)

    //We can now use the itemSlots variable to see how many of that specific item we have, this saves us having to use the getAmount function above.
    Writeln(Length(itemSlots)); //We are spitting out the length of the array which holds our item slots. Since there will be 1 slot stored for every time the item was found, the length of the array will match the amount of that item in our invent. We are getting 2 purposes out of 1 function and variable. We kill 2 bird with 1 stone, efficient.

    OSRS Color Scripts: Borland_Salamanders | Borland_Iron_Ores
    Utilities & Snippets: [Color] OSBuddy Item Looting

  25. #50
    Join Date
    Apr 2017
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    You are the best!! Worked perfectly!

    I had one more question which confuses me. I want a similar function to the GetInvCount but instead i want it to show the Current player health.

    The closest i got was in the folder: SRL-OSR. i found this:

    Code:
    function GetCurrentHealth: Integer;
    var
      tpa : TPointArray;
    begin
      tpa    := returnTPAExceptColors([4938344, 0], [20, 0], intToBox(522,56,541,69));
      result := strToIntDef(getTextATPA(clusterTPAEx(tpa,1,10), 5, 'StatChars07'), 0);
    end;
    But i have no idea how to actually use this to get it to show my health. Can you help? Thank you once again!

Page 2 of 4 FirstFirst 1234 LastLast

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
  •