SRL Archive - Reflection Help

Summoning familiars and Reflection


TomTuff

2011-02-15 23:15:28

A reply to IceFire908's RcRb made me have the idea to make a spirit graahk rune crafter. However, there is usually 4+ people at both edgeville bank and castle wars bank using spirit graahks as well. This means searching for the NPC would return your graahk and everyone elses. Is there a way to use reflection to determine which graahk is yours?

mormonman

2011-02-15 23:20:13

Why would you even click the graahk? Just click the summoning points button.

Train

2011-02-15 23:29:02

From: TomTuff
A reply to IceFire908's RcRb made me have the idea to make a spirit graahk rune crafter. However, there is usually 4+ people at both edgeville bank and castle wars bank using spirit graahks as well. This means searching for the NPC would return your graahk and everyone elses. Is there a way to use reflection to determine which graahk is yours?


Yes.

TomTuff

2011-02-15 23:35:10

From: mormonman
Why would you even click the graahk? Just click the summoning points button.

Wait, you can do that? o.o
From: Train
Yes.

Elaborate, O mysterious one.

Train

2011-02-15 23:37:55

From: TomTuff
Wait, you can do that? o.o

Elaborate, O mysterious one.


I don't have a pet to test it on, but you can think about it using pure logic.
Get all graahks.
Loop though all and find the one interacting with you.
Get the tile it's on (main).
Get all graahks on the tile.
Click choose option respectively.

TomTuff

2011-02-15 23:39:25

From: Train
Loop though all and find the one interacting with you.


That's the part I don't know how to do. I'm not very advanced with reflection. But it's okay, let's not delve to deeply; the summoning button would work better anyways.

Train

2011-02-15 23:43:05

From: TomTuff
That's the part I don't know how to do. I'm not very advanced with reflection. But it's okay, let's not delve to deeply; the summoning button would work better anyways.


Yes, it would work better that way. But randomizing it would be more human.
function GetAllNPCs(Null: Boolean):array of TNPC;   
function InteractingWithMe(NPC: TNPC): Boolean;

mormonman

2011-02-15 23:53:47

From: Train
Yes, it would work better that way. But randomizing it would be more human.
function GetAllNPCs(Null: Boolean):array of TNPC;   
function InteractingWithMe(NPC: TNPC): Boolean;


When I play I never click on my graahk/kyatt. Ever. It's more clicks.

Nava2

2011-02-16 00:07:42

From: mormonman
When I play I never click on my graahk/kyatt. Ever. It's more clicks.


Picking the correct one out of the list would be even harder.

Train

2011-02-16 00:11:47

From: Nava2
Picking the correct one out of the list would be even harder.


Nonsense! Why do you think that?

Nava2

2011-02-16 00:19:46

From: Train
Nonsense! Why do you think that?


When there are 10 of them in a list, you cannot tell from the options (afaik) which one correlates to each ghaark.

Train

2011-02-16 00:27:03

From: Nava2
When there are 10 of them in a list, you cannot tell from the options (afaik) which one correlates to each ghaark.


It would be from the respective order of the NPC on the tile, no?

kitchenrange

2011-02-16 00:28:16

I was thinking something similiar, but how do you make ChooseOption go past the first option that matches the text?

TomTuff

2011-02-16 00:29:37

From: Train
It would be from the respective order of the NPC on the tile, no?


That would make sense, but you have to take into account that when you get the NPCs on your graahk's main tile, you're only getting a few of the graahks that could be on that tile. There could be other graahks there who still cover that tile, but their main tile is somewhere else so reflection doesn't find it. When you right click on that tile, if your graahk is the 3rd graahk with their main tile on that tile, but there are 6 graahks with that tile as a secondary tile, you would misclick.

Also, this
From: kitchenrange
I was thinking something similiar, but how do you make ChooseOption go past the first option that matches the text?

Train

2011-02-16 00:30:47

To make it go past you would make a slight modification to the choose option function, nothing fancy.

Echo_

2011-02-16 10:07:01

From: Train
To make it go past you would make a slight modification to the choose option function, nothing fancy.


Why would you do all of that unnecessary work when you could just write a function that right clicks the summoning icon and selects the "teleport" option?

Nava2

2011-02-16 10:13:18

From: Echo_
Why would you do all of that unnecessary work when you could just write a function that right clicks the summoning icon and selects the "teleport" option?


… I play legit and did not know you could do this…

mormonman

2011-02-16 10:58:24

From: mormonman
Why would you even click the graahk? Just click the summoning points button.


From: Echo_
Why would you do all of that unnecessary work when you could just write a function that right clicks the summoning icon and selects the "teleport" option?


From: Nava2
… I play legit and did not know you could do this…


I'm pretty sure we already covered this -.-

And it isn't a "Teleport" option, it's an "Interact" option. and then you have to choose "Teleport" from the NPC chat interface.