Guise, holy shit, reflection features without reflection?!?
Guise, holy shit, reflection features without reflection?!?
Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
{ MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }
When posting a bug, please post debug! Help us, help you!
I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.
SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.
I'd love if we could get this into the includes somehow.
"Logic never changes, just the syntax" - Kyle Undefined?
Remember, The Edit Button Is There For A Reason!!!
I plan on adding it to math.simba. Also I'm really debating on using this for our MMtoMS instead (its way more accurate I think).
Simba Code:Function MMtoMS2(MM: TPoint): TPoint;
var
Yh, yMod, X, Y: Extended;
begin
X := MM.x-627.0;
Y := MM.y-85.0;
yMod := 36.0;
Yh := Abs(Y + yMod);
Result.x := Round(263.5 + (X*9.75/(12.8-(Yh/yMod*3.15))) * 9.75);
Result.y := Round(182.0 + Y * (6.3 + ((Yh/yMod)*2.4)));
if not PointInBox(Result, MSBox) then
Result := Point(-1, -1);
end;
(Scripts outdated until I update for new SRL changes)
AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
Summer = me busy, won't be around much.
Like this?
Simba Code:Function GridCoords16(Grid16: TPoint): TPoint;
var
Yh, yMod: Extended;
begin
yMod := 36.0;
Yh := Abs((Grid16.y+0.0) + yMod);
Result.x := Round(263.5 + ((Grid16.x)*9.75/(12.8-(Yh/yMod*3.15))) * 9.75);
Result.y := Round(182.0 + (Grid16.y+0.0) * (6.3 + ((Yh/yMod)*2.4)));
if not PointInBox(Result, MSBox) then
Result := Point(-1, -1);
end;
Function GetAbstractGridBoxCords(Grid: TPoint): TPointArray;//Length = 4 always
var
T: TPoint;
i: integer;
begin
T := Point(Grid.x*4, Grid.y*4);
Result := [GridCoords16(Point(T.x-2, T.y-2)), GridCoords16(Point(T.x+1, T.y-2)),
GridCoords16(Point(T.x+1, T.y+1)), GridCoords16(Point(T.x-2, T.y+1))];
for i := 0 to 3 do
if Result[i].x = -1 then
begin
Result := [Point(-1,-1), Point(-1,-1), Point(-1,-1), Point(-1,-1)];
Exit;
end;
end;
Function GetGridPos(PT: TPoint): TPoint;
var
x, y: integer;
TPA: TPointArray;
begin
Result := Point(-100, -100); //fail point
for x := -8 to 8 do
for y := -8 to 5 do
begin
TPA := GetAbstractGridBoxCords(Point(x,y));
if TPA[0].x = -1 then
Continue;
if InAbstractBox(TPA[0].x, TPA[0].y, TPA[1].x, TPA[1].y, TPA[2].x, TPA[2].y, TPA[3].x, TPA[3].y, PT.x, PT.y) then
begin
Result := Point(x, y);
Exit;
end;
end;
end;
Still working on it, like adding Height or just using X/Y mods.
(Scripts outdated until I update for new SRL changes)
AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
Summer = me busy, won't be around much.
Narcle, I wrote these while rewriting the randoms. Very useful for just creating a standard grid for the inventory, or bank, for example. I'll be using it to create boxes to check for items in Mordaut and Quiz, probably some others as well (and it can probably be used for inventory/bank, for later versions of SRL).
I was probably going to add them to math.simba, so if you want to add them when you add yours, feel free.
Used like:Simba Code:(*
GridBox
~~~~~~~
.. code-block:: pascal
function GridBox(slot, columns, rows, w, h, diffX, diffY: integer; startPoint: TPoint): TBox;
Returns a TBox of the slot 'slot' in a grid created by the other parameters.
Slots start with 1 being the top left of the grid, and counting accross.
* columns: number of columns in the grid
* rows: number of rows in the grid
* w: the width of each box in the grid
* h: the height of each box in the grid
* diffX: pixels from center to center (x)
* diffY: pixels from center to center (y)
* startPoint: the center point of the top left box in the grid
.. note::
Author: Coh3n
Last Modified: Jan. 25th, 2012 by Coh3n
Example:
.. code-block:: pascal
Result := GridBox(Slot, 4, 2, 95, 80, 0, 150, Point(110, 100));
*)
function GridBox(slot, columns, rows, w, h, diffX, diffY: integer; startPoint: TPoint): TBox;
begin
if (slot > (columns * rows)) then
begin
writeln('GridBox: Invalid slot: '+toStr(slot));
exit;
end;
result.x1 := (startPoint.x + (((slot - 1) mod columns) * diffX) - (w / 2));
result.y1 := (startPoint.y + (((slot - 1) div columns) * diffY) - (h / 2));
result.x2 := (result.x1 + w);
result.y2 := (result.y1 + h);
end;
(*
Grid
~~~~
.. code-block:: pascal
function Grid(columns, rows, w, h, diffX, diffY: integer; startPoint: TPoint): TBoxArray;
Returns a grid of TBoxes (see GridBox for parameters).
.. note::
Author: Coh3n
Last Modified: Jan. 25th, 2012 by Coh3n
Example:
.. code-block:: pascal
SMART_DrawBoxes(false, Grid(5, 10, 20, 20, 25, 25, point(30, 30)), clYellow);
*)
function Grid(columns, rows, w, h, diffX, diffY: integer; startPoint: TPoint): TBoxArray;
var
i: integer;
begin
setLength(result, (columns * rows));
for i := 0 to high(result) do
result[i] := GridBox(i + 1, columns, rows, w, h, diffX, diffY, startPoint);
end;
Doesn't really have much to do with this thread, other than they're a different kind of grid function. You can test by callingSimba Code:(**
* Author: Coh3n
* Description: Returns a TBox of the small puzzle item slot 'Slot'. Top right
* is slot 1, botton right is slot 8.
*)
function MD_SmallBox(Slot: Integer): TBox;
begin
Result := GridBox(Slot, 4, 2, 95, 80, 95, 150, Point(110, 100));
end;
Simba Code:SMART_DrawBoxesEx(false, Grid(4, 2, 95, 80, 95, 150, Point(110, 100)), clGreen);
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
I was facing north at highest angle.
Now i ran the grid 16 box code to draw all the tiles, and I noticed that the lower left tiles on screen are bit(maybe more) off
"Logic never changes, just the syntax" - Kyle Undefined?
Remember, The Edit Button Is There For A Reason!!!
(Scripts outdated until I update for new SRL changes)
AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
Summer = me busy, won't be around much.
Seeing as, would this work for random's like evil twin? considering the Camera move's out from a fixed point?
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
Is this still alive? Looked very promising!
Luke
It's already been added to SRL.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
I'm playing around with these functions at the moment, and it seems as though it only works when you are fully zoomed in (in RS visual settings). I thought that it was standard to have it zoomed all the way out? I would try and fix it, but I have no idea of the maths involved! So yeah - just wanted to give you guys the heads up on this, and if anyone knows the maths for how to make it compatible with the zoomed out.
Also, the boxes left-hand side are weird, and some boxes are incomplete :/ I've had a look at the code, and it seems all good - Narcle is pretty beast... I wanted to use those boxes to search in and stuff
I'm using this:
Simba Code:program new;
{$DEFINE SMART8}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
Function GridCoords16(Grid16: TPoint): TPoint;
var
Yh, yMod: Extended;
begin
yMod := 36.0;
Yh := Abs((Grid16.y+0.0) + yMod);
Result.x := Round(263.5 + ((Grid16.x)*9.75/(12.8-(Yh/yMod*3.15))) * 9.75);
Result.y := Round(182.0 + (Grid16.y+0.0) * (6.3 + ((Yh/yMod)*2.4)));
if not PointInBox(Result, MSBox) then
Result := Point(-1, -1);
end;
Function MMtoMSG16(x, y: integer): TPoint;
begin
Result := GridCoords16(Point(x-627, y-85));
end;
procedure DrawGridBox(PT: TPoint; Color: integer);
var
T: TPoint;
i: integer;
ATPA: T2DPointArray;
begin
T := Point(PT.x*4, PT.y*4);
SetLength(ATPA, 4);
ATPA[0] := [GridCoords16(Point(T.x-2, T.y-2)), GridCoords16(Point(T.x+1, T.y-2))];
ATPA[1] := [GridCoords16(Point(T.x-2, T.y+1)), GridCoords16(Point(T.x+1, T.y+1))];
ATPA[2] := [GridCoords16(Point(T.x-2, T.y-2)), GridCoords16(Point(T.x-2, T.y+1))];
ATPA[3] := [GridCoords16(Point(T.x+1, T.y-2)), GridCoords16(Point(T.x+1, T.y+1))];
for i := 0 to 3 do
begin
if (ATPA[i][0].x = -1) or (ATPA[i][1].x = -1) then
Continue;
SMART_DrawLine(False, ATPA[i][0], ATPA[i][1], Color);
End;
end;
var
x, y, i: integer;
T: TPoint;
npc: TPointArray;
begin
SRL_SixHourFix := True;
Smart_FixSpeed := True;
SetupSRL;
//SaveScreenshot(AppPath+'Grid shit 3.bmp');
SMART_ClearCanvas;
for x := -36 to 36 do
for y := -30 to 14 do
begin
T := GridCoords16(Point(x, y));
if (T.x = -1) then
Continue;
//SMART_DrawBoxEx(False, GridBox(Point(x, y)), clRed);
if (x = 0) and (y = 0) then
SMART_DrawDotsEx(false, [GridCoords16(Point(x, y))], clRed)
else
SMART_DrawDotsEx(false, [GridCoords16(Point(x, y))], clBlue);
end;
for x := -8 to 8 do
for y := -8 to 5 do
DrawGridBox(Point(x,y), clGreen);
npc := GetMiniMapDots('npc');
for i := 0 to high(NPC) do
Begin
T := MMtoMSG16(NPC[i].x, NPC[i].y);
if not PointInBox(T, MSBox) then
Continue;
SMART_DrawDotsEx(false, [T], clRed);
SMART_DrawBoxEx(False, False, IntToBox(T.x-2, T.y-2, T.x+2, T.y+2), clYellow);
SMART_DrawBoxEx(False, False, IntToBox(T.x-10, T.y-30, T.x+10, T.y+10), clBlue);
end;
end.
INACTIVE
How-to: Make S.M.A.R.T. less laggy
Sell me your Maple Shieldbows (u)! Up to 95gp ea!
My Scripts:
Ivy Chopper Ultra [RS3] | Fantastic Fletcher [RS3]
99 x78 | 99 x10 | 99 x2 | 99 x12
Use the REPORT tags when posting progress reports to make life easier (:
[REPORT]Put progress report in here![/REPORT]
Super Savvy Smither V1.06Cool Classy Cooker V1.02 [EoC]
@-daazndagger-
Yeah this is the main problem, MMtoMS functions were designed back when that was the zoom setting, but semi recently jagex released custom zoom-able and for obvious reasons the furthest zoom is the best/most used. Im sure its an easy fix if you created it (hey @Narcle ) or if you understand the math, must be something like adding more tiles or something.
Is this still used/viable?
There are currently 1 users browsing this thread. (0 members and 1 guests)