Results 1 to 20 of 20

Thread: Help with finding a tree

  1. #1
    Join Date
    May 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default finding ... a .... tree....

    Hi i was wondering if anyone could please look over this script im trying to make to cut logs in seers ... atm its set to drop trying to find out how to do banking so ill be sorting that soon but atm it wont even find the trees even tho i use ACA to sort out the TreeColor part anyways .... heres the code any tips would be greatly appreciated a soloution even more so lol

    Thanks in advance peeps

    P.S the script may be a little messy ...i tried to keep it tidy lol

    Simba Code:
    program MapleTreeCutter;

    {$DEFINE SMART}
    {$i srl\srl.simba}

    Const
      BreakEvery        =120;    // How Many Minutes To Break After
      BreakFor          =5;      // How Many Minutes To Break For
      VersionNumber     ='1.0';  // Current Version
      StartPlayer       =0;      // Player To Start Chopping With

    var
    TooLong:Integer;

    procedure DeclarePlayers;
    begin
       HowManyPlayers:= 1;                // Number Of Players
       NumberOfPlayers(HowManyPlayers);
       CurrentPlayer:= 0;

       Players[0].Name:='';      // Runescape Username
       Players[0].Pass:='';       // Runescape Password
       Players[0].Nick:='';               // Players Nickname 3-4 Letters Of Characters Username
       Players[0].active:=True;
    end;

    Procedure StatsGuise(wat:string);
    Begin
      Status(WAT);
      Disguise(wat);
    end;
    Procedure AntiBan;
    Begin
      Case Random(250) of
      0: Begin StatsGuise('AntiBan')GameTab (Tab_Stats) HoverSkill('WoodCutting', False) GameTab(28) End;  //AntiBan measure hovers over woodcutting skill
      1: Begin StatsGuise('AntiBan')SleepAndMoveMouse(700+Random(550)); End;                               //AntiBan measure moves the mouse around randomly for 7 seconds
      2: Begin StatsGuise('AntiBan')GameTab (Tab_Inv) ExamineInv; GameTab(28) End;                         //AntiBan measure examines a random item in invent
      3: Begin StatsGuise('AntiBan')RandomAngle(1); End;                                                   //AntiBan measure changes camara angle
      4: Begin StatsGuise('AntiBan')GameTab (Tab_Stats); Wait(3000+Random(550)); GameTab(28); End;         //AntiBan measure shows stats tab
      5: Begin StatsGuise('AntiBan')GameTab (Tab_Stats) HoverSkill('Random', False) GameTab(28) End;       //AntiBan measure hovers over a random skill in stats tab
      End;
    End;

    Procedure FailSafe(Reason:String);
    Begin
      Logout;
      Stats_Commit;
      TerminateScript;
    End;

    Function TreeColor: Integer;
    Var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    Begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.20, 0.91);

      if not (FindColorsTolerance(arP, 2701132, MSX1, MSY1, MSX2, MSY2, 11)) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      End;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      For i := 0 to arL Do
      Begin
        Result := arC[i];
        Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      End;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      If (i = arL + 1) Then
        Writeln('AutoColor failed in finding the color.');
    End;


    function ChopTree: Boolean;
    var
      x, y, PlusOne, TreeCounter, TooLong: Integer;
    Begin
      MarkTime(TooLong);
      FindNormalRandoms;
      PlusOne:=InvCount+1;
      x:=MSCX
      y:=MSCY
      If FindObjTPA(x, y, TreeColor, 5, 2, 15, 75, 250, ['Maple']) Then
      Begin
        StatsGuise('Hooray We Found A Tree');
        GetMousePos(x, y);
        Case Random(2) Of
          0:Mouse(x, y, 5, 5, True);
          1:Begin
              Mouse(x, y, 5, 5, False);
              WaitOption('Chop', 500);
            End;
        End;
      End;
      Flag;
      If (TimeFromMark(TooLong)>30000)Then
      Begin
        Failsafe('Could not find tree');
        MarkTime(TreeCounter);
      End;
      Repeat
        FindNormalRandoms;
        StatsGuise('anti ban and waiting');
        AntiBan;
        Wait(1000);
        If InvCount = PlusOne Then
          WriteLn('OK who took a shit in the bag ??');
       Until ( ( InvCount = PlusOne) Or (TimeFromMark(TreeCounter) > 7000));
    End;


    Procedure DropLogs;
    var
    x, y, LogDTM, I:Integer;
    SlotBox:TBox;
    LogPattern:TIntegerArray;

    Begin
      FindNormalRandoms;
      MarkTime(TooLong);
      LogDTM := DTMFromString('mqAEAAHicrczRCoJQDMbx75wI9b7X8A2CUBQpiEBQwve/FzUQysi/uMsuz+C3jW3sJOnupQo5LjibDAWueKBBZ55ozTav/f7nhg8/JzNjwcFJR8SIrN9mDl/2b7t9YUBvdUSZJmQfzE9hwwX2L1ZNvRSG');
      LogPattern := [1, 2, 3, 4, 8, 7, 6, 5, 9, 10, 11, 12, 16, 15, 14, 13, 17, 18, 19, 20, 24, 23, 22, 21, 25, 26, 27, 28];

      For I:=0 To 27 Do
      Begin
        FindNormalRandoms;
        StatsGuise('Taking A Dump:' + IntToStr(I));
        SlotBox:= InvBox(LogPattern[I]);
        If FindDTM(LogDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
          Begin
            MouseItem(LogPattern[I], mouse_right);
            ChooseOption('Dro');
          End;
      End;
    End;
    Begin
      SetUpSRL;
      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      SetAngle(1);
      Repeat;
        ChopTree;
        If InvFull Then
        DropLogs;
      Until(false);
    End.
    Last edited by jhony6180; 05-23-2012 at 08:07 PM.

  2. #2
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Remove
    Simba Code:
    GetMousePos(X, Y)
    from ChopTree


    ~Home

  3. #3
    Join Date
    May 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks i shall go try that now

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

    Default

    Quote Originally Posted by Home View Post
    Remove
    Simba Code:
    GetMousePos(X, Y)
    from ChopTree


    ~Home
    Nah still not working .. jsut keeps comin up with all this at the bottom


    AutoColor = 3621731
    AutoColor = 3621731
    AutoColor = 3621731
    AutoColor = 3621731
    AutoColor = 3621731
    AutoColor = 2963282
    AutoColor = 2963282

  5. #5
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Didn't like your first thread?
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  6. #6
    Join Date
    May 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lmao ... well ... ya see ... i figured more threads will be posted so post again to amke sure peeps can still see ... that way it ensures i may be able to get the help i need rather than waiting for peeps to go through multipole pages trying to find the other thread :P

  7. #7
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    ITs only a few threads down... Instead of bumping you wasted our time more with another thread.

  8. #8
    Join Date
    May 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    bumping ?!?

  9. #9
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Pick a thread...

    Still I don't get what you are asking. do you mean

    Code:
     If FindObjTPA(x, y, TreeColor, 5, 2, 15, 75, 250, ['Maple']) Then
    doesn't find anything?

  10. #10
    Join Date
    May 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol basically ... when i rn the script ... the mouse doesnt move to find the trees... i watched yohojo's tutorial ya know for ABSOLOUt beginners ... the i thought i would build from that script to make it cut maples instead of bog standard trees ... now its just not looking for the trees at all it worked at first with the FindObjCustom ... but now i changed it to FindObjTPA it wont even look for the trees ... it just its there for ages doing antiban lol

    maybe u could try running the script in simba and see woot i mean its hard to explain since im a scripting noob :P


    EDIT: if i knew a program to use i would make a video of it failing and post that
    Last edited by jhony6180; 05-24-2012 at 11:09 AM.

  11. #11
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Merged second thread, please keep it to one thread. Someone will help you out! (as you can see)
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  12. #12
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok i understand now so the line of code i posted is effectively just returning false everytime.

    http://villavu.com/forum/showthread.php?t=28248

    Have a read of that. But my initial thoughts are that the tol isn't high enough. Or the area is too small.

    I'll test it when I get home.

  13. #13
    Join Date
    May 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks i shall read through that page now and see if i can fix thanks for the help
    Would like to know the scariest film ever ..... my brother gf is in slow labour ... and we gonna scare her into labour

  14. #14
    Join Date
    Mar 2012
    Posts
    690
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Well its finding your color so it isnt anything wrong on that part, maybe your FindObjTPA got wrong values for how many pixel it searches for etc ?

  15. #15
    Join Date
    May 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    If FindObjTPA(x, y, TreeColor, 5, 2, 15, 75, 250, ['Maple']) Then

    so basically the problem is in this line .... and i should change the pixels from 250 .... ill try and make it like 500 and see if that helps



    Also this is a link to a vid on yt of exactly what it does when i click play

    https://www.youtube.com/watch?v=b1g1dp3RDP0
    Would like to know the scariest film ever ..... my brother gf is in slow labour ... and we gonna scare her into labour

  16. #16
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Best way to solve most problems... TEST!! give it a go. I'm not fluid enough with Simba yet to do it in my head. But I'll test it when I get home for you.

  17. #17
    Join Date
    May 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lmao thanks im testing n testing still trying to figure it out

    i refue to just sit waiting for replies to the thread here ....

    been trying to figure it out for almost 2 days now tho so decided it was time to try find help
    Would like to know the scariest film ever ..... my brother gf is in slow labour ... and we gonna scare her into labour

  18. #18
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Good attitude, look at some tuts in the tutorial section. I remember TPA's giving me headaches...

  19. #19
    Join Date
    May 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by [S]paz View Post
    Good attitude, look at some tuts in the tutorial section. I remember TPA's giving me headaches...

    lmao headaches .... .more like migrains lol before i posted i was expenting the reply of lol
    Would like to know the scariest film ever ..... my brother gf is in slow labour ... and we gonna scare her into labour

  20. #20
    Join Date
    May 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    omg im thick as pig shit do i need to declare the TreeColor function as a variable in my chop tree part ?? like this ...

    Simba Code:
    function ChopTree: Boolean;
    var
      x, y, PlusOne, TreeCounter, TooLong: Integer;
      TreeColor: Integer;
    Begin
      MarkTime(TooLong);
      FindNormalRandoms;
      PlusOne:=InvCount+1;
      x:=MSCX
      y:=MSCY
      If FindObjTPA(x, y, TreeColor, 5, 2, 15, 75, 250, ['Maple']) Then
      Begin
        StatsGuise('Hooray We Found A Tree');
        GetMousePos(x, y);
        Case Random(2) Of
          0:Mouse(x, y, 5, 5, True);
          1:Begin
              Mouse(x, y, 5, 5, False);
              WaitOption('Chop', 500);
            End;
        End;
      End;
      Flag;
      If (TimeFromMark(TooLong)>30000)Then
      Begin
        Failsafe('Could not find tree');
        MarkTime(TreeCounter);
      End;
      Repeat
        FindNormalRandoms;
        StatsGuise('anti ban and waiting');
        AntiBan;
        Wait(1000);
        If InvCount = PlusOne Then
          WriteLn('OK who took a shit in the bag ??');
       Until ( ( InvCount = PlusOne) Or (TimeFromMark(TreeCounter) > 7000));
    End;

    EDIT: scrap that tried it and it wont compile says

    Compiling failed.
    [Error] (53:10): Duplicate identifier 'TREECOLOR' at line 52
    Compiling failed.

    EDIT2 : seems to be working ok now .... dunno what i did :S but yeah it seems to work with a lower frame rate on the smart slider at the side now i just gotta figure out how to make it bonfire the logs after cutting em and make it spin the camera when it cant find no more trees ....

    any hints on how to change camera angle ??
    Last edited by jhony6180; 05-24-2012 at 03:42 PM.
    Would like to know the scariest film ever ..... my brother gf is in slow labour ... and we gonna scare her into labour

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
  •