Results 1 to 4 of 4

Thread: Script Help :(

  1. #1
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default Script Help :(

    I need some help with my script
    here it is
    could you tell me what i have done wrong and what i do to fix it please

    Code:
    {==============================================================================]
    [                        [SRL]4                                                ]
    [                                                                              ]
    [                                                                              ]
    [             NAME        : Destiful Chopper                                                   ]
    [             WRITER      : The Man                                                   ]
    [             CATEGORY    : Woodcutting                                                   ]
    [             DESCRIPTION :                                                    ]
    [                                                                              ]
    [==============================================================================]
    [ Instructions: Please check the forums for details.                           ]
    [==============================================================================}
    
    {=========================Records & Vars DONT TOUCH!===========================}
    program simplecutter;
    {.include SRL/SRL/Misc/Smart.scar}
    {.include SRL/SRL.scar}
    
    const
      Rockcolour = 379494;
      StartPlayer = 0;
    
    
    
    var
    x, y,RockDTM:integer;
    
    
    
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1; // Set Number of Players here.
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := StartPlayer;
      Players[0].Name := ''; //username
      Players[0].Pass := ''; //password
      Players[0].Nick := ''; //3-4 consecutive letters of your user
      Players[0].Active := True; //use this player
    end;
    
    procedure AntiRandom;
    begin
      FindNormalRandoms;
    end;
    
    procedure Proggy;
    begin
      writeln('Auto cutter and banker');
      writeln('Ran For: '+TimeRunning+'!');
    end;
    
    Procedure Towillows;
    begin
      if (not(loggedin)) then exit;
       GameTab(4);
    RockDTM := DTMFromString('78DA633CCBC4C020CAC8800C224383C1344C9' +
           '4F11C508D30AA1A370F0354351730CDF10EB2C3344702558D4F98' +
           '09AA9AD340359268EEC95645557312A8461C558DB3AB0EAA9A534' +
           '03522A86A1C1CAC485603004BED0DB8');
    
    
      writeln('to willows');
    
      wait(100);
      if (not(loggedin)) then exit;
      SetRun(True);
     if (FindColorSpiralTolerance(x, y, Rockcolour, 5, 5, MMX2, MMY2, 5)) then
     Mouse(x, y, 5, 5, True);
      if DTMRotated(RockDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
        begin
          Mouse(x, y, 0, 0, True);
        end;
    
    
      FindnormalRandoms;
      wait(100);
    end;
    
    
    function walktobank: Boolean;
    var
      I, R, G, B, Len, TestColor: Integer;
      H, S, L, X, Y, Z: Extended;
      P: TPointArray;
    
    begin
      Result := False;
      FFlag(0);
      FindColorsTolerance(P, 13135419, MMX1, MMY1, MMX2, MMY2, 60);
      Len := High(P);
      for I := 0 to Len do
        if RS_OnMinimap(P[I].X, P[I].Y) then
        begin
          TestColor := GetColor(P[I].X, P[I].Y);
          ColorToRGB(TestColor, R, G, B);
          if InRange(R - B, -161, -121) then
            if InRange(R - G, -71, -31) then
              if InRange(G - B, -110, -70) then
              begin
                ColorToHSL(TestColor, H, S, L);
                if InRange(Round(H - L), -5, 25) then
                  if InRange(Round(S - H), -19, 11) then
                    if InRange(Round(S - L), -10, 20) then
                    begin
                      ColorToXYZ(TestColor, X, Y, Z);
                      if InRange(Round(X - Y), -5, 9) then
                        if InRange(Round(Y - Z), -48, -34) then
                        begin
                          Mouse(P[I].X, P[I].Y, 6, 6, True);
                          Result := True;
                          Exit;
                        end;
                    end;
              end;
        end;
      WriteLn('Autocolor did not find the bank');
    end;
    
    function Findwillow: Boolean;
    var
      Colors: TIntegerArray;
      X, Y, I, A, M, curCTS: Integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;
    
    begin
      Result := False;
      if not LoggedIn then exit;
      curCTS := GetColorToleranceSpeed;
      Colors := [7919760, 8446096];
      for I := 0 to 1 do
      begin
        ColorToleranceSpeed(3);
        FindColorsSpiralTolerance(MSCX, MSCY, TPA, Colors[I], MSX1, MSY1, MSX2, MSY2, 5);
        if Length(TPA) = 0 then Continue;
        ColorToleranceSpeed(1);
        ATPA := TPAtoATPAEx(TPA, 10, 10);
        M := High(ATPA);
        for A := 0 to M do
          if MiddleTPAEx(ATPA[A], X, Y) then
          begin
            MMouse(X, Y, 6, 6);
            Wait(100 + Random(50));
            if Pos('Willow', RS_GetUpText) > 0 then
            begin
              GetMousePos(X, Y);
              Mouse(X, Y, 0, 0, True);
              Result := True;
              ColorToleranceSpeed(curCTS);
              Exit;
            end;
          end;
      end;
      ColorToleranceSpeed(curCTS);
    end;
    
    Procedure Depositwillows;
    var InvItems : boolean;
        I : integer;
    begin
      for I := 1 to 28 do
      if ExistsItem(i) then
      begin
        InvItems := true;
        break;
      end;
      if InvItems then
        MouseBox(381, 298,410, 318,1);
    end;
    
    procedure AntiBanage;
    begin
      case Random(10) of
        0:
          begin
            HoverSkill('mining', false);
    
          end;
        1:
          begin
            MakeCompass('random');
    
          end;
        2:
          begin
            Wait(1000 + Random(200));
          end;
        3:
          begin
            RandomMovement;
    
          end;
        4:
          begin
            RandomRClick;
          end;
        5:
          begin
            HoverSkill('random', false);
    
          end;
        6:
          begin
            GameTab(3);
          end;
      end;
    end;
    
    
    
    
    
    procedure setupScript;
    begin
      cleardebug;
      writeln('');
      writeln('');
      writeln('');
      writeln('');
      writeln('');
      writeln('');
      writeln('');
      writeln('');
      setupsrl;
      ScriptID := '1058';
      MouseSpeed := RandomRange(13, 18)
      declareplayers;
      activateclient;
      wait(500);
    end;
    
    begin
      setupScript;
        SMARTSetupEx(29, False, True, False);
       SetTargetDC(SMARTGetDC);
    
      if (not (LoggedIn)) then
      begin
        Loginplayer;
        setangle(true);
        Wait(500 + random(30))
         SetChat('on', 1);
        SetChat('friends', 2);
        SetChat('off', 3);
      end;
      repeat
    
        if not (loggedIn) then
        begin
          nextplayer(false);
            LoginPlayer;
        end;
      //end;
        begin
          logout;
          if howManyPlayers = 1 then
            wait(random(600000));
          nextplayer(true);
          LoginPlayer;
        end;
      until (false);
      
      Procedure MainLoop
      begin
      SetupPlayer;
    end;
    
    end.
    Last edited by Dynamite; 05-09-2009 at 09:02 PM.

  2. #2
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    What error[s] do you encounter?

    P.S;
    Added you on MSN.
    Ce ne sont que des gueux


  3. #3
    Join Date
    Nov 2008
    Location
    Belgium
    Posts
    254
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You left your username and password in it, please remove...

  4. #4
    Join Date
    Feb 2009
    Location
    Philipines
    Posts
    600
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You don't need procedure mainloop, so it should look like this:
    SCAR Code:
    {==============================================================================]
    [                        [SRL]4                                                ]
    [                                                                              ]
    [                                                                              ]
    [             NAME        : Destiful Chopper                                   ]
    [             WRITER      : The Man                                            ]
    [             CATEGORY    : Woodcutting                                        ]
    [             DESCRIPTION :                                                    ]
    [                                                                              ]
    [==============================================================================]
    [ Instructions: Please check the forums for details.                           ]
    [==============================================================================}


    {=========================Records & Vars DONT TOUCH!===========================}
    program SimpleCutter;

    {.Include SRL/SRL/Misc/Smart.Scar}
    {.Include SRL/SRL.Scar}

    const
      Rockcolour = 379494;
      StartPlayer = 0;

    var
      x, y, RockDTM: integer;


    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1; // Set Number of Players here.
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := StartPlayer;

      Players[0].Name := ''; //username
      Players[0].Pass := ''; //password
      Players[0].Nick := ''; //3-4 consecutive letters of your user
      Players[0].Active := True; //use this player
    end;

    procedure AntiRandom;
    begin
      FindNormalRandoms;
    end;

    procedure Proggy;
    begin
      WriteLn('Auto cutter and banker');
      WriteLn('Ran For: ' + TimeRunning + '!');
    end;

    procedure ToWillows;
    begin
      if (not (loggedin)) then exit;
      GameTab(4);
      RockDTM := DTMFromString('78DA633CCBC4C020CAC8800C224383C1344C9' +
        '4F11C508D30AA1A370F0354351730CDF10EB2C3344702558D4F98' +
        '09AA9AD340359268EEC95645557312A8461C558DB3AB0EAA9A534' +
        '03522A86A1C1CAC485603004BED0DB8');
      WriteLn('to willows');
      Wait(100);
      if (not (loggedin)) then Exit;
      SetRun(True);
      if (FindColorSpiralTolerance(x, y, Rockcolour, 5, 5, MMX2, MMY2, 5)) then
        Mouse(x, y, 5, 5, True);
      if DTMRotated(RockDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
      begin
        Mouse(x, y, 0, 0, True);
      end;
      FindNormalRandoms;
      Wait(100);
    end;


    function WalkToBank: Boolean;

    var
      I, R, G, B, Len, TestColor: Integer;
      H, S, L, X, Y, Z: Extended;
      P: TPointArray;


    begin
      Result := False;
      FFlag(0);
      FindColorsTolerance(P, 13135419, MMX1, MMY1, MMX2, MMY2, 60);
      Len := High(P);
      for I := 0 to Len do
        if RS_OnMinimap(P[i].X, P[i].Y) then
        begin
          TestColor := GetColor(P[i].X, P[i].Y);
          ColorToRGB(TestColor, R, G, B);
          if InRange(R - B, -161, -121) then
            if InRange(R - G, -71, -31) then
              if InRange(G - B, -110, -70) then
              begin
                ColorToHSL(TestColor, H, S, L);
                if InRange(Round(H - L), -5, 25) then
                  if InRange(Round(S - H), -19, 11) then
                    if InRange(Round(S - L), -10, 20) then
                    begin
                      ColorToXYZ(TestColor, X, Y, Z);
                      if InRange(Round(X - Y), -5, 9) then
                        if InRange(Round(Y - Z), -48, -34) then
                        begin
                          Mouse(P[i].X, P[i].Y, 6, 6, True);
                          Result := True;
                          Exit;
                        end;
                  end;
             end;
         end;
      WriteLn('Autocolor did not find the bank');
    end;

    function Findwillow: Boolean;
    var
      Colors: TIntegerArray;
      X, Y, I, A, M, curCTS: Integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      Result := False;
      if not LoggedIn then exit;
      curCTS := GetColorToleranceSpeed;
      Colors := [7919760, 8446096];
      for I := 0 to 1 do
      begin
        ColorToleranceSpeed(3);
        FindColorsSpiralTolerance(MSCX, MSCY, TPA, Colors[i], MSX1, MSY1, MSX2, MSY2, 5);
        if Length(TPA) = 0 then Continue;
        ColorToleranceSpeed(1);
        ATPA := TPAtoATPAEx(TPA, 10, 10);
        M := High(ATPA);
        for A := 0 to M do
          if MiddleTPAEx(ATPA[A], X, Y) then
          begin
            MMouse(X, Y, 6, 6);
            Wait(100 + Random(50));
            if Pos('Willow', RS_GetUpText) > 0 then
            begin
              GetMousePos(X, Y);
              Mouse(X, Y, 0, 0, True);
              Result := True;
              ColorToleranceSpeed(curCTS);
              Exit;
            end;
          end;
      end;
      ColorToleranceSpeed(curCTS);
    end;

    procedure DeposItWillows;
    var
      InvItems: boolean;
      I: integer;
    begin
      for I := 1 to 28 do
        if ExistsItem(i) then
        begin
          InvItems := true;
          break;
        end;
      if InvItems then
        MouseBox(381, 298, 410, 318, 1);
    end;

    procedure AntiBanage;
    begin
      case Random(10) of
        0:  HoverSkill('mining', false);
        1: MakeCompass('random');
        2: Wait(1000 + Random(200));
        3: RandomMovement;
        4: RandomRClick;
        5: HoverSkill('random', false);
        6: GameTab(3);
      end;
    end;

    procedure SetupScript;
    begin
      ClearDebug;
      Writeln('');
      Writeln('');
      Writeln('');
      Writeln('');
      Writeln('');
      Writeln('');
      Writeln('');
      Writeln('');
      SetupSRL;
      ScriptID := '1058';
      MouseSpeed := RandomRange(13, 18)
      DeclarePlayers;
      ActivateClient;
      wait(500);
    end;

    begin
      SetupScript;
      SMARTSetupEx(29, False, True, False);
      SetTargetDC(SMARTGetDC);
      if (not (LoggedIn)) then
      begin
        Loginplayer;
        SetAngle(True);
        Wait(500 + random(30))
        SetChat('on', 1);
        SetChat('friends', 2);
        SetChat('off', 3);
      end;
      repeat
        if not (loggedIn) then
        begin
          Nextplayer(false);
          LoginPlayer;
        end;
        begin
          LogOut;
          if HowManyPlayers = 1 then
            Wait(Random(600000));
            Nextplayer(true);
            LoginPlayer;
        end;
      until(False);
    end.

    The script will compile bit it won't do anything.

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
  •