Results 1 to 6 of 6

Thread: My First SCAR Script - WhoWantsABone

  1. #1
    Join Date
    Jun 2007
    Posts
    26
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default My First SCAR Script - WhoWantsABone

    Hey all,
    This is my first SCAR Script, but I can't get it to compile. I'm sure it is full of errors and missing features . But I've read over it and can't figure it out. Can someone please debug it for me? And I'd love suggestions.

    SCAR Code:
    program WhoWantsABone;
    {.include SRL\SRL.Scar}

    //---------------------------------------------------------------|                                                               |
    // *     PROGRAM:     WhoWantsABone                              |
    // *     CODER:       jbrauman                                   |
    // *     CATEGORY:    Prayer                                     |
    // *     DESCRIPTION: Picks up bones, then buries them for you.  |
    // *     USAGE:       Select the runescape client using the      |
    // *                  crosshair, fill out details, click play.   |
    // *     AUTOCOLOR:   YES!                                       |
    // *     NOTES:       Built for Scar Divi/SRL 3.7                |
    //---------------------------------------------------------------|
    // *    1. Use Runescape with Low Detail, Very Bright.
    // *    2. 32 BIT TRUE COLOR.
    // *    3. Use a busy world where people do not pick up bones.
    // *    4. Position your character somewhere @ Lumby Cow Pen.
    // *    5. Have nothing in inventory or it WILL be dropped.
    }

    const
         BoneColor1 = 11053492;
         BoneColor2 = 12500678;
         BoneColor3 = 12698057;
         Bone  :=  BitmapFromString(4, 4, '000001000001000001D2CCCC9B9' +
           '090A19595CEC7C79B909089807FDED9D9CAC3C29A8E8E000001C7' +
           'BFBFA99D9D000001');
    var
         RunDirection = 'N';   //Can be N, S, E, W, R (Random).
         LoadsPerPlayer = 10;  //Loads before next player.
         RandomLoads = 5;      //Added to LoadsPerPlayer. NOTE random(RandomLoads);

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1; //Number of players
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer:= 0;

      Players[0].Name :='chicken kllr';
      Players[0].Pass :='gh12adkl';
      Players[0].Nick :='cken';
      Players[0].Active:=True;
    end;


    {                CODE BELOW, DON'T TOUCH UNLESS
                      YOU KNOW SCAR BACK TO FRONT!
    }



    Procedure PickUpBones;
    var x, y :Integer
    begin
      repeat
      if(not(LoggedIn)) then
      begin
        Writeln('Not logged in');
        TerminateScript;
      end;

      begin
        case (random(2)) of
        0 : Exit;
        1 : AntiBan;
        2 : Exit;
        end;
        AntiRandoms;

        if (FindObjMulti('ones', BoneColor1, BoneColor2, BoneColor3, 3) then
        //Found Bones
        begin
          Wait(50 + random(100);
          GetMouse(x, y);
          If(IsUpTextMulti('option', 'opti', 'tion') then
          begin
            ClickMouse(x, y, false);
            ChooseOption(x,y,'ick up');
            //Picked up bones
            AntiRandoms;
          end;
        end;
      end;
      until(InvFull);

    Procedure BuryBones;
    AntiRandoms;
    Wait(Random(200)); //Always good to have random waits here and there
    repeat
      repeat
        ClickAllItemsBmpTolWait('ury', Bone, 50, 250); //Buries all bones in inventory.
      until(FindBitmap(Bone, x, y) = False) //Found no more bones.
      DropAll; //Drops any other items we may have accumulated during our boneburying spree.
      AntiRandoms;
    until(InvEmpty);
    end;

    Procedure Antiban; //Credits EsteBan (change a few things.)
    begin
      if(not(LoggedIn))then
      begin
      Writeln('Error Line 37');
      TerminateScript
      end;
      case Random(10) of

        0: begin
             HoverSkill('Random', false);
             wait(2453+Random(432));
           end;

        1: RandomRClickEvery(3 + Random(2));

        2: begin
             HoverSkill('Woodcutting',false);
             wait(2364+Random(413));
             GameTab(4);
           end;

        3: PickUpMouse;

        4: AlmostLogOut;

        5: SayCurrentLevels('Woodcutting');

        6: begin
             case random(4) of
               0: TypeSend('Whats up?');

               1: TypeSend('wc lvls?');

               2: TypeSend('Woodcutting levels?');

               3: TypeSend('sup?');
             end;
           end;

        7: begin
             RandomCompassDirection;
             wait(100+random(500));
             RandomCompassDirection;
             wait(100+random(500));
             RandomCompassDirection;
           end;

        8: BoredEvery(10+random(5));

        9: begin
             LowestAngle;
             wait(100+random(100));
             HighestAngle;
           end;

        10: SleepAndMoveMouse(600000+random(400000));

      end;
    end.

    procedure RandomCompassDirection;
    begin
      case random(3) of
      0: MakeCompass('N');
      1: MakeCompass('E');
      2: MakeCompass('S');
      3: MakeCompass('W');
      end;
    end;

    procedure AntiRandoms;
    NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    begin
      FindNormalRandoms;
      FindTalk;
      if (FindFight = True) then
      begin
         RunAwayDirection(RunDirection);
         Wait(10000 + random(20000));
         RunBack;
      end;
    FreeBitmap(NickNameBMP);
    end;



    begin
    repeat
      SetUpSRL; //Sets up SRL.
      ActivateClient;
      PickUpBones;
      BuryBones;
      AntiRandoms;
      AntiBan;
    until(not(LoggedIn));
    end.

    Thanks
    -jbrauman

    Don't know why but I like this emoticon...

  2. #2
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    You left your username and password in it!
    I wanted to change it and then PM it to you but someone else already took the account.
    I made a new script, check it out!.

  3. #3
    Join Date
    Jun 2007
    Posts
    26
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    eh.. whatever it was a level 10 or something
    Can someone fix it?

  4. #4
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    var
         RunDirection = 'N';   //Can be N, S, E, W, R (Random).
         LoadsPerPlayer = 10;  //Loads before next player.
         RandomLoads = 5;      //Added to LoadsPerPlayer. NOTE random(RandomLoads);

    That's not meant to be a variable, it's a constant.

    SCAR Code:
    Procedure PickUpBones;
    var x, y :Integer
    begin
      repeat
      if(not(LoggedIn)) then
      begin
        Writeln('Not logged in');
        TerminateScript;
      end;
     
      begin
        case (random(2)) of
        0 : Exit;
        1 : AntiBan;
        2 : Exit;
        end;
        AntiRandoms;
     
        if (FindObjMulti('ones', BoneColor1, BoneColor2, BoneColor3, 3) then
        //Found Bones
        begin
          Wait(50 + random(100);
          GetMouse(x, y);
          If(IsUpTextMulti('option', 'opti', 'tion') then
          begin
            ClickMouse(x, y, false);
            ChooseOption(x,y,'ick up');
            //Picked up bones
            AntiRandoms;
          end;
        end;
      end;
      until(InvFull);

    SCAR Code:
    If (Not(LoggedIn)) then
    WriteLn('Not Logeed In')
    TerminateScript;

    You have a player array, which is meant to log you in. I don't see why you have that part...

    SCAR Code:
    begin
    repeat
      SetUpSRL; //Sets up SRL.
      ActivateClient;
      PickUpBones;
      BuryBones;
      AntiRandoms;
      AntiBan;
    until(not(LoggedIn));
    end.

    Until (Not(LoggedIn))...once again, a player array so why do you make it like that?

    I don't have scar on this computer so after editing those, can you tell me what error you have and on what line?
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  5. #5
    Join Date
    Mar 2007
    Posts
    3,681
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    hey looks nice your scritp but in future you could also try bug fixing

    run the script and see the errors it gives then look JADs error fixing guide :

    http://www.villavu.com/forum/showthread.php?t=6413 and then you will get it to compile but looks gd looks good m8!

  6. #6
    Join Date
    Apr 2007
    Location
    brisbane
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If (Not(LoggedIn)) then
    WriteLn('Not Logeed In')
    TerminateScript;


    You have a player array, which is meant to log you in. I don't see why you have that part...
    eh? sounds like leeching
    x: y, why are you so fat?
    y:-_____
    ---l-1
    ---l-----
    ---l
    --\l64

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 03-02-2008, 09:26 AM
  2. Would you script on a Mac if you could use SCAR?
    By stein3 in forum News and General
    Replies: 12
    Last Post: 09-24-2007, 12:48 AM
  3. Scar/SRL Script API?
    By zerosrlven in forum OSR Help
    Replies: 0
    Last Post: 04-26-2007, 07:34 PM

Posting Permissions

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