Results 1 to 6 of 6

Thread: Weird problem's with my script

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

    Default Weird problem's with my script

    My maple chopper was working fine but someone posted that it doesn't work so when I checked it out he was right it's not working like almost at all it once clicked on a maple tree once. Any thoughts?

    Script:

    Simba Code:
    program GuccisMapleChopper;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$i sps/sps.simba}

    const
      SRLStats_User     = '';   // Your SRL Stats Username
      SRLStats_Password = '';   // Your SRL Stats Password
      SERVER            = 0;  // Enter "0" to pick a random server.
      MEMBERS           = True;
      NumbOfPlayers     = 1;
      StartPlayer       = 0;
      Banking           = 'yes'; // Banks at Seers Village, if you would like power chopping make no
      Skiller           = 'no'; // Hatchet in inventory.
    var
    StartXP, TotalEXP, LogsChopped, MapleLog, x, y: integer;
    ToBank: TPointArray;
    aFound: Extended;

    procedure DeclarePlayers;
      var i:integer;
    begin
      NumberOfPlayers(NumbOfPlayers);
      CurrentPlayer := StartPlayer
      for i := 0 to NumbOfPlayers-1 do
        Players[i].BoxRewards := ['XP'];

      With Players[0] do
      begin
        Name := ''; //Username.
        Pass := ''; //Password.
        Active := True;
      end;

    end;

    procedure XP;
    begin
    StartXp := GetXpBar(1)
    end;

    function CheckAndClick (UpText, Option:String; x, y:Integer; RClick:Boolean):Boolean;
     begin
      MMouse(x, y, 6, 6);
      If WaitUpText(UpText, 1000+Random(200)) Then
      begin
        Result:=True;
        GetMousePos(x, y);
        If RClick Then
        begin
          Mouse(x, y, 0, 0, False);
          Result:= WaitOption(Option, 2000);
          If Result Then FFlag(0);
        end Else
        Begin
          Mouse(x, y, 0, 0, True);
          Wait(150+Random(100));
          FFlag(0);
        end;
      end;
    end;

    Function Cutting: Boolean;
      var
          PBox: TBox;
          begin
          PBox := IntToBox(250, 132, 279, 193);
        Result := (AveragePixelShift(PBox, 500, 800) > 425);
    end;

    procedure Chopped;
    begin
      if (BankScreen) then
      IncEx(LogsChopped, 28);
    end;

    Procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colour: integer);
      var
        mx, my, Pic, I, B, H, TPH, Numb: Integer;
        TTP: TPointArray;
        Canvas: TCanvas;

      begin
        SmartSetDebug(True);
        GetClientDimensions(mx, my);
        Pic := BitmapFromString(mx, my, '');

        TPH := High(TP);
        for I := 0 to TPH do
        begin

          TTP := LoadTextTPA(TP[i], SmallChars, H);
          for B := 0 to High(TTP) do
          begin

            Numb := ((I + 1) * 13);
            FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1,8388736);
            FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
          end;
        end;
        Canvas := TCANVAS.Create;
        Canvas.Handle := SmartGetDebugDC;
        DrawBitmap(Pic, Canvas, Placement.x, Placement.y);

        FreeBitmap(Pic);

      end;

    Procedure OnSmart;  // Thanks to TehQ
    var
      WOODY, W_EXP: integer;
      begin
        W_EXP := (LogsChopped*100)
        WOODY := round((W_EXP) / (GetTimeRunning / 3600000.0));

        PrintOnSmart(['Version: 2 by Mega','',''+'Woodcutting XP Gained: ' +IntToStr(W_EXP),
         ''+'Woodcutting XP/Hour: ' +IntToStr(WOODY),''+MsToTime(GetTimeRunning, Time_Abbrev)],Point(32,10), 16777215);
      end;

    procedure Report;

    begin

      if (BankScreen) then
      begin
      TotalEXP := (LogsChopped*100);

      Writeln('############ MegaMapleChopper ##########');
      Writeln('|= Player : ' + Players[CurrentPlayer].Name);
      Writeln('|= Time Running : ' + TimeRunning);
      Writeln('|= Xp gained : ' + IntToStr(TotalEXP));
      Writeln('|= Logs Chopped: ' + IntToStr(LogsChopped));
      Writeln('########################################');
    end;
    end;

    procedure AntiBan;
    begin
      if(not(LoggedIn))then
        exit;
          FindNormalRandoms;
            case Random(160) of
          0:
            begin
              WriteLn('AntiBan Is Being Performed');
                GameTab(Tab_Stats);
                  HoverSkill('Woodcutting', false);
                    wait(2500 + Random(1000));
                      Mouse(659, 189, 0, 0, True);
                    end;
                1:
                  begin
                WriteLn('Bored')
              If (Cutting) then
            BoredHuman;
        end;
      end;
    end;

    procedure DTM;
    begin
      MapleLog := DTMFromString('mbQAAAHicY2VgYNjDzMCwC4hPAvFWIF4NxNMYGRi6gXgGEC8E4qlA7GfEBVTNhIYxASMWDAYAb/cHPw==');
    end;

    procedure FrDTM;
    begin
      FreeDTM(MapleLog);
    end;

    procedure FailSafe (Reason:String);
      begin
        Players[CurrentPlayer].Loc:=Reason;
          Logout;
        Stats_Commit;
      TerminateScript;
    end;

    function FindMaple(Var X,Y: Integer): Boolean;
    var
      CTS: Integer;
      TPA: TPointArray;
        begin
          Result := False;
            CTS := GetColorToleranceSpeed;
              ColorToleranceSpeed(2);
                SetColorSpeed2Modifiers(0.20, 0.39);
                  FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2375787, MSX1, MSY1, MSX2, MSY2, 7);
                    ColorToleranceSpeed(CTS);

                    if (Length(TPA) < 1) then
                    Exit;

                MMouse(TPA[0].X, TPA[0].Y, 5, 5);

                  if WaitUpText('hop', 250) then
                    begin
                      GetMousePos(X, Y);
                    Mouse(x, y, 0, 0, False);
                  ChooseOption('Chop');
                Result := True;
              Exit;
          end;
    end;

    procedure WalkToBank;
    begin
      SetupSRL;
      SPS_Setup(RUNESCAPE_SURFACE, ['6_6','6_7','7_7','7_6']);
       ToBank := [Point(2751, 2646), Point(2767, 2665), Point(2767, 2682),
       Point(2756, 2706), Point(2740, 2706), Point(2740, 2686), Point(2720, 2520),
       Point(2543, 2528), Point(2540, 2828), Point(2921, 2856), Point(2925, 2525)];
    end;

    procedure Bankin;
    begin
       if InvFull then
        SPS_WalkPath(ToBank);
       begin
       case Skiller of
       'no':
       begin
       if SPS_WalkPath(ToBank) then
       Wait(100 + Random(50));
       OpenBankFast('clt');
       Repeat
       Wait(50);
       Until(Bankscreen);
       if (BankScreen) then
       DepositAll;
    end;
    end;

      case Skiller of
      'yes':
        begin
       if SPS_WalkPath(ToBank) then
       Wait(100 + Random(50));
       OpenBank('clt',True,True);
       Repeat
       Wait(50);
       Until(Bankscreen);
       if (BankScreen) then
       FindDTMRotated(MapleLog, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
       GetMousePos(x, y);
       Mouse(x, y, 0, 0, False);
       ChooseOption('all');
    end;
    end;
    end;
    end;

    procedure MapleChopp;
    begin
      SetAngle(SRL_ANGLE_HIGH);
      case Banking of
      'no':
      begin
      MakeCompass('N');
        SetAngle(SRL_ANGLE_HIGH);
          wait(200+random(400));

              if FindMaple(x, y) then
                begin
                  Writeln('Tree Has Been Found');
                    Wait(10+random(20));
                      Mouse(x,y,4,4,true)
                        Wait(10+random(45));

                      if (Cutting) then
                    Antiban;

                end else Writeln('Cannot find Tree');
          repeat
            wait(50+random(100));
      Until(InvFull);
      DropAll;
    end;
    end;
        begin
          Case Banking of
           'yes':
           begin

           if (InvFull) then
            SPS_WalkPath(ToBank);
            Bankin;

             MakeCompass('N');
              SetAngle(SRL_ANGLE_HIGH);
                wait(200+random(400));

                  if FindMaple(x, y) then
                    begin
                      Writeln('Tree Has Been Found');
                        Wait(10+random(20));
                          Mouse(x,y,4,4,true)
                            Wait(10+random(45));

                      if (Cutting) then
                    Antiban;

                end else Writeln('Cannot find Tree');
          repeat
            wait(50+random(100));
      Until(InvFull);
    end;
    end;
    end;
    end;


    procedure FailSafe2 (Reason:String);
    var
      Z:TPoint;
    begin
      Z:= SPS_GetMyPos;
        if (Not Cutting) then
          Begin
            BoredHuman;
        SPS_WalkToPos(Point(2744, 2647));
      end;
    end;

    begin
      Smart_Signed := TRUE;
      Smart_Members := MEMBERS;
      Smart_SuperDetail := FALSE;
      ActivateClient;
      Smart_Server := 99;
      SetupSRL;
      DTM;
      DeclarePlayers;
        if not (LoggedIn) then
      LoginPlayer;
      wait(1000+random(400));
        Repeat
          MapleChopp;
          Bankin;
          OnSmart;
          Report;
        Until(False)
        FrDTM;
    end.
    Current Project: Retired

  2. #2
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    SetSpeed2Modifiers(0.2, 0.2); After you are done doing the find colours in your FindMaple Function.. Why? because you didn't reset the modifiers back to normal after..

    Just like CTS, u have to reset that too.. AND your colours could be outdated.. if you have the .aca file, load it in aca and check if it finds it.
    I am Ggzz..
    Hackintosher

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

    Default

    I just checked colors they are pretty good. And I'll check out the Modifier, Thanks

    E: Im using this now:

    Simba Code:
    function FindMaple(x, y: Integer): Boolean;
    var
      CTS, I: Integer;
      TPA: TPointArray;
      ATPA: Array of TPointArray;
    begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.20, 0.39);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2375787, MSX1, MSY1, MSX2, MSY2, 5);
      ColorToleranceSpeed(CTS);
      ATPA := TPAToATPAEx(TPA, 15, 15);

      For I := 0 to High(ATPA) do
      begin
        MiddleTPAEx(TPA, x, y);
        MMouse(x, y, 2, 2);
        If(IsUpTextMultiCustom(['hop, aple, ree'])) then
        begin
          Result := True;
          GetMousePos(x, y);
          Break;
        end;
      end;
      SetColorSpeed2Modifiers(0.2, 0.2);
    end;

    Still not working
    Last edited by Gucci; 03-09-2012 at 12:36 AM.
    Current Project: Retired

  4. #4
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    MMouse(TPA[0].X, TPA[0].Y, 5, 5);

    Should be:
    MiddleTPAEx(TPA, X, Y);
    MMouse(X, Y, 5, 5);

    Atm.. ur just moving it to the first point every single time..
    I am Ggzz..
    Hackintosher

  5. #5
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Does it attempt to walk to the bank? Does it do anti ban?
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

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

    Default

    Well no because it doesn't have a full inventory so it doesn't walk to bank and no antiban
    Current Project: Retired

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
  •