PDA

View Full Version : Unable to find Rune Essence portal using lape reflection



terd
11-24-2015, 09:30 PM
I am trying to make a rune essence miner as my first script in reflection just to use it as a base for improvement. However, I cannot seem to find the ID or any sort of object for the portal to teleport back to the shop out of the mine. I was instructed to use the ID 15638, and while this seems to be the ID of a portal, it works only very rarely. I'm not sure if I have outdated methods or if this is simply a bug in the reflection I'm using. I have attached my script, feel free to give me any other tips. Remember, I'm not expecting this to work fantastically, even when I'm finished.

Thanks

Hoodz
11-24-2015, 10:43 PM
first of all: the ID's change all the time, dont use them.
second: portals can be a gameObject OR a npc, keep that in mind.
last: their action text (like enter) is not always the same either.

terd
11-24-2015, 10:50 PM
first of all: the ID's change all the time, dont use them.
second: portals can be a gameObject OR a npc, keep that in mind.
last: their action text (like enter) is not always the same either.

Right, I noticed that sometimes the right click text is different. I was planning on accounting for that, along with other things such as opening the door to the shop if it is closed, later on. I would expect code such as this to work:


var
Port: TReflectObject;

if not Port.Find(objGame, 'Portal', 20) then
begin
Writeln('port NOT Found');

But it does not find the portal. I have also tried it using a TReflectNpc object as you suggested, but this did not work either.

Hoodz
11-25-2015, 12:18 AM
Right, I noticed that sometimes the right click text is different. I was planning on accounting for that, along with other things such as opening the door to the shop if it is closed, later on. I would expect code such as this to work:


var
Port: TReflectObject;

if not Port.Find(objGame, 'Portal', 20) then
begin
Writeln('port NOT Found');

But it does not find the portal. I have also tried it using a TReflectNpc object as you suggested, but this did not work either.
Because the name is hidden. (Will return null) try loading all objects and if they have an option "Enter" or "Use" then that gameobject will be the portal. Do the same for npcs if it didnt find any gameobjects with any of those actions

terd
11-25-2015, 12:38 AM
What code would I use to do that?

Kyle
11-25-2015, 12:42 AM
What code would I use to do that?

Wrote this in browser, so I dunno if it compiles, but something along the lines of this should work, assuming hoodz; is right, I'm sure he is, I don't know anything about the portals or that they were nulled.. You can also add the Object check if no Npc's are found.


Npcs.GetAll;
for I := 0 to High(Npcs) do
if (Npcs[I].GetName = 'Enter') or (Npcs[I].GetName = 'Use') then
Reflect.Mouse.Move(Npcs[I].GetMSPoint, 2, 2);

terd
11-25-2015, 01:28 AM
program Test;
{$DEFINE SMART}
{$i Reflection/Reflection.simba}

var
Npcs: TReflectNpcArray;
I: Integer;

begin
Reflect.Setup;
Npcs.GetAll;
for I := 0 to High(Npcs) do
begin
//WriteLn(Npcs[I].GetName);
//WriteLn(Npcs[I].GetTile);
//WriteLn(Npcs[I].GetID);
if (Npcs[I].GetName = 'Enter Portal') or (Npcs[I].GetName = 'Use Portal') then
Writeln('FOuND');
end;
end;

When I run this next to the portal, it does not find anything. I have also tried 'Use' and 'Enter' instead of with portal.

Kyle
11-25-2015, 02:35 AM
..

My bad, I meant to say .GetActions, but I actually just went to the portals, and for what ever reason even the actions are nulled out.. But you should still be able to do it since the portal appears to be the only npc in the cave, and more so, the only one with a nulled out name.
So try this and see if it works for you:

Npc.Find('');

terd
11-25-2015, 03:38 AM
My bad, I meant to say .GetActions, but I actually just went to the portals, and for what ever reason even the actions are nulled out.. But you should still be able to do it since the portal appears to be the only npc in the cave, and more so, the only one with a nulled out name.
So try this and see if it works for you:

Npc.Find('');

Nice, that seems to work! Thanks

tls
11-25-2015, 06:03 AM
My bad, I meant to say .GetActions, but I actually just went to the portals, and for what ever reason even the actions are nulled out.. But you should still be able to do it since the portal appears to be the only npc in the cave, and more so, the only one with a nulled out name.
So try this and see if it works for you:

Npc.Find('');

Null npcs been around for a while, the fix isn't the simplest.

Hoodz
11-25-2015, 01:22 PM
hoodz; is right, I'm sure he is
cute :blushing:

i knew this because i wrote a reflection rune essence mining script once.