Results 1 to 15 of 15

Thread: [BattleScape] Thieving Bot.. (help)

  1. #1
    Join Date
    Dec 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Wink [BattleScape] Thieving Bot.. (help)

    Okay so this is what I've got ...

    Code:
    program BSBot;
    {.include SRL/SRL.scar}
    var x,y:integer;
    procedure PickpocketPaladin;
    begin
      MakeCompass('SW');
      repeat
        if FindObjCustom(x,y,['Pala','din'],[6710893,6405352,1824472],7)then
        begin                              //colours of pala..
        Mouse(x,y,0,0,false);
        repeat
          Wait(100 + (random(150)));
          Chooseoption('ickpocket');        //pickpocket nigga
          until(InvFull)
      end;                             //until full inv
    until(InvFull)
    end;
    begin
    end.
    Actually, It's not done, just a little part I did.., but, can someone please tell me if I'm on the right way? Like, I don't really know lol,
    Would be very helpful if someone helped me and maybe tell me what more I need for a script that will pickpocket paladins and eat lobs/sharks and alch platebodies and bank ... Thank you in advance.



    P.S. Please dont flame me because I'm a noob lol

    Originally Posted by Zezima
    I like old men.

  2. #2
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If im right and too think its for a p sever, then you cant use SRL inclued as its for runescape, so no Invful not that i know how to do it lol
    Quote Originally Posted by DD on IRC
    wanted to troll the troll

  3. #3
    Join Date
    Dec 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Cool

    Yea, it's for a RSPS Uhm, I thought we could use the RS things for that ? xD but oh ok :P thanks ^^ Any other tips ?

    Originally Posted by Zezima
    I like old men.

  4. #4
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Umm well the best way to do it i think could just be basic color and cord clicking, need some one else to explain though im not great myself ethier

    Hope i helped
    Quote Originally Posted by DD on IRC
    wanted to troll the troll

  5. #5
    Join Date
    Dec 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Wink

    Ahh okay, thanks Yeah, I guess I'll just go read some other tutorials, then, lol



    (If someone already has a script for this, please help me ! :P :P would be nice )

    Originally Posted by Zezima
    I like old men.

  6. #6
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    You could try if this still works
    Simba Code:
    program BSScript;
    {$I SRL/SRL.scar}

    var HP_Check: Integer;

    const Username = '';
          Password = '';
          Script = 1; // 1 = Paladin Thiever
                      // 2 = Black Knight Killer
                      // 3 = Magic Axe Killer
                      // 4 = Hill Giant Killer
                      // 5 = Fire Rune Buyer
                      // 6 = Nature Rune Buyer
          Eating = True; // Defines if the script eats (Sharks).

          GTAB_COMBAT = 'combat';
          GTAB_STATS = 'stats';
          GTAB_QUEST = 'quest';
          GTAB_INV = 'inventory';
          GTAB_EQUIP = 'equip';
          GTAB_PRAYER = 'prayer';
          GTAB_MAGIC = 'magic';
          GTAB_FRIENDS = 'friends';
          GTAB_IGNORE = 'ignore';
          GTAB_LOGOUT = 'logout';
          GTAB_OPTIONS = 'options';
          GTAB_EMOTES = 'emotes';
          GTAB_MUSIC = 'music';

          FMSX1 = 7; //Main Screen top-left corner X value.
          FMSY1 = 5; //Main Screen top-left corner Y value.
          FMSX2 = 517; //Main Screen bottom-right corner X value.
          FMSY2 = 337; //Main Screen bottom-right corner Y value.

          FMMX1 = 555;
          FMMY1 = 5;
          FMMX2 = 724;
          FMMY2 = 151;

          FMSCX = 263; //Main Screen center X value.
          FMSCY = 206; //Main Screen center Y value.

          FMIX1 = 547; //Inventory top-left corner X value.
          FMIY1 = 205; //Inventory top-left corner Y value.
          FMIX2 = 740; //Inventory bottom-right corner X value.
          FMIY2 = 467; //Inventory bottom-right corner Y value.

    procedure ClickTab(x, y: Integer);
    begin
      if not (GetColor(x, y) = 1778795) then begin
        Mouse(x, y, 1, 1, True);
      end;
    end;

    procedure F_SetAngle(Highest : Boolean);
    begin
      KeyDown((Integer(not Highest) * 2) + 38);
      Sleep(1000 + Random(300));
      KeyUp((Integer(not Highest) * 2) + 38);
      Wait(500 + Random(100));
    end;

    procedure F_GameTab(GTab: String);
    begin
      case GTab of
        'combat':    ClickTab(532, 176);
        'stats':     ClickTab(567, 171);
        'quest':     ClickTab(599, 172);
        'inventory': ClickTab(632, 171);
        'equip':     ClickTab(666, 171);
        'prayer':    ClickTab(706, 174);
        'magic':     ClickTab(737, 171);
        'friends':   ClickTab(569, 469);
        'ignore':    ClickTab(598, 470);
        'logout':    ClickTab(632, 470);
        'options':   ClickTab(671, 476);
        'emotes':    ClickTab(698, 482);
        'music':     ClickTab(740, 469);
      end;
    end;

    function FullHP: Boolean;
    begin
    F_GameTab(GTAB_STATS);
      if (CountColorTolerance(65535, 647, 209, 661, 222, 15) = CountColorTolerance(65535, 659, 221, 673, 234, 15)) then begin
        Result := True;
      end else begin
        F_GameTab(GTAB_INV);
        Result := False;
      end;
    end;

    procedure AlchAddyPlate;
    var x, y: Integer;
    begin
      if (FindColorTolerance(x, y, 4873802, FMIX1, FMIY1, FMIX2, FMIY2, 5)) then begin
        Mouse(x, y, 2, 3, True);
      end;
    end;

    procedure Alch;
    var x, y: Integer;
    begin
      if (FindColorTolerance(x, y, 4873802, FMIX1, FMIY1, FMIX2, FMIY2, 5)) then begin
        F_GameTab(GTAB_MAGIC);
        Mouse(716, 335, 1, 1, True);
        Wait(400+Random(100));
        AlchAddyPlate;
        Wait(1700+Random(100));
        F_GameTab(GTAB_INV);
      end;
    end;

    procedure ClickAttack(x, y: Integer);
    begin
      Mouse(x, y, 0, 0, True);
      Wait(200 + Random(500));
      Wait(2200 + Random(500));
    end;

    procedure ClickPickpocket(x, y: Integer);
    begin
      Mouse(x, y, 0, 0, False);
      Wait(200 + Random(500));
      Mouse(x, y+40, 1, 1, True);
      Wait(1500 + Random(300));
    end;

    function F_InFight: Boolean;
    var x, y: Integer;
    begin
    Result := False;
      if (FindColorTolerance(x, y, 65280, 221, 119, 283, 169, 5)) then begin
        Result := True;
      end;
    end;

    procedure RelocateToNPC;
    var x, y: Integer;
    begin
      if (FindColorTolerance(x, y, 195836, FMMX1, FMMY1, FMMX2, FMMY2, 10)) then begin
        Mouse(x, y, 1, 1, True);
        Wait(2500+Random(500));
      end;
    end;

    function F_FightAt(x, y: Integer): Boolean;
    begin
    Result := False;
      {if (FindColorTolerance(x, y, 65280, x-30, y-10, x+30, y, 5)) then begin
        Result := True;
      end;}

    end;

    // Black Knight: 460553 (CCT: 150);
    // Paladin: 7434875 (CCT: 150);
    // Magic Axe: 2843259 (CCT: 100);
    // Hill Giant: 8039378 (CCT: 100);
    procedure Attack(Color, CCT: Integer; Click: String);
    var AttackTP: TPoint;
        AttackTPA: TPointArray;
        AttackATPA: T2DPointArray;
        i, x, y, AttackHigh: Integer;
    begin
      if (FindColorsSpiralTolerance(x, y, AttackTPA, Color, FMSX1, FMSY1, FMSX2, FMSY2, 15)) then
      begin
        SortTPAFrom(AttackTPA, Point(MSCX, MSCY));
        AttackATPA := TPAtoATPAEx(AttackTPA, 10, 10);
        AttackHigh := High(AttackATPA);
        for i := 0 to AttackHigh do
        begin
          if (i > 15) then begin
            RelocateToNPC;
            Break;
          end;
          AttackTP := MiddleTPA(AttackATPA[i]);
          if not (F_FightAt(AttackTP.X, AttackTP.Y)) then begin
            MMouse(AttackTP.X, AttackTP.Y, 3, 3);
            Wait(100);
            if (CountColorTolerance(1040102, 73, 3, 381, 19, 70)>CCT) then
            begin
              GetMousePos(x, y);
              case Click of
                'pickpocket': ClickPickpocket(x, y);
                'attack': ClickAttack(x, y);
              end;
              Break;
            end;
          end;
        end;
      end;
    end;

    function HP_Checks: Boolean;
    begin
    Result := False;
      if (HP_Check >= 5) then begin
        HP_Check := 0;
        Result := True;
      end;
      Inc(HP_Check);
    end;

    procedure Eat;
    var x, y: Integer;
    begin
    if (HP_Checks) then begin
      if not (FullHP) then begin
        F_GameTab(GTAB_INV);
        if (FindColorTolerance(x, y, 6782103, FMIX1, FMIY1, FMIX2, FMIY2, 9)) then begin
          Mouse(x, y, 2, 3, True);
        end;
      end else begin
        Writeln('HP is full.');
      end;
      F_GameTab(GTAB_INV);
    end;
    end;

    function F_LoggedIn: Boolean;
    begin
    Result := True;
      if (GetColor(180, 112) = 11184810) then begin
        Result := False;
      end;
    end;

    procedure F_LogIn;
    begin
      Mouse(273, 193, 2, 2, True);
      TypeSend(Username);
      Wait(300);
      TypeSend(Password);
      Wait(2000);
      Wait(500+Random(500));
    end;

    procedure F_LogOut;
    begin
      F_GameTab(GTAB_LOGOUT);
      Wait(100);
      Mouse(639, 376, 1, 1, True);
    end;

    procedure PaladinThiever;
    begin
      repeat
        ClearDebug;
        Writeln('Preparing to pickpocket.');
        Attack(5552103, 100, 'pickpocket');
        Alch;
        if (Eating) then begin
          Eat;
        end;
      until(False);
    end;

    procedure BlackKnightKiller;
    begin
      repeat
        ClearDebug;
        Writeln('Preparing to attack.');
        Attack(1184277, 150, 'attack');
        F_GameTab(GTAB_INV);
        F_GameTab(GTAB_STATS);
        while (F_InFight) do begin
          if (Eating) then begin
            Eat;
          end;
          Wait(1000);
          ClearDebug;
          Writeln('We are fighting.');
        end;
      until(False);
    end;

    procedure MagicAxeKiller;
    begin
      repeat
        ClearDebug;
        Writeln('Preparing to attack.');
        Attack(2843259, 100, 'attack');
        F_GameTab(GTAB_INV);
        F_GameTab(GTAB_STATS);
        while (F_InFight) do begin
          if (Eating) then begin
            Eat;
          end;
          Wait(1000);
          ClearDebug;
          Writeln('We are fighting.');
        end;
      until(False);
    end;

    procedure HillGiantKiller;
    begin
      repeat
        ClearDebug;
        Writeln('Preparing to attack.');
        Attack(8039378, 100, 'attack');
        F_GameTab(GTAB_INV);
        F_GameTab(GTAB_STATS);
        while (F_InFight) do begin
          if (Eating) then begin
            Eat;
          end;
          Wait(1000);
          ClearDebug;
          Writeln('We are fighting.');
        end;
      until(False);
    end;

    procedure FireBuyer;
    begin
      repeat
        Mouse(284, 84, 0, 0, False);
        Wait(150);
        Mouse(284, 164, 0, 0, True);
        Wait(150);
      until(False);
    end;

    procedure NatureBuyer;
    begin
      repeat
        Mouse(333, 132, 0, 0, False);
        Wait(150);
        Mouse(333, 212, 0, 0, True);
        Wait(150);
      until(False);
    end;

    procedure Debug;
    begin
      Writeln(IntToStr(CountColorTolerance(65535, 710, 210, 741, 236, 15)));
    end;

    begin
    SetupSRL;
    if not (F_LoggedIn) then begin F_LogIn; end;
      case Script of
        0: Debug;
        1: PaladinThiever;
        2: BlackKnightKiller;
        3: MagicAxeKiller;
        4: HillGiantKiller;
        5: FireBuyer;
        6: NatureBuyer;
      end;
    end.
    There used to be something meaningful here.

  7. #7
    Join Date
    Dec 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    You could try if this still works
    Simba Code:
    program BSScript;
    {$I SRL/SRL.scar}

    var HP_Check: Integer;

    const Username = '';
          Password = '';
          Script = 1; // 1 = Paladin Thiever
                      // 2 = Black Knight Killer
                      // 3 = Magic Axe Killer
                      // 4 = Hill Giant Killer
                      // 5 = Fire Rune Buyer
                      // 6 = Nature Rune Buyer
          Eating = True; // Defines if the script eats (Sharks).

          GTAB_COMBAT = 'combat';
          GTAB_STATS = 'stats';
          GTAB_QUEST = 'quest';
          GTAB_INV = 'inventory';
          GTAB_EQUIP = 'equip';
          GTAB_PRAYER = 'prayer';
          GTAB_MAGIC = 'magic';
          GTAB_FRIENDS = 'friends';
          GTAB_IGNORE = 'ignore';
          GTAB_LOGOUT = 'logout';
          GTAB_OPTIONS = 'options';
          GTAB_EMOTES = 'emotes';
          GTAB_MUSIC = 'music';

          FMSX1 = 7; //Main Screen top-left corner X value.
          FMSY1 = 5; //Main Screen top-left corner Y value.
          FMSX2 = 517; //Main Screen bottom-right corner X value.
          FMSY2 = 337; //Main Screen bottom-right corner Y value.

          FMMX1 = 555;
          FMMY1 = 5;
          FMMX2 = 724;
          FMMY2 = 151;

          FMSCX = 263; //Main Screen center X value.
          FMSCY = 206; //Main Screen center Y value.

          FMIX1 = 547; //Inventory top-left corner X value.
          FMIY1 = 205; //Inventory top-left corner Y value.
          FMIX2 = 740; //Inventory bottom-right corner X value.
          FMIY2 = 467; //Inventory bottom-right corner Y value.

    procedure ClickTab(x, y: Integer);
    begin
      if not (GetColor(x, y) = 1778795) then begin
        Mouse(x, y, 1, 1, True);
      end;
    end;

    procedure F_SetAngle(Highest : Boolean);
    begin
      KeyDown((Integer(not Highest) * 2) + 38);
      Sleep(1000 + Random(300));
      KeyUp((Integer(not Highest) * 2) + 38);
      Wait(500 + Random(100));
    end;

    procedure F_GameTab(GTab: String);
    begin
      case GTab of
        'combat':    ClickTab(532, 176);
        'stats':     ClickTab(567, 171);
        'quest':     ClickTab(599, 172);
        'inventory': ClickTab(632, 171);
        'equip':     ClickTab(666, 171);
        'prayer':    ClickTab(706, 174);
        'magic':     ClickTab(737, 171);
        'friends':   ClickTab(569, 469);
        'ignore':    ClickTab(598, 470);
        'logout':    ClickTab(632, 470);
        'options':   ClickTab(671, 476);
        'emotes':    ClickTab(698, 482);
        'music':     ClickTab(740, 469);
      end;
    end;

    function FullHP: Boolean;
    begin
    F_GameTab(GTAB_STATS);
      if (CountColorTolerance(65535, 647, 209, 661, 222, 15) = CountColorTolerance(65535, 659, 221, 673, 234, 15)) then begin
        Result := True;
      end else begin
        F_GameTab(GTAB_INV);
        Result := False;
      end;
    end;

    procedure AlchAddyPlate;
    var x, y: Integer;
    begin
      if (FindColorTolerance(x, y, 4873802, FMIX1, FMIY1, FMIX2, FMIY2, 5)) then begin
        Mouse(x, y, 2, 3, True);
      end;
    end;

    procedure Alch;
    var x, y: Integer;
    begin
      if (FindColorTolerance(x, y, 4873802, FMIX1, FMIY1, FMIX2, FMIY2, 5)) then begin
        F_GameTab(GTAB_MAGIC);
        Mouse(716, 335, 1, 1, True);
        Wait(400+Random(100));
        AlchAddyPlate;
        Wait(1700+Random(100));
        F_GameTab(GTAB_INV);
      end;
    end;

    procedure ClickAttack(x, y: Integer);
    begin
      Mouse(x, y, 0, 0, True);
      Wait(200 + Random(500));
      Wait(2200 + Random(500));
    end;

    procedure ClickPickpocket(x, y: Integer);
    begin
      Mouse(x, y, 0, 0, False);
      Wait(200 + Random(500));
      Mouse(x, y+40, 1, 1, True);
      Wait(1500 + Random(300));
    end;

    function F_InFight: Boolean;
    var x, y: Integer;
    begin
    Result := False;
      if (FindColorTolerance(x, y, 65280, 221, 119, 283, 169, 5)) then begin
        Result := True;
      end;
    end;

    procedure RelocateToNPC;
    var x, y: Integer;
    begin
      if (FindColorTolerance(x, y, 195836, FMMX1, FMMY1, FMMX2, FMMY2, 10)) then begin
        Mouse(x, y, 1, 1, True);
        Wait(2500+Random(500));
      end;
    end;

    function F_FightAt(x, y: Integer): Boolean;
    begin
    Result := False;
      {if (FindColorTolerance(x, y, 65280, x-30, y-10, x+30, y, 5)) then begin
        Result := True;
      end;}

    end;

    // Black Knight: 460553 (CCT: 150);
    // Paladin: 7434875 (CCT: 150);
    // Magic Axe: 2843259 (CCT: 100);
    // Hill Giant: 8039378 (CCT: 100);
    procedure Attack(Color, CCT: Integer; Click: String);
    var AttackTP: TPoint;
        AttackTPA: TPointArray;
        AttackATPA: T2DPointArray;
        i, x, y, AttackHigh: Integer;
    begin
      if (FindColorsSpiralTolerance(x, y, AttackTPA, Color, FMSX1, FMSY1, FMSX2, FMSY2, 15)) then
      begin
        SortTPAFrom(AttackTPA, Point(MSCX, MSCY));
        AttackATPA := TPAtoATPAEx(AttackTPA, 10, 10);
        AttackHigh := High(AttackATPA);
        for i := 0 to AttackHigh do
        begin
          if (i > 15) then begin
            RelocateToNPC;
            Break;
          end;
          AttackTP := MiddleTPA(AttackATPA[i]);
          if not (F_FightAt(AttackTP.X, AttackTP.Y)) then begin
            MMouse(AttackTP.X, AttackTP.Y, 3, 3);
            Wait(100);
            if (CountColorTolerance(1040102, 73, 3, 381, 19, 70)>CCT) then
            begin
              GetMousePos(x, y);
              case Click of
                'pickpocket': ClickPickpocket(x, y);
                'attack': ClickAttack(x, y);
              end;
              Break;
            end;
          end;
        end;
      end;
    end;

    function HP_Checks: Boolean;
    begin
    Result := False;
      if (HP_Check >= 5) then begin
        HP_Check := 0;
        Result := True;
      end;
      Inc(HP_Check);
    end;

    procedure Eat;
    var x, y: Integer;
    begin
    if (HP_Checks) then begin
      if not (FullHP) then begin
        F_GameTab(GTAB_INV);
        if (FindColorTolerance(x, y, 6782103, FMIX1, FMIY1, FMIX2, FMIY2, 9)) then begin
          Mouse(x, y, 2, 3, True);
        end;
      end else begin
        Writeln('HP is full.');
      end;
      F_GameTab(GTAB_INV);
    end;
    end;

    function F_LoggedIn: Boolean;
    begin
    Result := True;
      if (GetColor(180, 112) = 11184810) then begin
        Result := False;
      end;
    end;

    procedure F_LogIn;
    begin
      Mouse(273, 193, 2, 2, True);
      TypeSend(Username);
      Wait(300);
      TypeSend(Password);
      Wait(2000);
      Wait(500+Random(500));
    end;

    procedure F_LogOut;
    begin
      F_GameTab(GTAB_LOGOUT);
      Wait(100);
      Mouse(639, 376, 1, 1, True);
    end;

    procedure PaladinThiever;
    begin
      repeat
        ClearDebug;
        Writeln('Preparing to pickpocket.');
        Attack(5552103, 100, 'pickpocket');
        Alch;
        if (Eating) then begin
          Eat;
        end;
      until(False);
    end;

    procedure BlackKnightKiller;
    begin
      repeat
        ClearDebug;
        Writeln('Preparing to attack.');
        Attack(1184277, 150, 'attack');
        F_GameTab(GTAB_INV);
        F_GameTab(GTAB_STATS);
        while (F_InFight) do begin
          if (Eating) then begin
            Eat;
          end;
          Wait(1000);
          ClearDebug;
          Writeln('We are fighting.');
        end;
      until(False);
    end;

    procedure MagicAxeKiller;
    begin
      repeat
        ClearDebug;
        Writeln('Preparing to attack.');
        Attack(2843259, 100, 'attack');
        F_GameTab(GTAB_INV);
        F_GameTab(GTAB_STATS);
        while (F_InFight) do begin
          if (Eating) then begin
            Eat;
          end;
          Wait(1000);
          ClearDebug;
          Writeln('We are fighting.');
        end;
      until(False);
    end;

    procedure HillGiantKiller;
    begin
      repeat
        ClearDebug;
        Writeln('Preparing to attack.');
        Attack(8039378, 100, 'attack');
        F_GameTab(GTAB_INV);
        F_GameTab(GTAB_STATS);
        while (F_InFight) do begin
          if (Eating) then begin
            Eat;
          end;
          Wait(1000);
          ClearDebug;
          Writeln('We are fighting.');
        end;
      until(False);
    end;

    procedure FireBuyer;
    begin
      repeat
        Mouse(284, 84, 0, 0, False);
        Wait(150);
        Mouse(284, 164, 0, 0, True);
        Wait(150);
      until(False);
    end;

    procedure NatureBuyer;
    begin
      repeat
        Mouse(333, 132, 0, 0, False);
        Wait(150);
        Mouse(333, 212, 0, 0, True);
        Wait(150);
      until(False);
    end;

    procedure Debug;
    begin
      Writeln(IntToStr(CountColorTolerance(65535, 710, 210, 741, 236, 15)));
    end;

    begin
    SetupSRL;
    if not (F_LoggedIn) then begin F_LogIn; end;
      case Script of
        0: Debug;
        1: PaladinThiever;
        2: BlackKnightKiller;
        3: MagicAxeKiller;
        4: HillGiantKiller;
        5: FireBuyer;
        6: NatureBuyer;
      end;
    end.

    Thank you! I'll try it out PS, may I use some parts in it?, I'm new to scripting, so I want to learn some stuff (Only for personal use though.)

    EDIT: Why can't I just copy and paste it ?
    Last edited by noobscam; 12-11-2010 at 09:52 AM.

    Originally Posted by Zezima
    I like old men.

  8. #8
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by noobscam View Post
    Thank you! I'll try it out PS, may I use some parts in it?, I'm new to scripting, so I want to learn some stuff (Only for personal use though.)

    EDIT: Why can't I just copy and paste it ?
    You can modify and do everything you wish to it, I made the script as someone requested it (Used it myself too for some time).
    There used to be something meaningful here.

  9. #9
    Join Date
    Dec 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Unhappy

    Okay but like, when I try copy and paste, it doesn't line under organized, but it just gets thrown in there like a mess.. like:
    Code:
    program BSScript;{$I SRL/SRL.scar}var HP_Check: Integer;const Username = '';      Password = '';      Script = 1; // 1 = Paladin Thiever                  // 2 = Black Knight Killer                  // 3 = Magic Axe Killer                  // 4 = Hill Giant Killer                  // 5 = Fire Rune Buyer                  // 6 = Nature Rune Buyer      Eating = True; // Defines if the script eats (Sharks).      GTAB_COMBAT = 'combat';      GTAB_STATS = 'stats';      GTAB_QUEST = 'quest';      GTAB_INV = 'inventory';      GTAB_EQUIP = 'equip';      GTAB_PRAYER = 'prayer';      GTAB_MAGIC = 'magic';      GTAB_FRIENDS = 'friends';      GTAB_IGNORE = 'ignore';      GTAB_LOGOUT = 'logout';      GTAB_OPTIONS = 'options';      GTAB_EMOTES = 'emotes';      GTAB_MUSIC = 'music';      FMSX1 = 7; //Main Screen top-left corner X value.      FMSY1 = 5; //Main Screen top-left corner Y value.      FMSX2 = 517; //Main Screen bottom-right corner X value.      FMSY2 = 337; //Main Screen bottom-right corner Y value.      FMMX1 = 555;      FMMY1 = 5;      FMMX2 = 724;      FMMY2 = 151;      FMSCX = 263; //Main Screen center X value.      FMSCY = 206; //Main Screen center Y value.      FMIX1 = 547; //Inventory top-left corner X value.      FMIY1 = 205; //Inventory top-left corner Y value.      FMIX2 = 740; //Inventory bottom-right corner X value.      FMIY2 = 467; //Inventory bottom-right corner Y value.procedure ClickTab(x, y: Integer);begin  if not (GetColor(x, y) = 1778795) then begin    Mouse(x, y, 1, 1, True);  end;end;procedure F_SetAngle(Highest : Boolean);begin  KeyDown((Integer(not Highest) * 2) + 38);  Sleep(1000 + Random(300));  KeyUp((Integer(not Highest) * 2) + 38);  Wait(500 + Random(100));end;procedure F_GameTab(GTab: String);begin  case GTab of    'combat':    ClickTab(532, 176);    'stats':     ClickTab(567, 171);    'quest':     ClickTab(599, 172);    'inventory': ClickTab(632, 171);    'equip':     ClickTab(666, 171);    'prayer':    ClickTab(706, 174);    'magic':     ClickTab(737, 171);    'friends':   ClickTab(569, 469);    'ignore':    ClickTab(598, 470);    'logout':    ClickTab(632, 470);    'options':   ClickTab(671, 476);    'emotes':    ClickTab(698, 482);    'music':     ClickTab(740, 469);  end;end;function FullHP: Boolean;beginF_GameTab(GTAB_STATS);  if (CountColorTolerance(65535, 647, 209, 661, 222, 15) = CountColorTolerance(65535, 659, 221, 673, 234, 15)) then begin    Result := True;  end else begin    F_GameTab(GTAB_INV);    Result := False;  end;end;procedure AlchAddyPlate;var x, y: Integer;begin  if (FindColorTolerance(x, y, 4873802, FMIX1, FMIY1, FMIX2, FMIY2, 5)) then begin    Mouse(x, y, 2, 3, True);  end;end;procedure Alch;var x, y: Integer;begin  if (FindColorTolerance(x, y, 4873802, FMIX1, FMIY1, FMIX2, FMIY2, 5)) then begin    F_GameTab(GTAB_MAGIC);    Mouse(716, 335, 1, 1, True);    Wait(400+Random(100));    AlchAddyPlate;    Wait(1700+Random(100));    F_GameTab(GTAB_INV);  end;end;procedure ClickAttack(x, y: Integer);begin  Mouse(x, y, 0, 0, True);  Wait(200 + Random(500));  Wait(2200 + Random(500));end;procedure ClickPickpocket(x, y: Integer);begin  Mouse(x, y, 0, 0, False);  Wait(200 + Random(500));  Mouse(x, y+40, 1, 1, True);  Wait(1500 + Random(300));end;function F_InFight: Boolean;var x, y: Integer;beginResult := False;  if (FindColorTolerance(x, y, 65280, 221, 119, 283, 169, 5)) then begin    Result := True;  end;end;procedure RelocateToNPC;var x, y: Integer;begin  if (FindColorTolerance(x, y, 195836, FMMX1, FMMY1, FMMX2, FMMY2, 10)) then begin    Mouse(x, y, 1, 1, True);    Wait(2500+Random(500));  end;end;function F_FightAt(x, y: Integer): Boolean;beginResult := False;  {if (FindColorTolerance(x, y, 65280, x-30, y-10, x+30, y, 5)) then begin    Result := True;  end;}end;// Black Knight: 460553 (CCT: 150);// Paladin: 7434875 (CCT: 150);// Magic Axe: 2843259 (CCT: 100);// Hill Giant: 8039378 (CCT: 100);procedure Attack(Color, CCT: Integer; Click: String);var AttackTP: TPoint;    AttackTPA: TPointArray;    AttackATPA: T2DPointArray;    i, x, y, AttackHigh: Integer;begin  if (FindColorsSpiralTolerance(x, y, AttackTPA, Color, FMSX1, FMSY1, FMSX2, FMSY2, 15)) then  begin    SortTPAFrom(AttackTPA, Point(MSCX, MSCY));    AttackATPA := TPAtoATPAEx(AttackTPA, 10, 10);    AttackHigh := High(AttackATPA);    for i := 0 to AttackHigh do    begin      if (i > 15) then begin        RelocateToNPC;        Break;      end;      AttackTP := MiddleTPA(AttackATPA[i]);      if not (F_FightAt(AttackTP.X, AttackTP.Y)) then begin        MMouse(AttackTP.X, AttackTP.Y, 3, 3);        Wait(100);        if (CountColorTolerance(1040102, 73, 3, 381, 19, 70)>CCT) then        begin          GetMousePos(x, y);          case Click of            'pickpocket': ClickPickpocket(x, y);            'attack': ClickAttack(x, y);          end;          Break;        end;      end;    end;  end;end;function HP_Checks: Boolean;beginResult := False;  if (HP_Check >= 5) then begin    HP_Check := 0;    Result := True;  end;  Inc(HP_Check);end;procedure Eat;var x, y: Integer;beginif (HP_Checks) then begin  if not (FullHP) then begin    F_GameTab(GTAB_INV);    if (FindColorTolerance(x, y, 6782103, FMIX1, FMIY1, FMIX2, FMIY2, 9)) then begin      Mouse(x, y, 2, 3, True);    end;  end else begin    Writeln('HP is full.');  end;  F_GameTab(GTAB_INV);end;end;function F_LoggedIn: Boolean;beginResult := True;  if (GetColor(180, 112) = 11184810) then begin    Result := False;  end;end;procedure F_LogIn;begin  Mouse(273, 193, 2, 2, True);  TypeSend(Username);  Wait(300);  TypeSend(Password);  Wait(2000);  Wait(500+Random(500));end;procedure F_LogOut;begin  F_GameTab(GTAB_LOGOUT);  Wait(100);  Mouse(639, 376, 1, 1, True);end;procedure PaladinThiever;begin  repeat    ClearDebug;    Writeln('Preparing to pickpocket.');    Attack(5552103, 100, 'pickpocket');    Alch;    if (Eating) then begin      Eat;    end;  until(False);end;procedure BlackKnightKiller;begin  repeat    ClearDebug;    Writeln('Preparing to attack.');    Attack(1184277, 150, 'attack');    F_GameTab(GTAB_INV);    F_GameTab(GTAB_STATS);    while (F_InFight) do begin      if (Eating) then begin        Eat;      end;      Wait(1000);      ClearDebug;      Writeln('We are fighting.');    end;  until(False);end;procedure MagicAxeKiller;begin  repeat    ClearDebug;    Writeln('Preparing to attack.');    Attack(2843259, 100, 'attack');    F_GameTab(GTAB_INV);    F_GameTab(GTAB_STATS);    while (F_InFight) do begin      if (Eating) then begin        Eat;      end;      Wait(1000);      ClearDebug;      Writeln('We are fighting.');    end;  until(False);end;procedure HillGiantKiller;begin  repeat    ClearDebug;    Writeln('Preparing to attack.');    Attack(8039378, 100, 'attack');    F_GameTab(GTAB_INV);    F_GameTab(GTAB_STATS);    while (F_InFight) do begin      if (Eating) then begin        Eat;      end;      Wait(1000);      ClearDebug;      Writeln('We are fighting.');    end;  until(False);end;procedure FireBuyer;begin  repeat    Mouse(284, 84, 0, 0, False);    Wait(150);    Mouse(284, 164, 0, 0, True);    Wait(150);  until(False);end;procedure NatureBuyer;begin  repeat    Mouse(333, 132, 0, 0, False);    Wait(150);    Mouse(333, 212, 0, 0, True);    Wait(150);  until(False);end;procedure Debug;begin  Writeln(IntToStr(CountColorTolerance(65535, 710, 210, 741, 236, 15)));end;beginSetupSRL;if not (F_LoggedIn) then begin F_LogIn; end;  case Script of    0: Debug;    1: PaladinThiever;    2: BlackKnightKiller;    3: MagicAxeKiller;    4: HillGiantKiller;    5: FireBuyer;    6: NatureBuyer;  end;end.

    And by the way, when I try compile a script, or run, it just opens another script called Math.scar and says "unknown identifier" blabla, in THAT script ??? WHYYY ?

    Edit: I know that the script you posted was a Simba script though, just telling

    Originally Posted by Zezima
    I like old men.

  10. #10
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by noobscam View Post
    Okay but like, when I try copy and paste, it doesn't line under organized, but it just gets thrown in there like a mess.. like:
    Code:
    program BSScript;{$I SRL/SRL.scar}var HP_Check: Integer;const Username = '';      Password = '';      Script = 1; // 1 = Paladin Thiever                  // 2 = Black Knight Killer                  // 3 = Magic Axe Killer                  // 4 = Hill Giant Killer                  // 5 = Fire Rune Buyer                  // 6 = Nature Rune Buyer      Eating = True; // Defines if the script eats (Sharks).      GTAB_COMBAT = 'combat';      GTAB_STATS = 'stats';      GTAB_QUEST = 'quest';      GTAB_INV = 'inventory';      GTAB_EQUIP = 'equip';      GTAB_PRAYER = 'prayer';      GTAB_MAGIC = 'magic';      GTAB_FRIENDS = 'friends';      GTAB_IGNORE = 'ignore';      GTAB_LOGOUT = 'logout';      GTAB_OPTIONS = 'options';      GTAB_EMOTES = 'emotes';      GTAB_MUSIC = 'music';      FMSX1 = 7; //Main Screen top-left corner X value.      FMSY1 = 5; //Main Screen top-left corner Y value.      FMSX2 = 517; //Main Screen bottom-right corner X value.      FMSY2 = 337; //Main Screen bottom-right corner Y value.      FMMX1 = 555;      FMMY1 = 5;      FMMX2 = 724;      FMMY2 = 151;      FMSCX = 263; //Main Screen center X value.      FMSCY = 206; //Main Screen center Y value.      FMIX1 = 547; //Inventory top-left corner X value.      FMIY1 = 205; //Inventory top-left corner Y value.      FMIX2 = 740; //Inventory bottom-right corner X value.      FMIY2 = 467; //Inventory bottom-right corner Y value.procedure ClickTab(x, y: Integer);begin  if not (GetColor(x, y) = 1778795) then begin    Mouse(x, y, 1, 1, True);  end;end;procedure F_SetAngle(Highest : Boolean);begin  KeyDown((Integer(not Highest) * 2) + 38);  Sleep(1000 + Random(300));  KeyUp((Integer(not Highest) * 2) + 38);  Wait(500 + Random(100));end;procedure F_GameTab(GTab: String);begin  case GTab of    'combat':    ClickTab(532, 176);    'stats':     ClickTab(567, 171);    'quest':     ClickTab(599, 172);    'inventory': ClickTab(632, 171);    'equip':     ClickTab(666, 171);    'prayer':    ClickTab(706, 174);    'magic':     ClickTab(737, 171);    'friends':   ClickTab(569, 469);    'ignore':    ClickTab(598, 470);    'logout':    ClickTab(632, 470);    'options':   ClickTab(671, 476);    'emotes':    ClickTab(698, 482);    'music':     ClickTab(740, 469);  end;end;function FullHP: Boolean;beginF_GameTab(GTAB_STATS);  if (CountColorTolerance(65535, 647, 209, 661, 222, 15) = CountColorTolerance(65535, 659, 221, 673, 234, 15)) then begin    Result := True;  end else begin    F_GameTab(GTAB_INV);    Result := False;  end;end;procedure AlchAddyPlate;var x, y: Integer;begin  if (FindColorTolerance(x, y, 4873802, FMIX1, FMIY1, FMIX2, FMIY2, 5)) then begin    Mouse(x, y, 2, 3, True);  end;end;procedure Alch;var x, y: Integer;begin  if (FindColorTolerance(x, y, 4873802, FMIX1, FMIY1, FMIX2, FMIY2, 5)) then begin    F_GameTab(GTAB_MAGIC);    Mouse(716, 335, 1, 1, True);    Wait(400+Random(100));    AlchAddyPlate;    Wait(1700+Random(100));    F_GameTab(GTAB_INV);  end;end;procedure ClickAttack(x, y: Integer);begin  Mouse(x, y, 0, 0, True);  Wait(200 + Random(500));  Wait(2200 + Random(500));end;procedure ClickPickpocket(x, y: Integer);begin  Mouse(x, y, 0, 0, False);  Wait(200 + Random(500));  Mouse(x, y+40, 1, 1, True);  Wait(1500 + Random(300));end;function F_InFight: Boolean;var x, y: Integer;beginResult := False;  if (FindColorTolerance(x, y, 65280, 221, 119, 283, 169, 5)) then begin    Result := True;  end;end;procedure RelocateToNPC;var x, y: Integer;begin  if (FindColorTolerance(x, y, 195836, FMMX1, FMMY1, FMMX2, FMMY2, 10)) then begin    Mouse(x, y, 1, 1, True);    Wait(2500+Random(500));  end;end;function F_FightAt(x, y: Integer): Boolean;beginResult := False;  {if (FindColorTolerance(x, y, 65280, x-30, y-10, x+30, y, 5)) then begin    Result := True;  end;}end;// Black Knight: 460553 (CCT: 150);// Paladin: 7434875 (CCT: 150);// Magic Axe: 2843259 (CCT: 100);// Hill Giant: 8039378 (CCT: 100);procedure Attack(Color, CCT: Integer; Click: String);var AttackTP: TPoint;    AttackTPA: TPointArray;    AttackATPA: T2DPointArray;    i, x, y, AttackHigh: Integer;begin  if (FindColorsSpiralTolerance(x, y, AttackTPA, Color, FMSX1, FMSY1, FMSX2, FMSY2, 15)) then  begin    SortTPAFrom(AttackTPA, Point(MSCX, MSCY));    AttackATPA := TPAtoATPAEx(AttackTPA, 10, 10);    AttackHigh := High(AttackATPA);    for i := 0 to AttackHigh do    begin      if (i > 15) then begin        RelocateToNPC;        Break;      end;      AttackTP := MiddleTPA(AttackATPA[i]);      if not (F_FightAt(AttackTP.X, AttackTP.Y)) then begin        MMouse(AttackTP.X, AttackTP.Y, 3, 3);        Wait(100);        if (CountColorTolerance(1040102, 73, 3, 381, 19, 70)>CCT) then        begin          GetMousePos(x, y);          case Click of            'pickpocket': ClickPickpocket(x, y);            'attack': ClickAttack(x, y);          end;          Break;        end;      end;    end;  end;end;function HP_Checks: Boolean;beginResult := False;  if (HP_Check >= 5) then begin    HP_Check := 0;    Result := True;  end;  Inc(HP_Check);end;procedure Eat;var x, y: Integer;beginif (HP_Checks) then begin  if not (FullHP) then begin    F_GameTab(GTAB_INV);    if (FindColorTolerance(x, y, 6782103, FMIX1, FMIY1, FMIX2, FMIY2, 9)) then begin      Mouse(x, y, 2, 3, True);    end;  end else begin    Writeln('HP is full.');  end;  F_GameTab(GTAB_INV);end;end;function F_LoggedIn: Boolean;beginResult := True;  if (GetColor(180, 112) = 11184810) then begin    Result := False;  end;end;procedure F_LogIn;begin  Mouse(273, 193, 2, 2, True);  TypeSend(Username);  Wait(300);  TypeSend(Password);  Wait(2000);  Wait(500+Random(500));end;procedure F_LogOut;begin  F_GameTab(GTAB_LOGOUT);  Wait(100);  Mouse(639, 376, 1, 1, True);end;procedure PaladinThiever;begin  repeat    ClearDebug;    Writeln('Preparing to pickpocket.');    Attack(5552103, 100, 'pickpocket');    Alch;    if (Eating) then begin      Eat;    end;  until(False);end;procedure BlackKnightKiller;begin  repeat    ClearDebug;    Writeln('Preparing to attack.');    Attack(1184277, 150, 'attack');    F_GameTab(GTAB_INV);    F_GameTab(GTAB_STATS);    while (F_InFight) do begin      if (Eating) then begin        Eat;      end;      Wait(1000);      ClearDebug;      Writeln('We are fighting.');    end;  until(False);end;procedure MagicAxeKiller;begin  repeat    ClearDebug;    Writeln('Preparing to attack.');    Attack(2843259, 100, 'attack');    F_GameTab(GTAB_INV);    F_GameTab(GTAB_STATS);    while (F_InFight) do begin      if (Eating) then begin        Eat;      end;      Wait(1000);      ClearDebug;      Writeln('We are fighting.');    end;  until(False);end;procedure HillGiantKiller;begin  repeat    ClearDebug;    Writeln('Preparing to attack.');    Attack(8039378, 100, 'attack');    F_GameTab(GTAB_INV);    F_GameTab(GTAB_STATS);    while (F_InFight) do begin      if (Eating) then begin        Eat;      end;      Wait(1000);      ClearDebug;      Writeln('We are fighting.');    end;  until(False);end;procedure FireBuyer;begin  repeat    Mouse(284, 84, 0, 0, False);    Wait(150);    Mouse(284, 164, 0, 0, True);    Wait(150);  until(False);end;procedure NatureBuyer;begin  repeat    Mouse(333, 132, 0, 0, False);    Wait(150);    Mouse(333, 212, 0, 0, True);    Wait(150);  until(False);end;procedure Debug;begin  Writeln(IntToStr(CountColorTolerance(65535, 710, 210, 741, 236, 15)));end;beginSetupSRL;if not (F_LoggedIn) then begin F_LogIn; end;  case Script of    0: Debug;    1: PaladinThiever;    2: BlackKnightKiller;    3: MagicAxeKiller;    4: HillGiantKiller;    5: FireBuyer;    6: NatureBuyer;  end;end.

    And by the way, when I try compile a script, or run, it just opens another script called Math.scar and says "unknown identifier" blabla, in THAT script ??? WHYYY ?

    Edit: I know that the script you posted was a Simba script though, just telling
    Compiles fine on Simba, I don't user scar anymore, and I this was made for Simba.

    Attached the file.
    There used to be something meaningful here.

  11. #11
    Join Date
    Dec 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    Compiles fine on Simba, I don't user scar anymore, and I this was made for Simba.

    Attached the file.

    Aah, tyvm!

    Edit: Uhm, are you sure you tried to compile it ?

    Code:
    Exception in Script: Unable to find file 'SRL/SRL.scar' used from ''
     doesn't exist
    Sorry for being annoying not understanding this lol :/

    Originally Posted by Zezima
    I like old men.

  12. #12
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by noobscam View Post
    Aah, tyvm!

    Edit: Uhm, are you sure you tried to compile it ?

    Code:
    Exception in Script: Unable to find file 'SRL/SRL.scar' used from ''
     doesn't exist
    Sorry for being annoying not understanding this lol :/
    Search for a Simba & SRL setup tutorial, you need to enable the extensions.
    There used to be something meaningful here.

  13. #13
    Join Date
    Dec 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    Search for a Simba & SRL setup tutorial, you need to enable the extensions.
    Omg lmao I'm an idiot How did I forget to enable SRL extensions >.<
    Well, okay, I did that now

    Gah,
    Code:
    [Error] (41:23): colon (':') expected at line 40
    Compiling failed.
    ... I tried to put it like everywhere in line 40, (well, I'm not that dumb, but yea, I tried the things I thought would be the problem..)

    But then I just got the error unknown type 'y'. So .. Yeah

    (so, is it outdated ? but since it compiles fine for you, so idk )

    Originally Posted by Zezima
    I like old men.

  14. #14
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by noobscam View Post
    Omg lmao I'm an idiot How did I forget to enable SRL extensions >.<
    Well, okay, I did that now

    Gah,
    Code:
    [Error] (41:23): colon (':') expected at line 40
    Compiling failed.
    ... I tried to put it like everywhere in line 40, (well, I'm not that dumb, but yea, I tried the things I thought would be the problem..)

    But then I just got the error unknown type 'y'. So .. Yeah

    (so, is it outdated ? but since it compiles fine for you, so idk )
    You need to edit correct values into lines 30-46. the one that has no description is Minimap ofcourse. (MM = Minimap).

    And the script compiles fine for me.
    There used to be something meaningful here.

  15. #15
    Join Date
    Dec 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay - newb right here. Never used simba before, nor done any coding really. I wrote all of this out compiled it and run it, and it runs. But.. problem is all it does is move mouse to one spot over and over and does not actually do anything. What have a done wrong? :/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •