Results 1 to 13 of 13

Thread: TPA help

  1. #1
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default TPA help

    Im using TPA's for my rat finding thing, it finds it but throws the mouse in the corner and starts right clicking.

    Script=
    Code:
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    ///////////////////////////////////////////////////////////////////
    //                            JUNK's LRK
    //bitmap eating procedure           infight to keep fighting if not done
    //antirandoms                       cooked meat eater
    //failsafes                         small const, big result
    //////////////////////////////V2.00////////////////////////////////
    
    
    program LRK;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}
    
    
    Var x,y,foodbmp,kill :integer;
    var TPA : TPoint; i : integer;
    /////////////////////fill this in/////////////////////////////////////////////
    const
    mousecolor= 4013378;// your mouse color
    eat= true; //Cooked meat can only be eaten thanks to jad(boolean)
             //cook raw beef from a cow and get Cook it to get cooked meat
    howmanykills= 10; //how many do you want to kill
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      Players[0].Name    := 'farflafa';
      Players[0].Pass    := 'savedit';
      Players[0].Nick    := 'arfl';
      Players[0].Active  := True;
    end;
    //////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////dont touch the rest
    procedure EatFood;    // thanks to marpis
    begin
        foodbmp := BitmapFromString(13, 12, 'beNpzMpoV7zEpyqU/0rnWV' +
           '2BAENBqZERdZbhUEmkaJagn3KkxwGZqjCseK7pCHer8rEs9zBal+A' +
           'AjAqvi9mB7oDkQZSsz/Zek+cIVQyIOiIDmAJW1BNlV+1hmAwB9+ZV' +
           'I');
           if(hppercent<20)then //thanks to marpis again
           begin
           if(eat=true)then
           begin
           Writeln('said yes to eat.');
         GameTab(tab_Inv);
        wait(100+random(20));
       if (FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20)) then
      begin
        Mouse(x, y, 2, 2, true);
         writeln('Ate food successfully!');
          wait(1500+random(200));
          end
           else
         if not(FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20))then
        writeln('Could not find food');
        exit;
        end
       else
       if (eat = false )then
       begin
       Writeln('Said no to eat');
       exit;
       end;
      end;
     end;
     
    Procedure Anti;           //Estebans tutorial
    begin
    case random(4) of
    
     0:Sleepandmovemouse(5000+random(1000));
     
     1:Boredhuman;
     
     
     2:begin
         HoverSkill('Random', false);
         wait(2500+Random(500));
       end;
       
     3:Pickupmouse;
     
     4:Begin
         Makecompass('w')
         wait(1000+random(500))
         makecompass('e')
       end;
    
    end;
    end;
    
    function findmouse : boolean;           //Awkardsaw's tutorial tree finder
    var tpa : tpointarray; I : integer;
    begin
      if findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 20) then
        for i:= 0 to high(tpa) do
        begin
          mmouse(tpa[i].x, tpa[i].y, 0, 0);
          if isuptext('ttack') then
          begin
            result := true;
            Writeln('Mouse is found')
            exit;
            end else
            if(not(findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 20))) then
            begin
            Writeln('Mouse is not found, logging out.')
            logout;
            terminatescript;
          end;
       end;
    end;
    
    Procedure clickkiller;
    begin
      if(findmouse)then
       begin
       mouse(x,y,3,3,false);
       chooseoption('ttack')
      end;
    end;
    
    procedure waitinfight;
      begin
       if(infight)then
        begin
         repeat
          Anti;
         until(not(infight))
        if (not(infight)) then
       begin
       clickkiller;
      end;
     end;
    end;
    
    procedure proggy;
    begin
     writeln('Killed aprroximitely ' + inttostr(kill));
      writeln('ran for '+ (timerunning));
      writeln('Junkjs Lumbridge Rat Killer');
     writeln('end of the script');
    end;
    
    procedure death;
    begin
     if(finddead)then
     begin;
      logout;
       proggy;
      Writeln('you died')
      terminatescript;
     end;
    end;
    
    begin;
      setupsrl;
      DeclarePlayers;
      cleardebug;
      activateclient;
      if(not(loggedin))then
      Loginplayer;
       repeat
      Findnormalrandoms;
      clickkiller;
      EatFood;
      FreeBitmap(foodbmp);
      finddead;
       until(kill >=howmanykills)
       if(kill >=howmanykills)then
       begin
      logout;
      proggy;
      terminatescript;
      end;
    end.
    //        alot bai                              wr
    //             cs    Tpa pro           Tpa      it
    //                   cedure   bitmaps  Advice   er  login      standards and others
    {Credits- Jad,Baked,Awkardsaw,marpis,Evilkitten,me,masterbb,and others for helping me.
    Help and advice is appreciated.

  2. #2
    Join Date
    Jan 2008
    Location
    Frankfurt, Germany
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Fixed all the standards, those were horrible... now I'll go fix the real problem, and you go read a tut on standards in the mean time please. Standards are a huge thing, especially when applying for members or creating a complex script.
    SCAR Code:
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    ///////////////////////////////////////////////////////////////////
    //                            JUNK's LRK
    //bitmap eating procedure           infight to keep fighting if not done
    //antirandoms                       cooked meat eater
    //failsafes                         small const, big result
    //////////////////////////////V2.00////////////////////////////////


    program LRK;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}


    var
      x,y,foodbmp,kill :integer;
      TPA : TPoint; i : integer;
     
    /////////////////////fill this in/////////////////////////////////////////////

    const
      mousecolor= 4013378;// your mouse color
      eat= true; //Cooked meat can only be eaten thanks to jad(boolean)
             //cook raw beef from a cow and get Cook it to get cooked meat
      howmanykills= 10; //how many do you want to kill

    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name    := 'farflafa';
      Players[0].Pass    := 'savedit';
      Players[0].Nick    := 'arfl';
      Players[0].Active  := True;
    end;
    //////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////dont touch the rest
    procedure EatFood;    // thanks to marpis
    begin
      foodbmp := BitmapFromString(13, 12, 'beNpzMpoV7zEpyqU/0rnWV' +
         '2BAENBqZERdZbhUEmkaJagn3KkxwGZqjCseK7pCHer8rEs9zBal+A' +
         'AjAqvi9mB7oDkQZSsz/Zek+cIVQyIOiIDmAJW1BNlV+1hmAwB9+ZV' +
         'I');
      if(hppercent<20)then //thanks to marpis again
      begin
        if eat then        // "if eat=true then" is the same as "if eat then"
        begin
          Writeln('said yes to eat.');
          GameTab(tab_Inv);
          wait(100+random(20));
          if (FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20)) then
          begin
            Mouse(x, y, 2, 2, true);
            writeln('Ate food successfully!');
            wait(1500+random(200));
          end else
          if not(FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20))then
          begin
            writeln('Could not find food');
            exit;
          end;
        end else
          // if (eat = false )then not needed, if it is not true then it has to be false
        begin   // more than one line after the "if" or "else", so you need a "begin"
          Writeln('Said no to eat');
          exit;
        end;
      end;
     end;

    Procedure Anti;           //Estebans tutorial
    begin
      case random(4) of

        0:Sleepandmovemouse(5000+random(1000));

        1:Boredhuman;


        2:begin
            HoverSkill('Random', false);
            wait(2500+Random(500));
          end;

        3:Pickupmouse;

        4:Begin
            Makecompass('w')
            wait(1000+random(500))
            makecompass('e')
          end;

      end;
    end;

    function findmouse : boolean;           //Awkardsaw's tutorial tree finder
    var tpa : tpointarray; I : integer;
    begin
      if findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 20) then
        for i:= 0 to high(tpa) do
        begin
          mmouse(tpa[i].x, tpa[i].y, 0, 0);
          if isuptext('ttack') then
          begin
            result := true;
            Writeln('Mouse is found')
            exit;
          end else
            if(not(findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 20))) then
            begin
              Writeln('Mouse is not found, logging out.')
              logout;
              terminatescript;
            end;
        end;
    end;

    Procedure clickkiller;
    begin
      if(findmouse)then
      begin
        mouse(x,y,3,3,false);
        chooseoption('ttack')
      end;
    end;

    procedure waitinfight;
    begin
      if(infight)then
      begin
        repeat
          Anti;
        until(not(infight))
        if (not(infight)) then
          clickkiller;   //no "begin" needed since it is only one line
      end;
    end;

    procedure proggy;
    begin
      writeln('Killed aprroximitely ' + inttostr(kill));
      writeln('ran for '+ (timerunning));
      writeln('Junkjs Lumbridge Rat Killer');
      writeln('end of the script');
    end;

    procedure death;
    begin
      if(finddead)then
      begin;
        logout;
        proggy;
        Writeln('you died')
        terminatescript;
      end;
    end;

    begin;
      setupsrl;
      DeclarePlayers;
      cleardebug;
      activateclient;
      if(not(loggedin))then
      Loginplayer;
      repeat
        Findnormalrandoms;
        clickkiller;
        EatFood;
        FreeBitmap(foodbmp);
        finddead;
      until(kill >=howmanykills)
      if(kill >=howmanykills)then
      begin
        logout;
        proggy;
        terminatescript;
      end;
    end.
    //        alot bai                              wr
    //             cs    Tpa pro           Tpa      it
    //                   cedure   bitmaps  Advice   er  login      standards and others
    {Credits- Jad,Baked,Awkardsaw,marpis,Evilkitten,me,masterbb,and others for helping me.

    Alright, your problem is the global/local variable mix... if the mouse is found, then that location is saved in the variable "TPA[something]", yet when you click the mouse, you are using the variables "x" and "y". Here is the problem, fixed:

    SCAR Code:
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    ///////////////////////////////////////////////////////////////////
    //                            JUNK's LRK
    //bitmap eating procedure           infight to keep fighting if not done
    //antirandoms                       cooked meat eater
    //failsafes                         small const, big result
    //////////////////////////////V2.00////////////////////////////////


    program LRK;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}


    var
      x,y,foodbmp,kill :integer;
      TPA : TPoint; i : integer;
     
    /////////////////////fill this in/////////////////////////////////////////////

    const
      mousecolor= 989817;// your mouse color
      eat= true; //Cooked meat can only be eaten thanks to jad(boolean)
             //cook raw beef from a cow and get Cook it to get cooked meat
      howmanykills= 10; //how many do you want to kill

    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name    := 'farflafa';
      Players[0].Pass    := 'savedit';
      Players[0].Nick    := 'arfl';
      Players[0].Active  := True;
    end;
    //////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////dont touch the rest
    procedure EatFood;    // thanks to marpis
    begin
      foodbmp := BitmapFromString(13, 12, 'beNpzMpoV7zEpyqU/0rnWV' +
         '2BAENBqZERdZbhUEmkaJagn3KkxwGZqjCseK7pCHer8rEs9zBal+A' +
         'AjAqvi9mB7oDkQZSsz/Zek+cIVQyIOiIDmAJW1BNlV+1hmAwB9+ZV' +
         'I');
      if(hppercent<20)then //thanks to marpis again
      begin
        if eat then        // "if eat=true then" is the same as "if eat then"
        begin
          Writeln('said yes to eat.');
          GameTab(tab_Inv);
          wait(100+random(20));
          if (FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20)) then
          begin
            Mouse(x, y, 2, 2, true);
            writeln('Ate food successfully!');
            wait(1500+random(200));
          end else
          if not(FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20))then
          begin
            writeln('Could not find food');
            exit;
          end;
        end else
          // if (eat = false )then not needed, if it is not true then it has to be false
        begin   // more than one line after the "if" or "else", so you need a "begin"
          Writeln('Said no to eat');
          exit;
        end;
      end;
     end;

    Procedure Anti;           //Estebans tutorial
    begin
      case random(4) of

        0:Sleepandmovemouse(5000+random(1000));

        1:Boredhuman;


        2:begin
            HoverSkill('Random', false);
            wait(2500+Random(500));
          end;

        3:Pickupmouse;

        4:Begin
            Makecompass('w')
            wait(1000+random(500))
            makecompass('e')
          end;

      end;
    end;

    function findmouse(var TheRatx, TheRaty : Integer): boolean;           //Awkardsaw's tutorial tree finder
    var
      tpa : tpointarray; I : integer;
    begin
      if findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 10) then
        for i:= 0 to high(tpa) do
        begin
          mmouse(tpa[i].x, tpa[i].y, 0, 0);
          Wait(175);
          if isuptext('ttack') then
          begin
            result := true;
            TheRatx := tpa[i].x;
            TheRaty := tpa[i].y;
            Writeln('Mouse is found')
            exit;
          end else
            if(not(findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 20))) then
            begin
              Writeln('Mouse is not found, logging out.')
              logout;
              terminatescript;
            end;
        end;
    end;

    Procedure clickkiller;
    begin
      if(findmouse( x, y))then
      begin
        mouse(x,y,3,3,false);
        wait(175+random(25));
        chooseoption('ttack')
      end;
    end;

    procedure waitinfight;
    begin
      if(infight)then
      begin
        repeat
          Anti;
        until(not(infight))
        if (not(infight)) then
          clickkiller;   //no "begin" needed since it is only one line
      end;
    end;

    procedure proggy;
    begin
      writeln('Killed aprroximitely ' + inttostr(kill));
      writeln('ran for '+ (timerunning));
      writeln('Junkjs Lumbridge Rat Killer');
      writeln('end of the script');
    end;

    procedure death;
    begin
      if(finddead)then
      begin;
        logout;
        proggy;
        Writeln('you died')
        terminatescript;
      end;
    end;

    begin;
      setupsrl;
      DeclarePlayers;
      cleardebug;
      activateclient;
      if(not(loggedin))then
      Loginplayer;
      repeat
        Findnormalrandoms;
        clickkiller;
        EatFood;
        FreeBitmap(foodbmp);
        finddead;
      until(kill >=howmanykills)
      if(kill >=howmanykills)then
      begin
        logout;
        proggy;
        terminatescript;
      end;
    end.
    //        alot bai                              wr
    //             cs    Tpa pro           Tpa      it
    //                   cedure   bitmaps  Advice   er  login      standards and others
    {Credits- Jad,Baked,Awkardsaw,marpis,Evilkitten,me,masterbb,and others for helping me.

    If you are having problems understanding the solution, then i would suggest you read up on some starter tuts with variables, otehrwise, good luck scripting.
    There is nothing right in my left brain and there is nothing left in my right brain.

  3. #3
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Fixed a bit more
    SCAR Code:
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    ///////////////////////////////////////////////////////////////////
    //                            JUNK's LRK
    //bitmap eating procedure           infight to keep fighting if not done
    //antirandoms                       cooked meat eater
    //failsafes                         small const, big result
    //////////////////////////////V2.00////////////////////////////////


    program LRK;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}


    var
      x,y,foodbmp,kill :integer;
      TPA : TPoint; i : integer;

    /////////////////////fill this in/////////////////////////////////////////////

    const
      mousecolor= 4013378;// your mouse color
      eat= true; //Cooked meat can only be eaten thanks to jad(boolean)
             //cook raw beef from a cow and get Cook it to get cooked meat
      howmanykills= 10; //how many do you want to kill

    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name    := 'farflafa';
      Players[0].Pass    := 'savedit';
      Players[0].Nick    := 'arfl';
      Players[0].Active  := True;
    end;
    //////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////dont touch the rest
    procedure EatFood;    // thanks to marpis
    begin
      foodbmp := BitmapFromString(13, 12, 'beNpzMpoV7zEpyqU/0rnWV' +
         '2BAENBqZERdZbhUEmkaJagn3KkxwGZqjCseK7pCHer8rEs9zBal+A' +
         'AjAqvi9mB7oDkQZSsz/Zek+cIVQyIOiIDmAJW1BNlV+1hmAwB9+ZV' +
         'I');
      if(hppercent<20)then //thanks to marpis again
      begin
        if eat then        // "if eat=true then" is the same as "if eat then"
        begin
          Writeln('said yes to eat.');
          GameTab(tab_Inv);
          wait(100+random(20));
          if (FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20)) then
          begin
            Mouse(x, y, 2, 2, true);
            writeln('Ate food successfully!');
            wait(1500+random(200));
          end else
          if not(FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20))then
          begin
            writeln('Could not find food');
            exit;
          end;
        end else
          // if (eat = false )then not needed, if it is not true then it has to be false
        begin   // more than one line after the "if" or "else", so you need a "begin"
          Writeln('Said no to eat');
          exit;
        end;
      end;
     end;

    Procedure Anti;           //Estebans tutorial
    begin
      case random(4) of

        0:Sleepandmovemouse(5000+random(1000));
        1:Boredhuman;
        2:begin
            HoverSkill('Random', false);
            wait(2500+Random(500));
          end;
        3:Pickupmouse;
        4:Begin
            Makecompass('w')
            wait(1000+random(500))
            makecompass('e')
          end;
      end;
    end;

    function findmouse : boolean;           //Awkardsaw's tutorial tree finder
    var
    tpa : tpointarray; I : integer;
    begin
      if findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 20) then
        for i:= 0 to high(tpa) do
        begin
          mmouse(tpa[i].x, tpa[i].y, 0, 0);
          if isuptext('ttack') then
          begin
            result := true;
            Writeln('Mouse is found')
            exit;
          end else
            if(not(findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 20))) then
            begin
              Writeln('Mouse is not found, logging out.')
              logout;
              terminatescript;
            end;
        end;
    end;

    Procedure clickkiller;
    begin
      if(findmouse)then
      begin
        mouse(x,y,3,3,false);
        chooseoption('ttack')
      end;
    end;

    procedure waitinfight;
    begin
      if(infight)then
      begin
        repeat
          Anti;
        until(not(infight))
        if (not(infight)) then
          clickkiller;   //no "begin" needed since it is only one line
      end;
    end;

    procedure proggy;
    begin
      writeln('Killed aprroximitely ' + inttostr(kill));
      writeln('ran for '+ (timerunning));
      writeln('Junkjs Lumbridge Rat Killer');
      writeln('end of the script');
    end;

    procedure death;
    begin
      if(finddead)then
      begin;
        logout;
        proggy;
        Writeln('you died')
        terminatescript;
      end;
    end;

    begin;
      setupsrl;
      DeclarePlayers;
      cleardebug;
      activateclient;
      if(not(loggedin))then
      Loginplayer;
      repeat
        Findnormalrandoms;
        clickkiller;
        EatFood;
        FreeBitmap(foodbmp);
        finddead;
      until(kill >=howmanykills)
      if(kill >=howmanykills)then
      begin
        logout;
        proggy;
        terminatescript;
      end;
    end.
    {        alot bai                              wr
                 cs    Tpa pro           Tpa      it
                       cedure   bitmaps  Advice   er  login      standards and others
    Credits- Jad,Baked,Awkardsaw,marpis,Evilkitten,me,masterbb,and others for helping me.}

    T~M

  4. #4
    Join Date
    Jan 2008
    Location
    Frankfurt, Germany
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The Man View Post
    Fixed a bit more
    SCAR Code:
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    ///////////////////////////////////////////////////////////////////
    //                            JUNK's LRK
    //bitmap eating procedure           infight to keep fighting if not done
    //antirandoms                       cooked meat eater
    //failsafes                         small const, big result
    //////////////////////////////V2.00////////////////////////////////


    program LRK;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}


    var
      x,y,foodbmp,kill :integer;
      TPA : TPoint; i : integer;

    /////////////////////fill this in/////////////////////////////////////////////

    const
      mousecolor= 4013378;// your mouse color
      eat= true; //Cooked meat can only be eaten thanks to jad(boolean)
             //cook raw beef from a cow and get Cook it to get cooked meat
      howmanykills= 10; //how many do you want to kill

    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name    := 'farflafa';
      Players[0].Pass    := 'savedit';
      Players[0].Nick    := 'arfl';
      Players[0].Active  := True;
    end;
    //////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////dont touch the rest
    procedure EatFood;    // thanks to marpis
    begin
      foodbmp := BitmapFromString(13, 12, 'beNpzMpoV7zEpyqU/0rnWV' +
         '2BAENBqZERdZbhUEmkaJagn3KkxwGZqjCseK7pCHer8rEs9zBal+A' +
         'AjAqvi9mB7oDkQZSsz/Zek+cIVQyIOiIDmAJW1BNlV+1hmAwB9+ZV' +
         'I');
      if(hppercent<20)then //thanks to marpis again
      begin
        if eat then        // "if eat=true then" is the same as "if eat then"
        begin
          Writeln('said yes to eat.');
          GameTab(tab_Inv);
          wait(100+random(20));
          if (FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20)) then
          begin
            Mouse(x, y, 2, 2, true);
            writeln('Ate food successfully!');
            wait(1500+random(200));
          end else
          if not(FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20))then
          begin
            writeln('Could not find food');
            exit;
          end;
        end else
          // if (eat = false )then not needed, if it is not true then it has to be false
        begin   // more than one line after the "if" or "else", so you need a "begin"
          Writeln('Said no to eat');
          exit;
        end;
      end;
     end;

    Procedure Anti;           //Estebans tutorial
    begin
      case random(4) of

        0:Sleepandmovemouse(5000+random(1000));
        1:Boredhuman;
        2:begin
            HoverSkill('Random', false);
            wait(2500+Random(500));
          end;
        3:Pickupmouse;
        4:Begin
            Makecompass('w')
            wait(1000+random(500))
            makecompass('e')
          end;
      end;
    end;

    function findmouse : boolean;           //Awkardsaw's tutorial tree finder
    var
    tpa : tpointarray; I : integer;
    begin
      if findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 20) then
        for i:= 0 to high(tpa) do
        begin
          mmouse(tpa[i].x, tpa[i].y, 0, 0);
          if isuptext('ttack') then
          begin
            result := true;
            Writeln('Mouse is found')
            exit;
          end else
            if(not(findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 20))) then
            begin
              Writeln('Mouse is not found, logging out.')
              logout;
              terminatescript;
            end;
        end;
    end;

    Procedure clickkiller;
    begin
      if(findmouse)then
      begin
        mouse(x,y,3,3,false);
        chooseoption('ttack')
      end;
    end;

    procedure waitinfight;
    begin
      if(infight)then
      begin
        repeat
          Anti;
        until(not(infight))
        if (not(infight)) then
          clickkiller;   //no "begin" needed since it is only one line
      end;
    end;

    procedure proggy;
    begin
      writeln('Killed aprroximitely ' + inttostr(kill));
      writeln('ran for '+ (timerunning));
      writeln('Junkjs Lumbridge Rat Killer');
      writeln('end of the script');
    end;

    procedure death;
    begin
      if(finddead)then
      begin;
        logout;
        proggy;
        Writeln('you died')
        terminatescript;
      end;
    end;

    begin;
      setupsrl;
      DeclarePlayers;
      cleardebug;
      activateclient;
      if(not(loggedin))then
      Loginplayer;
      repeat
        Findnormalrandoms;
        clickkiller;
        EatFood;
        FreeBitmap(foodbmp);
        finddead;
      until(kill >=howmanykills)
      if(kill >=howmanykills)then
      begin
        logout;
        proggy;
        terminatescript;
      end;
    end.
    {        alot bai                              wr
                 cs    Tpa pro           Tpa      it
                       cedure   bitmaps  Advice   er  login      standards and others
    Credits- Jad,Baked,Awkardsaw,marpis,Evilkitten,me,masterbb,and others for helping me.}

    T~M
    W/E xD
    but the main thing is fixing the problem, not the standards
    There is nothing right in my left brain and there is nothing left in my right brain.

  5. #5
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok thanks with the standards and others.

  6. #6
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    If you don't understand what he is saying...

    You are finding the color and storing it in a element (slot) in the tpa. (assuming you understand arrays) So you need to

    Code:
    Mouse(tpa[element].x, tpa[element].y, 0, 0, bool);
    so that you move the mouse to the first element in the array. If you just do

    Code:
    Mouse(x, y, 0, 0, bool);
    x and y are just variables with no value so it moves to the upper-left corner of the screen.

    Hope that helps.

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  7. #7
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Hyper.

  8. #8
    Join Date
    May 2008
    Location
    Oregon, USA
    Posts
    154
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your doing a good job making your first script... Moving along nicely. Good job. I am still making my ankou killer... but i have basically stopped for a while.

  9. #9
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Now i get a semicolon expected when i replace hypers line with my mouse line..
    Code:
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    ///////////////////////////////////////////////////////////////////
    //                            JUNK's LRK
    //bitmap eating procedure           infight to keep fighting if not done
    //antirandoms                       cooked meat eater
    //failsafes                         small const, big result
    //////////////////////////////V2.00////////////////////////////////
    
    
    program LRK;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}
    
    
    var
      x,y,foodbmp,kill :integer;
      TPA : TPoint; i : integer;
    
    /////////////////////fill this in/////////////////////////////////////////////
    
    const
      mousecolor= 4013378;// your mouse color
      eat= true; //Cooked meat can only be eaten thanks to jad(boolean)
             //cook raw beef from a cow and get Cook it to get cooked meat
      howmanykills= 10; //how many do you want to kill
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      Players[0].Name    := '';
      Players[0].Pass    := '';
      Players[0].Nick    := 'arfl';
      Players[0].Active  := True;
    end;
    //////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////dont touch the rest
    procedure EatFood;    // thanks to marpis
    begin
      foodbmp := BitmapFromString(13, 12, 'beNpzMpoV7zEpyqU/0rnWV' +
         '2BAENBqZERdZbhUEmkaJagn3KkxwGZqjCseK7pCHer8rEs9zBal+A' +
         'AjAqvi9mB7oDkQZSsz/Zek+cIVQyIOiIDmAJW1BNlV+1hmAwB9+ZV' +
         'I');
      if(hppercent<20)then //thanks to marpis again
      begin
        if eat then        // "if eat=true then" is the same as "if eat then"
        begin
          Writeln('said yes to eat.');
          GameTab(tab_Inv);
          wait(100+random(20));
          if (FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20)) then
          begin
            Mouse(x, y, 2, 2, true);
            writeln('Ate food successfully!');
            wait(1500+random(200));
          end else
          if not(FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20))then
          begin
            writeln('Could not find food');
            exit;
          end;
        end else
          // if (eat = false )then not needed, if it is not true then it has to be false
        begin   // more than one line after the "if" or "else", so you need a "begin"
          Writeln('Said no to eat');
          exit;
        end;
      end;
     end;
    
    Procedure Anti;           //Estebans tutorial
    begin
      case random(4) of
    
        0:Sleepandmovemouse(5000+random(1000));
        
        1:Boredhuman;
        
        2:begin
            HoverSkill('Random', false);
            wait(2500+Random(500));
          end;
          
        3:Pickupmouse;
        
        4:Begin
            Makecompass('w')
            wait(1000+random(500))
            makecompass('e')
          end;
      end;
    end;
    
    function findmouse : boolean;           //Awkardsaw's tutorial tree finder
    var
    tpa : tpointarray; I : integer;
    begin
      if findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 20) then
        for i:= 0 to high(tpa) do
        begin
          mmouse(tpa[i].x, tpa[i].y, 0, 0);
          if isuptext('ttack') then
          begin
            result := true;
            Writeln('Mouse is found')
            exit;
          end else
            if(not(findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 20))) then
            begin
              Writeln('Mouse is not found, logging out.')
              logout;
              terminatescript;
            end;
        end;
    end;
    
    Procedure clickkiller;
    begin
      if(findmouse)then
      begin
        Mouse(tpa[element].x, tpa[element].y, 3, 3, bool);
        chooseoption('ttack')
      end;
    end;
    
    procedure waitinfight;
    begin
      if(infight)then
      begin
        repeat
          Anti;
        until(not(infight))
        if (not(infight)) then
          clickkiller;   //no "begin" needed since it is only one line
      end;
    end;
    
    procedure proggy;
    begin
      writeln('Killed aprroximitely ' + inttostr(kill));
      writeln('ran for '+ (timerunning));
      writeln('Junkjs Lumbridge Rat Killer');
      writeln('end of the script');
    end;
    
    procedure death;
    begin
      if(finddead)then
      begin;
        logout;
        proggy;
        Writeln('you died')
        terminatescript;
      end;
    end;
    
    begin;
      setupsrl;
      DeclarePlayers;
      cleardebug;
      activateclient;
      if(not(loggedin))then
      Loginplayer;
      repeat
        Findnormalrandoms;
        clickkiller;
        EatFood;
        FreeBitmap(foodbmp);
        finddead;
      until(kill >=howmanykills)
      if(kill >=howmanykills)then
      begin
        logout;
        proggy;
        terminatescript;
      end;
    end.
    {        alot bai                             wr
                  cs   Tpa pro           Tpa      it
                       cedure   bitmaps  Advice   er  login      standards and others
    Credits- Jad,Baked,Awkardsaw,marpis,Evilkitten,me,masterbb,and others for helping me.}
    Thanks Nachoes.

    EDIT: and i changed my password, cant beleive no even took the account.. been up for 2 days or something
    Last edited by Mr. Doctor; 08-18-2009 at 09:12 AM.

  10. #10
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    here, i fixed it up some.

    SCAR Code:
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    //JUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRKJUNKJ LRK
    ///////////////////////////////////////////////////////////////////
    //                            JUNK's LRK
    //bitmap eating procedure           infight to keep fighting if not done
    //antirandoms                       cooked meat eater
    //failsafes                         small const, big result
    //////////////////////////////V2.00////////////////////////////////


    program LRK;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}


    var
      x, y, foodbmp, kill : integer;

    /////////////////////fill this in/////////////////////////////////////////////

    const
      mousecolor= 4013378;// your mouse color
      eat= true; //Cooked meat can only be eaten thanks to jad(boolean)
             //cook raw beef from a cow and get Cook it to get cooked meat
      howmanykills= 10; //how many do you want to kill

    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name    := '';
      Players[0].Pass    := '';
      Players[0].Nick    := 'arfl';
      Players[0].Active  := True;
    end;
    //////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////dont touch the rest
    procedure EatFood;    // thanks to marpis
    begin
      foodbmp := BitmapFromString(13, 12, 'beNpzMpoV7zEpyqU/0rnWV' +
         '2BAENBqZERdZbhUEmkaJagn3KkxwGZqjCseK7pCHer8rEs9zBal+A' +
         'AjAqvi9mB7oDkQZSsz/Zek+cIVQyIOiIDmAJW1BNlV+1hmAwB9+ZV' +
         'I');
      if(hppercent<20)then //thanks to marpis again
      begin
        if eat then        // "if eat=true then" is the same as "if eat then"
        begin
          Writeln('said yes to eat.');
          GameTab(tab_Inv);
          wait(100+random(20));
          if (FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20)) then
          begin
            Mouse(x, y, 2, 2, true);
            writeln('Ate food successfully!');
            wait(1500+random(200));
          end else
          if not(FindBitmapToleranceIn(foodbmp, x, y, MIX1, MIY1, MIX2, MIY2, 20))then
          begin
            writeln('Could not find food');
            exit;
          end;
        end else
          // if (eat = false )then not needed, if it is not true then it has to be false
        begin   // more than one line after the "if" or "else", so you need a "begin"
          Writeln('Said no to eat');
          exit;
        end;
      end;
     end;

    Procedure Anti;           //Estebans tutorial
    begin
      case random(4) of

        0:Sleepandmovemouse(5000+random(1000));

        1:Boredhuman;

        2:begin
            HoverSkill('Random', false);
            wait(2500+Random(500));
          end;

        3:Pickupmouse;

        4:Begin
            Makecompass('w')
            wait(1000+random(500))
            makecompass('e')
          end;
      end;
    end;

    function findmouse : boolean;           //Awkardsaw's tutorial tree finder
    var
    tpa : tpointarray; I : integer;
    begin
      if findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 20) then
        for i:= 0 to high(tpa) do
        begin
          mmouse(tpa[i].x, tpa[i].y, 0, 0);
          if isuptext('ttack') then
          begin
            result := true;
            mouse(tpa[i].x, tpa[i].y, 0, 0, false);
            chooseoption('ttack');
            Writeln('Mouse is found')
            exit;
          end else
            if(not(findcolorstolerance(TPA, mousecolor, msx1, msy1, msx2, msy2, 20))) then
            begin
              Writeln('Mouse is not found, logging out.')
              logout;
              terminatescript;
            end;
        end;
    end;

    procedure waitinfight;
    begin
      while not infight do anti;
      if not findmouse then
      begin
        writeln('Mouse Not Found');//replace this with what ever failsafe you want. - awkwardsaw
      end;
    end;

    procedure proggy;
    begin
      writeln('Killed aprroximitely ' + inttostr(kill));
      writeln('ran for '+ (timerunning));
      writeln('Junkjs Lumbridge Rat Killer');
      writeln('end of the script');
    end;

    procedure death;
    begin
      if(finddead)then
      begin;
        logout;
        proggy;
        Writeln('you died')
        terminatescript;
      end;
    end;

    begin;
      setupsrl;
      DeclarePlayers;
      cleardebug;
      activateclient;
      if(not(loggedin))then
      Loginplayer;
      repeat
        Findnormalrandoms;
        findmouse;
        EatFood;
        FreeBitmap(foodbmp);
        finddead;
      until(kill >=howmanykills)
      if(kill >=howmanykills)then
      begin
        logout;
        proggy;
        terminatescript;
      end;
    end.
    i got rid of your click mouse procedure, since it can be put into your findmouse, then i edited the waitfight thing
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  11. #11
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Read up on arrays. I don't think you understand them enough.

    Element is a slot in the array.

    0,1,2,3,4,5 - this is an array of integers. an array that has a size of 6 elements.

    So what I was saying is, you have a TPA that is a certain size (lets say 4). If you do

    Code:
    for i := 0 to length(array) do
    mmouse(array[i].x, array[i].y, 0, 0, bool);
    it will move the mouse to each element in that array. so if the size of that array is 6 then it will move your mouse to 6 different locations.

    bool is just a placehold for your true/false depending on which click you want to do.

    Read up on arrays, you need it.

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  12. #12
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks awkwardsaw, dont mind if i use your procedure.

    edit: Thanks hyper ill check up on it.

  13. #13
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by Junkj View Post
    Thanks awkwardsaw, dont mind if i use your procedure.

    edit: Thanks hyper ill check up on it.
    i dont mind although that example was just a basic example, its good enough for now
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

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
  •