Reflection 2 -In the Making-
Drakan
2011-05-23 00:30:50
It's probably more appropriately named Reflection 10,000, but whatever. This time we're for reals. That's right, we [me, pyroryan, mormonman, and echo_] are strippin' it down and buildin' it back up. Well, we've pretty much already done it. We're pretty much done in fact! So be advised this is going to happen, and it's going to happen soon.
So what does this entail?The reflection include has been redone and for the better. We've removed bad code, found and fixed memory leaks, added more useful stuff, more accurate stuff, and cooler stuff. Just yesterday I spent the whole day getting Absolute Coords to work, and it works wonders. Bank.simba was completely redone and now has the ability to withdraw perfectly using scrolling and all. All these changes and more to better help scriptors make more accurate and better bots.
All this is great, but what's the downside?Every script will be broken. Some may require a couple of line changes, and some may require bigger changes, but the fact is there will probably not be one script that doesn't need some changes of some sort. It might be a little frustrating at first, but this is a necessary and proper change to the include. And most changes aren't very big anyway. One example of a change is that every function or procedure will have R_ in front of it. EVERY one.
Here's what we will do though. When we release Reflection 2, we will keep the old git open for ~2 more weeks. This will give authors a few weeks to make the changes needed to be up to date with the new include. After those 2 weeks, however, we will shut down the old git and everyone will be using the new one.
When can this be expected?I would say give it 1 more week, maybe 2. Depending on how things go with school for me and pyro, it should be out in the coming weekend. All that is really left is antirandoms, and some other small changes. Most of everything has been completed. We don't want to rush anything, as we want perfection in this include. We will do our best to get it here in a timely fashion.
Can we see the development git?You can, but I wouldn't recommend using it, unless you really know what you're doing. I want to get it out there so that script developers can see the changes and get a head start on transitioning their scripts over to the new include.
https://github.com/Drags111/Reflection_DevTo be honest the changes to the scripts shouldn't be that bad, but it's up to every author to look through the changes and make sure they have everything they need.
Thank you for your time, patience, efforts, feedback, love, care, etc. We appreciate all of your combined efforts to help make this an awesome community.
Sincerely,
Reflection Developers
Drags111, pyroryan, mormonman, Echo_
Harry
2011-05-23 00:34:31
Great, I am glad you're fixing all the broken stuff. But, can't you keep the "old git" open and just commit the new files when it's release time?
By the way, are you planning on leaving comments in, or are you stripping them all? Looking at the changelogs you appear to remove a lot of them, which I think is very useful for learning.
Drakan
2011-05-23 00:36:24
From: Harry
Great, I am glad you're fixing all the broken stuff. But, can't you keep the "old git" open and just commit the new files when it's release time?
I don't see why not I guess, but I also don't really see a reason to keep it open. The one featured in the simba updater will be the new one for sure though.
Also I'll probably put them back in. It's a good idea.
Do you know what a branch is?
Nava2
2011-05-23 01:54:16
Two things I would like to see:
1) Using a library approach to organizing the include. For example, check out:
https://github.com/Nava2/SRL-5/tree/NewStruct2) Use the old git once this is complete.. I do believe this should be worked on in the current git using a branch though. There's no need for a separate repository and all of the super secrecy more or less goes against the general ideology of FOSS.
Lastly though, I want to say great work and I'm really glad to see others taking the initiative and work to do what I have longed to do for a long time and used to do. Keep it up! :)
Flight
2011-05-23 02:11:06
This is wonderful news, I can't wait to see all the improvements! I really hope the ones, I personally am needing, are included. :)
Runescape Pro
2011-05-23 02:45:45
As soon as this is out ya'll gone be on ma stick homiez =P
I got plans ;)
Shuttleu
2011-05-23 03:36:30
yay, congratz, but im assuming the reason there is no r_GetSkillLevel/Experience is because you havent made it yet?
~shut
kingarabian
2011-05-23 04:48:30
Great job mate keep it up.
Edit: Hopefully we can tackle All the randoms soon.
Harry
2011-05-23 05:26:35
Antirandoms are going to be handled later I heard. The focus is on fixing the core stuff first, then moving on to randoms.
Naike
2011-05-23 06:18:38
Sounds good in theory..
I'd love to help out with a random, if you guys let me :)
Iamadam
2011-05-23 07:41:14
Drakan
2011-05-23 09:29:03
From: Nava2
Two things I would like to see:
1) Using a library approach to organizing the include. For example, check out: https://github.com/Nava2/SRL-5/tree/NewStruct
2) Use the old git once this is complete.. I do believe this should be worked on in the current git using a branch though. There's no need for a separate repository and all of the super secrecy more or less goes against the general ideology of FOSS.
Lastly though, I want to say great work and I'm really glad to see others taking the initiative and work to do what I have longed to do for a long time and used to do. Keep it up! :)
Can do. Pyro thought it be best to make a new one but we could do that for sure. Also I'll take a look at that structure later, as I have school right now.
@Naike: Of course I'd love to have you help with randoms! :D
@Flight: What sort of things are you lookin for? If you guys have requests, now would be a good time to post em.
@Iamadam: I'll look into it. Let me do some testing on it, see how slow it really is, and see what we can do about it. I'm trying to keep this as stable as quick as possible.
Echo_
2011-05-23 09:31:02
Ooh, absolute coords :drool:
Coh3n
2011-05-23 11:17:42
What exactly does absolute coords do?
Also, change R_WebWalk to R_BlindWalk or something. It's not web walking, it just walks in a line from where the player is to the end tile - that's not web walking.
Great job. :)
Flight
2011-05-23 11:43:34
From: drags111
@Flight: What sort of things are you lookin for? If you guys have requests, now would be a good time to post em.
Right now I just have two suggestions coming to mind.
This probably won't be in high demand but I'd sure appreciate it.
http://villavu.com/forum/showthread.php?t=64322And maybe a better object-finding for WallObjects. I noticed finding a wall object is no problem, but we apparently use the same tile-to-ms procedures for them as we do for literally everything else. This makes it really hard when you're trying to click a wall object but instead you click the ground tile underneath it. I don't know if that's a good enough explanation for what I'm talking about. A couple good examples are… ivy (I think), the teleport lever in Ardounge to the deep wilderness, and the 'floating' rifts in the Abyss that teleport you to the appropriate Runecrafting alter. I hope you know what I'm talking about.
Or maybe this is part of absolute coordinates?
Drakan
2011-05-23 12:06:10
coh3n, absolute coords give us the opportunity to return the exact screen position of interface components. this is very useful in banking, randoms, map, and anything that has to do with interfaces
flight:that would be something for models but you can use the height position and x and y offsets to get a more accurate point. models dont seem practical in pascal as they are very slow but we wil look into it when the time comes.
and yes i planned on changing webwalk to windwalk. also we have been studying up on making a webwalk but that is all after we are done.
pyroryan
2011-05-23 13:19:18
From: Nava2
2) Use the old git once this is complete.. I do believe this should be worked on in the current git using a branch though. There's no need for a separate repository and all of the super secrecy more or less goes against the general ideology of FOSS.
Given the failure rate of such projects, theres was little reason at the start to developing it on the current main GIT. The current GIT can be used after completion if desired.
Coh3n
2011-05-23 13:21:42
From: drags111
coh3n, absolute coords give us the opportunity to return the exact screen position of interface components. this is very useful in banking, randoms, map, and anything that has to do with interfaces
flight:that would be something for models but you can use the height position and x and y offsets to get a more accurate point. models dont seem practical in pascal as they are very slow but we wil look into it when the time comes.
and yes i planned on changing webwalk to windwalk. also we have been studying up on making a webwalk but that is all after we are done.
A web walker would be nice. A lot of people have worked on ones, but as far as know none have been completely finished to include obstacles and walking around walls, fences, etc. Boreas seems to have a good idea of how to go about things, ReadySteadyGo started developing a web include of some sort, and Cstrike had one that worked without obstacles. He's gone now, but I'm sure some of his code could be of use if you're interested.
Nava2
2011-05-23 14:39:40
From: pyroryan
Given the failure rate of such projects, theres was little reason at the start to developing it on the current main GIT. The current GIT can be used after completion if desired.
Oh yes, understood until it went public. But now that it is.. it should be on the main repository in a Branch. :)
masterBB
2011-05-23 14:43:08
{*******************************************************************************
function R_GetBankTabs: Integer;
By: drags111
Description: Gets the number of bank tabs.
*******************************************************************************}
function R_GetBankTabs: Integer;
var
Tab: TInterfaceComponent;
i, Index, c: Integer;
begin
if not R_BankScreen then Exit;
Result := 0;
c := 1;
Index := 60;
for i := 2 to 9 do
begin
Tab := R_GetInterfaceComponent(INTERFACE_BANK, Index);
if(Length(Tab.Actions) < 2)then
break;
Inc(c);
Index := Index - 2;
end;
Result := c;
end;
Wouldn't 60 could be better a constant. Like INTERFACE_BANK_FIRST_TAB or something like that? It feels a little out of place since you made most interface indexes constants.
The new interfaces.simba looks so sexy, I'm thinking about making a ref 2 interface tutorial.
Drakan
2011-05-23 14:54:55
From: masterBB
{*******************************************************************************
function R_GetBankTabs: Integer;
By: drags111
Description: Gets the number of bank tabs.
*******************************************************************************}
function R_GetBankTabs: Integer;
var
Tab: TInterfaceComponent;
i, Index, c: Integer;
begin
if not R_BankScreen then Exit;
Result := 0;
c := 1;
Index := 60;
for i := 2 to 9 do
begin
Tab := R_GetInterfaceComponent(INTERFACE_BANK, Index);
if(Length(Tab.Actions) < 2)then
break;
Inc(c);
Index := Index - 2;
end;
Result := c;
end;
Wouldn't 60 could be better a constant. Like INTERFACE_BANK_FIRST_TAB or something like that? It feels a little out of place since you made most interface indexes constants.
The new interfaces.simba looks so sexy, I'm thinking about making a ref 2 interface tutorial.
All those will be added in time. Don't focus too much on the little things like that right now, this isn't a release. I have to go through and reorganize things to look more like SRL 5 anyway. I just wanted to get out to you guys the general functionality of the project.
But yah thanks :) I'm also going to be released some vid tutorials on certain things like interfaces/objects/etc, but that will be after the release :)
Boreas
2011-05-23 14:55:31
From: Coh3n
Also, change R_WebWalk to R_BlindWalk or something. It's not web walking, it just walks in a line from where the player is to the end tile - that's not web walking.
)
From: drags111
and yes i planned on changing webwalk to windwalk. also we have been studying up on making a webwalk but that is all after we are done.
<3.
Drakan
2011-05-23 14:57:15
Also we have the means of obstacles and everything. We probably won't need any of their code, we just need to learn how to implement the A* algorithm to it all and do a lot of busy work such as node creation for the walking.
Will The reflection includeds ever include any functions/procedures under skills? like lets say summoning?
Coh3n
2011-05-23 15:07:44
From: drags111
Also we have the means of obstacles and everything. We probably won't need any of their code, we just need to learn how to implement the A* algorithm to it all and do a lot of busy work such as node creation for the walking.
I'm sure you could get a lot of people to help out in the making of nodes assuming it isn't a difficult task (should be written so nodes can be easily added anyway ;)).
Drakan
2011-05-23 15:12:23
Yah I'm sure I can, but I don't want to start tackling that until after I'm finished with school, as this is my last week :) We'll definitely assemble a team and get some public discussion on it when the time comes. There's a few concerns for it in pascal: mainly that of it being too slow. But I think I have some solutions for it. Anyway, we'll get to it when the time comes =]
Coh3n
2011-05-23 15:13:35
From: drags111
Yah I'm sure I can, but I don't want to start tackling that until after I'm finished with school, as this is my last week :) We'll definitely assemble a team and get some public discussion on it when the time comes. There's a few concerns for it in pascal: mainly that of it being too slow. But I think I have some solutions for it. Anyway, we'll get to it when the time comes =]
Yeah for sure. :) Good luck with the rest of school.
masterBB
2011-05-23 15:37:08
From: pur3b100d
Will The reflection includeds ever include any functions/procedures under skills? like lets say summoning?
What do you want to put under it? As most stuff can be done in one line of code. With color you will have to deal with much harder procedures and functions. There it is a huge time saver to include.
Could you give a few examples of what kind of function you want to include?
From: masterBB
Could you give a few examples of what kind of function you want to include?
for example with magic the locations of the spells or summoning the familiar location or how much time it has left.
From: pur3b100d
for example with magic the locations of the spells or summoning the familiar location or how much time it has left.
Reflection isn't necessary for everything you know, SRL still serves it's purpose perfectly fine. IMO basic functions shouldn't even be included in Reflection, as there is really no point as there's really no point since Ref will break before SRL does.
Either way, glad you guys are committing to these MUCH needed changes.
Ransom
2011-05-23 16:24:44
Hey glad to hear this news :) thanks for the hard work!
Drakan
2011-05-23 17:09:03
From: NCDS
Reflection isn't necessary for everything you know, SRL still serves it's purpose perfectly fine. IMO basic functions shouldn't even be included in Reflection, as there is really no point as there's really no point since Ref will break before SRL does.
Either way, glad you guys are committing to these MUCH needed changes.
Well certain things can become faster/better with reflection while some things won't change. I understand your philosophy on the matter and I'm tryin to implement that as much as possible.
masterBB
2011-05-23 17:21:30
From: NCDS
Reflection isn't necessary for everything you know, SRL still serves it's purpose perfectly fine. IMO basic functions shouldn't even be included in Reflection, as there is really no point since Ref will break before SRL does.
What do you mean? I'm making a full color script without reflection, and many color based functions from the SRL include aren't reliable/working. Color breaks after many updates, reflection breaks after each update, but only the hooks. So the functions in the skill related reflection files doesn't need much work to keep it up to date.
Or don't I understand what you try to say?
Drakan
2011-05-23 17:33:36
From: masterBB
What do you mean? I'm making a full color script without reflection, and many color based functions from the SRL include aren't reliable/working. Color breaks after many updates, reflection breaks after each update, but only the hooks. So the functions in the skill related reflection files doesn't need much work to keep it up to date.
Or don't I understand what you try to say?
The thing about SRL is its as dependable as it's scripters. Anyway this isnt a color vs srl argument so lets leave it at that. SRL = more skill, reflection = more accuracy.
n3ss3s
2011-05-23 18:16:06
Nice job with absolute interface coords :)
Gu3st...
2011-05-23 18:19:32
Anyone got cstrike's email? :o
n3ss3s
2011-05-23 18:20:06
From: drags111
Also we have the means of obstacles and everything. We probably won't need any of their code, we just need to learn how to implement the A* algorithm to it all and do a lot of busy work such as node creation for the walking.
(Acknowledged double post, someone merge plz)
If you haven't ported the algorithm to pascal yet -
By sir mastaraymond:
program Hoi;
type
TTpaNode = record
x,y : integer;
Last : integer;
HasBeenChecked : Boolean;
Distance : LongWord;
Roads : Array[0..7] of integer;
RoadExists : Array[0..7] of Boolean;
end;
{Tiles next to eachother x-x dist is 169
Tiles cross to eacother x dist is 239
\
x
}
{const
NW = 0;
W = 1;
SW = 2;
S = 3;
SE = 4;
E = 5;
NE = 6;
N = 7; }
Function PointToStr(PT : TPoint) : String;
begin;
Result := '(' + inttostr(PT.x) + ', ' + inttostr(pt.y) + ')';
end;
function ReverseArr(Arr : TPointArray) : TPointArray;
var
i,l : integer;
begin;
l := high(arr);
Setlength(result,l+1);
for i := 0 to l do
Result[i] := Arr[l-i];
end;
procedure AddToTPA(var TPA : TPointArray; PT : TPoint);
var
x : integer;
begin;
x := Length(TPA);
SetLengtH(TPA,x + 1);
TPA[x] := pt;
end;
Function FilterRandomTPA( TPA : TPointArray) : TPointArray;
var
I : integer;
begin;
AddToTPA(Result,Point(0,0));
for i := 1 to High(TPA) - 1 do
if random(2) <> 0 then
AddToTPA(Result,Point(TPA[i].x,TPA[i].y));
AddToTPA(Result,TPA[High(TPA)]);
end;
Function ShortestRoute(Point1,Point2 : integer; TPA : TPointArray) : TPointArray;
var
I,L,W,H,x,y: integer;
Grid : Array of Array of Integer;
Nodes : Array of TTpaNode;
TempDist : LongWord;
StartNode, EndNode : integer;
Pt1,Pt2 : TPoint;
uNode : Integer;
TempNodeCount,NodeCount : integer;
Box : TBox;
Str : String;
begin;
Box := GetTPABounds(TPA);
SetLength(Grid, box.x2 - Box.x1 + 1);
w := Box.x2 - Box.x1;
h := Box.y2 - Box.y1 + 1;
for i := 0 to w do
SetLength(Grid[i], h);
h := Box.y2 - Box.y1;
l := High(TPA);
NodeCount := (w + 1) * (H + 1);
SetLength(Nodes,l + 1);
for i := 0 to l do
Grid[TPA[i].x - Box.x1][TPA[i].y - Box.y1] := i + 1;
pt1 := Point( TPA[Point1].x - Box.x1, TPA[Point1].y - Box.y1);
pt2 := Point( TPA[Point2].x - Box.x1, TPA[Point2].y - Box.y1);
i := -1;
for y := 0 to h do
begin;
str := '';
for x := 0 to w do
if Grid[x][y] < 1 then
Str := Str + '-'
else
Str := Str + 'x';
Writeln(str);
end;
for i := 0 to l do
begin;
Nodes[i].x := TPA[i].x;
Nodes[i].y := TPA[i].y;
Nodes[i].Last := -1;
Nodes[i].Distance :=2147483647;
if (TPA[i].x = Pt1.x) and (TPA[i].y = pt1.y) then
StartNode := i
else if (TPA[i].x = pt2.x) and (TPA[i].y = pt2.y) then
EndNode := i;
if (TPA[i].x > 0) and (TPA[i].y > 0) then
begin;
Nodes[i].Roads[0] := Grid[TPA[i].x-1][TPA[i].y-1] - 1;//(x-1) + (y-1) *WPlus;
Nodes[i].RoadExists[0] := Grid[TPA[i].x-1][TPA[i].y-1] >= 1;
end;
if (TPA[i].x > 0) then
begin;
Nodes[i].Roads[1] := Grid[TPA[i].x-1][TPA[i].y] - 1; //Nodes[i].Roads[1] := Grid[x-1][y];
Nodes[i].RoadExists[1] := Grid[TPA[i].x-1][TPA[i].y]>= 1;;
end;
if (TPA[i].x > 0) and (TPA[i].y < h) then
begin;
Nodes[i].Roads[2] := Grid[TPA[i].x-1][TPA[i].y+1]- 1; //Nodes[i].Roads[2] := Grid[x-1][y+1];
Nodes[i].RoadExists[2] := Grid[TPA[i].x-1][TPA[i].y+1]>= 1;;
end;
if (TPA[i].y < h) then
begin;
Nodes[i].Roads[3] := Grid[TPA[i].x][TPA[i].y+1]- 1; //Nodes[i].Roads[3] := Grid[x][y+1];
Nodes[i].RoadExists[3] := Grid[TPA[i].x][TPA[i].y+1]>= 1;;
end;
if (TPA[i].x < w) and (TPA[i].y < h) then
begin;
Nodes[i].Roads[4] :=Grid[TPA[i].x + 1][TPA[i].y + 1]- 1; //Nodes[i].Roads[4] := Grid[x + 1][y + 1];
Nodes[i].RoadExists[4] := Grid[TPA[i].x + 1][TPA[i].y + 1]>= 1;;
end;
if (TPA[i].x < w) then
begin;
Nodes[i].Roads[5] := Grid[TPA[i].x + 1][TPA[i].y]- 1; //Nodes[i].Roads[5] := Grid[x + 1][y];
Nodes[i].RoadExists[5] := Grid[TPA[i].x + 1][TPA[i].y]>= 1;;
end;
if (TPA[i].x < w) and (TPA[i].y > 0) then
begin;
Nodes[i].Roads[6] := Grid[TPA[i].x + 1][TPA[i].y - 1]- 1; // Nodes[i].Roads[6] := Grid[x + 1][y - 1];
Nodes[i].RoadExists[6] := Grid[TPA[i].x + 1][TPA[i].y - 1]>= 1;;
end;
if (TPA[i].y > 0) then
begin;
Nodes[i].Roads[7] :=Grid[TPA[i].x][TPA[i].y-1]- 1; //Nodes[i].Roads[7] := Grid[x][y-1];
Nodes[i].RoadExists[7] := Grid[TPA[i].x][TPA[i].y-1]>= 1;;
end;
end;
Nodes[StartNode].Distance := 0;
TempNodeCount :=l;
While TempNodeCount > 0 do
begin;
TempDist := 2147483647;
for i := 0 to l do
if (Nodes[i].HasBeenChecked = false) then
begin;
if NOdes[i].Distance < TempDist then
begin;
TempDist := Nodes[i].Distance;
uNode := i;
end;
end;
if TempDist = 2147483647 then
Break;
// Writeln(PointToStr(Point(Nodes[uNode].x,Nodes[uNode].y)));
Nodes[uNode].HasBeenChecked := True;
for i := 0 to 7 do
if Nodes[uNode].RoadExists[i] then
if (Nodes[Nodes[uNode].Roads[i]].HasBeenChecked = false) then
begin;
{Tiles next to eachother x-x dist is 169
Tiles cross to eacother x dist is 239
\
x
}
case i of
0,2,4,6 : TempDist := Nodes[uNode].Distance + 239;
1,3,5,7 : TempDist := Nodes[uNode].Distance + 169;
end;
if TempDist < Nodes[Nodes[uNode].Roads[i]].Distance then
begin;
Nodes[Nodes[uNode].Roads[i]].Distance := TempDist;
Nodes[Nodes[uNode].Roads[i]].Last := uNode;
// Writeln(inttostr(Nodes[Nodes[uNode].Roads[i]].Distance) +'-'+ inttostr(Nodes[Nodes[uNode].Roads[i]].x) + '-' + inttostr(Nodes[Nodes[uNode].Roads[i]].y));
end;
end;
Dec(TempNodeCount);
end;
uNode := EndNode;
if Nodes[uNode].Last > -1 then
begin;
SetLength(Result, NodeCount);
Result[0] := Point(Nodes[EndNode].x,Nodes[EndNode].y);
i := 1;
while Nodes[uNode].Last > -1 do
begin;
Result[i] := Point(Nodes[Nodes[uNode].Last].x,Nodes[Nodes[uNode].Last].y);// Nodes[uNode].Last;
uNode := Nodes[uNode].Last;
inc(i);
end;
Setlength(result,i);
Result := ReverseArr(Result);
Exit;
end;
SetLength(result,0);
end;
var
TPA,TPA2 : TPointArray;
Canvas : TCanvas;
i : integer;
TStringArray : string;
begin
DisplayDebugImgWindow(500,500);
Canvas := GetDebugCanvas;
Canvas.Brush.Color := clBlack
Canvas.Rectangle(0,0,501,501);
{ TPA := [Point(0,0), Point(1,0), Point(2,0),Point(3,0),Point(4,0),
Point(0,1), Point(1,1),
Point(0,2), Point(2,2), Point(3,2),
Point(0,3), Point(4,3),
Point(0,4),Point(1,4),Point(2,4),Point(3,4),Point(4,4)];}
TPA := TPAFromBox(inttobox(0,0,10,10));
TPA2 := FilterRandomTPA(TPA);
TPA := TPA2;
Canvas.Brush.Color := clYellow;
for i := 0 to High(TPA) do
begin;
Canvas.Rectangle(TPA[i].x*5,TPA[i].y*5,TPA[i].x*5 + 5,TPA[i].y*5 + 5);
end;
Writeln(PointToStr(TPA[0]) + '-' + PointTOStr(TPA[High(TPA)]));
TPA := ShortestRoute(0,High(TPA),TPA);
Wait(10);
While Length(TPA) > 0 do
begin;
Canvas.Brush.Color := clRed;
for i := 0 to High(TPA) do
begin;
Writeln('WIN WIN WIN: ' + inttostr(TPA[i].x) + '-' + inttostr(TPA[i].y));
Wait(50);
Canvas.Rectangle(TPA[i].x*5,TPA[i].y*5,TPA[i].x*5 + 5,TPA[i].y*5 + 5);
end;
Wait(200);
Canvas.Brush.Color := clYellow;
for i := high(TPA) downto 0 do
begin;
Canvas.Rectangle(TPA[i].x*5,TPA[i].y*5,TPA[i].x*5 + 5,TPA[i].y*5 + 5);
Wait(50);
end;
end;
end.
ShortestRoute() is what you want.
Drakan
2011-05-23 19:29:42
Ah n3ss3s any idea how you would incorporate the bad tiles? Or should I just subtract the bad tiles from the good tile array. Bad tiles meaning unwalkable.
i luffs yeww
2011-05-23 19:36:10
From: NCDS
Reflection isn't necessary for everything you know, SRL still serves it's purpose perfectly fine. IMO basic functions shouldn't even be included in Reflection…
Reflection is a very applicable argument as to why I think SRL should be changed. Not only does having less efficient functions in an include make things confusing (things such as R_LoggedIn and what not), and instantly obsolete, but it just fills the include with "useless" methods. (Quoted, as they do have a use, there's just a better way to do it.) As I read in The C++ Programming Language [Stroustrup, 2000], using the standard library wherever possible is always better than a non-standard library. So, in that sense, where SRL can do things Reflection can, SRL > Reflection, although, there are still uses for non-standard libraries (meaning in certain cases, Reflection > SRL).
Anyway. Not really the place to discuss. Click "butthurt." in my sig to discuss such matters. ;)
Good work on this, drags. :) Glad you're back and working.
mormonman
2011-05-23 19:36:56
You guys not need my help anymore?
pyroryan
2011-05-23 19:38:50
From: mormonman
You guys not need my help anymore?
You're more than welcome to help :).
*cough* Menus *cough*
Drakan
2011-05-23 19:46:25
From: mormonman
You guys not need my help anymore?
log onto msn so we can use you :D
TomTuff
2011-05-23 19:48:27
From: drags111
Ah n3ss3s any idea how you would incorporate the bad tiles? Or should I just subtract the bad tiles from the good tile array. Bad tiles meaning unwalkable.
Interactable objects.
Add support for multi-tile Objects and NPCs if you haven't! I haven't looked at any of the new work :P
Coh3n
2011-05-23 19:55:41
From: TomTuff
Interactable objects.
Add support for multi-tile Objects and NPCs if you haven't! I haven't looked at any of the new work :P
Oh yeah! I remember trying to click some NPCs that take up more than one tile (Giant rat, Scorpion come to mind), and it always moves the mouse to the top right tile, which in most cases isn't actually on the monster. I ended up using offsets, but it would be nice to not have to since the offsets would be different for every monster. :)
Drakan
2011-05-23 20:04:00
From: TomTuff
Interactable objects.
Not the question, and not the answer. We have the hooks for the collision map, I was asking how to incorporate those list of tiles into the formual is all ;)
mormonman
2011-05-23 22:05:39
From: TomTuff
Add support for multi-tile Objects and NPCs if you haven't! I haven't looked at any of the new work :P
That was done a looooooonnnngggg time ago.
Coh3n
2011-05-23 22:06:46
From: mormonman
That was done a looooooonnnngggg time ago.
Then what can be done about:
From: Coh3n
Oh yeah! I remember trying to click some NPCs that take up more than one tile (Giant rat, Scorpion come to mind), and it always moves the mouse to the top right tile, which in most cases isn't actually on the monster. I ended up using offsets, but it would be nice to not have to since the offsets would be different for every monster. :)
Nava2
2011-05-23 23:14:27
From: Coh3n
Then what can be done about:
Are you using tiles with extended values? :)
Coh3n
2011-05-23 23:17:24
From: Nava2
Are you using tiles with extended values? :)
I used GetNPCs() in combination with TileToMS() methods, so whatever they use.
Nava2
2011-05-23 23:30:39
From: Coh3n
I used GetNPCs() in combination with TileToMS() methods, so whatever they use.
In our old system, tiles had extended values to accomodate when something was inbetween other tiles.
Coh3n
2011-05-23 23:32:03
From: Nava2
In our old system, tiles had extended values to accomodate when something was inbetween other tiles.
I'm 99% sure in the current reflection a tile is just a TPoint.
Drakan
2011-05-23 23:41:01
From: Coh3n
I'm 99% sure in the current reflection a tile is just a TPoint.
function R_TileToMSEx(tile: TTile; offx, offy : extended; height : integer) : TPoint;
He's referring to the offX and offY. If you want to use these then you can just use the NPC.Tile and R_TileToMSEx.
Coh3n
2011-05-23 23:47:30
From: drags111
function R_TileToMSEx(tile: TTile; offx, offy : extended; height : integer) : TPoint;
He's referring to the offX and offY. If you want to use these then you can just use the NPC.Tile and R_TileToMSEx.
I didn't know there was a function like that, I just added my own offsets to the resulting TPoint from TileToMS. What I'm saying, though, is that we shouldn't have to use offsets. If an NPC takes up more than one tile, then the NPC.Tile should be a TTileArray since there is more than one. The scripter can then write a function (or have one in the include) that gets the middle point from those tiles.
Drakan
2011-05-23 23:58:54
From: Coh3n
I didn't know there was a function like that, I just added my own offsets to the resulting TPoint from TileToMS. What I'm saying, though, is that we shouldn't have to use offsets. If an NPC takes up more than one tile, then the NPC.Tile should be a TTileArray since there is more than one. The scripter can then write a function (or have one in the include) that gets the middle point from those tiles.
Yeh I know what you mean :) I would indeed have to look into it and finding out if an npc takes up multiple tiles, etc. For now though we have other fish to fry.
after taking a closer look at menu.simba we decided we are going to be rewriting that entire mess. This will probably take a few days =].
We have reorganized the include to resemble that of SRL-5 due to the request of Nava2, and it looks a lot nicer. Not all documentation is done, we still have a ton of function headers to change/add but we will get around to that after all is said and done.
One notable change made is that reflection hooks will automatically be updated upon running a reflection script. Also SetupReflection will need to be called when running a script in order to work properly.
Thanks for all your input this far and thanks for supportin us. We will continue to work daily to try and get this out as quick as possible, but in the most stable state.
On a side note, a couple of neat little function were added to help prevent memory leaks and make the code look nicer.
(*
R_FreeObjects
~~~~~~~~~~~~~
.. code-block:: pascal
procedure R_FreeObjects(Objects: TIntegerArray);
Properly frees multiple objects using a try-catch statement.
.. note::
by Drags111
Example:
R_FreeObjects([ThisNode, ThatNode, TheOtherNode]);
*)
procedure R_FreeObjects(Objects: TIntegerArray);
var
I: Integer;
begin
for I := 0 to High(Objects) do
begin
try
SmartFreeObject(Objects[i]);
except
end;
end;
end;
(*
R_FreeObject
~~~~~~~~~~~~
.. code-block:: pascal
procedure R_FreeObject(Obj: Integer);
Properly frees an object using a try-catch statement.
.. note::
by Drags111
*)
procedure R_FreeObject(Obj: Integer);
begin
R_FreeObjects([Obj]);
end;
As it was pointed out to me, there were possibilities of crashes with SmartFreeObject if the object didn't need to be freed or some random thing like that, but these nice little functions will assist to make sure we don't leak anything. Easy and clean to use too!
R_FreeObjects([Object1, Object2, Object3])
instead of
try
SmartFreeObject(Object1);
except
end;
try
SmartFreeObject(Object2);
except
end;
try
SmartFreeObject(Object2);
except
end;
I'm off for the night, goodnight all!
Coh3n
2011-05-24 00:10:02
I like this better:
procedure R_FreeObjects(Objects: TIntegerArray);
var
I: Integer;
begin
for I := 0 to High(Objects) do
try
SmartFreeObject(Objects[i]);
except
R_Debug('Failed to free object: ' + ToStr(Objects[I]));
end;
end;
I find the more debugging the better.
mormonman
2011-05-24 01:38:13
From: Nava2
In our old system, tiles had extended values to accomodate when something was inbetween other tiles.
But that was when the client used extendeds too.
grats
2011-05-24 02:03:43
Awesome work with reflection!! Let me know when randoms are being worked on I got some accounts to lend over for randoms
From: Coh3n
A web walker would be nice. A lot of people have worked on ones, but as far as know none have been completely finished to include obstacles and walking around walls, fences, etc. Boreas seems to have a good idea of how to go about things, ReadySteadyGo started developing a web include of some sort, and Cstrike had one that worked without obstacles. He's gone now, but I'm sure some of his code could be of use if you're interested.
With what sm0k3 made with the web walking map I created we got pretty much the entire game mapped out and working (I've used it countless times already) lower on the thread we talked about adding obstacles too
Drakan
2011-05-24 09:15:08
I find the more debugging the better.
The only reason we don't debug there is because it's VERY unnecessary to know if something failed to free. If it fails its not because something didnt free, its because there was nothing to free and it kept tryin to do so.
Coh3n
2011-05-24 09:45:45
From: drags111
I find the more debugging the better.
The only reason we don't debug there is because it's VERY unnecessary to know if something failed to free. If it fails its not because something didnt free, its because there was nothing to free and it kept tryin to do so.
Ah okay. You can always writeln() the exception to if needed, but if it only happens if the object doesn't exist then I guess there's no need. Or even writeln "Object doesn't exist" or something.
Jakkle
2011-05-24 09:48:41
Can't wait for this to be released and to use it :). I see you say interfaces are going to be better/easier to use but I was wondering will this reflection be able to (When bank screen is open) tell weather you have something equipt ? Maybe by clicking the stats/equipt button at the top right of the bank screen which shows what your stats for what your wearing and what you have equipted in another interface on the bank screen. In that screen you can also remove what you are wearing, or can it tell you have something equipt without looking at anything ?
Iamadam
2011-05-24 10:18:52
@canReach:
It is a verrry useful function. Doesn't matter how slow it is. Scripters don't need to use it if they don't want - but the code is there, so I don't see why something this useful shouldn't be included :)
The function can probably be tweaked a little, but it gets a result in ~5ms, which is perfectly quick enough (most of that time is gathering the collision map).
Its something that has been seriously lacking in reflection, and I've done the hard work for you :P
Shuttleu
2011-05-24 12:13:06
From: Iamadam
it gets a result in ~5ms
(most of that time is gathering the collision map).
you make it sound if thats slow :p
~shut
masterBB
2011-05-24 13:17:17
Made an utility with the new interface system.
http://villavu.com/forum/showthread.php?t=64545
masterBB
2011-05-24 13:24:45
From: whacko999
Can't wait for this to be released and to use it :). I see you say interfaces are going to be better/easier to use but I was wondering will this reflection be able to (When bank screen is open) tell weather you have something equipt ? Maybe by clicking the stats/equipt button at the top right of the bank screen which shows what your stats for what your wearing and what you have equipted in another interface on the bank screen. In that screen you can also remove what you are wearing, or can it tell you have something equipt without looking at anything ?
Like this?

Oops, double post.
Drakan
2011-05-24 14:55:11
Nice i do have my own interface explorer as well, but thats a nice one, easy for people to use :) Thanks for your work! Saves me the trouble =]
Wizzup?
2011-05-24 15:00:55
From: drags111
Nice i do have my own interface explorer as well, but thats a nice one, easy for people to use :) Thanks for your work! Saves me the trouble =]
It's great to see someone working on it again. :)
Drakan
2011-05-25 14:37:37
Haha thanks wizzup :) It's good to be back.
excitement level… rising dangerously fast
masterBB
2011-05-26 17:15:13
There is still a very vital bug in interfaces.simba. Could you please make all getJavasting have the maxLength property on 512?
sm0k3
2011-05-26 18:41:46
From: grats
With what sm0k3 made with the web walking map I created we got pretty much the entire game mapped out and working (I've used it countless times already) lower on the thread we talked about adding obstacles too
with a small change to WalkPath witch i have been using in my Hiker script i have managed to get nearly full Obstical solving using my OBSTsolver script .. (i will release this soon grats)
all thats left is gathering the colours and uptext of Obsticals for the OBSTsolver's OBST.ini
Basicly i have A fully Working WebWalker that also Solves Obsticals :)
as OBSTsolver was designed as an include you are welcome to Include it
if you wish but it is a colour script . (altho it would be rely easy/quik to change to Reflection i guess)
Coh3n
2011-05-26 19:10:33
From: sm0k3
with a small change to WalkPath witch i have been using in my Hiker script i have managed to get nearly full Obstical solving using my OBSTsolver script .. (i will release this soon grats)
all thats left is gathering the colours and uptext of Obsticals for the OBSTsolver's OBST.ini
Basicly i have A fully Working WebWalker that also Solves Obsticals :)
as OBSTsolver was designed as an include you are welcome to Include it
if you wish but it is a colour script . (altho it would be rely easy/quik to change to Reflection i guess)
Wow nice. Does it automatically detect when there's an obstacle, or do you have to set it in your script?
sm0k3
2011-05-26 19:17:14
it auto detects obsticals at the moment by
1 checking if your moving (works well if your stuck behind a door)
2 im also working on a way to check for item on screen using reflection id but this is proving to be difficult .as i am not That good with reflection yet .
Drakan
2011-05-26 19:23:33
From: masterBB
There is still a very vital bug in interfaces.simba. Could you please make all getJavasting have the maxLength property on 512?
This is still development stage. Interfaces.simba wont even be the same tomorrow as it is today. These sorts of things will be fixed. Also I believe there was a reason we only allow 256, but I'll talk with benland and see whats up.
masterBB
2011-05-26 19:54:32
From: drags111
This is still development stage. Interfaces.simba wont even be the same tomorrow as it is today. These sorts of things will be fixed. Also I believe there was a reason we only allow 256, but I'll talk with benland and see whats up.
If you will ask, that would be nice. The point is it works with your max length, but sometimes it has an overflow(feels random to me). Simba doesn't give an error or anything… just shuts down. So I believe its really important not to let it overflow. Also you used both 255 as a max length as 256.
Also why is the RSChild_wrapper class not automatically defined in the reflection.simba script. Has this still to be done?
And will standard absolute positions for the bounds property come back? It doesn't really matter, just makes my code longer the new way.
Thanks in advance!
Drakan
2011-05-26 20:17:23
From: masterBB
If you will ask, that would be nice. The point is it works with your max length, but sometimes it has an overflow(feels random to me). Simba doesn't give an error or anything… just shuts down. So I believe its really important not to let it overflow. Also you used both 255 as a max length as 256.
Also why is the RSChild_wrapper class not automatically defined in the reflection.simba script. Has this still to be done?
And will standard absolute positions for the bounds property come back? It doesn't really matter, just makes my code longer the new way.
Thanks in advance!
This is development, its not meant to be used right now really. And yes I'm just waiting for ben to be back so I can talk to him. RSChild_Wrapper is automatically defined.
masterBB
2011-05-27 04:30:58
From: drags111
This is development, its not meant to be used right now really. And yes I'm just waiting for ben to be back so I can talk to him. RSChild_Wrapper is automatically defined.
I only see this wrapper include:
{$i ./lib/wrappers/wrappers.simba}
But it doesn't matter cause I can add it in my script.
Oh, and the include gives this error:
[Error] C:\Simba\Includes\Reflection\./lib/core/menu.simba(57:20): Unknown identifier 'R_GetNodeSubHead' at line 56
Cause there also isn't an include line for nodes.
edit: nvm, I see it is for a lot of things. I guess I will have to wait.
Bobzilla69
2011-05-27 04:34:01
From: masterBB
I only see this wrapper include:
{$i ./lib/wrappers/wrappers.simba}
But it doesn't matter cause I can add it in my script.
Oh, and the include gives this error:
[Error] C:\Simba\Includes\Reflection\./lib/core/menu.simba(57:20): Unknown identifier 'R_GetNodeSubHead' at line 56
Cause there also isn't an include line for nodes.
just incase you missed it in his last reply i will highlight it
From: drags111
This is development, its not meant to be used right now really. And yes I'm just waiting for ben to be back so I can talk to him. RSChild_Wrapper is automatically defined.
i am not trying to be an ass, but you has stated it in development and not really meant to be used as its not complete.
lets them get on with making it so it will work better than before.
also great work guys keep it up
Drakan
2011-05-27 08:10:07
From: masterBB
I only see this wrapper include:
{$i ./lib/wrappers/wrappers.simba}
But it doesn't matter cause I can add it in my script.
Oh, and the include gives this error:
[Error] C:\Simba\Includes\Reflection\./lib/core/menu.simba(57:20): Unknown identifier 'R_GetNodeSubHead' at line 56
Cause there also isn't an include line for nodes.
edit: nvm, I see it is for a lot of things. I guess I will have to wait.
it's included within wrappers.simba.
masterBB
2011-05-27 09:58:17
From: drags111
it's included within wrappers.simba.
How odd. In wrappers.simba you use: "{$include_once ./Nodes_Wrapper.simba}". And I get errors from menu.simba that it isn't included. But if I change that line to: "{$i ./Nodes_Wrapper.simba} ", it all works…
Sorry for all these questions, and thanks for answering them all.
Drakan
2011-05-27 10:43:34
have you pulled recently?
masterBB
2011-05-27 11:11:12
From: drags111
have you pulled recently?
I don't understand that. Sorry, English is not my main language. I do have the latest version of reflection 2, if pulled == downloaded.
Drakan
2011-05-27 11:20:33
yes that is what i mean. it compiles for all of us so it must be something on your end. whats your msn and i can help you when i get home in about 3-4 hours.
pyroryan
2011-05-27 11:22:24
Hooks up if you want to continue to develop this. You may have to fetch them manually from
http://pyroryan.net46.net/reflection/Hooks.simba.
Drakan
2011-05-27 11:24:22
From: pyroryan
Hooks up if you want to continue to develop this.
im at school but ill work on it when i get home. :) thanks pyro
pyroryan
2011-05-27 11:27:50
And get revision 2. The interface cache hook was wrong.
masterBB
2011-05-27 12:59:12
From: drags111
yes that is what i mean. it compiles for all of us so it must be something on your end. whats your msn and i can help you when i get home in about 3-4 hours.
I fixed it. I was still running the debug version of simba since the javastring length bug. And the debug version of simba doesn't handle include_once very well.
Drakan
2011-05-27 15:44:18
That's good. Like I said there's going to be a lot of changes and restructuring coming up so please refrain from making scripts or posting errors you find till we get everything stable and working. At the vet right now as my dog is dying.
Iamadam
2011-05-27 19:20:49
Woo, I see collision hooks.
=)
E: Also noticed you included R_WebWalk in its current form. Just a heads up that if it encounters a random during the walk, it will get stuck (happened multiple times in some of my scripts). So it just needs a failsafe.
Drakan
2011-05-28 09:56:19
From: Iamadam
Woo, I see collision hooks.
=)
E: Also noticed you included R_WebWalk in its current form. Just a heads up that if it encounters a random during the walk, it will get stuck (happened multiple times in some of my scripts). So it just needs a failsafe.
Haha yah we'll be getting to that eventually. I think I'll be able to spend a lot of time today on the include depending on how my dog does. We'll see! Thanks for your patience everyone!
Camaro'
2011-05-29 00:22:06
From: drags111
Haha yah we'll be getting to that eventually. I think I'll be able to spend a lot of time today on the include depending on how my dog does. We'll see! Thanks for your patience everyone!
I'm so sorry, I hope all goes well with your dog!
Markus
2011-05-31 16:10:04
Can't wait til this gets released! Already working on a script with the new API :p
Feature request: function R_UpdateNPC(NPC : TNPC) : TNPC; Updates all info of NPC, returns nil if doesn't exist anymore.
From: Markus
Can't wait til this gets released! Already working on a script with the new API :p
Feature request: function R_UpdateNPC(NPC : TNPC) : TNPC; Updates all info of NPC, returns nil if doesn't exist anymore.
I second this feature.
masterBB
2011-05-31 17:45:54
From: Markus
Can't wait til this gets released! Already working on a script with the new API :p
Feature request: function R_UpdateNPC(NPC : TNPC) : TNPC; Updates all info of NPC, returns nil if doesn't exist anymore.
Is this possible? As far as I could remember every NPC had a unique number. But every x seconds they all shuffle… So you couldn't track them for long. Or does ref 2 has a function to by pass that effect?
There should be some way jagex tracks em that we could use.
Drakan
2011-05-31 18:42:50
From: masterBB
Is this possible? As far as I could remember every NPC had a unique number. But every x seconds they all shuffle… So you couldn't track them for long. Or does ref 2 has a function to by pass that effect?
Every npc has its own unique ID. Never changes.
masterBB
2011-05-31 19:11:57
From: drags111
Every npc has its own unique ID. Never changes.
Oh well, probably didn't remembered it that good. Wrote a program to check it and you're right. Still going to search for a thread where I got that idea.
Edit:
http://villavu.com/forum/showthread.php?t=62467&highlight=trackingthis thread ^
Edit2:
Wouldn't such a function could be a short as this?(not tested)
function R_UpdateNPC(NPC : TNPC) : TNPC;
var
i:Integer;
allNpcs:TNPCArray;
begin
allNpcs := R_GetNullNPC(NPC.ID);
for i := 0 to i < High(allNpcs) do
if(allNpcs[i].Index = NPC.Index) then
begin
Result := allNpcs[i];
break;
end;
end;
From: drags111
Every npc has its own unique ID. Never changes.
Problem is that certain NPC's has teh same ID. So, there could be 2+ NPC's with the same ID which poses a problem for fighting scripts.
Jakkle
2011-05-31 20:14:52
From: sm0k3
2 im also working on a way to check for item on screen using reflection id but this is proving to be difficult .as i am not That good with reflection yet .
Item where on screen ? or do you mean an object ?
Drakan
2011-05-31 22:53:26
From: Yago
Problem is that certain NPC's has teh same ID. So, there could be 2+ NPC's with the same ID which poses a problem for fighting scripts.
function R_AreWeInteracting(var NPC: TNPC): Boolean;
'nuff said.
From: drags111
function R_AreWeInteracting(var NPC: TNPC): Boolean;
'nuff said.
And if you not interacting, someone else attacked the NPC or it moved? … I sure can code around it(inaccuracy is an issue), but it would help and make coding less inaccurate.
Drakan
2011-05-31 23:55:46
if you're not interacting with it then just do a search for all npcs that arent fighting again.
Harry
2011-06-01 11:10:45
Told you this on IRC, but var R_UpdateKill in Reflection.simba should be renamed to R_UpdateContinue (or something of that sort - it SHOULD kill the script by default if hooks get updated when initially running script; right now it does not due to the improper naming). Also, the hook checking could be compressed into a single HTTP request, which would save quite a bit of bandwidth and time. Lastly, use my host/some other method you guys choose to host the hooks on a non-free server that doesn't go down a lot. (Just posting this so neither of us forget :p)
Shuttleu
2011-06-05 15:57:56
hows it all going guys?
any good news?
~shut
Flight
2011-06-05 20:32:34
Yeah I'd like to know how the progress is coming as well. Although I can't do anything until I've gotten my laptop back with all my work on it back…
Drakan
2011-06-05 21:33:47
Currently we're all working on web walking to try and get that into reflection 2, but I'm thinking that might need to come at a later time. For now the only work that remains is really antirandoms. Then have to sweep through it all again and make sure everything is up to par with what we want and triple check for mem leaks etc.
Iamadam
2011-06-05 23:22:31
From: drags111
Currently we're all working on web walking to try and get that into reflection 2, but I'm thinking that might need to come at a later time. For now the only work that remains is really antirandoms. Then have to sweep through it all again and make sure everything is up to par with what we want and triple check for mem leaks etc.
Model clicking?
Coh3n
2011-06-06 00:26:58
From: drags111
Currently we're all working on web walking to try and get that into reflection 2, but I'm thinking that might need to come at a later time. For now the only work that remains is really antirandoms. Then have to sweep through it all again and make sure everything is up to par with what we want and triple check for mem leaks etc.
Maybe get it to a testing state so people can test for memory leaks?
jerryt
2011-06-06 02:18:37
From: Coh3n
Maybe get it to a testing state so people can test for memory leaks?
I would have to agree on that. You can get a wider field in debugging in, although it may be more extensive, too.
Shuttleu
2011-06-06 02:40:30
From: jerryt
I would have to agree on that. You can get a wider field in debugging in, although it may be more extensive, too.
more extensive means less bugs in the end though
~shut
Flight
2011-06-06 04:06:32
From: drags111
but I'm thinking that might need to come at a later time. For now the only work that remains is really antirandoms.
I agree. I think what's important is the initial core release. WebWalking is an add-on, that we can always come back to. Anti-randoms I would imagine would have priority up there with the core release, as they're very essential to have at any point.
From: Iamadam
Model clicking?
How wonderful that would!
Drakan
2011-06-06 08:12:23
I'm fairly certain that we decided model clicking would be way too slow in PS. We'll see. I am going to try and put off web walking for now and get the core out. It's also a busy few days to me since I have a bunch of family in town for my graduation tomorrow.
Iamadam
2011-06-06 10:13:10
Yeah it's be slow in PS. So write a plugin to do all the processing :) I'll do it if you guys won't - just get me all the hooks I need.
Shuttleu
2011-06-06 11:43:03
From: Iamadam
Yeah it's be slow in PS. So write a plugin to do all the processing :) I'll do it if you guys won't - just get me all the hooks I need.
thats assuming you can use functions from plugins, in plugins
~shut
Capricorn
2011-06-06 15:21:44
From: drags111
I'm fairly certain that we decided model clicking would be way too slow in PS. We'll see. I am going to try and put off web walking for now and get the core out. It's also a busy few days to me since I have a bunch of family in town for my graduation tomorrow.
Is it even possible to do Prison Pete WITHOUT model clicking?
Sabzi
2011-06-06 16:00:09
From: Capricorn
Is it even possible to do Prison Pete WITHOUT model clicking?
It is. Ask Iroki. :) (IIRC)
Harry
2011-06-06 16:05:58
From: Capricorn
Is it even possible to do Prison Pete WITHOUT model clicking?
http://villavu.com/forum/showpost.php?p=809315&postcount=12 is a good idea for solving it that Method has explained out.
As much as I would love model clicking, I don't know if it's easily possible (in PS to be both quick and efficient). Even with a plugin it would probably be really slow. Feel free to try though Iamadam, and let us all know how it works out.
Shuttleu
2011-06-06 16:06:23
From: Sabzi
It is. Ask Iroki. :) (IIRC)
tis been a long time since i last heard that name.
is he still around?
~shut
Sabzi
2011-06-06 16:08:42
From: Shuttleu
tis been a long time since i last heard that name.
is he still around?
~shut
I haven't seen him. I was just referring to him, not actually meant to go and ask him :p.
Capricorn
2011-06-06 16:17:08
From: Harry
http://villavu.com/forum/showpost.php?p=809315&postcount=12 is a good idea for solving it that Method has explained out.
As much as I would love model clicking, I don't know if it's easily possible (in PS to be both quick and efficient). Even with a plugin it would probably be really slow. Feel free to try though Iamadam, and let us all know how it works out.
well I don't care for model clicking, I only care for getting solid anti-randoms.
Gu3st...
2011-06-06 16:44:43
From: Shuttleu
tis been a long time since i last heard that name.
is he still around?
~shut
Still around. He's online msn at least :p
n3ss3s
2011-06-06 16:53:03
I think we could scrap the R_ prefix, if lots of function names clash with the SRL ones, change the SRL.scar including with a directive…
Just out of cosmetical reasons…
Nava2
2011-06-06 17:21:19
From: n3ss3s
I think we could scrap the R_ prefix, if lots of function names clash with the SRL ones, change the SRL.scar including with a directive…
Just out of cosmetical reasons…
I've suggested the same
Harry
2011-06-06 17:26:03
The issue with the above I think is that I like to mix-and-match procedures. I find R_ ones sometimes work better for certain things, and color ones work better for others. Doing so gives less freedom to do stuff like that. (if I am understanding you correctly, it'd be something like {$DEFINE REFLECTION}, like with SMART, and LoggedIn->R_LoggedIn, etc?)
Iamadam
2011-06-06 21:02:18
From: Shuttleu
thats assuming you can use functions from plugins, in plugins
~shut
Eh?
Simba gets the model data from SMART, sends it to a plugin which calculates model bounds, and returns a random (or specified, whatever) point on the model.
Then simba clicks.
Easy? Doing it now.
Drakan
2011-06-06 23:38:35
Iamadam let me know how it goes.
as far as the R_ prefix, I think it should stay. Talked to many people about it and me and pyro decided it would be best, especially since people like to make hybrid scripts using both includes. Not a big deal IMO.
Just finished the mordaut solver and seems 100% but needs more testing, if you have an account let me know.
jerryt
2011-06-06 23:46:43
IMO, Keep the R_ prefix for all functions dealing with reflection.
If I have an account available, I'll let you work on it.
Iamadam
2011-06-07 03:38:30
Managed to parse models into a bunch of triangles, its really not that slow, even in PS.
Having some problems though - it seems that the model outline is sometimes not in line with the actual model.
Will keep trying.
Dgby714
2011-06-07 03:52:56
From: Iamadam
Managed to parse models into a bunch of triangles, its really not that slow, even in PS.
Having some problems though - it seems that the model outline is sometimes not in line with the actual model.
Will keep trying.
If it becomes slow we can move it to a plugin. =)
Shuttleu
2011-06-07 04:01:45
From: Iamadam
Eh?
Simba gets the model data from SMART, sends it to a plugin which calculates model bounds, and returns a random (or specified, whatever) point on the model.
Then simba clicks.
Easy? Doing it now.
actually, nevermind, i dont know what i was thinking… :s
~shut
Iamadam
2011-06-07 04:11:25
From: Dgby714
If it becomes slow we can move it to a plugin. =)
Gonna put it in a plugin regardless :) Heavy calculation functions should all be in plugins IMO, since they shouldn't need to be changed often (if at all).
Anyway, I've got it working better. Here I've superimposed triangles over the model as proof of concept:

