Jump to content

limited to 1 local script?


senpai jinkusu

Recommended Posts

this was driving me nuts lol, i could not get the bot to find my script, until i figured out it only allows up to 1 local script, so i just deleted the other jar i had in there

It has to do something with the scripts' core. if the mainclass in a script is called main.java and in a second script the mainclass is called the same --> one of those two will only appear.

Link to comment
Share on other sites

this is off topic but i also have another question and i dont want to make another topic, 
are references to entities still valid after the entity changes (ie. when you chop down a tree and becomes a tree stump that entity changes) , so basically if i could still interact with the same tree instance after it respawns

Link to comment
Share on other sites

this is off topic but i also have another question and i dont want to make another topic, 

are references to entities still valid after the entity changes (ie. when you chop down a tree and becomes a tree stump that entity changes) , so basically if i could still interact with the same tree instance after it respawns

As long as you're calling them by String (entity name), then yes, after respawn your interaction will still work :). Just make sure you use a null check else if you cut them all down problems shall arise.

Link to comment
Share on other sites

As long as you're calling them by String (entity name), then yes, after respawn your interaction will still work smile.png. Just make sure you use a null check else if you cut them all down problems shall arise.

if i instantiate it like so

 

ent= getObjects().closest(new Area(...,tree id);

 

and it is not null, i chop it, it respawns, will this still be valid

Link to comment
Share on other sites

if i instantiate it like so

 

ent= getObjects().closest(new Area(...,tree id);

 

and it is not null, i chop it, it respawns, will this still be valid

That's correct, this is the entity declaration I use in my Willow Cutter:

	Entity tree = objects.closest("Willow");

It seems to work perfectly fine with respawned trees. I'd highly advise you avoid using the trees ID's as they're prone to changing on the fly, especially after updates.

  • Like 1
Link to comment
Share on other sites

That's correct, this is the entity declaration I use in my Willow Cutter:

Entity tree = objects.closest("Willow");
It seems to work perfectly fine with respawned trees. I'd highly advise you avoid using the trees ID's as they're prone to changing on the fly, especially after updates.
Im still pretty new when it comes to osbot scripts ( and rs bots in general) but I'll definitely keep that in mind
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...