Hayase Posted December 17, 2016 Posted December 17, 2016 So it seems all of these can work the same: RS2Object tree1 = objects.closest("Oak"); Entity tree2 = objects.closest("Oak"); NPC tree3 = npcs.closest("Oak"); What are the differences if they all accomplish the same job of finding the closest oak tree? [What is the right tool for the job?] Continuing on it looks like they all can be interactable: tree.interact("Chop Down"); tree2.interact("Chop Down"); tree3.interact("Chop Down"); Again what is the right tool for the job if they all do the same thing?
Deceiver Posted December 17, 2016 Posted December 17, 2016 http://osbot.org/forum/topic/93981-guidetypes-of-entities-and-how-to-use-them-correctly/ 3
Hayase Posted December 18, 2016 Author Posted December 18, 2016 http://osbot.org/forum/topic/93981-guidetypes-of-entities-and-how-to-use-them-correctly/ Well that was easy, thanks.
Alek Posted December 18, 2016 Posted December 18, 2016 Entity is the super class, meaning that RS2Object and NPC both extend it. Don't use the super class unless you know what you're doing; the OSBot API makes a lot of convenient decisions based on the child type (especially in interactions). 2