Results 1 to 2 of 2

Thread: Autofighter

  1. #1
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    418
    Mentioned
    2 Post(s)
    Quoted
    86 Post(s)

    Default Autofighter

    Started making my autofighter, I run it on mosses but i get
    Code:
    Error: Out Of Range at line 1075
    The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap]
    I followed a guide on freeing DTMs here:
    Code:
    http://villavu.com/forum/showthread.php?t=78418
    Script source:
    Code:
    program New;
    //{$DEFINE SMART}
    {$i srl/srl.simba}
    
    Procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
    end;
    
    procedure antiban;
    var StartAngle, clicks, i: integer;
    begin
      StartAngle := round(rs_GetCompassAngleDegrees());
        begin
        i := random(90);
          case (i) of
           1:  begin
                 KeyDown(VK_Left);
                 Wait((302)+random(50));
                 KeyUp(VK_Left);
                 IncEx(clicks, 1);
               end;
           2:  begin
                 KeyDown(VK_Right);
                 Wait((302)+random(50));
                 KeyUp(VK_Right);
                 IncEx(clicks, 1);
               end;
           3:  begin
                 KeyDown(40);
                 Wait((208)+random(50));
                 KeyUp(40);
                 IncEx(clicks, 1);
               end;
           4:  begin
                 KeyDown(38);
                 Wait((201)+random(50));
                 KeyUp(38);
                 IncEx(clicks, 1);
               end;
          end;
        end;
      Wait(100+Random(50));
      MakeCompass(StartAngle);
      begin
      case random(90) of
        0: RandomRClick;
        2: PickUpMouse;
        3: RandomMovement;
        4: BoredHuman;
        5: ExamineInv;
        end;
    end;
    end;
    procedure destroymosses;
    var
    x, y:integer;
    begin
      wait(130+randomrange(130,210));
      If FindColorSpiral(x, y, 5207917, MSX1, MSY1, MSX2,MSY2) then
      repeat
      wait(150);
      until(not srl_InFight);
      begin
      MMouse(x, y, 0, 0);
      begin
      wait(100);
      Mouse(x, y, 0, 0, true);
      wait(3500+randomrange(300,340));
        wait(100+randomrange(50,102));
      end;
        end;
         end;
     procedure heal;
     var
     x, y, shark: integer;
     begin
      if HPPercent<40 then
      begin
      if FindDTM(shark, x, y, MIX1, MIY1, MIX2, MIY2) then
        begin
        MMouse(x, y, 5, 5);
          Mouse(x, y, 0, 0, true);
          FreeDTM(shark);
          end;
            end;
              end;
    
      procedure dtmz;
      var
      shark:integer;
      begin
      shark := DTMFromString('mwQAAAHic42RgYLBjYmDwBmJzIDYEYjcg9oKyHYDYCogfAtV9AeLrQPwJiG8B8TMgfgql3wBxVZwrkGQkgAkDQiagmAIAZKMLiw==');
      end;
    
      procedure freedtmz;
      var
        shark:integer;
      begin
      FreeDTM(shark);
      end;
    begin
      SetUpSRL;
        dtmz;
        AddOnTerminate('freedtmz');
      repeat
      antiban;
      destroymosses;
      heal;
      until(false);
      freedtmz;
    end.

    Thank you very much, can you guys also recommend me some guides with links or such to make my scripts more complex. Such as using constants, proggy reports, TPA arrays.

  2. #2
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    418
    Mentioned
    2 Post(s)
    Quoted
    86 Post(s)

    Default

    Giving this one bump, also heres the error i get might help:


    Thank you very much

    Right click open in url doesn't seem to display on forum dunno why.

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
  •