Note that not all the triangles have been drawn - I left some out so the original object would be visible for the pic :)
Edit: Still having problems. Not sure what I did wrong :S… Here's my code:
program ModelClick;
{$DEFINE SMART}
{$i SRL\SRL.scar}
{$i SRL\SRL\misc\paintsmart.scar}
{$i Reflection\Reflection.simba}
{$i Reflection\core\RefPaint.simba}
{
Still not working :S. Sometimes triamgles are shifted a bit, and sometimes an incorrect triangle is drawn.
any help would be awesome.
}
type
TTriangle = record
vertex1, vertex2, vertex3 : TPoint;
end;
//3D model in RS animation space.
type
TModel = record
indices1, indices2, indices3 : array of Integer;
verticesX, verticesY, verticesZ : array of Integer;
pixelX, pixelY : Integer;
end;
//2D representation of a model, converted to screen coords.
type
TScreenModel = record
triangles : array of TTriangle;
end;
function NULL_MODEL : TModel;
begin
result.pixelX := -1;
result.pixelY := -1;
end;
//Give a reference to the TModel.
function parseTModel(modelObj : Integer) : TModel;
var xMax, count : Integer;
begin
writeln('Parsing model data...');
xMax := SmartGetFieldArraySize(modelObj, hook_sdmodel_GetIndices1, 1);
if(xMax < 0) then
begin
result := NULL_MODEL;
exit;
end;
setLength(result.indices1, xMax);
for count := 0 to xMax - 1 do
begin
result.indices1[count] := smartGetFieldArrayShort(modelObj, hook_sdmodel_GetIndices1, count);
end;
xMax := SmartGetFieldArraySize(modelObj, hook_sdmodel_GetIndices2, 1);
setLength(result.indices2, xMax);
for count := 0 to xMax - 1 do
begin
result.indices2[count] := smartGetFieldArrayShort(modelObj, hook_sdmodel_GetIndices2, count);
end;
xMax := SmartGetFieldArraySize(modelObj, hook_sdmodel_GetIndices3, 1);
setLength(result.indices3, xMax);
for count := 0 to xMax - 1 do
begin
result.indices3[count] := smartGetFieldArrayShort(modelObj, hook_sdmodel_GetIndices3, count);
end;
xMax := SmartGetFieldArraySize(modelObj, hook_sdmodel_GetPointsX, 1);
setLength(result.verticesX, xMax);
for count := 0 to xMax - 1 do
begin
result.verticesX[count] := smartGetFieldArrayInt(modelObj, hook_sdmodel_GetPointsX, count);
end;
xMax := SmartGetFieldArraySize(modelObj, hook_sdmodel_GetPointsY, 1);
setLength(result.verticesY, xMax);
for count := 0 to xMax - 1 do
begin
result.verticesY[count] := smartGetFieldArrayInt(modelObj, hook_sdmodel_GetPointsY, count);
end;
xMax := SmartGetFieldArraySize(modelObj, hook_sdmodel_GetPointsZ, 1);
setLength(result.verticesZ, xMax);
for count := 0 to xMax - 1 do
begin
result.verticesZ[count] := smartGetFieldArrayInt(modelObj, hook_sdmodel_GetPointsZ, count);
end;
end;
//Shamelessly ripped from 'getInteractableAt'
function getInteractableModelAt(tile : TTile) : TModel;
var
Plane, Ground, Node, Obj, ObjTemp, ID, modelObj: integer;
TempPixelPoint: TPoint;
TempTile, LocalPos, Base: TTile;
begin
try
Base.X := SmartGetFieldInt(0, hook_static_BaseX);
Base.Y := SmartGetFieldInt(0, hook_static_BaseY);
LocalPos.X := tile.X - Base.X;
LocalPos.Y := tile.Y - Base.Y;
Plane := SmartGetFieldInt(0, hook_static_LoadedPlane);
Ground := SmartGetFieldArray3DObject(0, hook_static_GroundTiles, Plane, LocalPos.X, LocalPos.Y);
Node := SmartGetFieldObject(Ground, hook_ground_AnimableList);
while(Node <> 0)do
begin
Obj := SmartGetFieldObject(Node, hook_AnimableNode_GetAnimable);
if(Obj <> 0)then
begin
ID := SmartGetFieldShort(Obj, hook_InteractiveObject_GetID) and $FFFF;
if((ID = -1) or ((ID) = 65535))then
begin
ObjTemp := SmartGetFieldObject(Obj, hook_interactiveobject2_GetObjectData);
if(ObjTemp <> 0) then
begin
ID := SmartGetFieldInt(ObjTemp, hook_secondlevelobject_GetID);
if((ID = -1) or ((ID and $FFFF) = 65535))then
begin
SmartFreeObject(ObjTemp);
Break;
end;
modelObj := SmartGetFieldObject(ObjTemp, hook_secondlevelobject_GetModel);
TempPixelPoint := Point(SmartGetFieldInt(ObjTemp, hook_animable_PixelX), SmartGetFieldInt(ObjTemp, hook_animable_PixelY));
SmartFreeObject(ObjTemp);
end;
end else //ID is valid, so we can use Obj
begin
modelObj := SmartGetFieldObject(Obj, hook_interactiveobject_GetModel);
TempPixelPoint := Point(SmartGetFieldInt(Obj, hook_animable_PixelX), SmartGetFieldInt(Obj, hook_animable_PixelY));
end;
result := ParseTModel(modelObj);
if(result = NULL_MODEL) then
begin
writeln('No model found.');
end else
begin
result.pixelX := TempPixelPoint.x;
result.pixelY := TempPixelPoint.y;
end;
SmartFreeObject(modelObj);
SmartFreeObject(Obj);
Break;
end;
SmartFreeObject(Node);
Node := SmartGetFieldObject(Node, hook_AnimableNode_GetNext);
end;
finally
try
SmartFreeObject(Ground);
except
end;
try
SmartFreeObject(Obj);
except
end;
try
SmartFreeObject(ObjTemp);
except
end;
try
SmartFreeObject(Node);
except
end;
try
SmartFreeObject(modelObj);
except
end;
end;
end;
function GetMyLocalPos: TTile;
var
me: Integer;
begin
me := SmartGetFieldObject(0, hook_static_MyPlayer);
Result.x := SmartGetFieldInt(me, hook_animable_PixelX);
Result.y := SmartGetFieldInt(me, hook_animable_PixelY);
SmartFreeObject(me);
end;
function World3DToScreenQuick(xx, yy, zz: Extended; Render: TRender; RenderData: TRenderData): TPoint;
var
rd : TRenderData;
r : TRender;
x, y, z: extended;
tries: integer;
label
ProcStart;
begin;
ProcStart:
x := 0;
y := 0;
z := 0;
Inc(tries);
result:= point(-1,-1);
z:= rd.zOff + (rd.zX * xx + rd.zY * yy + rd.zZ * zz);
if ((z < r.zMin) or (z > r.zMax)) then
exit;
x:= r.xScale * (rd.xOff + (rd.xX * xx + rd.xY * yy + rd.xZ * zz)) / z;
y:= r.yScale * (rd.yOff + (rd.yX * xx + rd.yY * yy + rd.yZ * zz)) / z;
if ((x >= r.xMin) and (x <= r.xMax) and (y >= r.yMin) and (y <= r.yMax)) then
begin
result.x:= Round((x - r.xMin)+4);
result.y:= Round((y - r.yMin)+4);
end else
begin
if (tries > 30)then Exit;
EmptyRenderInfo(r, rd);
UpdateRenderInfo(r, rd);
goto ProcStart;
end;
end;
function modelToScreen (model : TModel) : TScreenModel;
var
tri : TTriangle;
locZ, count : Integer;
r : TRender;
rd : TRenderData;
cmax : Integer;
Base : TPoint;
begin
Base.X := SmartGetFieldInt(0, hook_static_BaseX);
Base.Y := SmartGetFieldInt(0, hook_static_BaseY);
cmax := (high(model.indices1));
setLength(result.triangles, ((cmax + 1)));
locZ := getTileHeight(Tile((model.pixelX / 512) + Base.x, (model.pixelY / 512) + Base.y));
EmptyRenderInfo(r, rd);
UpdateRenderInfo(r,rd);
for count := 0 to cmax do
begin
try
tri.vertex1 := World3DToScreenQuick(model.pixelX + model.verticesX[model.indices1[count]], locZ + 0 + model.verticesY[model.indices1[count]], model.pixelY + model.verticesZ[model.indices1[count]], r, rd);
tri.vertex2 := World3DToScreenQuick(model.pixelX + model.verticesX[model.indices2[count]], locZ + 0 + model.verticesY[model.indices2[count]], model.pixelY + model.verticesZ[model.indices2[count]], r, rd);
tri.vertex3 := World3DToScreenQuick(model.pixelX + model.verticesX[model.indices3[count]], locZ + 0 + model.verticesY[model.indices3[count]], model.pixelY + model.verticesZ[model.indices3[count]], r, rd);
result.triangles[count] := tri;
except
writeln('error');
end;
end;
end;
procedure drawScreenModel (screenModel : TScreenModel);
var count : Integer;
begin
for count := 0 to high(screenModel.triangles) - 1 do
begin
if((screenModel.triangles[count].vertex1.x < 1) or (screenModel.triangles[count].vertex1.y < 1) or
(screenModel.triangles[count].vertex2.x < 1) or (screenModel.triangles[count].vertex2.y < 1) or
(screenModel.triangles[count].vertex3.x < 1) or (screenModel.triangles[count].vertex3.y < 1)) then
continue;
R_DrawLine(false, screenModel.triangles[count].vertex1, screenModel.triangles[count].vertex2, clWhite);
R_DrawLine(false, screenModel.triangles[count].vertex2, screenModel.triangles[count].vertex3, clWhite);
R_DrawLine(false, screenModel.triangles[count].vertex3, screenModel.triangles[count].vertex1, clWhite);
end;
end;
var model : TModel;
sm : TScreenModel;
Canvas : TCanvas;
begin
SMART_SERVER := 5;
SMART_SIGNED := true;
SMART_MEMBERS := false;
setupSRL;
setupReflection;
SmartSetDebug(True);
Canvas := TCanvas.Create;
Canvas.Handle := SmartGetDebugDC;
ClearRSCanvas(Canvas);
model := getInteractableModelAt(Tile(getMyPos.x + 1, getMyPos.y));
sm := modelToScreen(model);
drawScreenModel(sm);
end.
Drakan
2011-06-07 08:47:53
Looks pretty good so far Iamadam. Keep working on it so we can implement :P Graduation today!
Nava2
2011-06-07 08:59:32
Iamadam, perhaps use R2? :)
Jakkle
2011-06-07 12:46:10
Seems like things are going well and can't wait to try it out. Doing a good job Iamadam keep it up, hope you get the problem sorted.
@drags111 Hope you have a good day, congrats :)
Dgby714
2011-06-07 13:05:01
From: drags111
Graduation today!
Grats =)
Iamadam
2011-06-07 18:27:49
Congrats on graduating :)
I'm wondering if it'd be a good idea to update SMART a little too. It's open source, so we can do whatever we want.
I was thinking we could add a new way of handling objects - add an array of 'temp' objects which are automagically freed. We could give those to scripters to prevent memory leaks.
Also, and more to the point, we could perhaps add functions to grab an entire array at once, rather than doing it element by element. Would save time on things like collision flags & model grabbing.
Just a thought :)
jerryt
2011-06-07 20:21:23
Grabbing data as an array at once would be the same speed but more error-prone compared to grabbing data one at-a-time. When grabbing data one "element" at a time, you get the most present values.
Iamadam
2011-06-07 21:15:45
Grabbing as an array reduces the number of calls to SmartXXX by a huge amount, and when grabbing things like the traversal flags you want all the values at the time of the first call anyway.
If values change half way through loading an array, the first set of elements in the array are outdated. i.e. its actually better to get them all at once.
Edit: Still can't get it directly over the model -.-

