Results 1 to 21 of 21

Thread: My procedure dump.

  1. #1
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default My procedure dump.

    I do believe this kind of thing goes here.

    Anyways, hi

    I've put together a few simi-useful procedures here, and decided to share them with the rest of this community

    SCAR Code:
    procedure ClickToContinueEx(Times:Integer);
     var
     Done : Integer;
      begin
       repeat
        ClickToContinue;
        Wait(500 + Random(500));
        Done := Done + 1;
       until(Times = Done);
      end;

    Well, I got tired of typing in "ClickToContinue" over and over again, so I made a procedure for multiples of that command.

    SCAR Code:
    procedure NPCFinder(NPCColor, Tol: Integer; Name: String);
     var
     Tries : Integer;
      begin
       repeat
       if(FindColorSpiralTolerance(x, y, NPCColor, MSX1, MSY1, MSX2, MSY2, Tol))then
        Wait(500 + Random(100));
        MMouse(x, y, 1, 1);
        Tries := Tries + 1;
        if(Tries >= 5)then
         begin
          KeyDown(37);
          Wait(1000 + Random(500));
          KeyUp(37);
          Tries := 0;
         end;
       until(IsUpText(Name));
        Mouse(x, y, 0, 0, False);
        ChooseOption(x, y, 'Talk');
      end;

    This one and the next are pretty much in the same boat. They're just very simple ways of opening doors/talking to NPCs.

    SCAR Code:
    procedure DoorOpener(DoorColor, Tol:Integer);
     var
     Tries : Integer;
      begin
       repeat
        Wait(500 + Random(100));
        if(FindColorSpiralTolerance(x, y, DoorColor, MSX1, MSY1, MSX2, MSY2, Tol))then
        MMouse(x, y, 1, 1);
        Tries := Tries + 1;
        if(Tries >= 5)then
         begin
          KeyDown(37);
          Wait(1000 + Random(1000));
          KeyUp(37);
          Tries := 0;
         end;
       until(IsUpText('Door') or IsUpText('Gate'));
        if(IsUpText('Open'))then
         begin
          Writeln('Found a door.');
          Mouse(x, y, 0, 0, False);
          ChooseOption(x, y, 'Open');
          Writeln('Opened door.');
         end;
        if(IsUpText('Close'))then
         begin
          Writeln('Door was already open.');
          Exit;
         end;
      end;

    Enjoy! Tell me what you think them.

    I'll add more later on

  2. #2
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    very nice...can i use em in my tut runner?
    STOP PM'ING ME

  3. #3
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Sure, that's what they're here for

  4. #4
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    So for the NPC thing, could we use that to trade too? I have been trying to find this out for a while. I would just change talk to trade wouldnt i?

  5. #5
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Thats correct.

    If you're going to use it some of the time for talking and some of the time for trading, you could just take out "Talk", and tell scar what to do each time you use the command. Not that hard, eh?

  6. #6
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    also in the local variables you need to add x,y

    and its really weird..when i have procedure in its own scar window the parameter guide thing pops up liek it should...but when im doing it in my script it wont pop up owell it still works
    STOP PM'ING ME

  7. #7
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    In SRL the variables x and y are already declared. The functions use the command "ChooseOption" which is SRL. If you're going to use these procedures, you'll need SRL. (Unless you're going to modify it.)

  8. #8
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    yah i got that....but dont u get dupicate idintifer error if you dont put in local vars?
    STOP PM'ING ME

  9. #9
    Join Date
    Dec 2006
    Location
    Ky
    Posts
    390
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Hobbit View Post
    yah i got that....but dont u get dupicate idintifer error if you dont put in local vars?
    If you have SRL included and you were to Declare X and Y then you would get a duplicate identifier error. If this is what you mean
    SUMMER BREAK be back when I want to

  10. #10
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    if you declaired it in global vars at begining of script yes, but in local right after title of procedure before begin, no you don't i just tested to be sure, well it has no harm so just to be safe i'm declaring in local vars...but it does work without
    STOP PM'ING ME

  11. #11
    Join Date
    Dec 2006
    Location
    Ky
    Posts
    390
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Hobbit View Post
    if you declaired it in global vars at begining of script yes, but in local right after title of procedure before begin, no you don't i just tested to be sure, well it has no harm so just to be safe i'm declaring in local vars...but it does work without
    Ok thats what I figured. Always good to be sure
    SUMMER BREAK be back when I want to

  12. #12
    Join Date
    Oct 2006
    Location
    Ireland
    Posts
    855
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks man really needed the Npc finder. Is it okay if I edit it slightly? Just so if it doesn't find the npc it wont stop te entire script. Ill still give ya full credit

  13. #13
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by ~alex~ View Post
    Thanks man really needed the Npc finder. Is it okay if I edit it slightly? Just so if it doesn't find the npc it wont stop te entire script. Ill still give ya full credit
    Take it, modify it, do whatever you want to it.

    If someone posts a script, I don't believe that they have any right to say it can't be edited to someone elses likings.

  14. #14
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    have u posted this in the new srl procedures section?..cause i think this would be a good thing to have
    STOP PM'ING ME

  15. #15
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    I think that's Members only, isn't it?
    Interested in C# and Electrical Engineering? This might interest you.

  16. #16
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    no clue...i'll check and see then edit this post yes or no

    edit: yes...oops nvm then
    STOP PM'ING ME

  17. #17
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    You can post it there if you want

  18. #18
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    why u want me to do it for u? lol
    STOP PM'ING ME

  19. #19
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Tis members' only. I'm not a member

    You said it would be a good thing to have there, so if you want to, feel free to post it

  20. #20
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    nah i think you got good chance of becomeing member whenever you apply so you can do it
    STOP PM'ING ME

  21. #21
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Heh

    Thanks, mate

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. DTM Dump
    By [S]paz in forum RS3 Outdated / Broken Scripts
    Replies: 2
    Last Post: 11-03-2007, 09:11 AM
  2. My New Script Dump!
    By shaunthasheep in forum News and General
    Replies: 0
    Last Post: 06-13-2006, 09:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •