Results 1 to 7 of 7

Thread: TNT's AirCrafter [First script/Need help]

  1. #1
    Join Date
    Dec 2015
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default TNT's AirCrafter [First script/Need help]

    Hello all im trying to create my first script. as of right now it is not perfect and has no progress report or anti ban but i will add that eventually. this is one day of coding lol


    here is the full code :

    Code:
    program TNTsAirs;
    
    {$DEFINE SMART}              // Always have this to load smart
    {$I SRL-6/SRL.simba}         // To load the SRL include files
    {$I SPS/lib/SPS-RS3.Simba}   // To load the SPS include files
    function inAltar(waitTime: integer = 0) : Boolean;
    var
     t:TTimeMarker;
     y, x, altarDTM: integer;
    begin
      result := false;
      if not isLoggedIn() then
        exit;
      altarDTM= DTMFromString('mWAAAAHicY2FgYFjPxMBwE4i3AvFkIK4Eik0H4lNAvAiIo/31UTAXUAwZM6JhEAAAF2YI6Q==');
      t.start();
      repeat
        if(findDTM(altarDTM,x,y,minimap.getBounds())) then
          result := true;
    
        wait(gaussRangeInt(30,120));
      until (t.getTime() > waitTime) or (result);
    
      FreeDTM(altarDTM);
    end;
    
    procedure stopScript(reason : String);
    begin
      writeLn('Stopping script');
      writeLn(reason);
      if isLoggedIn() then
       writeLn('Logging out');
      players[currentPlayer].logout();
      writeLn('Done');
      terminateScript();
    end;
    procedure declarePlayers();
    begin
      setLength(players, 1);
      with players[0] do
      begin
        loginName := 'Username';
        password := 'password';
        isActive := true;
        isMember := false;
      end
      currentPlayer := 0;
    end;
    
    procedure openBank();  //code to open bank
    var
      x, y, i: integer;
    begin
       if not isLoggedIn() then
        exit;
    
      repeat
        mainscreen.findObject(x, y, 6304580, 8, colorSetting(2, 0.22, 0.85), mainscreen.playerPoint, 10, 30, 25, ['ank', 'anker'], MOUSE_LEFT);
        wait(randomRange(1000, 2000));
        inc(i);
      until bankScreen.isOpen() or (i >= 15);
    end;
    
    procedure withdrawEss();   //code to withdraw rune essence and close bank
    var
    timer : TTimeMarker;
    begin
        if   bankScreen.isOpen(1000)  then
        begin
          repeat
            bankscreen.ClickButton(BANK_BUTTON_PRESET_1);
            wait(gaussRangeInt(100,300));
          until (not Bankscreen.isOpen) or (not isLoggedIn()) or (timer.getTime >30000);
        wait(500)
        if (not tabBackpack.isFull()) then
        begin
          wait(500);
          if(not tabBackpack.isFull()) then
          begin
            StopScript('Out Of Ess');
          end;
        end;
      end;
    end;
    
    procedure runToAlter();  //code  to run to alter
    var
    pathToAlter: TPointArray;
    begin
      if not isLoggedIn() then
        exit;
    
      pathToAlter := [Point(379, 172), Point(357, 200), Point(325, 203), Point(294, 204), Point(265, 233), Point(231, 249), Point(198, 260), Point(162, 277), Point(119, 290)];
    
      if SPS.walkPath(pathToAlter) then
        minimap.waitPlayerMoving()
      else
        writeLn('We failed to walk to the alter');
    
    end;
    
    procedure enterAlter();  //code to enter alter
    var
      t: TTimeMarker;
      x, y, i: integer;
      p: TPoint;
    begin
       if not isLoggedIn() then
        exit;
      if minimap.findSymbol(p, MM_SYMBOL_RUNECRAFTING, minimap.getBounds()) then
        writeLn('we are next to the alter searching');
        t.start();
    
        repeat
          mainscreen.findObject(x, y, 13746322, 3, colorSetting(2, 0.56, 1.05), mainscreen.playerPoint, 10, 30, 25, ['ysterious', 'uins'], MOUSE_LEFT);
          wait(randomRange(2000, 3000));
          inc(i);
        until inAltar(300) or (t.getTime>3000);
    
    end;
    
    procedure makeAirRunes();  //code to make Air runes
    var
      x,y: Integer;
      t: TTimeMarker;
    begin
      if not isLoggedIn() then
        exit;
      mainScreen.setAngle(MS_ANGLE_HIGH);
      minimap.setAngle(MM_DIRECTION_WEST);
      t.start()
      repeat
        mainscreen.findObject(x, y, 8550014, 4, colorSetting(2, 0.22, 0.11), mainscreen.playerPoint, 10, 30, 25, ['raft-rune altar', 'ltar'], MOUSE_LEFT);
        wait(randomRange(1000, 2000));
      until (tabBackpack.count < 3) or (t.getTime > 20000) or (not isLoggedIn());
    end;
    
    procedure exitAlter(); //code to exit alter
    var
      x, y, randomN, i: integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;
      t: TTimeMarker;
      tt : TTimeMarker;
    begin
      if not isLoggedIn() then
        exit;
      wait(1000);
    
      t.start();
      repeat
        findColorsSpiralTolerance(x, y,TPA ,9023921, mainScreen.getBounds(), 21, colorSetting(2, 0.00, 0.17));
        if (Length(TPA) < 1) then
        begin
          exit;
        end;
    
        mainScreen.filterPointsPlayer(TPA);
        ATPA := TPA.toATPA(25, 25);
        FilterTPAsBetween(ATPA,1,30);
        ATPA.sortFromMidPoint(mainscreen.playerPoint);
    
    
        for i := 0 to high(ATPA) do
        begin
          mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
          if isMouseOverText(['nter Portal'], 500) then
            begin
              fastClick(MOUSE_LEFT);
              tt.Start();
    
          repeat
            wait(gaussRangeInt(40,200));
          until(not inAltar(100)) or (tt.getTime() > 6000);
        end;
        end
      until (not inAltar(100)) or (not isLoggedIn()) or (t.getTime() > 30000);
    end
    procedure runToBank();  //code to run to bank
    var
    pathToBank: TPointArray;
    begin
      if not isLoggedIn() then
        exit;
    
      pathToBank := [Point(119, 290), Point(162, 277), Point(198, 260), Point(231, 249), Point(265, 233), Point(294, 204), Point(325, 203), Point(357, 200), Point(379, 172)];
    
      if SPS.walkPath(pathToBank) then
        minimap.waitPlayerMoving()
      else
        writeLn('We failed to walk to the Bank');
    
    end;
    
    
    
    // main loop
    begin
      clearDebug();               // Clear the debug box
      smartEnableDrawing := true; // So we can draw on SMART
      setupSRL();                   // Load the SRL include files
      declarePlayers();             // Set up your username/pass
    
      SPS.setup('AIRALTER_MAP', RUNESCAPE_OTHER)
      repeat
      if not isLoggedIn() then             // If player isn't logged in then
      begin
        players[currentPlayer].login();   // Log them in
        exitTreasure();            // Exit treasure hunter
        minimap.setAngle(MM_DIRECTION_NORTH);  // Make compass north and angle high
        mainScreen.setAngle(MS_ANGLE_HIGH);
      end;
    
      if tabBackpack.isFull() then
      begin
        runToAlter();
        enterAlter();
        makeAirRunes();
        exitAlter();
      end;
      runToBank();
      openBank();
      withdrawEss();
    until(false);
    end.
    if you want to run the script have a full inventory of ess in preset1 also you will need to place this picture in your runescape other folder of SRS:http://imgur.com/SV3fU34

    TO DO:
    antiban
    progress reports
    rest if run below limit


    Thanks to:
    TheMayor for his guide on his scripting guide.
    camel: for some of the ideas such as inAlter, and various other ideas.


    like i said any help/critique would be appreciated

    Thanks
    TNT
    Last edited by trinitrotoluene; 12-28-2015 at 12:35 AM. Reason: added to do list and fixed a problem

  2. #2
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    needs to be pointed south to be able to find the portal
    Simba Code:
    minimap.setAngle(MM_DIRECTION_SOUTH);
    should work.

  3. #3
    Join Date
    Dec 2015
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    Simba Code:
    minimap.setAngle(MM_DIRECTION_SOUTH);
    should work.
    thats what i did but there would be times it would be confused by a level up i set it to point west and it seems to be working currently right now will see how long it runs any advice on an anti ban or anything to clean it up at all?

  4. #4
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by trinitrotoluene View Post
    thats what i did but there would be times it would be confused by a level up i set it to point west and it seems to be working currently right now will see how long it runs any advice on an anti ban or anything to clean it up at all?
    To clean it up you could go through and make sure your spacing/indenting/etc is consistent.

    Also, in your enterAlter procedure you have:

    Simba Code:
    begin
       if not isLoggedIn() then
        exit;
      if minimap.findSymbol(p, MM_SYMBOL_RUNECRAFTING, minimap.getBounds()) then
        writeLn('we are next to the alter searching');
        t.start();

        repeat
          mainscreen.findObject(x, y, 13746322, 3, colorSetting(2, 0.56, 1.05), mainscreen.playerPoint, 10, 30, 25, ['ysterious', 'uins'], MOUSE_LEFT);
          wait(randomRange(2000, 3000));
          inc(i);
        until inAltar(300) or (t.getTime>3000);

    end;
    Your indenting and spacing suggests that you meant to include everything from the writeln to the until in the if statement, but how it is right now it's not. You would need to add
    Simba Code:
    begin
    and
    Simba Code:
    end;
    around that part for it to be included.

  5. #5
    Join Date
    Dec 2015
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    To clean it up you could go through and make sure your spacing/indenting/etc is consistent.

    Also, in your enterAlter procedure you have:

    Simba Code:
    begin
       if not isLoggedIn() then
        exit;
      if minimap.findSymbol(p, MM_SYMBOL_RUNECRAFTING, minimap.getBounds()) then
        writeLn('we are next to the alter searching');
        t.start();

        repeat
          mainscreen.findObject(x, y, 13746322, 3, colorSetting(2, 0.56, 1.05), mainscreen.playerPoint, 10, 30, 25, ['ysterious', 'uins'], MOUSE_LEFT);
          wait(randomRange(2000, 3000));
          inc(i);
        until inAltar(300) or (t.getTime>3000);

    end;
    Your indenting and spacing suggests that you meant to include everything from the writeln to the until in the if statement, but how it is right now it's not. You would need to add
    Simba Code:
    begin
    and
    Simba Code:
    end;
    around that part for it to be included.

    like:
    Simba Code:
    begin
       if not isLoggedIn() then
        exit;
      if minimap.findSymbol(p, MM_SYMBOL_RUNECRAFTING, minimap.getBounds()) then
       begin
        writeLn('we are next to the alter searching');
        t.start();

        repeat
          mainscreen.findObject(x, y, 13746322, 3, colorSetting(2, 0.56, 1.05), mainscreen.playerPoint, 10, 30, 25, ['ysterious', 'uins'], MOUSE_LEFT);
          wait(randomRange(2000, 3000));
          inc(i);
        until inAltar(300) or (t.getTime>3000);
      end
    end;

  6. #6
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by trinitrotoluene View Post
    like:
    Simba Code:
    begin
       if not isLoggedIn() then
        exit;
      if minimap.findSymbol(p, MM_SYMBOL_RUNECRAFTING, minimap.getBounds()) then
       begin
        writeLn('we are next to the alter searching');
        t.start();

        repeat
          mainscreen.findObject(x, y, 13746322, 3, colorSetting(2, 0.56, 1.05), mainscreen.playerPoint, 10, 30, 25, ['ysterious', 'uins'], MOUSE_LEFT);
          wait(randomRange(2000, 3000));
          inc(i);
        until inAltar(300) or (t.getTime>3000);
      end
    end;
    Remember the semicolon after the end, but yeah.

  7. #7
    Join Date
    Dec 2015
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    Remember the semicolon after the end, but yeah.
    thanks i always for get that haha

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
  •