Results 1 to 15 of 15

Thread: Starting my first script

  1. #1
    Join Date
    Apr 2012
    Posts
    92
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default Starting my first script

    Hello guys,

    I just started writing my first script for 07scape by reading tutorials and mainly by watching the scripting video from YoHoJoSRL.

    Right now my script is only chopping the maple trees at seers village. I want to add bank later. First I need to know if the script is correct right now, I have no compile issues but still want to know if it functions right

    Simba Code:
    program MapleChopper;
       {$i SRL\SRL.simba}
       {$I SRL/SRL/Misc/Debug.Simba}
       {$I P07Include.Simba}
    const
      Version = '1,0';

    Procedure P07_DeclarePlayer;
    Begin
      P07_PlayerName:='';
      P07_PlayerPass:='';
    end;


    Function AntiBan: Boolean;

    begin
      case Random(250) of
        0: P07_HoverSkill ('woodcutting', RandomRange(2500, 4000));
        1: P07_MakeCompassSouth;
        2: MMouse(random(700), random(400), 0, 0);
        3: P07_MakeCompassEast;
        4: P07_MakeCompassWest;
        5: P07_MakeCameraAngleHigh;
      end;
    end;

    Function ChopDownMaple: boolean;
    var
      x, y, TreeCounter: Integer;
    begin
      if P07_FindObjCustom(x, y, ['Cho', 'own','p d'], [20860, 21377, 19325], 10) then
      begin
        case Random(2) of
        0: begin
            ClickMouse2(mouse_left);
            Wait(RandomRange(9000, 11000))
           end;
         1:
          begin
            ClickMouse2(mouse_right);
            P07_WaitOptionMulti(['hop', 'own'],RandomRange(200,300))
            Wait(RandomRange(9000, 11000));
            end;
         end;

        repeat
          MarkTime(TreeCounter);
          Antiban;
          Wait(100);
        Until (TimeFromMark(TreeCounter) > 7000)

      end;
    end;


    begin
      ActivateClient;
      SetupP07Include;
      P07_DeclarePlayer;
      repeat
      ChopDownMaple;
      until(false);
      TerminateScript;
    end.

    I want to know if my antiban in the function 'ChopDownMaple' works correct this way for 07scape? because I saw it in a scripting video that was 2 years old.
    And what do you think I can improve more?

    I already saw in issue with chopping. There are 4 tree's at seers village. 3 tree's pretty close to eachother and 1 tree not. If the script comes to close at the 1 tree side it can't see the other tree's anymore. How can I fix this?
    If you don't know what I mean, go to seers village.
    Last edited by juunhoad; 02-28-2013 at 01:53 AM.

  2. #2
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Antiban Procedure should work fine. The best was to see if it works is to test it, then come back and tell us how it goes

  3. #3
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Looks great to me!
    Nice work, good standards and it's logical.
    Keep it up

    Creds to DannyRS for this wonderful sig!

  4. #4
    Join Date
    Apr 2012
    Posts
    92
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default

    I changed
    Simba Code:
    2: MMouse(random(700), random(400), 0, 0);
    from the antiban to
    Simba Code:
    MMouse(RandomRange(X - 5, X + 5), RandomRange(y - 5, y + 5), 0, 0);

    Or could I keep?
    Simba Code:
    MMouse(random(700), random(400), 0, 0);?

  5. #5
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    euh make it MMouse(RandomRange(1, 500), RandomRange(1,500), 0, 0));
    or use HoverMouse

    check antiban include for more

    Creds to DannyRS for this wonderful sig!

  6. #6
    Join Date
    Apr 2012
    Posts
    92
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default

    Ok thx changed it.
    I already encoutered a problem with the antiban.
    Right now I have
    Simba Code:
    repeat
          MarkTime(TreeCounter);
          Antiban;
          Wait(100);
        Until (TimeFromMark(TreeCounter) > 7000)

    But then it will Repeat the antiban the whole time after 7 seconds, so it can't chop again. How can I changed this in to the code that it will randomly do antiban within 7-9 seconds?

  7. #7
    Join Date
    Apr 2012
    Posts
    92
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default

    Could this work?
    Simba Code:
    repeat
          MarkTime(TreeCounter);
          Antiban;
          Wait(100);
        Until (TimeFromMark(TreeCounter) = RandomRange(7000, 9000))

    EDIT: The script still keeps doing the repeat...until proces.
    It will first click on the tree, then after several seconds it will only do the antiban function because of the repeat..until and can't chop again.
    Last edited by juunhoad; 02-28-2013 at 12:41 PM.

  8. #8
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

    You have your MarkTime. In the wrong place its should be before the repeat loop.

    Right now you are marking the time inside your loop which is making it repeat forever.

    Edit:
    Could do

    If TimeFromMark(timer) > 7000 then
    Begin
    Antiban;
    MarkTime(timer);
    End;

    Add your random interval time to make it more human like
    Last edited by Mark; 02-28-2013 at 01:03 PM.

  9. #9
    Join Date
    Apr 2012
    Posts
    92
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default

    Thankyou, this is working. What would be the best TimeFromMark with the randomrange click:
    Simba Code:
    Wait(RandomRange(9000, 11000));
    because now the antiban will sometimes be right before the ClickMouse2 which looks weird. Seeing the mousemove(for antiban) and then instantly to the tree(for cutting).

    Now I have another question. How can I only make it click the tree when it's NOT cutting?
    Because now the script will randomly click the tree within 9-11 seconds.

  10. #10
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

    it looks weird because your not controlling the mouse :P
    there is nothing wrong with that you could have your antiban with longer intervals alot of people afk while doing certain skills there is no perfect amount everybody is random while playing legit i do so much antiban i dont even realise it try record your self playing runescape legit and see what you do without knowing

    you could also look into Animation.Simba
    Last edited by Mark; 02-28-2013 at 01:31 PM.

  11. #11
    Join Date
    Feb 2013
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    32 Post(s)

    Default

    Quote Originally Posted by juunhoad View Post
    Hello guys,

    I just started writing my first script for 07scape by reading tutorials and mainly by watching the scripting video from YoHoJoSRL.

    Right now my script is only chopping the maple trees at seers village. I want to add bank later. First I need to know if the script is correct right now, I have no compile issues but still want to know if it functions right

    Simba Code:
    program MapleChopper;
       {$i SRL\SRL.simba}
       {$I SRL/SRL/Misc/Debug.Simba}
       {$I P07Include.Simba}
    const
      Version = '1,0';

    Procedure P07_DeclarePlayer;
    Begin
      P07_PlayerName:='';
      P07_PlayerPass:='';
    end;


    Function AntiBan: Boolean;

    begin
      case Random(250) of
        0: P07_HoverSkill ('woodcutting', RandomRange(2500, 4000));
        1: P07_MakeCompassSouth;
        2: MMouse(random(700), random(400), 0, 0);
        3: P07_MakeCompassEast;
        4: P07_MakeCompassWest;
        5: P07_MakeCameraAngleHigh;
      end;
    end;

    Function ChopDownMaple: boolean;
    var
      x, y, TreeCounter: Integer;
    begin
      if P07_FindObjCustom(x, y, ['Cho', 'own','p d'], [20860, 21377, 19325], 10) then
      begin
        case Random(2) of
        0: begin
            ClickMouse2(mouse_left);
            Wait(RandomRange(9000, 11000))
           end;
         1:
          begin
            ClickMouse2(mouse_right);
            P07_WaitOptionMulti(['hop', 'own'],RandomRange(200,300))
            Wait(RandomRange(9000, 11000));
            end;
         end;

        repeat
          MarkTime(TreeCounter);
          Antiban;
          Wait(100);
        Until (TimeFromMark(TreeCounter) > 7000)

      end;
    end;


    begin
      ActivateClient;
      SetupP07Include;
      P07_DeclarePlayer;
      repeat
      ChopDownMaple;
      until(false);
      TerminateScript;
    end.

    I want to know if my antiban in the function 'ChopDownMaple' works correct this way for 07scape? because I saw it in a scripting video that was 2 years old.
    And what do you think I can improve more?

    I already saw in issue with chopping. There are 4 tree's at seers village. 3 tree's pretty close to eachother and 1 tree not. If the script comes to close at the 1 tree side it can't see the other tree's anymore. How can I fix this?
    If you don't know what I mean, go to seers village.
    Hey man.

    Make it so it has more chance of single clicking trees, and a lower chance of right clicking. A 50/50 chance is too obvious.
    Le_Don
    Last edited by Le_don; 02-28-2013 at 01:55 PM.

  12. #12
    Join Date
    Apr 2012
    Posts
    92
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default

    Ya that's true :P right now I have this function for Chopping:
    Simba Code:
    Function ChopDownMaple: boolean;
    var
      x, y, TreeCounter, PlusThree: Integer;
    begin
      if P07_FindObjCustom(x, y, ['Cho', 'own','p d'], [20860, 21377, 19325], 10) then
      begin
        case Random(20) of
        0..15: begin
            Wait(RandomRange(100,250));
            ClickMouse2(mouse_left);
            Wait(RandomRange(9000, 11000));
           end;
        15..20:
          begin
            Wait(RandomRange(100,250));
            ClickMouse2(mouse_right);
            P07_WaitOptionMulti(['hop', 'own'],RandomRange(200,300))
            Wait(RandomRange(9000, 11000));
            end;
         end;

        if TimeFromMark(TreeCounter) > 5000 then
          begin
            AntiBan;
            Wait(RandomRange(1500,3000))
            Marktime(TreeCounter);
          end;

      end;
    end;

    Will this look random enough for you?
    Ok thx, I will have a look at that.
    But, I got another question again . Does this procedure look good for Birds nest?
    Simba Code:
    procedure BirdsNest;
    var
      x ,y: Integer;
    begin
      if P07_FindObjCustom(x, y, ['ake'], [2569530, 2569530], 5) then
       begin
          Wait(RandomRange(1000,1500));
          ClickMouse2(mouse_left);
       end;
    end;

  13. #13
    Join Date
    Apr 2012
    Posts
    92
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default

    Quote Originally Posted by Le_don View Post
    Hey man.

    Make it so it has more chance of single clicking trees, and a lower chance of right clicking. A 50/50 chance is too obviouse.

    Le_Don
    Already had done that :P look above this post

  14. #14
    Join Date
    Feb 2013
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    32 Post(s)

    Default

    Quote Originally Posted by juunhoad View Post
    Already had done that :P look above this post
    Good work, using your TreeCounter in a private script for mining - hope you don't mind!

    Can't seem to get it to click, though it hovers over the ore.. Hopefully I don't have bugged uptext.. Here's my code, It's the old ore I'm trying to mine.

    Simba Code:
    program LeDonsKhazardIronDepositor2;
       {$i SRL\SRL.simba}
       {$I SRL/SRL/Misc/Debug.Simba}
       {$I P07Include.Simba}
    const
      Version = '0.0';

    procedure Iron;
    var
     x, y, TreeCounter: Integer;
     begin
        if P07_FindObjCustom(x, y, ['ine', 'Mine', 'Min'], [1646647, 1646647, 1646647], 10) then
        begin
        case Random(20) of
        15:
        begin
         ClickMouse2 (mouse_left);
         Wait (RandomRange(200,500))
        end;
        5:
        begin
         ClickMouse2 (mouse_right);
         P07_WaitOptionMulti(['Mine', 'ine'], RandomRange (200,300))
         Wait (RandomRange(400,700))
         end;
       end;
           repeat
          MarkTime(TreeCounter);
          Wait(100);
        Until (TimeFromMark(TreeCounter) > 5000)

      end;
    end;

    begin
    ActivateClient;
    SetupSRL;
    SetupP07Include;
    repeat
    Iron;
    until(false);
    TerminateScript;
    end.

    Hoping you could help me out, lol sorry if I missed something I'm new too!

  15. #15
    Join Date
    Apr 2012
    Posts
    92
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default

    try 1..15: not only 15

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
  •