Results 1 to 14 of 14

Thread: woodcutting bug

  1. #1
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default woodcutting bug

    im making a reflection powecutter(i wanna be as cool as cycro )

    and this is my little "practice" cutter, since its actually the first time i have ever made one. the problem is, is that it keeps clicking the tree, although it should be breaking out of the loop and wait when it clicks.

    SCAR Code:
    Function Chopwillow: boolean;
    var
      T : tpointarray;
      i, x, y: integer;
    begin
      result:= true;
      repeat
        if not loggedin then exit;
        ColorToleranceSpeed(3);
        FindColorsSpiralTolerance(MSCX, MSCY, T, 6063478, MSX1, MSY1, MSX2, MSY2, 15);
        if Length(T) = 0 then
        begin
          writeln('color not found');
          result:= false;
          exit;
        end;
        for i:= 0 to high(t) do
        begin
          mmouse(T[i].X, T[i].Y, 0, 0);
          if isuptext('illow') then
          begin
            getmousepos(x, y);
            mouse(x, y, 0, 0, true);
            wait(100 + random(2000));
            break;
          end;
          While (CharacterMoving or CharacterAnimating) do AntiBan;
            if invfull then exit;
        end;
      until invfull or result = false;
      if not result then
        writeln('Something has gone wrong, willows not found.');
    end;
    Last edited by Awkwardsaw; 08-06-2009 at 10:24 AM.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  2. #2
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    SCAR Code:
    While (CharacterMoving or CharacterAnimating) do AntiBan;
            if invfull then exit;

    That part is inside the for loop, so it isn't being executed if the first point is on a tree. Move it outside of the end beneath it and it should wait.
    :-)

  3. #3
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    o wait, i moved it there after i posted. sorry haha this is what i actually had(editing now)

    SCAR Code:
    for i:= 0 to high(t) do
        begin
          mmouse(T[i].X, T[i].Y, 0, 0);
          if isuptext('illow') then
          begin
            getmousepos(x, y);
            mouse(x, y, 0, 0, true);
            wait(100 + random(2000));
            break;
          end;
          While (CharacterMoving or CharacterAnimating) do AntiBan;
            if invfull then exit;
        end;
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  4. #4
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    It still looks the same. Like I said, move that piece of code beneath the end that is beneath it.
    :-)

  5. #5
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by Method View Post
    It still looks the same. Like I said, move that piece of code beneath the end that is beneath it.
    oo ffs. i got ya,

    testing now haha

    edit: nope, im guessing it has to do with break? unless im still not getting it haha

    SCAR Code:
    for i:= 0 to high(t) do
        begin
          mmouse(T[i].X, T[i].Y, 0, 0);
          if isuptext('illow') then
          begin
            getmousepos(x, y);
            mouse(x, y, 0, 0, true);
            wait(100 + random(2000));
            break;
          end;
            if invfull then exit;
        end;
        While (CharacterMoving or CharacterAnimating) do AntiBan;
      until invfull or result = false;
    Last edited by Awkwardsaw; 08-06-2009 at 10:32 AM.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  6. #6
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Try this:

    SCAR Code:
    for i := 0 to High(t) do
        begin
          MMouse(T[i].X, T[i].Y, 0, 0);
          if IsUpText('illow') then
          begin
            GetMousePos(x, y);
            Mouse(x, y, 0, 0, True);
            Wait(100 + Random(2000));
            While (CharacterMoving or CharacterAnimating) do AntiBan;
          end;
          if InvFull then Exit;
        end;
      until(InvFull or (Result = False) or not LoggedIn);

    Hopefully that works.

  7. #7
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    You just need 1 more break; ...
    SCAR Code:
    for i:= 0 to high(t) do
        begin
          mmouse(T[i].X, T[i].Y, 0, 0);
          if isuptext('illow') then
          begin
            getmousepos(x, y);
            mouse(x, y, 0, 0, true);
            wait(100 + random(2000));
            break;
          end;
            if invfull then exit;
          Break;
        end;
        While (CharacterMoving or CharacterAnimating) do AntiBan;
      until invfull or result = false;
    Should fix it I believe..you just needed to exit the for..to..do loop.

  8. #8
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    so, the break exited out of the begin-end, not the loop? and +rep
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  9. #9
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    Break should only exit out of loops.
    :-)

  10. #10
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by Method View Post
    Break should only exit out of loops.
    thats what i thought i havnt tested yet lol
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  11. #11
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    hm, nope. neither of them worked lol =\
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  12. #12
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    Perhaps you should make sure your hooks are updated, and then post your script if things still aren't working.
    :-)

  13. #13
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    z0mg, i didnt even think of that.

    edit:

    SCAR Code:
    program New;
    {.include SRL/SRL/Misc/Smart.scar}
    {.Include SRL/SRL.scar}
    {.include srl/srl/reflection/reflection.scar}

    procedure DeclarePlayers;
    begin
      //To add more players, copy and paste the player set up
      //and change numbers accordingly
      //remember to change HowManyPlayers!
     
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      with Players[0] do
      begin
        Name := 'grody';
        Pass := '';
        Nick := 'rod';
        Active := True;
        Integers[0] := 10;  //loads, not currently used
        Integers[1] := 20; //what SMART world would you like to go on?
        Booleans[0] := false; //weilding hatchet?
        Strings[0] := 'willow'; //what logs do you want to cut, not currently used
        BoxRewards := ['XP', 'ostume'];
      end;
     
    end;

    var logs, xp: integer; exp: extended;

    procedure AntiBan;
    begin
      R_FindRandoms;
      wait(100 + random(2000));
      case random(30) of
        0: Gametab(1+random(13));
        2: wait(1000 + random(3000));
        3: begin
             MakeCompass(IntToStr(random(361)));
             SleepAndMoveMouse(1000+random(500));
             MakeCompass(IntToStr(random(361)));
           end;
        end;
      gametab(tab_inv);
      MakeCompass(0);
    end;

    Function Chopwillow: boolean;
    var
      T : tpointarray;
      i, x, y, d: integer;
    label goback;
    begin
      result:= true;
      d:= 0;
      repeat
        if not loggedin then exit;
        ColorToleranceSpeed(3);
        FindColorsSpiralTolerance(MSCX, MSCY, T, 6063478, MSX1, MSY1, MSX2, MSY2, 15);
        if Length(T) = 0 then
        begin
          writeln('color not found');
          result:= false;
          exit;
        end;
        for i:= 0 to high(t) do
        begin
          mmouse(T[i].X, T[i].Y, 0, 0);
          if isuptext('illow') then
          begin
            getmousepos(x, y);
            mouse(x, y, 0, 0, true);
            wait(100 + random(2000));
            goback:
            While (CharacterMoving or CharacterAnimating) do AntiBan; //
            if not (CharacterMoving or CharacterAnimating) then    //
            begin                                                //
              wait(100 + random(400));                            //
              inc(d);                                             //all added to
              writeln(inttostr(d));                               //help debug
              if d > 5 then exit;                                 //
              goto goback;                                        //
            end;
            break;
          end;
            if invfull then exit;
          Break;
        end;
        While (CharacterMoving or CharacterAnimating) do AntiBan;
      until invfull or result = false;
      if not result then
        writeln('Something has gone wrong, willows not found.');
    end;

    procedure DropLogs;
    var c: integer;
    begin
      if not loggedin then exit;
      if not invfull then exit;
      if players[CurrentPlayer].booleans[0] then
      begin
         dropall;
         incex(logs, 28);
         exp:= logs * 67.5
         xp:= round(exp);
      end;
      if not players[CurrentPlayer].booleans[0] then
      begin
        for c:= 2 to 28 do
          DropItem(c);
        incex(logs, 27);
        exp:= logs * 67.5
        xp:= round(exp);
      end;
    end;

    begin
      DeclarePlayers;
      Smart_Server := players[currentplayer].Integers[1];
      SetupSRL;
      mousespeed:= 10;
      if not loggedin then loginplayer;
      while not gametab(tab_inv) do wait(10);
      setangle(true);
      Chopwillow;
      DropLogs;
    end.

    i changed stuff around to help debug it, hopefully it didnt fuck it up lol

    edit edit: is it me or does chooseoption not work in SMART?
    Last edited by Awkwardsaw; 08-07-2009 at 04:50 AM.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  14. #14
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    ok, sorry for double post but i am an IDIOT

    hooks wherent updated, i forgot to add setupreflection in the main loop.

    +rep for method fo sho
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

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
  •