Jump to content

Some questions


filthycasual

Recommended Posts


Hi all,

I’ve spent the last month getting familiar with the osbot api. Over the time I have collected some questions and it would be great to get some insight from the scripters over here ;d.

Often when I build the jar I am unable to do so because the current jar is in memory, even when no script is running. Clicking refresh doesn’t help either. The only solution is to restart the client. This is costing me a lot of time and I cannot figure out why it is happening. Does anyone have a solution to this problem?

Sometimes the .closest method doesn’t return the actually closest object because of some obstacle in the way. I remember someone posted a presumably better .closest method. I am however unable to  find it. Is there someone that knows what im talking about / someone that implemented it themselves?

I want to be able to execute actions (eg alching/fletching/logging out) whilst webwalking. Initially I tried doing this by setting a breakcondition, which works okay sometimes, but often it takes a very large amount of time (5 sec +) before the webwalking stops after my breakcond is true, also, even it the breakcond were to behave as expected it wouldn’t be optimal because i’d be spamcreating webwalkevents which isn’t very efficient. The current solution I have in mind is seeing if there is some sort of webwalking thread that I could pause/stop and then resume after completing my own action. Another solution could be looking at the eventqueue and perhaps manipulating that to add my own events between the webwalk click events. Since i’m not so  familiar with the api yet, it would be great to get some suggestions on this matter.

I noticed that some teleports are not being used yet by the webwalker, is there a way I could manually add eg Necklace of Passage to the list.

Cheers

Link to comment
Share on other sites

1 hour ago, filthycasual said:


Hi all,

I’ve spent the last month getting familiar with the osbot api. Over the time I have collected some questions and it would be great to get some insight from the scripters over here ;d.

Often when I build the jar I am unable to do so because the current jar is in memory, even when no script is running. Clicking refresh doesn’t help either. The only solution is to restart the client. This is costing me a lot of time and I cannot figure out why it is happening. Does anyone have a solution to this problem?

Sometimes the .closest method doesn’t return the actually closest object because of some obstacle in the way. I remember someone posted a presumably better .closest method. I am however unable to  find it. Is there someone that knows what im talking about / someone that implemented it themselves?

I want to be able to execute actions (eg alching/fletching/logging out) whilst webwalking. Initially I tried doing this by setting a breakcondition, which works okay sometimes, but often it takes a very large amount of time (5 sec +) before the webwalking stops after my breakcond is true, also, even it the breakcond were to behave as expected it wouldn’t be optimal because i’d be spamcreating webwalkevents which isn’t very efficient. The current solution I have in mind is seeing if there is some sort of webwalking thread that I could pause/stop and then resume after completing my own action. Another solution could be looking at the eventqueue and perhaps manipulating that to add my own events between the webwalk click events. Since i’m not so  familiar with the api yet, it would be great to get some suggestions on this matter.

I noticed that some teleports are not being used yet by the webwalker, is there a way I could manually add eg Necklace of Passage to the list.

Cheers

Regarding your closest question, I think there are two different methods to calculate the closest entity, one based off "real distance" which I think is walking distance though im not sure, and the other is the direct distance through pythagoras. You can find these in the EntityAPI class.

Link to comment
Share on other sites

9 hours ago, filthycasual said:

I noticed that some teleports are not being used yet by the webwalker, is there a way I could manually add eg Necklace of Passage to the list.

Depending on your use of this, it might be worth manually adding that teleport to your script and then webwalking from the teleport destination.

Link to comment
Share on other sites

10 hours ago, filthycasual said:


Hi all,

I’ve spent the last month getting familiar with the osbot api. Over the time I have collected some questions and it would be great to get some insight from the scripters over here ;d.

Often when I build the jar I am unable to do so because the current jar is in memory, even when no script is running. Clicking refresh doesn’t help either. The only solution is to restart the client. This is costing me a lot of time and I cannot figure out why it is happening. Does anyone have a solution to this problem?

Sometimes the .closest method doesn’t return the actually closest object because of some obstacle in the way. I remember someone posted a presumably better .closest method. I am however unable to  find it. Is there someone that knows what im talking about / someone that implemented it themselves?

I want to be able to execute actions (eg alching/fletching/logging out) whilst webwalking. Initially I tried doing this by setting a breakcondition, which works okay sometimes, but often it takes a very large amount of time (5 sec +) before the webwalking stops after my breakcond is true, also, even it the breakcond were to behave as expected it wouldn’t be optimal because i’d be spamcreating webwalkevents which isn’t very efficient. The current solution I have in mind is seeing if there is some sort of webwalking thread that I could pause/stop and then resume after completing my own action. Another solution could be looking at the eventqueue and perhaps manipulating that to add my own events between the webwalk click events. Since i’m not so  familiar with the api yet, it would be great to get some suggestions on this matter.

I noticed that some teleports are not being used yet by the webwalker, is there a way I could manually add eg Necklace of Passage to the list.

Cheers

  1. If you're exporting jar files of your scripts to test, then read this: 
  2. The closest function uses Pythagoras algorithm. There are alternative functions to find the closest entity using real distance. The real distance is calculated by how many tiles you would need to traverse before reaching the entity.
  3. I'm not at all familiar with the web walking API. However, I'd do something similar to promises in JavaScript. This should allow you to do asynchronous/concurrent actions after having clicked somewhere to walk. However, those actions would need to be interrupted if there's not enough time to complete them. This would lead to problems, such as, the bot failing to walk to the next tile because an item is selected. There'd need to be something like: 
    WebWalker#walk#resolve(TRY_FLETCH)#reject(UNSELECT_ITEM)

     

Link to comment
Share on other sites

15 hours ago, battleguard said:

I get that jar in memory warning also when building with intellij, but the script will still update when you hit refresh on the script selector on the next run. Check and see if the last modified date is changing on the compiled jar when you build.

Unfortunately that isn't the case for me ;<, when the error occurs my build hasn't gone through.

 

14 hours ago, rsplayerz said:

Regarding your closest question, I think there are two different methods to calculate the closest entity, one based off "real distance" which I think is walking distance though im not sure, and the other is the direct distance through pythagoras. You can find these in the EntityAPI class.

Thank you!!

 

6 hours ago, safe profile said:

Depending on your use of this, it might be worth manually adding that teleport to your script and then webwalking from the teleport destination.

This is my current solution but it isn't ideal because my starting point is dynamic ;/.

5 hours ago, liverare said:
  1. If you're exporting jar files of your scripts to test, then read this: 
  2. The closest function uses Pythagoras algorithm. There are alternative functions to find the closest entity using real distance. The real distance is calculated by how many tiles you would need to traverse before reaching the entity.
  3. I'm not at all familiar with the web walking API. However, I'd do something similar to promises in JavaScript. This should allow you to do asynchronous/concurrent actions after having clicked somewhere to walk. However, those actions would need to be interrupted if there's not enough time to complete them. This would lead to problems, such as, the bot failing to walk to the next tile because an item is selected. There'd need to be something like: 
    
    WebWalker#walk#resolve(TRY_FLETCH)#reject(UNSELECT_ITEM)

     

If I read that tutorial correctly it's just about setting automatic jar builds to the osbot script folder. I already do this ( with intellij though ). Even cleaning doesn't fix the issue.

Thanks for the suggestion on promises, I like the idea of using reject to circumvent unexpected state. I still don't have the required knowledge off the api to implement this though, guess i'll dive into the api docs again.

 

 

 

 

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...