Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'msi-sps2.0'

  • Loading branch information...
commit 2e53dcf156985ec088d7bd23599de03a3329cc6c 2 parents 000308d + 01f74a8
@cohenadair cohenadair authored
View
2  MSI/Core/Locations.simba
@@ -1069,7 +1069,7 @@ begin
begin
name := 'Crafting Guild Silver';
spsBox := intToBox(3594, 3495, 3609, 3515);
- compass := randomRange(315, 360);
+ compass := randomRange(105, 130);
subLocs[i].camera := SRL_ANGLE_HIGH;
objects := [ROCK_SILVER];
end;
View
1  MSI/Core/Objects.simba
@@ -1329,6 +1329,7 @@ begin
Tol := 12;
Hue := [0.05];
Sat := [0.60];
+ RightClickOnly := true;
end;
PORTAL_EARTH:
View
2  MSI/Core/Obstacles.simba
@@ -453,7 +453,7 @@ begin
makeCompass(obs.camera[0]);
- while ((not result) and (t < 5)) do
+ while ((not result) and (t < 10)) do
begin
inc(t);
View
34 MSI/Core/Scripts.simba
@@ -956,8 +956,8 @@ begin
TPointArray([Point(279, 507), Point(356, 499)])
];
- SPSSurfaces := [RUNESCAPE_SURFACE, DWARVEN_MINE];
- SPSAreas := [TStringArray(['9_7', '9_8']), TStringArray(['0_1'])];
+ SPSSurfaces := [RUNESCAPE_SURFACE, RUNESCAPE_OTHER];
+ SPSAreas := [TStringArray(['9_7', '9_8']), TStringArray(['dwarven_mine'])];
Obstacles[OBS_LOC_TO] := [OBS_LADDER_MG_DOWN];
Obstacles[OBS_LOC_FROM] := [OBS_LADDER_MG_UP];
@@ -987,7 +987,7 @@ begin
SPSPath := [
// bank to outside guild
- TPointArray([Point(3885, 3240), Point(3864, 3284),
+ TPointArray([Point(3885, 3237), Point(3864, 3284),
Point(3863, 3379), Point(3739, 3527),
Point(3646, 3487), Point(3570, 3500)]),
@@ -1671,15 +1671,17 @@ begin
endLoc := LOC_ALTAR_AIR;
spsPath := [
- TPointArray([Point(4579, 2906), Point(4353, 3025)]),
+ TPointArray([Point(4565, 2907), Point(4563, 2935),
+ Point(4347, 3019)]),
+
TPointArray([])
];
spsAreas := [
- TStringArray(['11_7', '10_7']), TStringArray(['0_0'])
+ TStringArray(['11_7', '10_7']), TStringArray(['runecrafting_altars'])
];
- spsSurfaces := [RUNESCAPE_SURFACE, RUNECRAFTING_ALTARS];
+ spsSurfaces := [RUNESCAPE_SURFACE, RUNESCAPE_OTHER];
obstacles[OBS_LOC_TO] := [OBS_RUINS_AIR];
obstacles[OBS_LOC_FROM] := [OBS_PORTAL_AIR];
@@ -1718,10 +1720,10 @@ begin
];
spsAreas := [
- TStringArray(['12_6', '12_7']), TStringArray(['0_0'])
+ TStringArray(['12_6', '12_7']), TStringArray(['runecrafting_altars'])
];
- spsSurfaces := [RUNESCAPE_SURFACE, RUNECRAFTING_ALTARS];
+ spsSurfaces := [RUNESCAPE_SURFACE, RUNESCAPE_OTHER];
obstacles[OBS_LOC_TO] := [OBS_RUINS_EARTH];
obstacles[OBS_LOC_FROM] := [OBS_PORTAL_EARTH];
@@ -1759,10 +1761,10 @@ begin
];
spsAreas := [
- TStringArray(['12_9']), TStringArray(['0_0'])
+ TStringArray(['12_9']), TStringArray(['runecrafting_altars'])
];
- spsSurfaces := [RUNESCAPE_SURFACE, RUNECRAFTING_ALTARS];
+ spsSurfaces := [RUNESCAPE_SURFACE, RUNESCAPE_OTHER];
obstacles[OBS_LOC_TO] := [OBS_RUINS_FIRE];
obstacles[OBS_LOC_FROM] := [OBS_PORTAL_FIRE];
@@ -1800,10 +1802,10 @@ begin
];
spsAreas := [
- TStringArray(['10_9', '11_9']), TStringArray(['0_0'])
+ TStringArray(['10_9', '11_9']), TStringArray(['runecrafting_altars'])
];
- spsSurfaces := [RUNESCAPE_SURFACE, RUNECRAFTING_ALTARS];
+ spsSurfaces := [RUNESCAPE_SURFACE, RUNESCAPE_OTHER];
obstacles[OBS_LOC_TO] := [OBS_RUINS_WATER];
obstacles[OBS_LOC_FROM] := [OBS_PORTAL_WATER];
@@ -1843,10 +1845,10 @@ begin
];
spsAreas := [
- TStringArray(['9_7', '9_6']), TStringArray(['0_0'])
+ TStringArray(['9_7', '9_6']), TStringArray(['runecrafting_altars'])
];
- spsSurfaces := [RUNESCAPE_SURFACE, RUNECRAFTING_ALTARS];
+ spsSurfaces := [RUNESCAPE_SURFACE, RUNESCAPE_OTHER];
obstacles[OBS_LOC_TO] := [OBS_RUINS_MIND];
obstacles[OBS_LOC_FROM] := [OBS_PORTAL_MIND];
@@ -1885,10 +1887,10 @@ begin
];
spsAreas := [
- TStringArray(['10_6', '10_7', '9_6', '9_7']), TStringArray(['0_0'])
+ TStringArray(['10_6', '10_7', '9_6', '9_7']), TStringArray(['runecrafting_altars'])
];
- spsSurfaces := [RUNESCAPE_SURFACE, RUNECRAFTING_ALTARS];
+ spsSurfaces := [RUNESCAPE_SURFACE, RUNESCAPE_OTHER];
obstacles[OBS_LOC_TO] := [OBS_RUINS_BODY];
obstacles[OBS_LOC_FROM] := [OBS_PORTAL_BODY];
View
94 MSI/Core/Walking.simba
@@ -55,6 +55,7 @@ begin
t := (getSystemTime + 10000);
anim := MSI_GetAnimation(ANIM_IDLE);
+ setAngle(SRL_ANGLE_HIGH);
while (getSystemTime < t) do
begin
@@ -76,6 +77,13 @@ begin
continue;
end;
+ // wait for the player to stop moving
+ if (flagDist <= 0) then
+ repeat
+ if (not isMoving()) then
+ exit;
+ until(getSystemTime > t);
+
// close enough to the flag or not moving
if (flagDistance <= flagDist) or (MSI_IsAnimating(anim)) then
break;
@@ -119,7 +127,7 @@ begin
//SPS_Debug := true;
SPS_Setup(surface, areas);
- MSI_Debug('MSI_SetupSPS: Surface: '+toStr(SPS_Surface.Name)+', Areas: '+toStr(areas));
+ MSI_Debug('MSI_SetupSPS: Areas: '+toStr(areas));
{$ELSE}
MSI_Debug('MSI_SetupSPS: SPS isn''t defined');
{$ENDIF}
@@ -364,7 +372,6 @@ function MSI_FurthestPoint(tPath: TPointArray; P: TPoint): Integer;
var
i, h: Integer;
begin
-
// finds the furthest visible point
h := high(tPath)
for i := h downto 0 do
@@ -381,63 +388,6 @@ begin
end;
(*
-MSI_PathBetween
-~~~~~~~~~~~~~~~
-
-.. code-block:: pascal
-
- function MSI_PathBetween(fT, tT: TPoint; tDist, Rand: Integer): TPointArray;
-
-Creates a TPA between points (fT and tT), tDist intervals, Rand randonmness.
-
-.. note::
-
- | Author: Nava2
- | Last Updated: 04 October 2011 by Nava2
-
-Example:
-
-.. code-block:: pascal
-
- See MSI_EnterPath in
- `Walking.simba <https://github.com/SRL/MSI/raw/master/MSI/Core/Walking.simba>`_.
-*)
-function MSI_PathBetween(fT, tT: TPoint; tDist, Rand: Integer): TPointArray;
-var
- hyp, xR, yR: Extended;
- l: Integer;
-begin
- if not LoggedIn then
- Exit;
-
- // set Result Length and first point at initial Point
- SetLength(Result, Ceil(Distance(fT.X, fT.y, tT.X, tT.Y) * 1.0 / tDist) + 1);
- Result[0] := fT;
-
- // if no need for intermediate Points then nvm. :)
- if (Distance(fT.X, fT.Y, tT.X, tT.Y) <= tDist) then
- begin
- Result[High(Result)] := tT;
- Exit;
- end;
-
- // ratios for 'Similar Triangles' maths
- hyp := Hypot(fT.X - tT.x, fT.Y - tT.Y);
- xR := (tT.X - fT.X) / hyp;
- yR := (tT.Y - fT.Y) / hyp;
-
- // set points
- for l := High(Result) - 1 downto 1 do
- begin
- Result[l].X := Round(fT.X + l * tDist * xR) + RandomRange(-Rand, Rand);
- Result[l].Y := Round(fT.Y + l * tDist * yR) + RandomRange(-Rand, Rand);
- end;
-
- // last point is tT
- Result[High(Result)] := tT;
-end;
-
-(*
MSI_ExpandPath
~~~~~~~~~~~~~~
@@ -469,7 +419,7 @@ begin
SetLength(t, h);
for i := 1 to h do
- t[i - 1] := MSI_PathBetween(ctrlPoints[I - 1], ctrlPoints[I], tDist, Randomness);
+ t[i - 1] := TPABetweenPoints(ctrlPoints[I - 1], ctrlPoints[I], tDist, Randomness);
Result := MergeATPA(t);
end;
@@ -503,7 +453,7 @@ var
begin
if (MSI_PointOnPath(i, Path, PPos, maxDist)) then
begin
- tmpPath := MSI_PathBetween(PPos, Path[i], DIST_BETWEEN_POINTS, DIST_RANDOMNESS);
+ tmpPath := TPABetweenPoints(PPos, Path[i], DIST_BETWEEN_POINTS, DIST_RANDOMNESS);
{$IFDEF SPS}
result := SPS_WalkPath(tmpPath);
@@ -532,7 +482,7 @@ the rest of the path.
.. note::
| Author: Nava2
- | Last Updated: 15 March 2012 by Coh3n
+ | Last Updated: 04 April 2012 by Coh3n
Example:
@@ -543,7 +493,7 @@ Example:
function MSI_WalkTPA(Path: TPointArray; Destination, MaxDist: Integer): Boolean;
var
playerPos, dPoint: TPoint;
- h, d, nextPoint, attempts, dist: integer;
+ h, d, nextPoint, attempts, dist, flagDist: integer;
begin
if (not(loggedIn)) then
exit;
@@ -586,13 +536,21 @@ begin
begin
MSI_Debug(format('Next Point: %d (%d, %d)', [nextPoint, path[nextPoint].x, path[nextPoint].y]));
- if (MSI_WalkPoint(path[nextPoint], playerPos, randomRange(5, 10)*integer(nextPoint<>h))) then
+ // to make sure we only click the final point once (to be as close to the end point as possible)
+ if (distance(path[nextPoint].x, path[nextPoint].y, path[h].x, path[h].y) <= DIST_FROM_END) then
+ flagDist := 0
+ else
+ flagDist := randomRange(15, 20);
+
+ if (MSI_WalkPoint(path[nextPoint], playerPos, flagDist)) then
begin
attempts := 0;
wait(100 + random(100));
playerPos := MSI_GetMyPos();
end;
- end;
+
+ end else
+ playerPos := MSI_GetMyPos();
inc(attempts);
@@ -604,6 +562,9 @@ begin
end;
MSI_CloseHeader('MSI_WalkTPA: '+boolToStr(result));
+
+ if (not Result) then
+ MSI_FindRandoms(true);
end;
(*
@@ -672,6 +633,9 @@ begin
tmpSurfaces := MSI_MirrorTIA(pathInfo.spsSurfaces);
end;
+ if (inRange(round(rs_GetCompassAngleDegrees()), 5, 350)) then
+ clickNorth(SRL_ANGLE_HIGH);
+
// set a defaul maxDist field
if (pathInfo.maxDist <= 0) then
pathInfo.maxDist := 70;
Please sign in to comment.
Something went wrong with that request. Please try again.