Page 4 of 4 FirstFirst ... 234
Results 76 to 86 of 86

Thread: Expected semicolon instead of "end."

  1. #76
    Join Date
    Jan 2012
    Location
    Billingham
    Posts
    171
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Nebula, These guys are doing brilliant and the world of good, I am trying to do what I can That is why I get these errors, do you realise this is my first script, share some consideration please.

    I change It Because I see things where I think they could be altered yet I change nothing other than what you say.

    Simba Code:
    program New;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$DEFINE SRL5}

    //Run The script anywhere where there is many
    //Trees or Oaks, Works anywhere, recommended spot:-
    // Lumbridge castle orWest Of Cooking Guild Grand Exchange!


    //Any Problems found, Pm Me Or Leave an Issue on
    //Thread!



    //This Is My very First Script, If You
    //Are Using It Please Leave Constructive Critiscism!

    Const
      World = 103; //May not Work As of Yet.
      MEMBERS = True;

      Stats_UserID   = '';
      Stats_Password = '';

      AutoUpdate  = True;

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name := ''; // Username?
      Players[0].Pass := ''; // Password?
      Players[0].Nick := '';  // 3 letters of your username (not the first letter)
      Players[0].Active := True;
    end;

    function CheckAndClick(UpText, Option:String; X,Y:Integer;RClick:Boolean) :Boolean;
    begin
      MMouse(x,y,5,5);
      if WaitUptext(Uptext, 1500+Random(500)) then
      begin
        Result:= True;
        GetMousePos(x, y);
        if RClick then
        begin
          Mouse(x, y, 0, 0, False);
          Result:= WaitOption(Option,1800);
          if Result then
            FFlag(0);
        end else
        begin
          Mouse(x, y, 0, 0, True);
          Wait(100+Random(50));
          FFlag(0);
        end;
      end;
    end;

    procedure AntiBan;
    begin
      if(not(LoggedIn))then
        Exit;
      FindNormalRandoms;
      case Random(2) of
      0:
        begin
          Wait(16000+Random(387));
          Gametab(Tab_Stats) Hoverskill ('Random',False);
          Wait(3000+Random(298));
          Gametab(Tab_Inv);
          CompassMovement(-180, 180, False);
          Wait(4500+Random(222));
          CompassMovement(-180, 180, False);
        end;
       1: PickUpMouse;
       2:
        begin
          MakeCompass('0');
          wait(2000+random(1335));
          MakeCompass('0');
          wait(561+random(133));
          MakeCompass('0');
          FindNormalRandoms;
        end;
      end;
    end;



    procedure ChopTree;
    var
      x, y, PlusOne, TooLong, TreeCounter: integer;
    begin
      PlusOne:= InvCount + 1;
      x:=MSCX;
      y:=MSCY;
      if FindObjTPA(x, y, 3162184, 5, 1, 15, 60, 600, ['Cho'])then
        case Random(2) of
          0: Mouse(x, y, 4, 4, True);
          1: begin
              Mouse(x, y, 4, 4, False);
              WaitOption('Chop', 500);
              CompassMovement(180, -180, false);
            end;
        end;
      Flag;
      MarkTime(TreeCounter);
      if (TimeFromMark(TooLong) > 30000) then
        CompassMovement(-180, 180, false);

      repeat
        FindNormalRandoms;
        if FindObj(x, y, 'hop', 3162184, 22) then
          Mouse(x, y, 2, 2, false);

        ChooseOption('hop');           //this will be run no matter if it found the tree or not
        Wait(19+Random(12));
        WriteLn ('ANNIHILATING TREE!');
        if InvCount=+1 then
          WriteLn('We Got the log!!');

        Mouse(x, y, 2, 2, false);
        ChooseOption('hop');

        Flag;
        MarkTime(TreeCounter);
      until(InvFull);
    end;

    procedure DropLogs;
    var
      x, y, LogDTM, I:Integer;
      SlotBox:TBox;
      LogPattern:TIntegerArray;
    begin
      LogDTM := DTMFromString('mbQAAAHicY2VgYHBlYmAwA2JjIHYA4gAgfgIUfwTEb4D4AxA/BmIHAxkgyYSGUcF/IGbEgsEAABw/B2s=');
      LogPattern:=[1,5,9,13,17,21,25,29,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,16,12,8,4];
      for I:=2 to 28 do
      begin
        FindNormalRandoms;
        Status('Dropping Log:'+ IntToStr(I));
        SlotBox:=InvBox(LogPattern[I]);
        If FindDTm(LogDTM,x,y,Slotbox.x1,Slotbox.y1, SlotBox.x2, Slotbox.y2) Then
        begin
          MouseItem(LogPattern[I], 0);      //instead of 0 you can also use mouse_Right
          ChooseOption('rop');
        end;
      end;
    end;

    begin
      SetUpSRL;
      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      repeat
        ChopTree;
        If InvFull Then
         WriteLn('OMFG DROPPING THE BITCHES!!!');
          DropLogs;
        until(false);
      end.

  2. #77
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Wow I just tested it and it has REAL trouble finding the Trees.

    Might I suggest you use AutoColor Aid: http://villavu.com/forum/showthread....t=AutoColorAid
    It will do all the work for you and can be quite accurate if you spend some time getting the right colors.

    If you want to know howto use it: http://www.youtube.com/watch?v=98wVr...07Mm809Bbqg%3D


    EDIT: You also need to use PixelShift: http://villavu.com/forum/showthread....ght=PixelShift
    This stops it from searching for other trees while its still chopping the current one.
    Last edited by Abu; 03-22-2012 at 10:22 PM.

  3. #78
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Sorry for coming off as inconsiderate, I didn't mean to sound that way. I was just saying that you will learn more if you try fixing things yourself.

    Anyways, here's a re-written version of your ChopTree procedure. I tried to keep as much of your original code as possible. It should work, but I didn't test it and made it rather quickly so you might find an issue.

    Simba Code:
    procedure ChopTree;
    var
      x, y, PlusOne, TooLong, TreeFindFailsafe, TreeWaitFailsafe: integer;
    begin
      PlusOne:= InvCount;
      x:=MSCX;
      y:=MSCY;
      MarkTime(TooLong);
      MarkTime(TreeFindFailsafe);
      repeat
        repeat
          if FindObjTPA(x, y, 3162184, 5, 1, 15, 60, 600, ['Cho'])then
          begin
            case Random(2) of
              0: Mouse(x, y, 4, 4, True);
              1: begin
                  Mouse(x, y, 4, 4, False);
                  WaitOption('Chop', 500);
                end;
            end;
            Flag;
            Break;
          end;
          if (TimeFromMark(TooLong) > 30000) then
            CompassMovement(-180, 180, false);
        until(TimeFromMark(TreeFindFailsafe) > 60000);
        if (TimeFromMark(TreeFindFailsafe) > 60000) then
        begin
          writeln('Couldnt find tree');
          Logout;
          TerminateScript;
        end else
        begin
          wait(RandomRange(300, 600));
          if InvCount > PlusOne then
          begin
            WriteLn('We Got the log!!');
            break;
          end else
          begin
            MarkTime(TreeWaitFailsafe);
            repeat
              wait(RandomRange(50, 150));
            until(InvCount > PlusOne) or (TimeFromMark(TreeWaitFailsafe) > RandomRange(5000, 10000));
            if (TimeFromMark(TreeWaitFailsafe) > 5000) then
            begin
              writeln('Log wasnt cut');
              break;
            end else
            begin
              writeln('Log was Cut! :)');
              break;
            end;
          end;
        end;
      until(False);
    end;

  4. #79
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Nebula you've definitely improved it, but it still has issues with the tree color.

    Takes too long to find the next tree

  5. #80
    Join Date
    Jan 2012
    Location
    Billingham
    Posts
    171
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Ehh I changed colours, I was using like 3667892 or something and was fine (That was a guess, I am Not updating or doing anything tonight, I have the weekend for that...But I'm at my dads so I will come on here to get the script, night.

  6. #81
    Join Date
    Jan 2012
    Location
    Billingham
    Posts
    171
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Yeah abu I know, I switched the colours for evergreens as I thought an evergreen powerchopper would be brilliant as there are LOADS of them, though it's hard to find the colours, and I will give that ACA a go.

  7. #82
    Join Date
    Jan 2012
    Location
    Billingham
    Posts
    171
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Once again, I am having great trouble with dropping!!

    I used ACA and It's going well but it keeps clicking the tree and won't drop I'm really getting sick and tired of asking people.

    Simba Code:
    program New;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$DEFINE SRL5}

    //Run The script anywhere where there is many
    //Trees or Oaks, Works anywhere, recommended spot:-
    // Lumbridge castle orWest Of Cooking Guild Grand Exchange!


    //Any Problems found, Pm Me Or Leave an Issue on
    //Thread!



    //This Is My very First Script, If You
    //Are Using It Please Leave Constructive Critiscism!

    Const
      World = 103; //May not Work As of Yet.
      MEMBERS = True;

      Stats_UserID   = '';
      Stats_Password = '';

      AutoUpdate  = True;

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name := ''; // Username?
      Players[0].Pass := ''; // Password?
      Players[0].Nick := '10w';  // 3 letters of your username (not the first letter)
      Players[0].Active := True;
    end;

    function CheckAndClick(UpText, Option:String; X,Y:Integer;RClick:Boolean) :Boolean;
    begin
      MMouse(x,y,5,5);
      if WaitUptext(Uptext, 1500+Random(500)) then
      begin
        Result:= True;
        GetMousePos(x, y);
        if RClick then
        begin
          Mouse(x, y, 0, 0, False);
          Result:= WaitOption(Option,1800);
          if Result then
            FFlag(0);
        end else
        begin
          Mouse(x, y, 0, 0, True);
          Wait(100+Random(50));
          FFlag(0);
        end;
      end;
    end;

    procedure AntiBan;
    begin
      if(not(LoggedIn))then
        Exit;
      FindNormalRandoms;
      case Random(2) of
      0:
        begin
          Wait(16000+Random(387));
          Gametab(Tab_Stats) Hoverskill ('Random',False);
          Wait(305+Random(298));
          Gametab(Tab_Inv);
          CompassMovement(-180, 180, False);
          Wait(4500+Random(222));
          CompassMovement(-180, 180, False);
        end;
       1: PickUpMouse;
       2:
        begin
          MakeCompass('0');
          wait(1743+random(1335));
          MakeCompass('0');
          wait(561+random(133));
          MakeCompass('0');
          FindNormalRandoms;
        end;
      end;
    end;


    function TreeColour: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.93, 0.79);

      FindColorsSpiralTolerance(MSCX, MSCY, arP, 1910309, MSX1, MSY1, MSX2, MSY2, 2);
      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
        ColorToXYZ(arC[i], X, Y, Z);

        if (X >= 1.34) and (X <= 2.07) and (Y >= 1.47) and (Y <= 2.33) and (Z >= 1.17) and (Z <= 1.80) then
        begin
          Result := arC[i];
          Writeln('AutoColor = ' + IntToStr(arC[i]));
          Break;
        end;
      end;

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

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


    procedure ChopTree;
    var
      x, y, PlusOne, TooLong, TreeFindFailsafe, TreeWaitFailsafe: integer;
    begin
      PlusOne:= InvCount;
      x:=MSCX;
      y:=MSCY;
      MarkTime(TooLong);
      MarkTime(TreeFindFailsafe);
      repeat
        repeat
          if FindObjTPA(x, y, TreeColour, 5, 1, 15, 60, 600, ['Cho'])then
          begin
            case Random(2) of
              0: Mouse(x, y, 4, 4, True);
              1: begin
                  Mouse(x, y, 4, 4, False);
                  WaitOption('Chop', 500);
                end;
            end;
            Flag;
            Break;
          end;
          if (TimeFromMark(TooLong) > 30000) then
            CompassMovement(-180, 180, false);
        until(TimeFromMark(TreeFindFailsafe) > 60000);
        if (TimeFromMark(TreeFindFailsafe) > 60000) then
        begin
          writeln('Couldnt find tree');
          Logout;
          TerminateScript;
        end else
        begin
          wait(RandomRange(300, 600));
          if InvCount > PlusOne then
          begin
            WriteLn('We Got the log!!');
            break;
          end else
          begin
            MarkTime(TreeWaitFailsafe);
            repeat
              wait(RandomRange(50, 150));
            until(InvCount > PlusOne) or (TimeFromMark(TreeWaitFailsafe) > RandomRange(5000, 10000));
            if (TimeFromMark(TreeWaitFailsafe) > 5000) then
            begin
              writeln('Log wasnt cut');
              break;
            end else
            begin
              writeln('Log was Cut! :)');
              break;
            end;
          end;
        end;
      until(False);
    end;


    procedure DropLogs;
    var
      x, y, LogDTM, I:Integer;
      SlotBox:TBox;
      LogPattern:TIntegerArray;
    begin
      LogDTM:= DTMFromString('mbQAAAHicY2VgYIhlYmAIAuJgIE4A4gwg7mGE4BlAPB2Iu4HY0VIEqJqJwUBBAUxDMCZgxILBAADLpQW6');
      LogPattern:=[1,5,9,13,17,21,25,29,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,16,12,8,4];
      for I:=2 to 28 do
      begin
        FindNormalRandoms;
        Status('Dropping Log:'+ IntToStr(I));
        SlotBox:=InvBox(LogPattern[I]);
        If FindDTm(LogDTM,x,y,Slotbox.x1,Slotbox.y1, SlotBox.x2, Slotbox.y2) Then
        begin
          MouseItem(LogPattern[I], 0);      //instead of 0 you can also use mouse_Right
          ChooseOption('rop');
        end;
      end;
    end;

    begin
      SetUpSRL;
      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      repeat
        ChopTree;
        If InvFull Then
         WriteLn('Dropping!');
          DropLogs;
        until(false);
      end.

    There is the script, I don't care about trying myself, I've been trying for ages now even while you awesome helpers have been giving advice, please I just want a fix now for god sake.

    EDIT:- ALSO GET THIS ** Warning in InvBox: Incorrect index: 29 ** while running.

  8. #83
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    I guess you could just post this in the first scripts section and hope that someone will come along and find the error.

    For your other problem, I think you're forgetting the use of the Search Button:
    http://villavu.com/forum/showthread....Warning+InvBox

  9. #84
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    LogPattern:=[1,5,9,13,17,21,25,29,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,2 0,16,12,8,4];

    You got 29 in that array, but there are only 28 inventory spots...

    edit: and you got an infinity loop in your tree cut procedure.
    Working on: Tithe Farmer

  10. #85
    Join Date
    Jan 2012
    Location
    Billingham
    Posts
    171
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Has the code completely changed since I left this thread? I might retry this script unless it is completely dead.

  11. #86
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Quote Originally Posted by 10wnu9 View Post
    Has the code completely changed since I left this thread? I might retry this script unless it is completely dead.
    I'd be lying if I said a lot hasn't change. With the release of SRL 6 a lot of code was altered. Saying that, it shouldn't take too much catching up if you're still interested!
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

Page 4 of 4 FirstFirst ... 234

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
  •