Results 1 to 19 of 19

Thread: Runaway.scar

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

    Default Runaway.scar

    Mostly for woodcutting (excepting Cop_wait and Cop_mouse, those are just to reduce the amount of typing required), I decided to make a few shortcuts for a few of the widely used procedures and functions.

    with some help from:
    ian,
    noidea,
    and marpis,
    I have created:

    procedure Cop_wait(waittime: integer)
    This takes the time and does several different mathematic equations with it. The absolute minimum wait time you can get out of this is the same as the variable you plug into it. for example, Cop_wait(100) can range from 100ms to 240ms wait time. The larger the initial input, the larger the output can be.
    SCAR Code:
    procedure Cop_wait(waittime: integer);
    var
      r1: Integer;
    begin
      r1 := randomrange(1, 4);
      wait((waittime/r1)+random(50));
      wait(waittime-random(waittime/2));
      wait((waittime/4)+random(20));
    end;

    ------------------------------------------------------------------------

    procedure Cop_mouse(x, y: integer; leftclick: boolean)
    This is just a shortcut, using a random integer for the rx and ry in the Mouse(x, y, rx, ry, leftclick) procedure.
    SCAR Code:
    procedure Cop_mouse(x, y: integer; leftclick: boolean);
    var
      ranx1, rany1: Integer;
    begin
      ranx1 := randomrange(2, 5);
      rany1 := randomrange(2, 5);
      Mouse(x, y, ranx1, rany1, leftclick);
    end;

    ------------------------------------------------------------------------

    procedure Cop_antiban(skill: string; randomtalker: boolean)
    An antiban that includes all forms of "antibanning". Has an option to use my randomtalker, and choose what skill to say to people around you. Has a 10% chance of using antiban.
    Valid arguments for skill: all skills, and you can choose random for extra fun!
    SCAR Code:
    procedure Cop_antiban(skill: string; randomtalker: boolean);
    var
      compassangle1, compassangle2: Integer;
    begin
      if not (LoggedIn) then Exit;
    // inc(AntibansDone);
      case random(200) of
        0,1: BoredHuman;
        2,3: RandomRClick;
        4,5: PickUpMouse;
        6,7: HoverSkill('random', false);
        8,9: ExamineInv;
        10,11: begin
                 compassangle1 := randomrange(1, 55);
                 compassangle2 := randomrange(120, 250);
                 MakeCompass(IntToStr(compassangle1));
                 Cop_wait(50);
                 MakeCompass(IntToStr(compassangle2));
                 Cop_wait(50);
                 MakeCompass('n');
               end;
        12,13: begin
                 GetMousePos(x, y);
                 MMouse(x, y, 15, 15);
                 Cop_wait(25);
                 MMouse(x, y, 5, 5);
               end;
        14: begin
            if not (randomtalker) then Exit;
              case random(5) of
                0: TypeSend('lol');
                1: TypeSend('...');
                2: TypeSend('bored.');
                3: TypeSend('omg this is boring');
                4: TypeSend('auayuidy.');
              end;
            end;
        15,16: RandomMovement;
        17,18: begin
                 GameTab(RandomRange(1, 13));
                 Cop_wait(500);
                 Gametab(tab_Inv);
               end;
        19,20: SayCurrentLevels(skill);
     end;
    end;

    ------------------------------------------------------------------------

    procedure Cop_dropload(itemcolor: integer)
    Just a quick little procedure that can make powerminers and cutters that much easier to deal with.
    SCAR Code:
    procedure Cop_dropload(itemcolor: integer);
    var
      b: tbox;
      i: Integer;
    begin
      if not (LoggedIn) then Exit;
      for i := 1 to 28 do
      begin
        b := InvBox(i);
        if FindColor(itemcolor, x, y,b.x1, b.y1, b.x2, b.y2) then
          DropItem(i);
      end;
    end;

    ------------------------------------------------------------------------

    function Cop_findtree(treetype: string; leftclick: boolean): boolean
    Using the input from the user, this will take the tree type and find and chop that particular tree. For example, Cop_findtree(magic, false) will find a magic tree and then right click it, choosing the chop option from the drop-down menu.
    Valid arguments: normal, oak, willow, maple, yew, and magic.
    SCAR Code:
    function Cop_findtree(treetype: string; Chop: boolean): boolean;
    var
      Colors: Array of integer;
      UpText: string;
    begin
      if not (LoggedIn) then Exit;
      case Lowercase(treetype) of
        'normal': Colors := [1854786, 3567717, 1062703];
        'oak': Colors := [1922889, 4624516, 2516570];
        'willow': Colors := [6919048, 2441789, 5010788];
        'maple': Colors := [3495048, 1451327, 2176088];
        'yew': Colors :=  [2120012, 2648669, 4228986];
        'magic': Colors := [10479596, 4623230, 2186320];
      end else
      begin
          writeln('Tree type selected is not supported.');
          exit;
      end;
      UpText := copy(treetype, 2, High(treetype)); // this takes the first letter off from treetype and saves it to variable UpText, willow -> illow
      if FindObjCustom(x, y, [UpText], Colors, 5) then
      begin
        result := true;
        if Chop then
        begin
          GetMousePos(x, y);
          Mouse(x, y, 0, 0, false);
          result := WaitOption('p down', 500+random(100));
        end;
      end;
    end;

    ------------------------------------------------------------------------

    Yay!
    Enjoy them, I have found them to be quite useful making different kinds of scripts!

    -Runaway
    Last edited by Runaway; 08-23-2009 at 12:15 AM.

  2. #2
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Nice release
    I'm glad we got this sorted out over msn
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

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

    Default

    I added you to the list of people who helped out.
    To tell you the truth I didn't know your SRL name until you posted on this :P

    ALSO:
    There are more additions to this include coming!
    It would be cool to get feedback too

  4. #4
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I beleive the prefix of R_ is being used in Reflection which would cause a bit of confusion?

    Not 100% sure lol.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

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

    Default

    Yeah, I saw that after I made them all :O
    I guess I could change them, but I don't know what to...

    EDIT: I could change them all to: rc_wait and such?

  6. #6
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Rc = remote control =X

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

  8. #8
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Cop_
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

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

    Default

    edited the procedures and function and made the prefix Cop_
    thanks again noidea :P

  10. #10
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I personally use TPA for tree finding, but nevertheless Runaway Cop, a good effort.

    Edit :

    Edit2: But I don't think this will be added to SRL

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

    Default

    SCAR Code:
    procedure Cop_wait(waittime: integer);
    var
      r1: Integer;
    begin
      r1 := randomrange(1, 4);
      wait((waittime/r1)+random(50));
      wait(waittime-random(waittime/2));
      wait((waittime/4)+random(20));
    end;
    You could just do something like wait(100+random(100)), and it would be just as good.

    SCAR Code:
    procedure Cop_mouse(x, y: integer; leftclick: boolean);
    var
      ranx1, rany1: Integer;
    begin
      ranx1 := randomrange(2, 5);
      rany1 := randomrange(2, 5);
      Mouse(x, y, ranx1, rany1, leftclick);
    end;
    ???
    Mouse(x, y, 4, 4, false); doesn't seem very long to me

    SCAR Code:
    case random(14) of
                   0: Gametab(tab_Notes);
                   1: Gametab(tab_Combat);
                   2: Gametab(tab_Stats);
                   3: Gametab(tab_Quest);
                   4: Gametab(tab_Diary);
                   5: Gametab(tab_Equip);
                   6: Gametab(tab_Prayer);
                   7: Gametab(tab_Magic);
                   8: Gametab(tab_Friends);
                   9: Gametab(tab_Ignore);
                   10: Gametab(tab_Clan);
                   11: Gametab(tab_Options);
                   12: Gametab(tab_Emotes);
                   13: Gametab(tab_Music);
                 end;
                 Cop_wait(500);
                 Gametab(tab_Inv);
    shortened:
    SCAR Code:
    GameTab(RandomRange(1, 13));
      Wait(500+random(100));
      GameTab(tab_Inv);

    SCAR Code:
    procedure Cop_dropload(itemcolor: integer);
    var
      i: Integer;
    begin
      if not (LoggedIn) then Exit;
      if FindColor(itemcolor, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        CountItemsIn('inv', 'colour', itemcolor,  [5, 1]);
        for i := 1 to 28 do
        begin
          DropAll;
          //inc(LoadsDone);
        end;
        for i := 2 to 28 do
        begin
          DropItem(i);
          //inc(LoadsDone);
        end;
      end;
    end;
    shortened:
    SCAR Code:
    procedure Cop_dropload(itemcolor: integer);
    var
      b: tbox;
      i: Integer;
    begin
      if not (LoggedIn) then Exit;
      for i := 1 to 28 do
      begin
        b := InvBox(i);
        if FindColor(itemcolor, x, y,b.x1, b.y1, b.x2, b.y2) then
          DropItem(i);
      end;
    end;

    SCAR Code:
    function Cop_findtree(treetype: string; leftclick: boolean): boolean;
    begin
     if not (LoggedIn) then Exit;
     case Lowercase(treetype) of
       'normal':  begin
                    if FindObjCustom(x, y, ['ree'], [1854786, 3567717, 1062703], 5) then
                    begin
                      result := true;
                      Cop_mouse(x, y, leftclick);
                      Cop_wait(100);
                      if (leftclick) then
                        ChooseOption('hop')
                      else
                    end;
                  end;
       'oak': begin
                if FindObjCustom(x, y, ['ak'], [1922889, 4624516, 2516570], 5) then
                begin
                  result := true;
                  Cop_mouse(x, y, leftclick);
                  Cop_wait(100);
                  if (leftclick) then
                    ChooseOption('hop')
                  else
                end;
              end;
       'willow': begin
                   if FindObjCustom(x, y, ['illow'], [6919048, 2441789, 5010788], 5) then
                   begin
                     result := true;
                     Cop_mouse(x, y, leftclick);
                     Cop_wait(100);
                     if (leftclick) then
                       ChooseOption('hop')
                     else
                   end;
                 end;
       'maple': begin
                  if FindObjCustom(x, y, ['aple'], [3495048, 1451327, 2176088], 5) then
                  begin
                    result := true;
                    Cop_mouse(x, y, leftclick);
                    Cop_wait(100);
                    if (leftclick) then
                      ChooseOption('hop')
                    else
                  end;
                end;
       'yew': begin
                if FindObjCustom(x, y, ['ew'], [2120012, 2648669, 4228986], 5) then
                begin
                  result := true;
                  Cop_mouse(x, y, leftclick);
                  Cop_wait(100);
                  if (leftclick) then
                    ChooseOption('hop')
                  else
                end;
              end;
       'magic': begin
                  if FindObjCustom(x, y, ['agic'], [10479596, 4623230, 2186320], 5) then
                  begin
                    result := true;
                    Cop_mouse(x, y, leftclick);
                    Cop_wait(100);
                    if (leftclick) then
                      ChooseOption('hop')
                    else
                  end;
                end;

        else
          writeln('Tree type selected is not supported.');
      end;
    end;
    shortened, also edited it abit
    SCAR Code:
    function Cop_findtree(treetype: string; Chop: boolean): boolean;
    var
      Colors: Array of integer;
      UpText: string;
    begin
      if not (LoggedIn) then Exit;
      case Lowercase(treetype) of
        'normal': Colors := [1854786, 3567717, 1062703];
        'oak': Colors := [1922889, 4624516, 2516570];
        'willow': Colors := [6919048, 2441789, 5010788];
        'maple': Colors := [3495048, 1451327, 2176088];
        'yew': Colors :=  [2120012, 2648669, 4228986];
        'magic': Colors := [10479596, 4623230, 2186320];
      end else
      begin
          writeln('Tree type selected is not supported.');
          exit;
      end;
      UpText := copy(treetype, 2, High(treetype)); // this takes the first letter off from treetype and saves it to variable UpText, willow -> illow
      if FindObjCustom(x, y, [UpText], Colors, 5) then
      begin
        result := true;
        if Chop then
        begin
          GetMousePos(x, y);
          Mouse(x, y, 0, 0, false);
          result := WaitOption('p down', 500+random(100));
        end;
      end;
    end;

    Keep up the good work, but don't make things too complicated!

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

    Default

    Thanks so much marpis!

    oh, and I use Cop_wait because it is much more random than using wait(100+random(100));.

    If you input Cop_wait(1000), the output can be between 1000 and 1820.

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

    Default

    Quote Originally Posted by Smarter Child View Post
    I personally use TPA for tree finding, but nevertheless Runaway Cop, a good effort.

    Edit :

    Edit2: But I don't think this will be added to SRL
    I know it won't be added to SRL :P
    just wanted to throw it out there just in case someone wanted to save some time and use my pre-made antiban or somethin like that

    EDIT: sorry for double post :O

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

    Default

    Quote Originally Posted by Runaway Cop View Post
    Thanks so much marpis!

    oh, and I use Cop_wait because it is much more random than using wait(100+random(100));.

    If you input Cop_wait(1000), the output can be between 1000 and 1820.
    = wait(1000+random(1820))

  15. #15
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by marpis View Post
    = wait(1000+random(1820))
    = wait(100+random(820));
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  16. #16
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Arent people meant to make their own tree finding? Includes are to help you, not do everything FOR you
    Jus' Lurkin'

  17. #17
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    =wait(1000+random(821)), he said 1000ms nodiea, and you gotta put the random one number higher. But anyway, good job Runaway, I have a group of procedures/functions also in my includes folder .

  18. #18
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Very nice stuff over there... like most of them.

    and to be honest, one of them is useless, which is the findtree function. i am sure that most of us use our very own finding procedures and functions, not because yours is slow, but i think people won't use it.
    Hi

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

    Default

    Quote Originally Posted by Tickyy View Post
    Very nice stuff over there... like most of them.

    and to be honest, one of them is useless, which is the findtree function. i am sure that most of us use our very own finding procedures and functions, not because yours is slow, but i think people won't use it.
    It's fine if people don't use it. I just wanted to put it out there in case someone actually DOES

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
  •