Results 1 to 13 of 13

Thread: Lumbridge...

  1. #1
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Lumbridge...

    Hi,

    Is there a way to check if a player is already located in lumbridge?


    - Thank you!

  2. #2
    Join Date
    Mar 2007
    Location
    Alberta, Canada
    Posts
    1,780
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    See if you can find a way to walk to lumbride, but not actually click. But there isn't a written in include like
    checkiflumbride or something.

  3. #3
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    You could do a symbol check or a colour check of some kind.

    To make it most effective add them both together in something like this:

    SCAR Code:
    Function InLumbridge: Boolean;
    Var
    x, y:integer;
    Begin
      If FindSymbol(x, y, 'water') then
        If FindColorTolerance(x, y, {colour}, MSX1, MSY1, MSX2, MSY2, {tolerance}) then
          Result := true
        else
          Result := false;
    end;

    Not sure if that would compile, you have to find something that is unique to lumbridge, and do a search for that unique item, if found then the function returns that its in lumbridge.

  4. #4
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hahah yea lol, i've been trynna find something unique in in lumbridge for soooo long now and when i did find something pretty much suitable, that place is really crowded so most of the times it'll prolly not detect it due to players covering up the symbol... :S

  5. #5
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Probably lowering the accuracy would help, as the water symbol is pretty much unique, as low as 0.2 may work.

  6. #6
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Try FindSymbols. Where exactly in lumby? Screenshot please? Doors might help.

  7. #7
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Or u could use Reflection.
    I do visit every 2-6 months

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

    Default

    SCAR Code:
    Function InLumby: Boolean;
    var  x, y: Integer;
    begin
      if FindSymbol(x, y, 'water') then
      result := (CountColor(FindLumbyRoadColor, mmx1, mmy1, mmx2, mmy2) > 2000);
    end;
    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
    May 2008
    Location
    127.0.0.1
    Posts
    705
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    or... you could just Home Tele, so you know the exact location you're at in lumby.

  10. #10
    Join Date
    Feb 2009
    Location
    Nebraska
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by noidea View Post
    SCAR Code:
    Function InLumby: Boolean;
    var  x, y: Integer;
    begin
      if FindSymbol(x, y, 'water') then
      result := (CountColor(FindLumbyRoadColor, mmx1, mmy1, mmx2, mmy2) > 2000);
    end;
    Careful, you're leaving result unassigned in once branch of execution. It may be initialized to a reliable value by the script engine, but it's bad practice to rely on implementation details of the engine. A future engine upgrade might change that behavior and break your code.

    SCAR Code:
    Function InLumby: Boolean;
    var  x, y: Integer;
    begin
      [B]result := false;[/B]
      if FindSymbol(x, y, 'water') then
        result := (CountColor(FindLumbyRoadColor, mmx1, mmy1, mmx2, mmy2) > 2000);
    end;

    Of course you could do this as well:

    SCAR Code:
    Function InLumby: Boolean;
    var  x, y: Integer;
    begin
      result := FindSymbol(x, y, 'water') and (CountColor(FindLumbyRoadColor, mmx1, mmy1, mmx2, mmy2) > 2000);
    end;

  11. #11
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Grippy View Post
    Careful, you're leaving result unassigned in once branch of execution. It may be initialized to a reliable value by the script engine, but it's bad practice to rely on implementation details of the engine. A future engine upgrade might change that behavior and break your code.
    The engine's reliable enough, and Freddy wouldn't be stupid enough to change that part, so though it is bad practice, it will be fine.

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

    Default

    Quote Originally Posted by Grippy View Post
    Careful, you're leaving result unassigned in once branch of execution. It may be initialized to a reliable value by the script engine, but it's bad practice to rely on implementation details of the engine. A future engine upgrade might change that behavior and break your code.

    SCAR Code:
    Function InLumby: Boolean;
    var  x, y: Integer;
    begin
      [B]result := false;[/B]
      if FindSymbol(x, y, 'water') then
        result := (CountColor(FindLumbyRoadColor, mmx1, mmy1, mmx2, mmy2) > 2000);
    end;

    Of course you could do this as well:

    SCAR Code:
    Function InLumby: Boolean;
    var  x, y: Integer;
    begin
      result := FindSymbol(x, y, 'water') and (CountColor(FindLumbyRoadColor, mmx1, mmy1, mmx2, mmy2) > 2000);
    end;

    SCAR automatically sets local booleans as false
    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

  13. #13
    Join Date
    Feb 2009
    Location
    Nebraska
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by noidea View Post
    SCAR automatically sets local booleans as false
    Like I said, it does in this version. It may be unlikely to change, but think of it as a failsafe, a more portable variant, and code that is easier for a reader to understand.

    Now, if unnecessary variable init were to become a performance problem in a particular location, one would be quite justified in commenting it out with a note about why it is a problem. However, it has been said, premature optimization is the root of all evil, meaning, among other things, that code should first be correct and clear before being tweaked for speed.

    On the other hand, if you /want/ code that is difficult to follow ('if it was hard to write, it should be hard to read!'), perhaps to dazzle noobs with one's superior scripting talent, or whatever (nothing wrong with this, it's why we have things like the The International Obfuscated C Code Contest, it's great fun!), stuff like this, and more, is certainly a fair standard (or, perhaps, non-standard).

    Anyway, my advice was just that one ought to be aware that leaving vars uninitialized in that way can potentially be a source of problems, depending on what happens to the code in the future, not necessarily that it is, in fact, a problem in this case. Take it or leave it.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. 10% done lumbridge miner
    By RudeBoiAlex in forum Research & Development Lounge
    Replies: 19
    Last Post: 09-03-2007, 01:06 PM
  2. Lumbridge to Draynor?
    By TravisV10 in forum Discussions & Debates
    Replies: 0
    Last Post: 08-27-2007, 11:23 AM
  3. Lumbridge
    By Boreas in forum RS3 Outdated / Broken Scripts
    Replies: 66
    Last Post: 04-30-2007, 08:25 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
  •