I think I'm missing something
Edit2: Ok, so tileheight gives average tile height, not exact. That's part of it, and fixes a lot.
But I need to be able to get model height. Hum.
Drakan
2011-06-08 06:49:38
gogo iamadam! im uber tired, just got home from after grad. And yes grabbing entire arrays would be a lot faster.
tom99
2011-06-08 08:41:41
Maby add a condition for followed ? if possible,to detect someone take follow on you.
Capricorn
2011-06-08 15:58:13
From: tom99
Maby add a condition for followed ? if possible,to detect someone take follow on you.
I'm pretty sure all you have to do is check if they are interacting with you.
Iamadam
2011-06-08 19:09:21
^Yup.
Flight
2011-06-08 21:20:04
Iamadam I must say I'm very excited about your progress. I truly, truly hope your work turns out to be successful and becomes implanted in Reflection 2. I'm sure you're as aware as I am of how many possibilities this has. ;) Just want ya to know I'm routin' for ya!
Iamadam
2011-06-08 22:41:16
Hmm.. I have it clicking models with ~95% accuracy (hoping to increase this to 100%) but the thing I'm having a lot of trouble with is world to screen.
I don't quite understand why the renderdata needs to be updated so often. (If it encounters an error in w2s, it reloads render data). I don't understand why it needs to be updated SO many times. Wouldn't the same renderdata work for every point which needs to be translated? Hoping for some help on that.
If I can get it to use one set of render data which doesn't need updating, I can move it to a plugin and the whole process (grabbing, translating to screen and finding a point to click) will be possible in less than 50ms. Otherwise it takes a good 400ms to translate to screen.
Hulp.
Thanks.
Edit:
Facepalm.
Fixed it.
This was drawn in 100ms (no plugin). It perfectly matches the model. Woo :)

