Results 1 to 11 of 11

Thread: MMToMS

  1. #1
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default MMToMS

    Touch of tidy up.
    SCAR Code:
    Function MMToMS(MM: TPoint): TPoint;
    var
      X, Y: Integer;
      Dis: TPoint;
    begin
      X := MM.X - 647; //1)
      Y := MM.Y - 84;

      Dis := Point(MM.X - MMCX, MM.Y - MMCY);
      Result := Point(260 + X + Dis.X*10, Round(170 + Y + Dis.Y*6.5));

      If Not IntInBox(Result.X, Result.Y, IntToBox(MSX1, MSY1, MSX2, MSY2))then
        Result := Point(-1, -1);
    end;
    1) Also Should it be
    X := MM.X - MMCX
    Y := MM.Y - MMCY
    Last edited by Wanted; 02-19-2010 at 03:46 PM. Reason: Easier to read -.-

  2. #2
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Also Should it be
    X := MM.X - MMCX
    Y := MM.Y - MMCY
    Why?

  3. #3
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    {.Include SRL\SRL.SCAR}

    begin
      WriteLn(IntToStr(MMCX) + ', ' + IntToStr(MMCY));
    end.

    This won't make any difference, though I don't understand why people aren't using constants.... I can understand maybe other consts like gametab and crap where it gets redundant/annoying using so many difference consts but game boundries like MS.. MC. MM have been used long before SRL.

    Is there a particular reason... I've seen BenLand do the same thing in reflection routines using numbers instead of consts?

  4. #4
    Join Date
    Mar 2007
    Location
    <3
    Posts
    2,683
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    This won't make any difference, though I don't understand why people aren't using constants.... I can understand maybe other consts like gametab and crap where it gets redundant/annoying using so many difference consts but game boundries like MS.. MC. MM have been used long before SRL.

    Is there a particular reason... I've seen BenLand do the same thing in reflection routines using numbers instead of consts?
    Made this function ages ago, even before being dev'd.

  5. #5
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by Naike View Post
    Made this function ages ago, even before being dev'd.
    Offtopic: Nick ? Naike What's going on


    ~Home

  6. #6
    Join Date
    Feb 2006
    Location
    Berkeley, CA
    Posts
    1,837
    Mentioned
    52 Post(s)
    Quoted
    60 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    This won't make any difference, though I don't understand why people aren't using constants.... I can understand maybe other consts like gametab and crap where it gets redundant/annoying using so many difference consts but game boundries like MS.. MC. MM have been used long before SRL.

    Is there a particular reason... I've seen BenLand do the same thing in reflection routines using numbers instead of consts?
    Because constants fail. Only time I would use constants is if they changed often (and didn't want to update >9000 places in the script). But if they are actual constant constants (lol) I just write them in there. Makes sense to me, idk.

  7. #7
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by BenLand100 View Post
    Because constants fail. Only time I would use constants is if they changed often (and didn't want to update >9000 places in the script). But if they are actual constant constants (lol) I just write them in there. Makes sense to me, idk.
    I used to feel the same till I went through boot camp with RM for MSI stuff
    They just allow for more readability really.

  8. #8
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by BenLand100 View Post
    Because constants fail.
    True

    Quote Originally Posted by BenLand100 View Post
    Only time I would use constants is if they changed often (and didn't want to update >9000 places in the script).
    But they do change, RuneTek5 messed up RadialWalking aid... a single major runescape update would render all your values outdated.

    Quote Originally Posted by BenLand100 View Post
    But if they are actual constant constants (lol) I just write them in there. Makes sense to me, idk.
    Point taken :-/

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

    Default

    Quote Originally Posted by IceFire908 View Post
    Is there a particular reason... I've seen BenLand do the same thing in reflection routines using numbers instead of consts?
    To be frank, constants are annoying as hell. This isn't business level programming. It doesn't have to be readable. Sure, as a community, we should make a programming readable for learning/teaching sake. But I'd rather have a value instead of a constant.
    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

  10. #10
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by noidea View Post
    To be frank, constants are annoying as hell. This isn't business level programming. It doesn't have to be readable. Sure, as a community, we should make a programming readable for learning/teaching sake. But I'd rather have a value instead of a constant.
    I'd agree but, for game sides they do change and aren't easy to remember.

  11. #11
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't think the function is working 100% accuratly, perhaps it could be fined tuned...

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
  •