SRL Archive - SRL Archives

MMToMS


Bad Boy JH

2010-02-19 00:56:49

Touch of tidy up.
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

n3ss3s

2010-02-19 06:10:19

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


Why?

Wanted

2010-02-19 10:49:02

{.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?

Naike

2010-02-19 15:46:27

From: IceFire908

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.

Home

2010-02-20 06:36:56

From: Naike
Made this function ages ago, even before being dev'd.


Offtopic: Nick ? Naike :D What's going on :)


~Home

BenLand100

2010-02-21 10:31:42

From: IceFire908
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.

NCDS

2010-02-21 10:43:10

From: BenLand100
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.

Wanted

2010-02-21 11:51:32

From: BenLand100
Because constants fail.


True

From: BenLand100
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. :redface:

From: BenLand100
But if they are actual constant constants (lol) I just write them in there. Makes sense to me, idk.


Point taken :-/

noidea

2010-02-21 14:37:38

From: IceFire908
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.

Wanted

2010-02-21 14:45:36

From: noidea
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.

Bad Boy JH

2010-02-22 05:12:36

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