Jump to content
Wanted

OSI 2 RS07 New Map Functions and more

Recommended Posts

https://github.com/OfficialSCARInclude/OSI2/commit/2e627d0be82327092974f0856b374e6c6cd12ef9

 

New Map compass and walking functions

Added transferring profile wait to Login

New compass and map globals

New FindColorTPA spiral wrappers

 

Bunch of new map stuff

 

 

[sCAR]{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Official SCAR Include

Runescape 07

Mini-Map Routines

--------------------------------------------------------------------------------

* function OnMM(P: TPoint): Boolean;

By: Wanted

* function TPAOnMM(TPA: TPointArray): Boolean;

By: Wanted

* procedure TPAExtractMMPoints(var TPA: TPointArray);

By: Wanted

* function MMToMSEx(MM: TPoint; Height: Extended): TPoint;

By: Wanted

* function MMToMS(MM: TPoint): TPoint;

By: Wanted

* function MMOnMS(MM: TPoint): Boolean;

By: Wanted

* function MMsToMSs(TPA: TPointArray): TPointArray;

By: Wanted

* function FilterMMPointsMS(TPA: TPointArray): TPointArray;

By: Wanted

* function FindMMColorTol(var P: TPoint; Color, Tol: Integer): Boolean;

By: Wanted

* function FindMMColorsExTol(var TPA: TPointArray; Color, Tol: Integer): Boolean;

By: Wanted

* function FindMMColorSpiral(SP: TPoint; var P: TPoint; Color: Integer): Boolean;

By: Wanted

* function GetCompassAngleRadians: Extended;

By: Wanted

* function GetCompassAngleDegrees: Extended;

By: Wanted

* function SetCompassAngleEx(Angle, Accuracy: Extended; AdjustHeight, Highest: Boolean): Boolean;

By: Wanted

* function SetCompassAngleAcc(Angle, Acc: Extended): Boolean;

By: Wanted

* function SetCompassAngle(Angle: Extended): Boolean;

By: Wanted

* function SetCompassAngleAndHeight(Angle: Extended; Highest: Boolean): Boolean;

By: Wanted

* procedure SetScreenHeight(Highest: Boolean);

By: Wanted

* function FindFlag(var P: TPoint): Boolean;

By: Wanted

* function FlagExists: Boolean;

By: Wanted

* function GetFlagDistanceEx(FromX, FromY: Extended): Extended;

By: Wanted

* function GetFlagDistance: Extended;

By: Wanted

* function FlagEx(Distance: Extended): Boolean;

By: Wanted

* function Flag: Boolean;

By: Wanted

* function MouseFlagEx(P: TPoint; RX, RY: Integer; Distance: Extended): Boolean;

By: Wanted

* function MouseFlag(P: TPoint; RX, RY: Integer): Boolean;

By: Wanted

* function RadarRoadWalk(var TPA: TPointArray; SRad, ERad, SAng, EAng, FlagD: Extended; XOffset, YOffset, RX, RY: Integer): Boolean;

By: Wanted

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}[/sCAR]

 

[sCAR]CMCX = 20; // Compass Center Points // March 12, 2013 Wanted ???

CMCY = 561; // March 12, 2013 Wanted ???

CMX1 = 545; // Compass Edge Points // March 12, 2013 Wanted ???

CMY1 = 4; // March 12, 2013 Wanted ???

CMX2 = 576; // March 12, 2013 Wanted ???

CMY2 = 36; // March 12, 2013 Wanted ???

CMPR = 15; // Compass Pixel Radius // March 12, 2013 Wanted ???

CMPRe = 15.5; // March 12, 2013 Wanted ???

CMPA = 754; // Compass Pixel Area // March 12, 2013 Wanted ???

CMPW = (CMX2 - CMX1) + 1; // Compass Width // March 12, 2013 Wanted ???

CMPH = (CMY2 - CMY1) + 1; // Compass Height // March 12, 2013 Wanted ???

CMPAe = 754.7676350249478255406500728329; // March 12, 2013 Wanted ???

CMCXe = (CMX1 + CMX2) / 2; // March 12, 2013 Wanted ???

CMCYe = (CMY1 + CMY2) / 2; // March 12, 2013 Wanted ???

[/sCAR]

 

