Results 1 to 7 of 7

Thread: 2 More Q's: How to Swivel When No Clicks, and how to find a Specific Item?

  1. #1
    Join Date
    Aug 2010
    Posts
    122
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default 2 More Q's: How to Swivel When No Clicks, and how to find a Specific Item?

    So, I am trying to make a woodcutter on my own.

    I've found 2 major issues:

    1: Sometimes the bot clicks in front if itself so many times, then is too far forward and all the trees are behind him... which he is missing.

    Is there some way to swivel in these circumstances? Like if it doesn't find a chop option after a wait(10000) then it swivels the screen?


    2: How do I do an invent check for a specific item? In this case, these silly wooden knots. I just want to drop them. Every time my invent is full, I'd like to just drop them. Their color is just a bit different than regular logs, so I think maybe just some sort of color check for 4088718?

    Thank you for your wonderful help villavu!
    Last edited by Mister Snow; 05-17-2012 at 08:31 PM.

  2. #2
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Post your code.

  3. #3
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Hello,

    for checking items and dropping, give this a try:

    Simba Code:
    function CheckInvColor(Color, Tol, StartSlot, EndSlot: Integer): TBooleanArray;
    var
      i: Integer;
      x, y: Integer;
      Slot: Tbox;
    begin
      if not LoggedIn then
        Exit;
      SetArrayLength(Result, 28);
      for i:= StartSlot to EndSlot do
      begin
        Result[i]:= False;
        Slot:= InvBox(i);
        if ExistsItem(i) then
          Result[i]:= FindColorTolerance(x, y, Color, Slot.x1, Slot.y1, Slot.x2, Slot.y2, Tol);
      end;
    end;

    ^ That will create an array of booleans which will tell you if the item you are searching for is in each slot. Then use this:

    Simba Code:
    var
      ToDrop: TBooleanArray;
      i: Integer;

    ...

    if InvFull then
    begin
      ToDrop:= CheckInvColor(4088718, 3, 1, 28);
      for i:= 1 to 28 do
      begin
        if ToDrop[i] then
          DropItem(i);
      end;
    end;

    ^ That will drop the item if it's marked as found from the CheckInvColor function.

    Sorry if it doesn't work, I can't test it right now :S
    Last edited by Runaway; 05-17-2012 at 09:09 PM.

  4. #4
    Join Date
    Mar 2012
    Posts
    426
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Mister Snow View Post
    So, I am trying to make a woodcutter on my own.

    I've found 2 major issues:

    1: Sometimes the bot clicks in front if itself so many times, then is too far forward and all the trees are behind him... which he is missing.

    Is there some way to swivel in these circumstances? Like if it doesn't find a chop option after a wait(10000) then it swivels the screen?


    2: How do I do an invent check for a specific item? In this case, these silly wooden knots. I just want to drop them. Every time my invent is full, I'd like to just drop them. Their color is just a bit different than regular logs, so I think maybe just some sort of color check for 4088718?

    Thank you for your wonderful help villavu!
    You can do MarkTime(T) at the start of your searching for tree procedure and somewhere in the loop put If TimeFromMark(T) >= 10000 Then MakeCompass('S')
    - My Scripts (Beginning to Update to SRL 6) -

  5. #5
    Join Date
    Feb 2012
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by alevere4 View Post
    You can do MarkTime(T) at the start of your searching for tree procedure and somewhere in the loop put If TimeFromMark(T) >= 10000 Then MakeCompass('S')
    You might not want to do that, because you could go too far south. You could try rotating the compass angle 180 degrees instead of always doing south :P

  6. #6
    Join Date
    Mar 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    For the clicking too much part, maybe you should add a random wait after each click. As for the knots (even though I never ever saw them) you should make a DTM of it, then use the method Runaway posted.
    Oh, and to add further "humanness", check if the player is animating before actually clicking. And if it is, then it is chopping, so you don't click.
    Projects Directory: http://subliment.co.cc/
    Latest News: Working on ZChopper
    ZChopper: The chopper that will chop, bank (or drop), and chop, forever (or till a random pops out)

  7. #7
    Join Date
    May 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    For the 2nd problem i would suggest something like

    Code:
    if invfull then
    if FindDTM(KnotDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
    begin
      mouse(X, Y, ?, ?, False) 
      waitoption('rop', 300)
    end;
    Something similar to that probably would work.
    Last edited by jakegran; 05-18-2012 at 05:55 PM.

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
  •