Results 1 to 7 of 7

Thread: DoGnomeObstacle ~~ Agility

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

    Default DoGnomeObstacle ~~ Agility

    Tell me how this looks, it's my first attempt at making a function. Please don't flame, just tell me what you like, don't like, and how I can improve it.

    (I haven't tested it yet, I don't know how good it'll work but I don't see why it wouldn't)

    SCAR Code:
    {*******************************************************************************
    function DoGnomeObstacle(Color:TIntegerArray; Text:TStringArray; Tol, Pause:Integer): Boolean;
    By: Baked0420
    Description: It does the Gnome Agility Course, just put in the uptext under text,
                 the color of the obstacle under color, set the tolerance you want,
                 and how long you want it to wait after clicking an obstacle under
                 pause.
    *******************************************************************************}

    Function DoGnomeObstacle(Color:TIntegerArray; Text:TStringArray; Tol, Pause:Integer): Boolean;
    begin
      if(not(LoggedIn)) then Exit;
      If(FindObjCustom(x, y, Text, Color, Tol)) then
      begin
        MMouse(x, y, 2, 2);
        if(IsUpTextMultiCustom(Text)) then
        begin
          Mouse(x, y, 2, 2, True);
          wait(Pause + random(500));
        end;
      end;
    end;

  2. #2
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Well.. Isn't it kind of. unnecessary?
    It's just a FindObjCustom only it has clicking included :P
    And, FindObjCustom already checks for UpText:

    SCAR Code:
    {*******************************************************************************
    Function DoGnomeObstacle(Color : TIntegerArray; Text : TStringArray; Tol : Integer):
    Boolean;
    By: Baked0420
    Description: It does the Gnome Agility Course, just put in the uptext under text,
                 the color of the obstacle under color, set the tolerance you want,
                 and how long you want it to wait after clicking an obstacle under
                 pause.
    *******************************************************************************}


    Function DoGnomeObstacle(Color : TIntegerArray; Text : TStringArray; Tol : Integer): Boolean;
    Begin
      If Not LoggedIn Then Exit;
      If FindObjCustom(x, y, Text, Color, Tol) Then
      Begin
        Mouse(x, y, 2, 2, True);
        Wait(Pause + random(500)); //Pause isnt set..?
      End;
    End;
    Ce ne sont que des gueux


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

    Default

    I know, I have checking for UpText again kind of as a failsafe to make sure it has the right thing moused over, so if it somehow messed up it won't click the wrong thing, but I suppose it's a little unnecessary, it just helps shorten your script a lot instead of using:

    SCAR Code:
    Begin
      If Not LoggedIn Then Exit;
      If FindObjCustom(x, y, Text, Color, Tol) Then
      Begin
        Mouse(x, y, 2, 2, True);
        Wait(Pause + random(500));
      End;
    End;

    that like 7 times for the Gnome Agility course, but with actually text, colors, and wait. It helps save time if you just have to write it once, and it saves lines of script so instead of it being say a 300 line script it may be like I don't know 250, it helps clean up the script a little in my opinion. I just made it for my agility script to help me save time and I figured I'd post it to see what people think of it. But thanks for the feedback, I'll try to add stuff to make it more useful.

    EDIT: I copied my function you posted then saw the note after I posted it, wow thanks I totally forgot and never realized I didn't add pause, I'll add it into my first post, not something hard to add =P. Ok I added it in, and if you look, I had pause in the discription like where I write the function noted, but I didn't have it in the actual function lol, thanks for catching that for me.

  4. #4
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    And, when adding parameters to a function, each different type (integer, boolean, etc) has to be seperated with a semicolon ';'.
    So:
    SCAR Code:
    Function Test(ThisIsAnInt, ThisToo : Integer; ButThisIsABool : Boolean): Boolean;
    Ce ne sont que des gueux


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

    Default

    oh thanks, like I said in my first post it is my first function, so I didn't know, thanks for telling me, I would've never fixed that. haha you make me feel like such a noob scripter, because I already made two stupid mistakes. I'll go fix that in my first post also now.

  6. #6
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Your exactly what I was first
    Dont worry
    Ce ne sont que des gueux


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

    Default

    haha well, I don't usually make my own functions for my scripts, so I guess it doesn't matter too much, because all my scripts worked that I made, or most anyway, and the reason I probably didn't catch those errors you did is because I made that function for my agility script, but I never put it into affect, I just wanted to make it so I could shorten it if I wanted, but for now, it's in my script noted, so it doesn't compile so it never told me any errors with it that i didn't catch.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Barbarian Agility?
    By VivaLaRofl in forum RS3 Outdated / Broken Scripts
    Replies: 0
    Last Post: 05-26-2007, 04:56 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
  •