Page 1 of 3 123 LastLast
Results 1 to 25 of 56

Thread: Trying to get the bot to ChopTree for me

  1. #1
    Join Date
    Dec 2010
    Location
    Hawaii
    Posts
    612
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Trying to get the bot to ChopTree for me

    I have this so far http://paste.villavu.com/show/v5vRobQEY4pI9YwqHyK7/
    I want it to ChopTree until(InvFull)
    Bank and repeat
    Tell me how to do this and which commands and where to put what, cause I mess things up a lot.
    Thanks.

  2. #2
    Join Date
    Nov 2010
    Location
    Australia
    Posts
    1,472
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    offtopic: I would recommend you making some other script such as superheater/alcher to get used to some of the commonly used functions(thats how i started off).

    ontopic: In your script, all you're doing is getting the co-ords of the tree, after that you need to click the tree, so you use mouse(x, y....), then use repeated loops to click the tree if you're not woodcutting.

  3. #3
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    I also made woodcutter as first script. It's quite a challenge. The hardest part is making an 'waitWhileCutting' function. Is it crowded where you are cutting? Else I suggest looking in SRL animation.scar.
    Working on: Tithe Farmer

  4. #4
    Join Date
    Dec 2010
    Location
    Hawaii
    Posts
    612
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    No, I'm a member, so it's easier for me. Right now having trouble with banking IDK where to put it, this is what I have so far
    http://paste.villavu.com/show/8ImCvwiqRQORIVhsnB5w/
    And how easy is an alcher?

  5. #5
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    here is a little help with the tree finding
    Simba Code:
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      CurrentPlayer := 0;
      NumberOfPlayers(HowManyPlayers);

      with Players[0] do
      begin
        Name := '*********';
        Pass := '*********';
        Nick        := '';
        Pin := '*********'; // Bank Pin
        Member      := True;
        Active      := True;
      end;
    end;

    function FindTree: Boolean; // i suggest you change this to a function
    Var
      TreeLocation :Tpoint;
    begin
      if not LoggedIn then Exit; // this is good practice, and helps not causing infinite loops

      if (FindColorTolerance(TreeLocation.x, TreeLocation.y, 1324067, MSX1, MSY1, MSX2, MSY2, 5)) then  // searches for the colour
      begin
        MMouse(TreeLocation.X, TreeLocation.Y, 0, 0); // moves to the exact point the correct colour is found
        if (WaitUpTextMulti(['Tree', 'ree', 'etc'], RandomRange(400, 550))) then  // searches for correct uptext,
        begin                                                                     // need a wait as uptext doesnt appear right away
          Result := True;
          writeln('Successfully found and clicked a tree');
          Exit
        end else
        begin
          Result := False;
          writeln('FindColor true but uptext false, Result := False');
          Exit;
        end
     end else
     begin
       Result := False;
       writeln('Could not find the correct colour, Result := False');
       Exit;
     end;
    end;


    end;

    begin
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      FindTree;
    end.

    i tried to explain it as i went, is should work but its just an idea i hope it helps



  6. #6
    Join Date
    Dec 2010
    Location
    Hawaii
    Posts
    612
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    I need help with banking, where do I put the const
    Bank_DR = 'db' ; // (Draynor Bank), and Bonfield changing right now.

    1. Got this now. But when I put play it opens tab with bank includes.http://paste.villavu.com/show/TZIRDwMuZi3H2SYrEgbG/
    Last edited by Huthaifah; 07-11-2011 at 08:56 AM.

  7. #7
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    can you post what you have?

    i would also suggest using TPointArrays for finding the trees, it will be alot more accurate, it is like creating a list(array) of tpoints where correct colours are found instead of just one single colour

    there are alot of good tutorial on this

    about the banking that would depend on how you have writen your banking procedure



  8. #8
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Quote Originally Posted by Huthaifah View Post
    No, I'm a member, so it's easier for me. Right now having trouble with banking IDK where to put it, this is what I have so far
    http://paste.villavu.com/show/8ImCvwiqRQORIVhsnB5w/
    And how easy is an alcher?
    I'm sorry. Don't understand you. Why is it easier cause you're a member? Also banking is just:
    OpenBank('db',True);
    Working on: Tithe Farmer

  9. #9
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    1. Got this now. But when I put play it opens tab with bank includes.
    i dont understand this? when you press play it plays with bank tabs or inventory tabs? and what do you mean bank includes?



  10. #10
    Join Date
    Dec 2010
    Location
    Hawaii
    Posts
    612
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    No lol, on simba it opens a new tab about bank includes. like OpenBank, DepositItems, you know what I mean.

    @Master easier no bots so I can take my time and not wait for the tree to regrow.

  11. #11
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Quote Originally Posted by Huthaifah View Post
    No lol, on simba it opens a new tab about bank includes. like OpenBank, DepositItems, you know what I mean.

    @Master easier no bots so I can take my time and not wait for the tree to regrow.
    You don't understand me, you need something like this:

    Simba Code:
    repeat
      repeat
       ClickTree;
       WaitWhileCutting;
      until(InvFull);
      Bank;
    until(loadsdone = loadsyouwanttobedone);
    Working on: Tithe Farmer

  12. #12
    Join Date
    Dec 2010
    Location
    Hawaii
    Posts
    612
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Is it possible for one of you guys to take over my computer and show me how this goes?

  13. #13
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    taking over your computer wont really help

    something that helps me make scripts is planning

    eg
    Code:
    willow banker
    
    start off in bank
    check levels and if axe is equiped
    if equiped walk to trees, if not search bank for one
    when character is at the tree find and cut
    wait until full
    repeat
    i write something like that, then make my procedures/functions to suit, doing this may or may not help you with your logic

    did you understand the tree finding function i posted for you?

    can you post everything you have made, i will try to help you

    or you can go on irc
    Last edited by Bonfield; 07-11-2011 at 09:25 AM.



  14. #14
    Join Date
    Nov 2010
    Location
    Australia
    Posts
    1,472
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Huthaifah View Post
    And how easy is an alcher?
    The alcher im using currently using to lvl up mage on my pure is about 60 lines with failsafe(with an 'ok' antiban). but since you want to utilise banking, you should make a superheater or smelter(use reflection to make things easy for yourself at the start)

  15. #15
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    i would suggest learning colour then reflection, another good idea is to read scripts to see how people use the srl include

    the script ma seem hard if you look at it like one massive piece of code, try to break it up into sections



  16. #16
    Join Date
    Dec 2010
    Location
    Hawaii
    Posts
    612
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Thanks, I want my bot to do wat you said Bonfield.....

  17. #17
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by Bonfield View Post
    i would suggest learning colour then reflection, another good idea is to read scripts to see how people use the srl include

    the script ma seem hard if you look at it like one massive piece of code, try to break it up into sections
    That's always what I tell people to do for the best way of learning to script, look at example scripts people have made, look at how they do it. I find this to be a much faster learning process than reading tutorials.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  18. #18
    Join Date
    Dec 2010
    Location
    Hawaii
    Posts
    612
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    All of the draynor woodcutters are old . Help me fix this error, [Error] (6:1): Duplicate identifier 'Bank_DR' at line 5
    Compiling failed.


    http://paste.villavu.com/show/OE0tK3EGnOZaLNJxHsMu/

  19. #19
    Join Date
    Sep 2010
    Location
    Finland
    Posts
    299
    Mentioned
    8 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by Huthaifah View Post
    All of the draynor woodcutters are old . Help me fix this error, [Error] (6:1): Duplicate identifier 'Bank_DR' at line 5
    Compiling failed.


    http://paste.villavu.com/show/OE0tK3EGnOZaLNJxHsMu/
    It gives that because there is already a constant Bank_DR in bank.scar. You should change it to something else.

    Code:
    const
      Bank_FE = 'feb'; // (Falador East Bank)
      Bank_FW = 'fwb'; // (Falador West Bank)
      Bank_VE = 'veb'; // (Varrock East Bank)
      Bank_VW = 'vwb'; // (Varrock West Bank)
      Bank_GE = 'geb'; // (Varrock GE Bank)
      Bank_DR = 'db' ; // (Draynor Bank)
      Bank_AK = 'akb'; // (Al-Kharid Bank)
      Bank_EV = 'eb' ; // (Edgeville Bank)
      Bank_CT = 'ctb'; // (Catherby bank)
      Bank_CM = 'clt'; // (Camelot bank)
      Bank_NA = 'nab'; // (North Ardougne bank)
      Bank_SA = 'sab'; // (South Ardougne bank)
      Bank_YN = 'ynb'; // (Yanille bank)
      Bank_NG = 'ngb'; // (North gnome bank)
      Bank_SG = 'sgb'; // (South gnome bank)
      Bank_WG = 'wgb'; // (Warrior guild bank)
      Bank_FG = 'fgb'; // (Fishing guild bank)
    Rusting away

  20. #20
    Join Date
    Aug 2007
    Location
    Hawaii
    Posts
    3,880
    Mentioned
    7 Post(s)
    Quoted
    152 Post(s)

    Default

    Quote Originally Posted by Huthaifah View Post
    All of the draynor woodcutters are old . Help me fix this error, [Error] (6:1): Duplicate identifier 'Bank_DR' at line 5
    Compiling failed.


    http://paste.villavu.com/show/OE0tK3EGnOZaLNJxHsMu/
    You don't really need that as a const. And also don't half ass the script and expect it to compile.

    Have the tree detection ready and completed 100%
    then
    Have it chop the tree and make sure its chopped or being chopped.
    then
    wait till full inventory and have it count the items.
    THEN
    Work on banking.

    And don't forget walking. Continue reading tutorials. Read them 50000 times until you get it. Also look at other similar scripts. They don't have to be woodcutters, they could be miners that have the same concept.

    Also don't say "help me" after each little error. Please try and figure it out.

    But I like your progress.
    Last edited by kingarabian; 07-11-2011 at 05:20 PM.
    Faith is an oasis in the heart which will never be reached by the caravan of thinking.

  21. #21
    Join Date
    Dec 2010
    Location
    Hawaii
    Posts
    612
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    The only updated tutorial is c0h3ns and he doesn't talk about this stuff..

  22. #22
    Join Date
    Mar 2007
    Location
    USA
    Posts
    1,433
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I hear you, try looking through the different includes in SRL for useful functions and use those instead of coding your own. It's saving me a lot of time and confusion. Then if you have specific issue, people here can help.
    I'm Silent SPY
    Secret project: 0%
    Need help? Send me a PM

  23. #23
    Join Date
    Dec 2010
    Location
    Hawaii
    Posts
    612
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    How do I add ChopTree? Or what is the function that chops the tree.

  24. #24
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Simba Code:
    function FindTreeAndChop: Boolean; // i suggest you change this to a function
    Var
      TreeLocation :Tpoint;
    begin
      if not LoggedIn then Exit; // this is good practice, and helps not causing infinite loops

      if (FindColorTolerance(TreeLocation.x, TreeLocation.y, 1324067, MSX1, MSY1, MSX2, MSY2, 5)) then  // searches for the colour
      begin
        MMouse(TreeLocation.X, TreeLocation.Y, 0, 0); // moves to the exact point the correct colour is found
        if (WaitUpTextMulti(['Tree', 'ree', 'etc'], RandomRange(400, 550))) then  // searches for correct uptext,
        begin                                                                     // need a wait as uptext doesnt appear right away
          Mouse(TreeLocation.x, TreeLocation.y, 5, 5, True);  // this is where you click the tree
          Result := True;
          writeln('Successfully found and clicked a tree');
          Exit
        end else
        begin
          Result := False;
          writeln('FindColor true but uptext false, Result := False');
          Exit;
        end
     end else
     begin
       Result := False;
       writeln('Could not find the correct colour, Result := False');
       Exit;
     end;
    end;

    Mouse(TreeLocation.x, TreeLocation.y, 5, 5, True);
    thats the part where the script will click the tree in the example i showed you, you have to write that SRL doesnt have preset functions like this

    do you understand what the code i posted is supposed to do? not saying it will work but what it is supposed to do is it checks for a colour moves the mouse to it, checks the uptext and if bot are right its clicks the tree

    i suggest read about TPA's and do the same. they can be bit hard to get your head around at first so if you would like help pm me or post here



  25. #25
    Join Date
    Dec 2010
    Location
    Hawaii
    Posts
    612
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Kk bot is working, except it keeps clicking the tree and doesn't stop until its gone. And I want to add randomness to the mouse so I Don't get banned easily. http://pastebin.com/AXWpdkUQ

Page 1 of 3 123 LastLast

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
  •