Results 1 to 9 of 9

Thread: Bandit Thiever, Needing help

  1. #1
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Smile Bandit Thiever, Needing help

    Ok, I'm trying to make a bandit thiever. I tried in Polliniveach and the colors were not easy to get right so i moved to where everyone attacks then for combat exp. The capes are an easy color to find. I've got the script to Find the color, find the bandit, right click, pickpocket, and continue. This is where i've run into a problem. These bandits add lockpicks and antipoisions to your invy. When it gets full you can't pickpocket. So i created a loop that will pickpocket untill(InvFull). Now i need to drop these 2 items which are random in order. A problem also with this is that i want to not drop the first 6 slots in order to have food there. Later i will add hp check ---> eating, then when out of food running to nearby store ---> drop first 6 spots (except 1(which contains noted food)) --->unnoteing 5 foods ---> and then running back to position. Heres what i got so far.

    Pickpocket
    Dropping
    Eating/HpCheck
    Running to bank
    Dropping first 6
    Unnoteing
    Running back

    Simba Code:
    program testbandit;
    {$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;
    begin
      case Random(90) of
        20: HoverSkill('Thieving', False);
        30: PickUpMouse;
        40: RandomMovement;
        50: BoredHuman;
        59: ExamineInv;
      end;
      Writeln('Antiban in action!');
    end;



    function Bandit: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.42, 0.14);

      FindColorsSpiralTolerance(MSCX, MSCY, arP, 1714004, MSX1, MSY1, MSX2, MSY2, 7);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        Result := arC[i];
        //Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        //Writeln('AutoColor failed in finding the color.');
    end;







    Procedure Pickpocket;
    var
      x, y: integer;
    begin
      repeat
      if(not(LoggedIn))then
        Exit;

        x:=MSCX;
        y:=MSCY;

        If FindObjTPA(x, y, Bandit, 5, 2, 5, 10, 20,['Atta'])then

        begin
          WriteLn('Found Bandit');

          GetMousePos(x, y);
          Mouse(x, y, 10, 10, False);
          WaitOption('Pick', 500)
          Wait(100)
          if pos( 'stunned', GetblackChatMessage) <> 0 then
            Case Random(2) of
              1:Wait(4000);
              2:Antiban;
            end;
        end;
       until(InvFull);
       begin
       FindNormalRandoms;
       WriteLn('This is where we"ll drop');
       Wait(15000);

       //Droping

       end;



    end;






    begin
      Smart_Server := 0;
      Smart_Members := True;
      Smart_Signed := True;
      Smart_SuperDetail := False;

      SetUpSRL;
      DeclarePlayers;
      LoginPlayer;
      repeat
        FindNormalRandoms;
        Pickpocket;
      Until(false);

    end.
    Last edited by Littellj; 03-07-2012 at 11:56 PM.

  2. #2
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    E: oops for got to read if that not first six slots. Make DTM's for the lockpick and for antipoisons and just make a procedure for dropping that finds both items in inventory when InvFull and drop them. I recommend using Demise's DTM Tutorial. I'm sure there's a easier method also something that goes over the inv slots without finding the DTM it's a for..to...do statement, sorry I can't be of much help with the simpler method
    Last edited by Gucci; 03-07-2012 at 02:08 AM.
    Current Project: Retired

  3. #3
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Gucci View Post
    For dropping use:

    Simba Code:
    procedure Dropping;
    begin
      if (InvFull) then

    begin
      DropAll; <-- Built into SRL and will drop everything in inventory.
    end;
    end;

    How would i exclude certain inventory slots, I would like to have food stored in the first 6 slots and not have to drop them.

  4. #4
    Join Date
    Nov 2011
    Location
    MA
    Posts
    545
    Mentioned
    3 Post(s)
    Quoted
    10 Post(s)

    Default

    Quote Originally Posted by Littellj View Post
    How would i exclude certain inventory slots, I would like to have food stored in the first 6 slots and not have to drop them.
    Typing on my phone so we'll see how this comes out

    For i:=(#inv slot first item to drop) to 28 do ..

  5. #5
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok so i looked around at YoHoJo's tut and his powerminner and found a possible way to do it. I think i have the code correct except i get error

    Simba Code:
    [Error] (87:3): Duplicate identifier 'DropPattern' at line 86
    Compiling failed.

    Ideas?


    Simba Code:
    program testbandit;
    {$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 StatsGuise(wat:String);
    begin
      StatsGuise(wat);
      Disguise(wat);
    end;



    procedure Antiban;
    begin
      case Random(90) of
        20: HoverSkill('Thieving', False);
        30: PickUpMouse;
        40: RandomMovement;
        50: BoredHuman;
        59: ExamineInv;
      end;
      Writeln('Antiban in action!');
    end;



    function Bandit: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.42, 0.14);

      FindColorsSpiralTolerance(MSCX, MSCY, arP, 1714004, MSX1, MSY1, MSX2, MSY2, 7);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        Result := arC[i];
        //Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        //Writeln('AutoColor failed in finding the color.');
    end;

    ///////////////Taken from YoHoJo's powerminner////////////

    Procedure DropJunk;
    var
      x, y, Needle, Antipoision, I: Integer;
      SlotBox:TBox;
      DropPattern:TIntegerArray;                 <----Error Line

    begin
       Lockpick:= DTMFromString('mrAAAAHic42BgYOhjZmCYD8QzgHgiELcDcQsQtwJxDxBXMDIwFAJxHhAXAXE9ELcAcQcQ1wKxnbU10BQmPBg/YCSAYQAA5GsJNg==');
       Antipoision:= DTMFromString('mAAEAAHiclc0xDkBQFETRebTWYGmCgiBYhpKSRiKhQmzRTX6j9G9ymmkmklSEToUaLXp0KJEiQYYch0kjJizYzG0nblzYsWLG8DS8BB7+F8M8fXsB8IkOcA==');
       DropPattern:= [9,13,17,21,25,10,14,18,22,26,7,11,15,19,23,27,8,12,16,20,24,28];

       for I:= 0 to 21 do
       Begin
         SlotBox:= InvBox(DropPattern[I]);
         if FindDTM(Lockpick,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Or
             FindDTm(Antipoision,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
          Begin
            MouseItem(DropPattern[I], False);
            WaitOption('Dro', 500);
          end;
       end;

       FreeDTM(Needle);
       FreeDTM(Antipoision);

    end;

    Procedure Pickpocket;
    var
      x, y: integer;
    begin
      repeat
      if(not(LoggedIn))then
        Exit;

        x:=MSCX;
        y:=MSCY;

        If FindObjTPA(x, y, Bandit, 5, 2, 5, 10, 20,['Atta'])then

        begin
          WriteLn('Found Bandit');

          GetMousePos(x, y);
          Mouse(x, y, 10, 10, False);
          WaitOption('Pick', 500)
          Wait(100)
          if pos( 'stunned', GetblackChatMessage) <> 0 then
            Case Random(2) of
              1:Wait(4000);
              2:Antiban;
            end;
        end;
       until(InvFull);
       begin
         FindNormalRandoms;
         WriteLn('Dropping');
         DropJunk;
         //Droping

       end;


    end;






    begin
      Smart_Server := 0;
      Smart_Members := True;
      Smart_Signed := True;
      Smart_SuperDetail := False;

      SetUpSRL;
      DeclarePlayers;
      LoginPlayer;
      repeat
        FindNormalRandoms;
        Pickpocket;
      Until(false);

    end.

  6. #6
    Join Date
    Nov 2011
    Location
    MA
    Posts
    545
    Mentioned
    3 Post(s)
    Quoted
    10 Post(s)

    Default

    Quote Originally Posted by Littellj View Post
    Ok so i looked around at YoHoJo's tut and his powerminner and found a possible way to do it. I think i have the code correct except i get error

    Simba Code:
    [Error] (87:3): Duplicate identifier 'DropPattern' at line 86
    Compiling failed.

    Ideas?
    Try using DropPattern(dp_Random);

  7. #7
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Had to use a different method but got the Dropping working, going back over my code to try and make the AutoColor only run once instead of doing it every round like it is doing. This should make it pick faster = more exp

  8. #8
    Join Date
    Apr 2011
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i wouldnt use autocolor on anything but on the minimap. everything else just pick color and find it with some tolerance. You already know how to use ACA it shouldnt be hard to figure out how to use that and find ur bandit effectively!

  9. #9
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Psilocybin View Post
    i wouldnt use autocolor on anything but on the minimap. everything else just pick color and find it with some tolerance. You already know how to use ACA it shouldnt be hard to figure out how to use that and find ur bandit effectively!
    Ok ill play around with this until there's a way to make it a constant integer.

    Update:

    Got the dropping working

    It sometimes finds the blackchat 'fail' and does the correct procedure of wait, antiban, or HpCheck but most of the time misses this and keeps clicking pick while stunned... Which could be a big problem if it misses a bunch in a row b/c it does a HpCheck if stunned. So if anyone has a fix to this, help a brother out 'lol'.


    I know the code looks ugly but ill worry about that once i get it working.




    Simba Code:
    program testbandit;
    {$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 StatsGuise(wat:String);
    begin
      StatsGuise(wat);
      Disguise(wat);
    end;



    procedure Antiban;
    begin
      case Random(90) of
        20: HoverSkill('Thieving', False);
        30: PickUpMouse;
        40: RandomMovement;
        50: BoredHuman;
        59: ExamineInv;
      end;
      Writeln('Antiban in action!');
      Wait(2000 + Random(500));
    end;



    function Bandit: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.42, 0.14);

      FindColorsSpiralTolerance(MSCX, MSCY, arP, 1714004, MSX1, MSY1, MSX2, MSY2, 7);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        Result := arC[i];
        //Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        //Writeln('AutoColor failed in finding the color.');
    end;



      Procedure FastDropSlot(Slot: Integer);
      Var
        TB: TBox;
      begin
        Case Slot of

          7: TB := IntToBox(648,250,682,280);
          8: TB := IntToBox(690,250,724,280);

          9: TB := IntToBox(564,286,598,316);
          10: TB := IntToBox(606,286,640,316);
          11: TB := IntToBox(648,286,682,316);
          12: TB := IntToBox(690,286,724,316);

          13: TB := IntToBox(564,322,598,352);
          14: TB := IntToBox(606,322,640,352);
          15: TB := IntToBox(648,322,682,352);
          16: TB := IntToBox(690,322,724,352);

          17: TB := IntToBox(564,358,598,388);
          18: TB := IntToBox(606,358,640,388);
          19: TB := IntToBox(648,358,682,388);
          20: TB := IntToBox(690,358,724,388);

          21: TB := IntToBox(564,394,598,424);
          22: TB := IntToBox(606,394,640,424);
          23: TB := IntToBox(648,394,682,424);
          24: TB := IntToBox(690,394,724,424);

          25: TB := IntToBox(564,430,598,460);
          26: TB := IntToBox(606,430,640,460);
          27: TB := IntToBox(648,430,682,460);
          28: TB := IntToBox(690,430,724,460);
        end;

        MouseSpeed := RandomRange(26,39);
        MouseBox(TB.X1, TB.Y1, TB.X2, TB.Y2, mouse_right);
        WaitOptionMulti(['Drop', 'rop R', 'op R'], 400);
      end;



    Procedure DropRemaining;
    Var
      I: Integer;
    begin

      For I := 8 downto 7 do
      begin
        if (I = 9) then
          Break;
        FastDropSlot(I);
      end;

        For I := 9 to high(12) do
        begin
          if (I = 13) then
            Break;
          FastDropSlot(I);
        end;

        For I := 16 downto 13 do
        begin
          if (I = 17) then
            Break;
          FastDropSlot(I);
        end;

        For I := 17 to high(20) do
        begin
          if (I = 21) then
            Break;
          FastDropSlot(I);
        end;

        For I := 24 downto 21 do
        begin
          if (I = 25) then
            Break;
          FastDropSlot(I);
        end;

        For I := 25 to high(28) do
        begin
          if (I = 29) then
            Break;
          FastDropSlot(I);
        end;
      end;



    procedure EatFood;
    var
      Food: integer;
      x, y: integer;
    begin
          //change to lobs**
      Food := DTMFromString('mAAEAAHic42FgYJjAzMAwBYg7gbgFijuhYjOBeAEUzwXieUAcxsjAEAjFIHYMECcAcRwQx0LZkUAcBMS+QBzgbgu0hYkETBpgJBEjAwDd9gw2');
      GameTab(tab_Inv);
      wait(100+random(20));
      FindNormalRandoms;

      if FindBitmapToleranceIn(Food, x, y, MIX1, MIY1, MIX2, MIY2, 20) then
      begin
        Mouse(x, y, 2, 2, true); // leftclick food
        writeln('Eat yo Food!');
        wait(1000+random(200));

      end;
      FreeBitmap(Food);
    end;



    Procedure HpCheck;
    begin
      WriteLn('Checking HP');
      if (HPPercent < 40) then
        begin
          repeat
            FindNormalRandoms;
            EatFood;
          until(HPPercent > 90)   //should eat all 5 foods in invy --> need to restock
         //begin
            //walk to store
            //sell noted
            //buy unnoted
            //return to spot
          //end; ---> Will return into pickpocketing procedure.
         end;
      if (HPPercent > 40) then

        Case Random(2) of
          1:AntiBan;
          2:Wait(3500 + Random(500));
        end;
    end;


    Procedure Pickpocket;
    var
      x, y: Integer;
    begin
      repeat
      if(not(LoggedIn))then
        Exit;

        SetAngle(SRL_ANGLE_HIGH);
        x:=MSCX;
        y:=MSCY;

        If FindObjTPA(x, y, Bandit, 5, 2, 5, 10, 20,['Atta'])then

        begin
          WriteLn('Found Bandit');

          GetMousePos(x, y);
          Mouse(x, y, 5, 5, False);
          WaitOption('Pick', 500)
        end;


        If FindBlackChatMessage('ail') Then
        begin
          WriteLn('Stunned')
          HpCheck;
        end;
        //find Fail here
            //begin
              //HpCheck;    //Antiban or Wait if HPPercent > 40

        //maybe put if (not(find fail) continue???
       until(InvFull);

       begin
         FindNormalRandoms;
         WriteLn('Droping');

         DropRemaining;

       end;


    end;




    begin
      Smart_Server := 0;
      Smart_Members := True;
      Smart_Signed := True;
      Smart_SuperDetail := False;

      SetUpSRL;
      DeclarePlayers;
      LoginPlayer;
      repeat
        FindNormalRandoms;
        Pickpocket;
      Until(AllPlayersInactive);

    end.

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
  •