Results 1 to 7 of 7

Thread: need some script help

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

    Default need some script help

    ok my problem is that it doesnt solve randoms and i have no idea what im doing wrong any help would be appreciated

    SCAR Code:
    program hbryan1991powerchopper;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/skill/WoodCutting.scar}

    const
      //Tree Type - Tree, Oak, Willow, Maple, or Yew.
      TreeType = 'Willow';  //set this for the type of tree your gonna cut
      //Tree Colors - You may have to set these
      OakColor = 4881568;
      TreeColor = 3440752;
      WillowColor = 2582616;
      MapleColor = 2582616;
      YewColor = 2582616;
      //Loads To Do
      Loadz = 10;

    Procedure DeclarePlayers;
    Begin
     HowManyPlayers:=1; //Don't Change if you want more players just fill in their info and set their active to: True/False
     NumberOfPlayers(HowManyPlayers);
     CurrentPlayer := 0; //Player to start on

      Players[0].Name :='Username';  //Fill in your username
      Players[0].Pass :='Pass';  //Fill in your password
      Players[0].Nick :='Nick';      //2-3 letters of your username
      Players[0].Active :=True;      //Set true if you want to use this player
      Players[0].Boolean1 := True;    //Axe Settings: True=Equiped  False=InventoryFirstSlot

      NickNameBmp:=CreateBitMapMaskFromText(Players[CurrentPlayer].Nick,UpChars);
    End;

    var
    Ix, Iy, LoadzDone, wclvl, logz: Integer;

    //////////////////////////////
    Const VersionNum = '1.17';  //
    //////////////////////////////

    function FindFastRandoms: Boolean; //By WT-Fakawi.
    var
      i: Integer;
    begin
      for i := 1 to 8 do
      begin
        case I of
          1: if FindDead then
              Result := True;
          2: if FindMod then
              Result := True;
          3: if FindMime then
              Result := True;
          4: if FindMaze then
              Result := True;
          5: if FindQuiz then
              Result := True;
          6: if FindDemon then
              Result := True;
          7: begin
              if NoGameTab then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'No GameTab';
                Logout;
                Exit;
              end;
            end;
          7: begin
              if InBlack then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'InBlack';
                Logout;
                Exit;
              end;
            end;
          8: RC;
        end;
        wait(1);
      end;
    end;

    procedure FindRandoms;
    begin
      FindFastRandoms;
      FindNormalRandoms;
      If (FindFight) Then RunAwayDirection('N');
    end;

    Procedure AntiBanage;
    Begin
      if(not(LoggedIn))then
      Exit;
      case Random(5) of
        0: Begin
           GameTab(2);
           HoverSkill('Woodcutting', false);
           GameTab(4);
           End;
        1: PickUpMouse;
        2: GameTab(1 + Random(12));
        3: MouseBox(MSX1,MMY1,MMX2,MMY2,5);
        4: SleepAndMoveMouse(3000+random(2000));
      end;
    end;

    function FindObjMultiText2(var cx, cy: Integer; Ut1, UT2, UT3: string; color,
      tolerance: Integer): Boolean;
    var
      x, y, a, c, i, x1, y1, x2, y2: Integer;
    begin
        Color := Color;
      if (FindColorTolerance(x, y, color, msx1, msy1, msx2, msy2, tolerance)) then
      begin
        x1 := 245;
        y1 := 165;
        x2 := 277;
        y2 := 185;
        repeat
          if (not (Loggedin)) then
            Break;
          a := a + 1;
          if (a = 1) or (a = 3) then
            c := c + 1;
          for i := 1 to c do
          begin
            if (a = 1) then
            begin
              x1 := x1 + 30;
              x2 := x2 + 30;
            end
            else if (a = 2) then
            begin
              y1 := y1 - 20;
              y2 := y2 - 20;
            end
            else if (a = 3) then
            begin
              x1 := x1 - 30;
              x2 := x2 - 30;
            end
            else if (a = 4) then
            begin
              y1 := y1 + 20;
              y2 := y2 + 20;
            end;
            if (x1 = 485) and (x2 = 517) then
              x2 := x2 - 2;
            if (y1 = 325) and (y2 = 345) then
              y2 := y2 - 7;
            if (x2 > 515) then
              Break;
            if (FindColorTolerance(x, y, Color, x1, y1, x2, y2, tolerance)) then
            begin
              MMouse(x, y, 0, 0)
              Wait(10);
                cx := x;
              cy := y;
              if (IsUpTextMulti(UT1, UT2, UT3)) then
              begin
                Result := True;
                Break;
              end;
            end;
          end;
          if (a = 4) then
            a := 0;
        until (x2 > 515) or (Result = True);
      end;
    end;


    Procedure ProgReport;
    Begin
      Cleardebug;
      wclvl:= Getskilllevel('Woodcutting')
      logz := logz;
      WriteLn('//////////////////////////////////////////////////')
      WriteLn('| hbryan1991 PowerCutter');
      WriteLn('| Version: '+VersionNum);
      WriteLn('| Logs Cut: '+IntToStr(logz)+'.');
      WriteLn('| Loads Dropped: '+IntToStr(LoadzDone)+'.');
      Writeln('| Worked for '+ TimeRunning);
      WriteLn('//////////////////////////////////////////////////')
      SRLRandomsReport;
    End;

    Procedure drop;
    Begin
    If(Players[CurrentPlayer].Boolean1 = True)Then
     Begin
      Dropall;
      LoadzDone := LoadzDone+1;
      Logz := Logz+28;
     End;
    If(Players[CurrentPlayer].Boolean1 = False)Then
     Begin
      DropTo(2,28);
      LoadzDone := LoadzDone+1;
      Logz := Logz+27;
     End;
    ProgReport;
    End;

    //->Ent Checker<-//     //credit  Fourscape
    Var
      EX, EY : integer;
      FX, FY : integer;
    Procedure EntChecker;
    Begin
      Status('Checking For Ent')
      Flag;
      If (FindObjMultiText(EX, EY, TreeType, TreeType, TreeType, Treecolor, 4)) then
      Begin
        MMouse(Ex, EY, 0, 0)
          If FindColorTolerance( FX, FY, 55769, 85, 15, 115, 15, 20) then
          Begin
            Status('Ent Found');
            MouseFindFlag(648,83,5,5);
            Wait(15000+Random(5000));
            EntsAvoided := EntsAvoided + 1
          end;
       end;
    end;

    Procedure Tree;
    Begin
    GameTab (4);
     Repeat
      If FindObjMultiText2(Ix, Iy, 'Tre', 'ree', 'ee', TreeColor, 5) then
       Mouse (Ix, Iy, 0, 0, True);
       FindRandoms;
       AntiBanage;
       FindHead;
       EntChecker;
       wait(2500+random(500));
     Until(invcount = 28);
     drop;
    End;

    Procedure OakTree;
    Begin
    GameTab (4);
     Repeat
      If FindObjMultiText2(Ix, Iy, 'Oa', 'ak', 'Oak', OakColor, 5) then
       Mouse (Ix, Iy, 0, 0, True);
       FindRandoms;
       AntiBanage;
       FindHead;
       EntChecker;
       wait(2500+random(500));
     Until(invcount = 28);
     drop;
    End;

    Procedure WillowTree;
    Begin
    GameTab (4);
     Repeat
      If FindObjMultiText2(Ix, Iy, 'Wil', 'ill', 'low', WillowColor, 5) then
       Mouse (Ix, Iy, 0, 0, True);
       FindRandoms;
       AntiBanage;
       FindHead;
       EntChecker;
       wait(2500+random(500));
     Until(invcount = 28);
     drop;
    End;

    Procedure MapleTree;
    Begin
    GameTab (4);
     Repeat
      If FindObjMultiText2(Ix, Iy, 'Map', 'apl', 'ple', MapleColor, 5) then
       Mouse (Ix, Iy, 0, 0, True);
       FindRandoms;
       AntiBanage;
       FindHead;
       EntChecker;
       wait(2500+random(500));
     Until(invcount = 28);
     drop;
    End;

    Procedure YewTree;
    Begin
    GameTab (4);
     Repeat
      If FindObjMultiText2(Ix, Iy, 'Ye', 'ew', 'Yew', YewColor, 5) then
       Mouse (Ix, Iy, 0, 0, True);
       FindRandoms;
       AntiBanage;
       FindHead;
       EntChecker;
       wait(2500+random(500));
     Until(invcount = 28);
     drop;
    End;

    Begin

     SetupSRL;
     activateclient;
     ClearDebug;
     ProgReport;
     DeclarePlayers;
     LoadzDone := 0;


     If(not(LoggedIn)) then
       LoginPlayer;
        setchat('off',3);
        setchat('off',2);
        makecompass('N')
        highestangle;
        FindAxeHeadColor;
    Repeat

     If(LoadzDone = Loadz)Then
     Begin
      NextPlayer(True);
     End;

     If (TreeType = 'Tree') Then
     Begin
      Tree;
     End;

     If(TreeType = 'Oak')Then
     Begin
      OakTree;
     End;

     If(TreeType = 'Willow')Then
     Begin
      WillowTree;
     End;

      If(TreeType = 'Maple')Then
     Begin
      MapleTree;
     End;

      If(TreeType = 'Yew')Then
     Begin
      YewTree;
     End;

     until(False);

    End.

  2. #2
    Join Date
    Jun 2007
    Posts
    107
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    srry about that i couldnt figureout the scar tag thing

  3. #3
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Make sure you have your nickname set correctly.. Otherwise the anti-randoms wont work. and its not [/scar] its
    [*ode]
    [/code]

  4. #4
    Join Date
    May 2006
    Location
    Qld, Australia
    Posts
    223
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Edit your first post instead of double posting next time,


    Okay, Your script doesnt find randoms very well because, It searches for randoms right after it clicks the tree then it Waits(2500 + Random(500)) so in that 2.5-3 seconds it wouldn't check for randoms, Try something like
    SCAR Code:
    procedure WaitOut;
    var
      TMark: Integer;
    begin
      MarkTime(TMark);
      repeat
        FindRandoms;
        AntiBanage;                       //Will Search for randoms until the time from the marker 'TMark' is larger then 2500 + Random(500) or the Inventory is Full
        EntChecker;
      until((TimeFromMark(TMark) >= (2500 + Random(500))) or InvFull);
    end;
    Haven't scripted in a while, Willing to proofread, test and provide feedback.

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

    Default

    Actually it is SCAR...he needs to have [Scar] at the beginning.

    Edit:
    SCAR Code:
    procedure WaitOut;
    var
      TMark: Integer;
    begin
      MarkTime(TMark);
      repeat
        FindRandoms;
        AntiBanage;                       //Will Search for randoms until the time from the marker 'TMark' is larger then 2500 + Random(500) or the Inventory is Full
        EntChecker;
      until((TimeFromMark(TMark) >= (2500 + Random(500))) or InvFull);
    end;

    That probably wouldn't work. The InvFull isn't really efficient because when you chop a tree it doesn't always fill the full inventory...

    SCAR Code:
    procedure WaitOut;
    var
      TMark: Integer;
    begin
      MarkTime(TMark);
      repeat
        FindRandoms;
        AntiBanage;                       //Will Search for randoms until the time from the marker 'TMark' is larger or equal to then 2500 + Random(500) or the Inventory is Full
        EntChecker;
        if (InvFull) then Exit;
      until((TimeFromMark(TMark) >= (2500 + Random(500))));
    end;

    I also edited the green comments, Kevin had them wrong.
    [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]

  6. #6
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh, i didnt know you code do scar.. I always just put code

  7. #7
    Join Date
    Jun 2007
    Posts
    107
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok im gonna try out what you guys said sorry for the double post and thanks again for the response

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
  •