Results 1 to 9 of 9

Thread: PowerTreeNoober

  1. #1
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default PowerTreeNoober

    PowerTreeNoober
    Its my first Scirpt that cuts normal, oak and willows and drops

    Updates coming
    1-Progy Done
    2-I think there is a bug where it dose not stop after its done the loads I think its Done
    3-Maybe add banking

    If poeple could test out and give feedback it would be great, also if there is a bug some help on fixing it maybe thanks
    And hope you like my first ever scirpt

    Poeple please Post Proggys
    And any ideas for the next Version would be great

    Version Updates descriptions:

    PowerTreeNoober V1.1
    Added Proggy
    Changed Bits Thanks to JAD
    Added Intro
    Found a Bug and Fixed it

    PowerTreeNoober V1.2
    Kind of reworte the cut Procedure
    Made a Spin Procedure for AntiBan

    Quick Note
    LOL Nobody Downloaded V1.1 befor i uploaded V1.2
    Last edited by rya; 08-21-2009 at 04:16 AM.

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is a great first script. Much better than my first

    A few suggestions:

    Players strings 1 (the should axe be equipped) should use a boolean variable. A boolean variable can only hold two types of values: true and false. That sounds perfect in this case.

    [scar]Players[0].Booleans[0] := true; //true to equip, false for in inventory[/csar]

    For your random finding, maybe give the user an option for what to use the lamp on? You could this as a constant or you could add another string to the Players array.

    Why is Text an array of string? A normal string would work just fine there.

    In CutTree, there are a few problems near FindObjTPA:
    1) FindObjTPA moves the mouse to the object already. You do not need to call another MMouse to move there again.

    2) then, you click the mouse at a random spot around there too.

    3) Both those things combined are very unhuman and could cause you to miss the tree. You should do:

    SCAR Code:
    FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)
              //MMouse(x, y, 4, 4); Get rid of this
              GetMousePos(x,y); //Get the current mouse position, which is where
              begin                   //the tree was found
                case Random(2) of
                  0  :  begin
                          Mouse(x, y, 0, 0, False); //Click where the tree was found,
                          Wait(1500 + Random(2000)); //not a random spot near there
                          ChooseOption('hop');
                        end;
                  1  :   Mouse(x, y, 0, 0, True); //Click where the tree was found,
                                                           //not a random spot near there
                end;

    Some more adjustments to that (didn't want to cram too many comments into the above one):

    SCAR Code:
    FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)
              GetMousePos(x,y);
              //begin  //unnecessary begin/end

                //Took out the case. With 2 cases or less it actually takes more lines
                if(random(2) = 1)then
                begin
                  Mouse(x, y, 0, 0, False);
                  Wait(1500 + Random(2000));
                  ChooseOption('hop');
                end else
                  Mouse(x, y, 0, 0, True);
                Wait(4500 + Random(3000));
                AntiRandoms;
                AntiBan;
              //end; // unnecessary


    In here:

    SCAR Code:
    until (Invfull) or not FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text);
             while (not FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)) do
             Wait(1500 + Random(2000));

    You may want to drop the logs if the inventory is full before waiting until finding the tree? Do like:

    SCAR Code:
    until (Invfull) or not FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text);
            if(InvFull)then Drop; //You will need to put the drop procedure
                                        //above CutTree
             while (not FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)) do
             Wait(1500 + Random(2000));

    I would also try some MarkTimes because you do have some possible infinite loops here. For the first one (example), what if the script is finding the obj tpa but not chopping because you lost your axe, and therefore the inventory isn't filling up either? Then this loop will go on forever.

    Try creating an integer variable called Timer, and then:
    SCAR Code:
    MarkTime(Timer);
            repeat
              if(TimeFromMark(Timer) > 600000+random(100000))then
              begin
                //gone on for over 10 minutes
                Writeln('Problem chopping the logs');
                Exit; //Get out of this procedure
              end;
              SetTree;
              FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)
              MMouse(x, y, 4, 4);
              begin
                case Random(2) of
                  0  :  begin
                          Mouse(x, y, 4, 3, False);
                          Wait(1500 + Random(2000));
                          ChooseOption('hop');
                        end;
                  1  :  begin
                          Mouse(x, y, 3, 4, True);
                        end;
                end;
                Wait(4500 + Random(3000));
                AntiRandoms;
                AntiBan;
              end;
             until (Invfull) or not FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text);

    And also with your while:

    SCAR Code:
    MarkTime(Timer);
    while (not FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)) do
    begin
      Wait(1500 + Random(2000));
      if(TimeFromMark(Timer) > 20000 + random(5000))then //over 20 seconds
        break; //Get out of the loop



    Your drop procedure could be shortened a good amount:

    SCAR Code:
    procedure Drop;
    begin
      Inc(LoadsDone);
      if(lowercase(Players[CurrentPlayer].Strings[1]))then
      begin
        DropAll; //SRL function to drop everything in inventory
        IncEx(LogsCut, 28);
      end else
      begin
        for i:= 2 to 28 do
          DropItem(i);
        IncEx(LogsCut, 27);
      end;
      AntiRandoms; //Moved to bottom because you do it either way
      AntiBan;
    end;

    You also were incrementing LogsCut if Players Strings[1] wasn't true 27 times because you had it in the for loop.


    In your main loop:
    SCAR Code:
    if (not LoggedIn) then
           NextPlayer(True);

    Change NextPlayer(True); to NextPlayer(False);




    I am really impressed by some of the advanced techniques you used. I don't mean to discourage you with everything I pointed out, but you still just have a few things to work on. Keep working at it, and I'm sure you will become an SRL member sometime in the future.

    If you are interested in learning a little more advanced object finding than FindObjTPA, you may find some use in reading my tutorial: http://www.villavu.com/forum/showthread.php?t=48915

    Cheers!
    ~JAD
    Last edited by JAD; 08-20-2009 at 07:07 AM.

  3. #3
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    You don't SetTree 'normal/oak'
    The script is looking very good for a first script! Alot of "advanced" things where most new scripters make mistakes.

    Also i recommend you to check uptext/option 'hop down', because in lumbridge you might accidentally click the p2p tree and get stuck there

  4. #4
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks For the feedback, and thanks for the changes
    The Normal/Oak i was going to add but missed out sorry because it looks botty trying to find a oak

    And JAD you did not discourage and thanks for taking the time to help me

  5. #5
    Join Date
    Jun 2008
    Location
    Somewhere
    Posts
    117
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    Very nice for a first time (hmmmmm are you sure this is your first script)

  6. #6
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Ghostman View Post
    Very nice for a first time (hmmmmm are you sure this is your first script)
    Well it is my first is it that good?
    Last edited by rya; 08-20-2009 at 11:38 PM.

  7. #7
    Join Date
    Sep 2009
    Posts
    0
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    very nice

  8. #8
    Join Date
    Jun 2008
    Location
    Somewhere
    Posts
    117
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    lol of course it is

    Should have seen mine =/

  9. #9
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Grave Dig?
    It does not Work
    I see Now, says the blind man

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
  •