SRL Archive - Discussions and Debates

Reflection entfinder?


BobboHobbo

2008-08-04 08:47:12

I just got reflection working properly and got a Iswoodcutting procedure working without hovering over a tree. Is there like a way to find a a Ent with reflection?

Would be great! :)

JuKKa

2008-08-04 09:18:06

From: BobboHobbo
I just got reflection working properly and got a Iswoodcutting procedure working without hovering over a tree. Is there like a way to find a a Ent with reflection?

Would be great! :)


FindNPC tree? The tree turns into a NPC, so by searching for the npc u find it.

The Claw

2008-08-04 09:26:03

Yep, just put what Jukka said into your randoms loop which you should call every few seconds while you're chopping the tree.

if FindNPC('Tree') then
HandleTreeNPC

or whatever the function for finding NPCs is.

Harry

2008-08-04 11:48:30

I do not think a Tree is declared as an NPC because it does not hold a yellow dot on the Minimap. But!, the Ent uses a yellow dot, you can just call the FindNPC thing on the Ent's ID (which I do not know, sorry ;))

Method

2008-08-04 14:35:28

You can use FindNPC to see if an ent is present anywhere on the screen, but that's not really going to help you out if it's not the tree you're chopping or going to chop. If you know the tiles of the trees you're going to chop, you can look for a certain tree by tiles, see if an ent exists and if so, if it's location is within the 4 tiles a tree is in, then respond accordingly.

Otherwise, simply using FindNPC by itself is unreliable and will not give very good results.

n3ss3s

2008-08-04 15:00:39

From: Hy71194
I do not think a Tree is declared as an NPC because it does not hold a yellow dot on the Minimap. But!, the Ent uses a yellow dot, you can just call the FindNPC thing on the Ent's ID (which I do not know, sorry ;))



That was the whole point of it, Tree is not an NPC, but Ent is an NPC and 'Tree'.

It does work if your StartChopping(Var TileX, TileY: Integer) method does like that, returns the tile pos of the three so you can do loc find on the NPC and voila.

the scar noob

2008-08-04 15:00:57

It could be possible that there's an ID for and ent, because there is one for a whirlpool (look at Zephyr's script).

-Tsn.

Timer

2008-08-04 15:03:39

There is, but evry one isn't figuring it… Run the npc getter while chopping, wait for an ent and get the ID.

n3ss3s

2008-08-04 15:06:07

You don't need the ID! Just do FindNPC('Tree') like Claw said.

[-jesus-]

2008-08-04 20:41:12

Scripts getting shorter already :o.. Maybe we will go back to 1k lines of code being big :p

Shuttleu

2008-08-04 20:51:52

how about you get the script to get your position then if it finds a the npc with the name tree within 1 square around it then it will detect the ent :)

here is a picture to explain myself better
you are standing on the red square
you tell the script to get your position (which will be the red square)
then you tell the script to search the blue boxs around you for a npc called tree
if it frinds the npc called tree then it will say that it has found an ent

~shut

BobboHobbo

2008-08-05 01:24:56

Oh mad. Thanks!

Negaal

2008-08-05 01:44:49

Also it's possible to detect ent with getanimation…but the problem is the array of those numbers would be pretty big and hard to find out..every axe(bronze..rune) has different numbers when cutting an ent… also it may be different per every tree..but it would be foolproof..

This reflection stuff is great..I think I have to make a script to try all of them out..

Any requests? Recommendations?

Wizzup?

2008-08-05 01:46:50

So much for no antirandoms with Reflection.

[-jesus-]

2008-08-05 01:47:35

From: Negaal
Also it's possible to detect ent with getanimation…but the problem is the array of those numbers would be pretty big and hard to find out..every axe(bronze..rune) has different numbers when cutting an ent… also it may be different per every tree..but it would be foolproof..

This reflection stuff is great..I think I have to make a script to try all of them out..

Any requests? Recommendations?


A quest, not many of those. & even if you just did like a rune mysteries quest runner it would still be good :)

Negaal

2008-08-05 01:51:29

Also I'm not SURE does the shuttleu's way works, see the tree takes usually more than 1 square, may take up to 9 squares, but in case the ent appears, then will the "NPC" cover the area what tree covered before?..the NPC may take only 1 square now…once I had ent, but the yellow dot was like 10 px away from me on MM, there the idea about this came… Imo using disrance(); will not hurt..

n3ss3s

2008-08-05 02:57:45

Also it's possible to detect ent with getanimation…but the problem is the array of those numbers would be pretty big and hard to find out..every axe(bronze..rune) has different numbers when cutting an ent… also it may be different per every tree..but it would be foolproof..


This is teh shiz I love, there is a relation between them for sure, e.g AxeID + 1555 = EntID for that axe, like that…

e.g some RSBot Forums mod made a prison pete solver, here's a piece of it:

[php]
public int setItemIDs(int b2p) {
switch (b2p) {
case 10749:
return 3119;
case 10750:
return 3120;
case 10751:
return 3121;
case 10752:
return 3122;
}
return 0;
}
[/php]

You can see how he could've just done

[php]return b2p - 7630;[/php] and voila ;)

Daniel

2008-08-05 03:02:36

Cool, so how does it find the NPC?

NiCbaZ

2008-08-05 03:05:10

read the include…. it basicly reads the client gets the id's from the MM ( i think) convets the MMtoMS for when finding and vola, just read the include tho.

Daniel

2008-08-07 02:50:39

From: NiCbaZ
read the include…. it basicly reads the client gets the id's from the MM ( i think) convets the MMtoMS for when finding and vola, just read the include tho.

But would i put FindNPC('gas') since it's gas or 'rocks'? They're two totally different things.

Bobarkinator

2008-08-07 02:59:43

[QUOTE=Dan's The Man;444516]But would i put FindNPC('gas') since it's gas or 'rocks'? They're two totally different things.

Gas isn't counted as NPC AFAIK

P1nky

2008-08-07 03:19:28

than wouldnt ent not be a NPC too :O?

gas-for mining
ent-for wcing

tough… but to me gas shouldnt be a NPC… :S
Ent looks like a monster so it should be LOL JK :)

Daniel

2008-08-07 06:49:39

Damn.

Bobarkinator

2008-08-07 12:07:19

From: P1NKY
than wouldnt ent not be a NPC too :O?

gas-for mining
ent-for wcing

tough… but to me gas shouldnt be a NPC… :S
Ent looks like a monster so it should be LOL JK :)


Ent is an NPC
Gas is an object