TTScripts Posted September 15, 2017 Share Posted September 15, 2017 Hi, i'm coding my script and it's not finding objects. Refer to picture below. Maybe bad code? Idk but using this line to check if an object nearby has always worked in the past. I added some debugging because I wanted to make sure but in the top left you'll see 9348 is being called a null even though you can see (through Entity hover debug) there is a 9348 object right there (Bird snare with Tropical wagtail in it) What's going on? Quote Link to comment Share on other sites More sharing options...
TTScripts Posted September 15, 2017 Author Share Posted September 15, 2017 No one? Quote Link to comment Share on other sites More sharing options...
ProjectPact Posted September 15, 2017 Share Posted September 15, 2017 Would try to help if I could understand the logic. Quote Link to comment Share on other sites More sharing options...
Juggles Posted September 15, 2017 Share Posted September 15, 2017 (edited) 37 minutes ago, Project said: Would try to help if I could understand the logic. Same. Edit: figured it out. I think i was having similar issues yesterday. Most Players with spaces in their name were ==null for some reason even if they existed. Maybe it has something to do with spaces NPCs Objects and Players Edited September 15, 2017 by Juggles Quote Link to comment Share on other sites More sharing options...
TTScripts Posted September 16, 2017 Author Share Posted September 16, 2017 On 9/14/2017 at 9:17 PM, Juggles said: Same. Edit: figured it out. I think i was having similar issues yesterday. Most Players with spaces in their name were ==null for some reason even if they existed. Maybe it has something to do with spaces NPCs Objects and Players So how do we correct the issue? Does OSBot's API recognize underscores in place of spaces? Quote Link to comment Share on other sites More sharing options...
Token Posted September 16, 2017 Share Posted September 16, 2017 5 minutes ago, TTScripts said: So how do we correct the issue? Does OSBot's API recognize underscores in place of spaces? Access entities via getAll() methods instead of closest() and process the collection until you obtain the desired result 1 Quote Link to comment Share on other sites More sharing options...
TTScripts Posted September 16, 2017 Author Share Posted September 16, 2017 Just now, Token said: Access entities via getAll() methods instead of closest() and process the collection until you obtain the desired result Not a bad idea bro, i'll try it! Quote Link to comment Share on other sites More sharing options...