I now have the function
'atObject(action, name : String; location : TTile) : boolean; Will pretty much never ever miss, regardless of object size or position on the tile (doors = easy now :) ).
On uneven terrain it still has some problems.
Hooks for Character model please :)
Shuttleu
2011-06-09 03:26:58
From: Iamadam
Hmm.. I have it clicking models with ~95% accuracy (hoping to increase this to 100%) but the thing I'm having a lot of trouble with is world to screen.
I don't quite understand why the renderdata needs to be updated so often. (If it encounters an error in w2s, it reloads render data). I don't understand why it needs to be updated SO many times. Wouldn't the same renderdata work for every point which needs to be translated? Hoping for some help on that.
If I can get it to use one set of render data which doesn't need updating, I can move it to a plugin and the whole process (grabbing, translating to screen and finding a point to click) will be possible in less than 50ms. Otherwise it takes a good 400ms to translate to screen.
Hulp.
Thanks.
Edit:
Facepalm.
Fixed it.
This was drawn in 100ms (no plugin). It perfectly matches the model. Woo :)

I now have the function 'atObject(action, name : String; location : TTile) : boolean; Will pretty much never ever miss, regardless of object size or position on the tile (doors = easy now :) ).
On uneven terrain it still has some problems.
Hooks for Character model please :)
wow, thats… amazing!
we now have model support WOO!
there are so much more things we can do easier now :D
rep++
oh, can i see the sauce so i can see how its done?
~shut
Iamadam
2011-06-09 03:46:07
Source:
program ModelClick;
{$DEFINE SMART}
{$i SRL\SRL.scar}
{$i SRL\SRL\misc\paintsmart.scar}
{$i Reflection\Reflection.simba}
{$i Reflection\core\RefPaint.simba}
type
TTriangle = record
vertex1, vertex2, vertex3 : TPoint;
end;
//3D model in RS animation space.
type
TModel = record
indices1, indices2, indices3 : array of Integer;
verticesX, verticesY, verticesZ : array of Integer;
pixelX, pixelY : Integer;
end;
//2D representation of a model, converted to screen coords.
type
TScreenModel = record
triangles : array of TTriangle;
end;
function NULL_MODEL : TModel;
begin
result.pixelX := -1;
result.pixelY := -1;
end;
//Give a reference to the TModel.
function parseTModel(modelObj : Integer) : TModel;
var xMax, count : Integer;
begin
writeln('Parsing model data...');
xMax := SmartGetFieldArraySize(modelObj, hook_sdmodel_GetIndices1, 1);
if(xMax < 0) then
begin
result := NULL_MODEL;
exit;
end;
setLength(result.indices1, xMax);
for count := 0 to xMax - 1 do
begin
result.indices1[count] := smartGetFieldArrayShort(modelObj, hook_sdmodel_GetIndices1, count);
end;
xMax := SmartGetFieldArraySize(modelObj, hook_sdmodel_GetIndices2, 1);
setLength(result.indices2, xMax);
for count := 0 to xMax - 1 do
begin
result.indices2[count] := smartGetFieldArrayShort(modelObj, hook_sdmodel_GetIndices2, count);
end;
xMax := SmartGetFieldArraySize(modelObj, hook_sdmodel_GetIndices3, 1);
setLength(result.indices3, xMax);
for count := 0 to xMax - 1 do
begin
result.indices3[count] := smartGetFieldArrayShort(modelObj, hook_sdmodel_GetIndices3, count);
end;
xMax := SmartGetFieldArraySize(modelObj, hook_sdmodel_GetPointsX, 1);
setLength(result.verticesX, xMax);
for count := 0 to xMax - 1 do
begin
result.verticesX[count] := smartGetFieldArrayInt(modelObj, hook_sdmodel_GetPointsX, count);
end;
xMax := SmartGetFieldArraySize(modelObj, hook_sdmodel_GetPointsY, 1);
setLength(result.verticesY, xMax);
for count := 0 to xMax - 1 do
begin
result.verticesY[count] := smartGetFieldArrayInt(modelObj, hook_sdmodel_GetPointsY, count);
end;
xMax := SmartGetFieldArraySize(modelObj, hook_sdmodel_GetPointsZ, 1);
setLength(result.verticesZ, xMax);
for count := 0 to xMax - 1 do
begin
result.verticesZ[count] := smartGetFieldArrayInt(modelObj, hook_sdmodel_GetPointsZ, count);
end;
end;
//Shamelessly ripped from 'getInteractableAt'
function getInteractableModelAt(tile : TTile) : TModel;
var
Plane, Ground, Node, Obj, ObjTemp, ID, modelObj: integer;
TempPixelPoint: TPoint;
TempTile, LocalPos, Base: TTile;
begin
try
Base.X := SmartGetFieldInt(0, hook_static_BaseX);
Base.Y := SmartGetFieldInt(0, hook_static_BaseY);
LocalPos.X := tile.X - Base.X;
LocalPos.Y := tile.Y - Base.Y;
Plane := SmartGetFieldInt(0, hook_static_LoadedPlane);
Ground := SmartGetFieldArray3DObject(0, hook_static_GroundTiles, Plane, LocalPos.X, LocalPos.Y);
Node := SmartGetFieldObject(Ground, hook_ground_AnimableList);
while(Node <> 0)do
begin
Obj := SmartGetFieldObject(Node, hook_AnimableNode_GetAnimable);
if(Obj <> 0)then
begin
ID := SmartGetFieldShort(Obj, hook_InteractiveObject_GetID) and $FFFF;
if((ID = -1) or ((ID) = 65535))then
begin
ObjTemp := SmartGetFieldObject(Obj, hook_interactiveobject2_GetObjectData);
if(ObjTemp <> 0) then
begin
ID := SmartGetFieldInt(ObjTemp, hook_secondlevelobject_GetID);
if((ID = -1) or ((ID and $FFFF) = 65535))then
begin
SmartFreeObject(ObjTemp);
Break;
end;
modelObj := SmartGetFieldObject(ObjTemp, hook_secondlevelobject_GetModel);
TempPixelPoint := Point(SmartGetFieldInt(ObjTemp, hook_animable_PixelX), SmartGetFieldInt(ObjTemp, hook_animable_PixelY));
SmartFreeObject(ObjTemp);
end;
end else //ID is valid, so we can use Obj
begin
modelObj := SmartGetFieldObject(Obj, hook_interactiveobject_GetModel);
TempPixelPoint := Point(SmartGetFieldInt(Obj, hook_animable_PixelX), SmartGetFieldInt(Obj, hook_animable_PixelY));
end;
result := ParseTModel(modelObj);
if(result = NULL_MODEL) then
begin
writeln('No model found.');
end else
begin
result.pixelX := TempPixelPoint.x;
result.pixelY := TempPixelPoint.y;
end;
SmartFreeObject(modelObj);
SmartFreeObject(Obj);
Break;
end;
SmartFreeObject(Node);
Node := SmartGetFieldObject(Node, hook_AnimableNode_GetNext);
end;
finally
try
SmartFreeObject(Ground);
except
end;
try
SmartFreeObject(Obj);
except
end;
try
SmartFreeObject(ObjTemp);
except
end;
try
SmartFreeObject(Node);
except
end;
try
SmartFreeObject(modelObj);
except
end;
end;
end;
function World3DToScreenQuick(xx, yy, zz: Extended; var r: TRender; var rd: TRenderData): TPoint;
var
x, y, z: extended;
tries: integer;
label
ProcStart;
begin;
ProcStart:
x := 0;
y := 0;
z := 0;
Inc(tries);
result:= point(-1,-1);
z:= rd.zOff + (rd.zX * xx + rd.zY * yy + rd.zZ * zz);
if ((z < r.zMin) or (z > r.zMax)) then
exit;
x:= r.xScale * (rd.xOff + (rd.xX * xx + rd.xY * yy + rd.xZ * zz)) / z;
y:= r.yScale * (rd.yOff + (rd.yX * xx + rd.yY * yy + rd.yZ * zz)) / z;
if ((x >= r.xMin) and (x <= r.xMax) and (y >= r.yMin) and (y <= r.yMax)) then
begin
result.x:= Round((x - r.xMin));
result.y:= Round((y - r.yMin));
end else
begin
if (tries > 1)then begin
writeln('more than 5 tries...');
exit;
end;
UpdateRenderInfo(r, rd);
goto ProcStart;
end;
end;
//Same as TileHeight but doesn't give average height.
function GetExactHeight(tile: TTile) : integer;
var
x, y, CurPlane, PlaneInstance : integer;
begin
x:= tile.x - SmartGetFieldInt(0,hook_static_BaseX);
y:= tile.y - SmartGetFieldInt(0,hook_static_BaseY);
if ((x < 0) or (x > 104) or (y < 0) or (y > 104)) then
begin
result := 0;
exit;
end;
CurPlane:= SmartGetFieldInt(0,hook_static_LoadedPlane);
if ((CurPlane < 3) and ((SmartGetFieldArray3DByte(0,hook_static_GroundSettingsArray,1,x,y) and 2) <> 0)) then
CurPlane:= CurPlane + 1;
PlaneInstance := SmartGetFieldArrayObject(0,hook_static_PlaneArray,CurPlane);
result:= (SmartGetFieldArray2DInt(PlaneInstance,hook_sdplane_TileHeights,x,y));
if(Result = -1)then
writeln('****************TileHight hooks are incorrect.*****************');
SmartFreeObject(PlaneInstance);
end;
function Triangle(point1, point2, point3 : TPoint) : TTriangle;
begin
result.vertex1 := point1;
result.vertex2 := point2;
result.vertex3 := point3;
end;
function ModelToScreen (model : TModel) : TScreenModel;
var
locZ, count : Integer;
r : TRender;
rd : TRenderData;
Base : TPoint;
p1, p2, p3 : TPoint;
begin
Base.X := SmartGetFieldInt(0, hook_static_BaseX);
Base.Y := SmartGetFieldInt(0, hook_static_BaseY);
setLength(result.triangles, high(model.indices1) + 1);
locZ := GetExactHeight(Tile((model.pixelX div 512) + Base.x, (model.pixelY div 512) + Base.y)); //clean this up.
for count := 0 to high(model.indices1) do
begin
try
p1 := world3dtoScreenQuick(model.pixelX + model.verticesX[model.indices1[count]], locZ + model.verticesY[model.indices1[count]], model.pixelY + model.verticesZ[model.indices1[count]], r, rd);
p2 := world3dtoScreenQuick(model.pixelX + model.verticesX[model.indices2[count]], locZ + model.verticesY[model.indices2[count]], model.pixelY + model.verticesZ[model.indices2[count]], r, rd);
p3 := world3dtoScreenQuick(model.pixelX + model.verticesX[model.indices3[count]], locZ + model.verticesY[model.indices3[count]], model.pixelY + model.verticesZ[model.indices3[count]], r, rd);
result.triangles[count] := Triangle(p1,p2, p3);
except
writeln('error');
end;
end;
end;
procedure R_DrawTriangle(tri : TTriangle);
begin
R_Drawline(false, tri.vertex1, tri.vertex2, clWhite);
R_DrawLIne(false, tri.vertex2, tri.vertex3, clWhite);
R_Drawline(false, tri.vertex3, tri.vertex1, clWhite);
end;
function validTriangle(tri : TTriangle) : boolean;
begin
if((tri.vertex1.x > 1) and (tri.vertex2.x > 1) and (tri.vertex3.x > 1)
and (tri.vertex1.y > 1) and (tri.vertex1.y > 1) and (tri.vertex1.y > 1)) then result := true;
end;
procedure drawScreenModel (screenModel : TScreenModel);
var count : Integer;
begin
for count := 0 to high(screenModel.triangles) - 1 do
begin
if(validTriangle(screenModel.triangles[count])) then
R_DrawTriangle(screenModel.triangles[count]);
end;
end;
function center(tri : TTriangle) : TPoint;
begin
result.x := (tri.vertex1.x + tri.vertex2.x + tri.vertex3.x) div 3;
result.y := (tri.vertex1.y + tri.vertex2.y + tri.vertex3.y) div 3;
end;
function getPoint(model : TScreenModel) : TPoint;
var idx : Integer;
begin
if(high(model.triangles) < 0) then exit;
idx := RandomRange(0, high(model.triangles));
if(validTriangle(model.triangles[idx])) then
result := center(model.triangles[idx])
else
result := getPoint(model); //this could loop forever so better check if valid triangles exist.
end;
function clickModel(uptext : String; model : TScreenModel) : boolean;
var clickPoint : TPoint;
begin
result := false;
clickPoint := getPoint(model);
if((clickPoint.x < 1) or (clickPoint.y < 1)) then
exit;
MMouse(clickPoint.x, clickPoint.y, 0, 0);
wait(100);
if(isUpText(uptext)) then
begin
clickMouse2(true);
if r_WaitCrossHairColor(CROSSHAIR_RED, 500 + Random(100)) then
result := true
else
result := false;
end
else if(OptionExists(uptext)) then
begin
clickMouse2(false);
wait(300 + random(200));
if(isMenuOpen) then
begin
result := R_ChooseOption(uptext);
end;
end;
end;
var model : TModel;
sm : TScreenModel;
Canvas : TCanvas;
count : Integer;
begin
SMART_SERVER := 5;
SMART_SIGNED := true;
SMART_MEMBERS := false;
setupSRL;
setupReflection;
SmartSetDebug(True);
Canvas := TCanvas.Create;
Canvas.Handle := SmartGetDebugDC;
ClearRSCanvas(Canvas);
count := getSystemTime;
model := getInteractableModelAt(Tile(getMyPos.x + 1, getMyPos.y));
writeln('Took ' + toStr(getSystemTime - count));
count := getSystemTime;
sm := modelToScreen(model);
writeln('Took ' + toStr(getSystemTime - count));
drawScreenModel(sm);
clickModel('xamine' , sm);
end.
Doesn't work on 'secondlevelobject' because the hooks are wrong at the moment (I'm 85% sure). This will draw the model of whatever object is 1 tile to your east, and then examine it.
Also, currently doesn't check the point it will click is on screen. This needs to be done too, but is easy.
I'm going to leave this here : future development is up to everyone else.
Flight
2011-06-09 06:48:43
From: Iamadam
Facepalm.
Fixed it.
This was drawn in 100ms (no plugin). It perfectly matches the model. Woo :)