[sCAR]{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function CMCP: TPoint;

Contributors: Wanted

Description: Compass center point.

Date Created: March 12th, 2013. By Wanted. RS07 Build ???.

Last Modified: March 12th, 2013. By Wanted. RS07 Build ???.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

function CMCP: TPoint;

begin

Result := Point(CMCX, CMCY);

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function CMB: TBox;

Contributors: Wanted

Description: Compass bounds.

Date Created: March 12th, 2013. By Wanted. RS07 Build ???.

Last Modified: March 12th, 2013. By Wanted. RS07 Build ???.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

function CMB: TBox;

begin

Result := Box(CMX1, CMY1, CMX2, CMY2);

end; [/sCAR]

 

[sCAR]{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

const RS2 direction/angle Indexes

Contributors: Wanted

Description: Index handles for SetCompassAngle and all runescape directions.

Date Created: November 4th, 2011. By Wanted. RS2 Build 675.

Last Modified: March 6th, 2013. By Wanted. RS07 Build ???.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

const

Dir_North = 0;

Dir_NorthEast = 45;

Dir_East = 90;

Dir_SouthEast = 135;

Dir_South = 180;

Dir_SouthWest = 225;

Dir_West = 270;

Dir_NorthWest = 315;[/sCAR]

 

V5kCu4Y.png

 

Thanks to older RS flag functions are much faster and reliable than in OSI 1 because it's a simple FindColorSpiral of the stem. FlagEx is also timed much better now because the flags don't disappear so soon before you get to your location. Any distance less than 5 pixels is set to a fixed wait due to unpredictability, however it is still very accurate and I don't know why you would be using less than 5 distance anyways.

 

Compass is working SOLID. Returns very accurate results everytime similar to OSI1's super compass.

 

I revamped SetCompassAngle and now it can hold two keys at a time if you want so you can adjust mainscreen height angle and compass angle at the same time.

 

I also designed where if somehow it overshoots your angle it immediately reverses rotation direction by switching keys. You can get very accurate with compass now, however I wouldn't recommend less than the default setting which is 2.5 acc unless you are doing 0, 90, 180, 270... (you can use 0 acc for these lol) for 45 etc.. I would recommend 1-2.5 or more for those... honestly I wouldn't even use SetCompass(Ex).. and just use OSI's recommended 2.5, but I wouldn't rob you the scripter's ability to customize their options as much as reasonably possible.

 

Even RadarWalk is back now! All that's left for Map.scar pretty much is the MMDot functions which I will do tomorrow.

 

Other than all that we have 4 new color wrapper that emulate spiral searching with FindColor(...)TPA

 

[sCAR] * function FindColorSpiralTPA(SP: TPoint; var P: TPoint; Color: LongInt; TPA: TPointArray): Boolean;

By: Wanted

* function FindColorSpiralTPAEx(SP: TPoint; var TPA: TPointArray; Color: LongInt; SearchTPA: TPointArray): Boolean;

By: Wanted

* function FindColorSpiralTPATol(SP: TPoint; var P: TPoint; Color: LongInt; TPA: TPointArray; Tol: LongInt): Boolean;

By: Wanted

* function FindColorSpiralTPATolEx(SP: TPoint; var TPA: TPointArray; Color: LongInt; SearchTPA: TPointArray; Tol: LongInt): Boolean;

By: Wanted[/sCAR]

 

Oh and I added support for if your char logs into a different world too quickly and needs to wait while profile is being transferred :)

 

More good stuff coming soon! SMART, Bank, MMDot, Options tab, Stats tab, more gametabs etc..

 

Get the feedback coming!

Edited by Wanted
Link to comment
Share on other sites

Sweet update man!

 

Just curious, did you base the SetCompassAngle() on compass needle or the player view (angle where your player is looking at in RS07)?

In MSSL I based RS07_SetCompass() on player view, as seen in this photo below:

 

V5kCu4Y.png

 

..and if you did base it on the compass needle, are you planning to add support in for player view aswell (player view is always the same, pointing to north)

 

Obviously, I could have tested or looked at source for this, but damn I can be lazy sometimes. :D

 

-Jani

Link to comment
Share on other sites

[sCAR]{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

const RS2 direction/angle Indexes

Contributors: Wanted

Description: Index handles for SetCompassAngle and all runescape directions.

Date Created: November 4th, 2011. By Wanted. RS2 Build 675.

Last Modified: March 6th, 2013. By Wanted. RS07 Build ???.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

const

Dir_North = 0;

Dir_NorthEast = 45;

Dir_East = 90;

Dir_SouthEast = 135;

Dir_South = 180;

Dir_SouthWest = 225;

Dir_West = 270;

Dir_NorthWest = 315;[/sCAR]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...