Results 1 to 3 of 3

Thread: Battlescape thieving script (HELP) (RSPS)

  1. #1
    Join Date
    Oct 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Question Battlescape thieving script (HELP) (RSPS)

    As I'm a total noob in scar, I don't understand this shit at all. Frement made a script for battlescape (RSPS) thieving months/year ago, and now it seems to not be working. I'd like to know how to fix it and what's wrong with it? I know the x&y's and u gotta change addy plates to rune scim etc are wrong but even if u fix them, it's still not working.
    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.

    That's the original script from him, haven't changed anything from it. I did try to put the correct x&y's, all it did was click around and when it detected a paladin, it just moved the cursor on it for 1 sec and then started clicking like crazy again. Btw if you haven't played battlescape, do not come & comment like "omfg n00b pl0xz y u bots on priv srv haha lazy gayfagetcetc". Any help please?

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

    Default

    omfg n00b pl0xz y u bots on priv srv haha lazy gayfagetcetc.

    I'm just kidding, I don't know much about battlescape but I just wanted to throw me .02 cents in. We aren't like that (^^) here and don't bash people like other botting communities.

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


  3. #3
    Join Date
    Oct 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your comment didn't really help me with the script but thanks anyways. :/

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
  •