I now have the function 'atObject(action, name : String; location : TTile) : boolean; Will pretty much never ever miss, regardless of object size or position on the tile (doors = easy now :) ).
On uneven terrain it still has some problems.
Hooks for Character model please :)
Sexy. I agree, rep++.
Bonfield
2011-06-09 07:55:19
Can I ask what you were doing wrong?
Great job btw, I did something similar with npcs, it was pretty crude and just created a 3d box around them, that is so much more than I had great job
Drakan
2011-06-09 10:06:57
I'll check if its the hook or not, easy to check (Dairy cows are secondary).
pyroryan
2011-06-09 10:11:05
From: drags111
I'll check if its the hook or not, easy to check (Dairy cows are secondary).
Rev 3?
Edit:
Issue resolved over MSN?
Coh3n
2011-06-09 17:48:28
So does this mean Prison Pete can be solved easily? :D
Gu3st...
2011-06-09 18:01:35
Wow, jagex sucks at 3d modeling… -.-
So many triangles for such a tiny tree….
Method
2011-06-09 18:28:25
From: Zyt3x
Wow, jagex sucks at 3d modeling… -.-
So many triangles for such a tiny tree….
How would you model the tree?
masterBB
2011-06-09 18:43:25
From: Method
How would you model the tree?
Minecraft did it pretty efficient;)
But I think it aren't that many triangles. A tree is a pretty complicated shape. You don't want to make it look to edgie… I'm not a pro in modeling, but I'm sure I wouldn't be able to use less triangles without reducing the quality of the tree.
Gu3st...
2011-06-09 19:45:33
From: Method
How would you model the tree?
Fewer triangles. They used like 4 triangles on something you'd need 1 for :(
Iamadam
2011-06-09 21:23:23
They need a lot of triangles to make the model look smooth from all angles :)
What I was doing wrong: Well, it was deserving of a facepalm. I copied worldtoscreen, but allowed render + renderdata to be set as parameters so they would only need to be grabbed once for a bunch of points. Only problem was that I didn't actually USE the ones I passed as arguments… I left in the local ones. -.-
Hmm: Character has a model array, not a single model. Interesting. Time to investigate… may need model index too.
E: Everything has 4 models. One for each direction?? We shall see.
EE: The models are all null. Argh I wish I had kept up to date with how this all works -.-
Method
2011-06-09 22:12:36
From: Iamadam
Hmm: Character has a model array, not a single model. Interesting. Time to investigate… may need model index too.
E: Everything has 4 models. One for each direction?? We shall see.
Considering players and npcs can face in more than four directions, no. From what I remember, the array stores temporary models for internal use. Injection bots add fields to various classes in the client, so I'm not sure if you'll be able to grab the data you're looking for using reflection.
Iamadam
2011-06-09 22:20:28
Yeah they seem to be temporary arrays. That's frustrating.
pyroryan
2011-06-10 00:47:26
Haven't tested this but, for NPCs, you should be able to do something along these lines (Hooks apply to #652):
Get NPCDefLoader from NPCDef (hook for NPCDef to Loader is "maa.hb")
mruNodes = getField(npcdefLoader, "md.q"); //md.q=ModelReference
nodeCache = getField(mruNodes, "wq.f");
toolkit = getField(null, "pm.b");
toolkitIdx = getField(toolkit, "ha.f");
ID = NPC ID
index = ID | (toolkitIdx << 16);
Then search nodeCache for nodeID == index.
I think the rest of it is the same as any object models from here (HardReference/SoftReference).
For items, the modelReference hook is something like "fj.v".
Drakan
2011-06-10 09:31:04
Just a little update for those of you who are waiting patiently: I am currently working on the randoms, and I have 4 of them finished right now. They are all being rewritten and tested multiple times. That being said, I could always use more accounts to test them with. Currently I have completed and need more testing accounts for:
- Cap'n Arnav
- BeeKeeper
- Maze
- Mordaut
- Drill Demon
As far as a release date. It's hard to say, but when these randoms get finished it will likely be that same day or the following day. We are working as much as we can on it, and do expect to be done sometime soon. Thanks for waiting everyone, and hopefully we'll get this thing out sooner rather than later! :)
Bixby Sayz
2011-06-10 15:14:17
I have one in Leo that I'll leave there for a while in case you need it for testing. The inventory is full which breaks the current implementation.
Jakkle
2011-06-11 10:29:18
If my chars get any randoms I will pass them over.
Drakan
2011-06-11 11:37:03
From: whacko999
If my chars get any randoms I will pass them over.
Haha thanks :) I appreciate any random accounts that I can get!
Jakkle
2011-06-12 09:41:03
Right I have a problem in getting randoms, it solves them lol. So I put
If (R_FindRandoms) then
begin
Writeln ('Found random logging out');
Logout;
End;
Thought that should logout and not do the random ? but yet it solves the random and then logs out :S any help ?
Drakan
2011-06-12 10:20:26
R_FindRandoms solves the randoms too.
masterBB
2011-06-12 10:46:41
From: whacko999
Right I have a problem in getting randoms, it solves them lol. So I put
If (R_FindRandoms) then
begin
Writeln ('Found random logging out');
Logout;
End;
Thought that should logout and not do the random ? but yet it solves the random and then logs out :S any help ?
Just use R_FindRandoms like normal, but go to antirandoms/Antirandoms.simba and change the following lines to:
SolveRandom := @LogOut;
This will not solve them but log out instead, do this for all randoms you want to safe.
Jakkle
2011-06-12 10:49:01
From: drags111
R_FindRandoms solves the randoms too.
Should it not be R_SolveRandom then ? just a thought.
E: and make R_FindRandom so it only = a resault(true or false) of finding that you are in a random and not solving it.
From: masterBB
Just use R_FindRandoms like normal, but go to antirandoms/Antirandoms.simba and change the following lines to:
SolveRandom := @LogOut;
This will not solve them but log out instead, do this for all randoms you want to safe.
Thanks alot :)
jerryt
2011-06-12 11:39:22
Could we get the source to RefCalculationsLib.dll? in
https://github.com/Drags111/Reflection_Dev/blob/master/plugins/, or could you compile a shared library for linux?
Drakan
2011-06-12 18:41:23
From: jerryt
Could we get the source to RefCalculationsLib.dll? in https://github.com/Drags111/Reflection_Dev/blob/master/plugins/, or could you compile a shared library for linux?
Added the source =]
Dgby714
2011-06-12 18:46:40
From: drags111
Added the source =]
Don't need *.res, *.ico =P and in some cases you wont even need the *.lpi
function GetFunctionCallingConv(x : Integer) : Integer; stdcall; export;
begin
Result := 0;
case x of
0..2 : Result := 1;
end;
end;
You don't export a func 1 or 2 so it should be
function GetFunctionCallingConv(x : Integer) : Integer; stdcall; export;
begin
Result := 0;
case x of
0: Result := 1;
end;
end;
Drakan
2011-06-14 19:04:36
I'll get to it later :P Working on randoms atm, not a big deal. It all works xD
KingKong
2011-06-16 06:18:36
Are the new player finding methods different than the old ones? There were a few bugs in the old ones, see this thread:
http://villavu.com/forum/showthread.php?t=64262
Drakan
2011-06-16 10:03:00
Lookin at the post, sometimes people put mulitple spaces but in the game it only shows one. That would make it not work if you're searching by name :P
masterBB
2011-06-16 10:18:51
Just debug player names, and copy the results. That should work.
Drakan
2011-06-16 11:40:05
Timer helped me with the solution. Apparently, sometimes the client returns some funky characters in place of spaces. Added a fix to reflection 2.
footballjds
2011-06-16 11:54:48
From: drags111
Timer helped me with the solution. Apparently, sometimes the client returns some funky characters in place of spaces. Added a fix to reflection 2.
He's smart. Even though Wizzup? doesn't think so…
MylesMadness
2011-06-16 12:28:56
From: footballjds
He's smart. Even though Wizzup? doesn't think so…
He's more knowledgeable than smart. Its his job to know the runescape client well.
footballjds
2011-06-16 14:02:45
From: MylesMadness
He's more knowledgeable than smart. Its his job to know the runescape client well.
don't want to argue semantics… but i have too :p
"having or showing quick intelligence or ready mental capability" - smart
He's definitely smart and i picked the right word. He is also knowledgeable.
Wizzup?
2011-06-16 16:25:57
Footballjds, I'm sure you're a cool guy, but can you stop making this kind of posts? Timer is - in my opinion - dumb (as illustrated by his inability to stay outside the banned users group) and a horrible coder, aside from having a terrible personality. My reasons for disliking him go far beyond your imagination. I've had to put up with enough of his crap and I really dislike it that you keep bringing this up.
Stop derailing threads with your opinions about banned users and your preference for SCAR. If you feel you have strong arguments and want to share them with us, make a thread so we can flame you for it and break the arguments down, but stop doing it in other threads.
footballjds
2011-06-16 16:47:48
From: Wizzup?
Footballjds, I'm sure you're a cool guy, but can you stop making this kind of posts? Timer is - in my opinion - dumb (as illustrated by his inability to stay outside the banned users group) and a horrible coder, aside from having a terrible personality. My reasons for disliking him go far beyond your imagination. I've had to put up with enough of his crap and I really dislike it that you keep bringing this up.
Stop derailing threads with your opinions about banned users and your preference for SCAR. If you feel you have strong arguments and want to share them with us, make a thread so we can flame you for it and break the arguments down, but stop doing it in other threads.
hey, i'll stop as soon as you quit giving infractions because of your egotistical love for SIMBA. Sound fair enough?
Drakan
2011-06-16 16:50:04
take it outside ladies, this is my thread D:<
Wizzup?
2011-06-16 17:08:50
From: footballjds
hey, i'll stop as soon as you quit giving infractions because of your egotistical love for SIMBA. Sound fair enough?
I think you mean this
warning?
http://villavu.com/forum/showpost.php?p=811244&postcount=64 (The only one handed out to you by me, nice try bending facts to your advantage though)
Seemed like a fair warning. I hand them out for a lot less, but obviously you cannot know that, you and Timer are too smart for that.
footballjds
2011-06-16 17:14:27
From: Wizzup?
I think you mean this warning? http://villavu.com/forum/showpost.php?p=811244&postcount=64
Seemed like a fair warning. I hand them out for a lot less, but obviously you cannot know that, you and Timer are too smart for that.
The OP of that thread asked for SCAR help and someone said to try SIMBA as if that is a solution…
Sorry that hurt your simba pride.
Wizzup?
2011-06-16 17:20:03
From: footballjds
The OP of that thread asked for SCAR help and someone said to try SIMBA as if that is a solution…
Sorry that hurt your simba pride.
Well, you're surely showing the same level of intelligence as Timer. You should consider dropping your current attitude
right now if you don't want to end up like him.
You can try hard to make me look bad and biased by spreading fud like Timer tried to do with a couple of other members. But really, it's pointless. Lies never last.
You're only making yourself look like an idiot to me, the rest of the staff and pretty much the all the members. If you don't like it here, leave. Or, like I said: make a
thread about it, back your opinion with facts and expect our responses.
footballjds
2011-06-16 17:25:47
From: Wizzup?
You should consider dropping your current attitude right now if you don't want to end up like him.
You'd ban me for saying a former member is smart?
Or are you referring to telling someone to "try to be smarter" when they told the OP of that thread to try a whole other product rather then trying to help them with their issue in the first place?
From: Wizzup?
You're only making yourself look like an idiot to me, the rest of the staff and pretty much the all the members.
did you mean: "You're only making yourself look like an idiot to me, the rest of the staff and pretty much
the all the members."
And don't tell me to go make another thread in a
response to me on
THIS thread. kinda an oxymoron.
Drakan
2011-06-16 17:35:16
What did i say. GET THE EFF OUT OF MY THREAD. <3
footballjds
2011-06-16 17:38:16
From: drags111
What did i say. GET THE EFF OUT OF MY THREAD. <3
Yes Sir. I'm gone.
EDIT: http://villavu.com/forum/showthread.php?t=64944
Wizzup?
2011-06-16 17:42:19
From: footballjds
You'd ban me for saying a former member is smart?
Or are you referring to telling someone to "try to be smarter" when they told the OP of that thread to try a whole other product rather then trying to help them with their issue in the first place?
No, I'm pointing out that you're placing direct attacks on people without any reason. Step out of your dream world.
From: footballjds
And don't tell me to go make another thread in a response to me on THIS thread. kinda an oxymoron.
No, it really isn't. Stop making yourself look even dumber than the girl in your signature.
At:
From: footballjds
try being smarter :duh::duh::duh:
EDIT:
Whoever ++repped me and said "fuck the infraction" <3 you
I can tell you who the person is, without looking. It's Icefire. He has been teaming with Timer for over a year now to pretty much go against whatever I say, or just generally trying to make me look like someone who makes childish decision over his own preferences. Sorry to burst your bubble.
I'll look it up for you anyway:
IceFire908 footballjds 08:05, 10th Jun 2011 17 fuck the infraction [Post] [Edit] [Delete]
Voila.
@Drags. I'll stop here, and I can only say that hopefully footballjds will grow up and do the same. If not, I'll take action.
Drakan
2011-06-16 17:49:30
You're all babies and you're all mine! I love my babies but they need to stop fighting :( It hurts my soul.
Jakkle
2011-06-16 19:21:17
From: drags111
You're all babies and you're all mine! I love my babies but they need to stop fighting :( It hurts my soul.
Amen
Flight
2011-06-16 20:43:21
From: drags111
take it outside ladies, this is my thread D:<
Aye, I'm glad someone finally said something.
Drags, what do you think about Iamadam's model debugging/clicking? Do you think this will be implanted into Reflection 2 or will it be a separate add-on?
Drakan
2011-06-16 21:47:53
@Flight: After I release reflection 2 I will work on those sorts of things (model clicking, web walking, etc). First I need a good solid foundation to give you guys so progress can be made and more botting :D
As far as a status update: Kind of depressing today. Decided to benchmark the include a bit compared to reflection 1. Results were fairly (to say the least) disappointing.
Reflection 2 took 43212 ms to get all npcs 1000 times.
Reflection 1 took 27238 ms to get all npcs 1000 times.
After doin a bit more benchmarks and research, I've decided to rewrite the include (again) and abandon the idea of wrappers. It's a trade off: cleanliness for speed. Unfortunately, we're looking for speed :). So far after the rewrite I'm look at a bit better speeds.
<Drags111> Reflection 1 took an average of 26453 ms to get all npcs 1000 times.
<Drags111> Reflection "3" took an average of 21510 ms to get all npcs 1000 times.
I won't be upping the rewrite until I'm finished with everything however. We'll see how it goes. Thanks for your patience! I promise it will be worth the wait!
EDIT: New benchmark:
Reflection 2 took 33010 ms to get all npcs 1000 times.
Reflection "3" took 16021 ms to get all npcs 1000 times.
jerryt
2011-06-16 23:42:29
EDITED BY DRAGS111: Irrelevant, I asked politely for people to stop this flame war on my thread. Now I'm annoyed.
footballjds
2011-06-16 23:45:34
From: jerryt
bunch of swear words and nonsense.
Please do as i did and let this thread be about Reflection 2.
sorry drags
jerryt
2011-06-16 23:48:38
EDITED BY DRAGS111: Irrelevant, I asked politely for people to stop this flame war on my thread. Now I'm annoyed.
Drakan
2011-06-17 00:24:37
From: footballjds
Please do as i did and let this thread be about Reflection 2.
sorry drags
Don't worry, took care of it. For those of you who care:
Reflection[1] took 31 ms to search, and found 11 npcs.
Reflection[2] took 46 ms to search, and found 11 npcs.
Reflection[2.1] took 16 ms to search, and found 11 npcs.
As you can see, a pretty good improvement in search speed! About half the time as Reflection 1 and almost 1/3 the time of reflection 2!
Nava2
2011-06-17 01:02:07
From: drags111
Don't worry, took care of it. For those of you who care:
Reflection[1] took 31 ms to search, and found 11 npcs.
Reflection[2] took 46 ms to search, and found 11 npcs.
Reflection[2.1] took 16 ms to search, and found 11 npcs.
As you can see, a pretty good improvement in search speed! About half the time as Reflection 1 and almost 1/3 the time of reflection 2!
The lowest time that will register is 16ms.. thus when you do bench marks, do say 100 and get the average. It might even be faster than 16ms ;)
Also, please tell me you didn't completely abandon the wrappers.. they just need to be done differently.
Drakan
2011-06-17 01:15:45
From: Nava2
The lowest time that will register is 16ms.. thus when you do bench marks, do say 100 and get the average. It might even be faster than 16ms ;)
Also, please tell me you didn't completely abandon the wrappers.. they just need to be done differently.
Whats a way it could be done that wouldn't take more time?
Dgby714
2011-06-17 01:21:22
From: drags111
Whats a way it could be done that wouldn't take more time?
Actual classes =P
Need to do more work on adding classes from plugins >..>
Drakan
2011-06-17 01:23:36
From: Dgby714
Actual classes =P
Need to do more work on adding classes from plugins >..>
Agreed. I think that is _the_ only efficient way to use wrappers. In large searches wrappers just add too much for whatever reason. I hate PS :)
Nava2
2011-06-17 02:46:13
Branch what you've got into git and then we can see what you're trying to do haha.
Dgby714
2011-06-17 03:15:34
From: Nava2
Branch what you've got into git and then we can see what you're trying to do haha.
Me or him?
Nava2
2011-06-17 12:51:09
From: Dgby714
Me or him?
him. :>
Dgby714
2011-06-17 13:02:37
From: Nava2
him. :>
lol =P
footballjds
2011-06-17 13:06:11
Drags, whats your thoughts on models and model clicking?
Also, have you considered a mouse function with a dynamic x,y value?
for instance: MouseNPC(105, false); could right click the nearest grizzley bear, even if it's moving. every couple mouse "steps" there would have to be a find npc though.
just ideas….
Carlito
2011-06-17 14:53:53
wow breifly read all the things in this thread, excellent work! good luck finishing and hopefully it all works the way its meant to! A+
Flight
2011-06-17 21:11:18
From: footballjds
for instance: MouseNPC(105, false); could right click the nearest grizzley bear, even if it's moving. every couple mouse "steps" there would have to be a find npc though.
just ideas….
You're talking about refreshing the 'Find nearest NPC' (or whatever) every so many milliseconds? Something this specific should be done in the script's loop. Or did I miss your point?
footballjds
2011-06-17 22:35:29
From: Flight
You're talking about refreshing the 'Find nearest NPC' (or whatever) every so many milliseconds? Something this specific should be done in the script's loop. Or did I miss your point?
Im talking mouse(x, y) with dynamic x, y value that changed WHILE moving the mouse.
Nava2
2011-06-17 22:42:09
Football, thst would require either a seperate thread or to modify the mouse function to adapt to new cords. It could be done, but it'll not be as nice as if were threading it.
footballjds
2011-06-17 23:48:52
From: Nava2
Football, thst would require either a seperate thread or to modify the mouse function to adapt to new cords. It could be done, but it'll not be as nice as if were threading it.
Well were SOL as far as multithreading goes =/
Drakan
2011-06-18 00:18:44
Well here's some good news: I just rewrote R_GetAllObjects and benchmarked it vs Reflection 1. Here are the results.
After 1 search, Reflection[1] took 4851 ms to search. Found 1781 objects.
After 1 search, Reflection[2] took 6895 ms to search. Found 1781 objects.
After 1 search, Reflection[2.1] took 1826 ms to search. Found 1781 objects.
Pretty legit.
Runescape Pro
2011-06-18 00:21:04
Damn, That's awesome! The speed increase is very crucial for proper running scripts.
Iamadam
2011-06-18 01:08:55
A thought: In functions like getAllNPS, accept a function pointer, which returns whether the whole npc should be reflected or if it can be skipped. This would save time too.
Eg. maybe we get the npc name, getNPCs calls 'filterNPC' which determines whether the NPC should be included or not. Not sure, just a thought.
i luffs yeww
2011-06-18 01:12:32
Pointers aren't supported in PS.
Iamadam
2011-06-18 01:30:57
function confirm() : Boolean;
begin
result := true;
end;
function getNPCs(confirm : function : boolean) : String;
begin
if(confirm()) then
result := 'Insert NPC';
end;
begin
writeln(getNPCs(@confirm));
end.
Pointer(ish) functionality. Or do I have the naming wrong? I know java and there are no pointers there, so I might be explaining this poorly.
Harry
2011-06-18 01:40:22
wat
Why would you do that? Just have a parm on the getNPCs function, and call it accordingly. Why all that complexity?
Nava2
2011-06-18 01:45:14
From: Iamadam
A thought: In functions like getAllNPS, accept a function pointer, which returns whether the whole npc should be reflected or if it can be skipped. This would save time too.
Eg. maybe we get the npc name, getNPCs calls 'filterNPC' which determines whether the NPC should be included or not. Not sure, just a thought.
I will implement this :)
Drakan
2011-06-18 01:53:26
After much retardation in my knowledge of GIT, nava2 helped me figure out branches and we added what I have of the new reflection to the GIT. You can find that branch here:
https://github.com/Drags111/Reflection_Dev/tree/reflection2_1EDIT:
Finished up Objects.simba tonight! I did quite a bit of overhauling to it. Also added some new functionality to it to make it easier to search for objects, giving it more of the feel of NPC finding. The final benchmarks for the night:
After 10 searches, Reflection[1] took 5138 ms per search and found 1487 objects.
After 10 searches, Reflection[2] took 7765 ms per search and found 1487 objects.
After 10 searches, Reflection[2.1] took 1884 ms per search and found 1487 objects.
Fairly impressive. All searches were done on the same spot on the same character right in succession.
Anyway check out the link, its a good read if you're interested!
https://github.com/Drags111/Reflection_Dev/blob/reflection2_1/lib/animable/objects/Objects.simba
Coh3n
2011-06-24 03:44:44
That's quite the speed increase!
Have you thought about adding documentation to Reflection? The same that SRL5/MSI/Simba/Stats use? May not be a bad idea, but it is time consuming.
Documentation would be nice for the future. Good work Drags111 that's 4x faster. Which is pretty nice.
~BraK
From: drags111
The final benchmarks for the night:
After 10 searches, Reflection[1] took 5138 ms per search and found 1487 objects.
After 10 searches, Reflection[2] took 7765 ms per search and found 1487 objects.
After 10 searches, Reflection[2.1] took 1884 ms per search and found 1487 objects.
Fairly impressive. All searches were done on the same spot on the same character right in succession.
That's incredibly better. Great job!
How long 'til the entire project is rolled out?
Drakan
2011-06-24 23:19:23
If you look at the repo, I've been keeping up with the format for documentation for it all =] It might not be 100% perfect but I've at least got the proper headers for every function.
And as far as time estimate: Not 100% sure on that, will have to see. I am working as much as I can on it, but I did start my actual job back up again so its not AS much. The rewrite it almost done then I just have to finish antirandoms (big pain).
Coh3n
2011-06-25 08:04:35
From: drags111
If you look at the repo, I've been keeping up with the format for documentation for it all =] It might not be 100% perfect but I've at least got the proper headers for every function.
Great. :) You'll have to talk to Wizzup? about the files you need to create the Documentation page.
Is Ref 2 gonna have sub-menu support for R_chooseoption?
Drakan
2011-06-26 20:37:59
From: Yago
Is Ref 2 gonna have sub-menu support for R_chooseoption?
yup added a few weeks ago
From: drags111
yup added a few weeks ago
Ok. Thanks :)
Bobzilla69
2011-07-01 15:09:11
How are things going?
hope its going well for you guys, cant wait for it to be released