Purus Pasta Client [Now with NEW botting API!]

Forum for alternative clients, mods & discussions on the same.

Re: Purus Pasta Client [Now with NEW botting API!]

Postby shubla » Sat Mar 30, 2019 3:04 pm

Granger wrote:Why do you push an update that breaks functionality?

Because I personally didn't have issues with that functionality being removed. And no one has really complained yet that they were using it.
Nashorn didn't support new and cool things from newest ECMAScript standards. So it had to go.
Not worth it using Nashorn for some odd functionality that maybe somebody sometimes uses, which is very thread unsafe anyway.
If you used this functionality and want it back, perhaps we can discuss about possible ways of replacing it with something.
Image
I got my own cool HnH custom client check it out.
Purus Pasta
http://i.imgur.com/CRrirds.png?1
User avatar
shubla
 
Posts: 9846
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

Re: Purus Pasta Client [Now with NEW botting API!]

Postby ffsfiftyseven » Sat Mar 30, 2019 5:12 pm

shubla wrote:If you used this functionality and want it back, perhaps we can discuss about possible ways of replacing it with something.

Adding a button near every script in the list to stop it's thread?
Easier(?) take: one button in the scriptlist window to stop all running script threads.
I think we only used missing functionality to stop our scripts anyway.
ffsfiftyseven
 
Posts: 5
Joined: Sat Jan 15, 2011 3:18 pm

Re: Purus Pasta Client [Now with NEW botting API!]

Postby shubla » Sat Mar 30, 2019 5:15 pm

ffsfiftyseven wrote:
shubla wrote:If you used this functionality and want it back, perhaps we can discuss about possible ways of replacing it with something.

Adding a button near every script in the list to stop it's thread?
Easier(?) take: one button in the scriptlist window to stop all running script threads.
I think we only used missing functionality to stop our scripts anyway.

Just forcing threads to stop like that is not very good idea.
Image
I got my own cool HnH custom client check it out.
Purus Pasta
http://i.imgur.com/CRrirds.png?1
User avatar
shubla
 
Posts: 9846
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

Re: Purus Pasta Client [Now with NEW botting API!]

Postby Granger » Sat Mar 30, 2019 9:12 pm

shubla wrote:
ffsfiftyseven wrote:
shubla wrote:If you used this functionality and want it back, perhaps we can discuss about possible ways of replacing it with something.

Adding a button near every script in the list to stop it's thread?
Easier(?) take: one button in the scriptlist window to stop all running script threads.
I think we only used missing functionality to stop our scripts anyway.

Just forcing threads to stop like that is not very good idea.

You should be able to raise an exception inside the thread, IIRC.
Please check Announcements, Game Guides, GLoSQ before posting questions, search is your friend.
Follow the Bug Report HOWTO to ease solving your issue and, in general, The Rules.
User avatar
Granger
 
Posts: 8981
Joined: Mon Mar 22, 2010 2:00 pm

Re: Purus Pasta Client [Now with NEW botting API!]

Postby LostJustice » Sun Mar 31, 2019 5:10 pm

ffsfiftyseven wrote:
LostJustice wrote:It does support multithreading. You start the thread on the java side and use the java implementation of it. Issue why it crashes it because you are not creating handling or scheduling for activating the button during the click event. Create thread -> Thread does the actual button click -> schedule and start thread.

GraalVM enforces the "one thread per js runtime" rule. If you synchronize concurrent access to runtime between threads you will end up with runtime locked in the loop, without a way to access it from another thread and flip the switch stopping the loop.


It a port over from java you can create variables on the java side that are threads extends your “one” thread and interacts with these threads. So still not convinced. Using proper thread access you wouldn’t need to synchronize for most situations and not sure why you would for a scripting api.
Last edited by LostJustice on Sun Mar 31, 2019 5:42 pm, edited 2 times in total.
Image
User avatar
LostJustice
 
Posts: 615
Joined: Sun Mar 25, 2012 3:57 am

Re: Purus Pasta Client [Now with NEW botting API!]

Postby LostJustice » Sun Mar 31, 2019 5:14 pm

shubla wrote:
LostJustice wrote:
shubla wrote:Current issues:
Currently graalvm does not support multithreading, so if you click a button in PBotWindow while the javascript is already running, it will crash.
Thus you cannot stop your scripts at all by clicking the button while they are running for example. May fix if I come up with some good solution to this issue.

If you have any suggestions about how the API could be improved, for example, some functions to add, please tell at the Purus Pasta discord server!


It does support multithreading. You start the thread on the java side and use the java implementation of it. Issue why it crashes it because you are not creating handling or scheduling for activating the button during the click event. Create thread -> Thread does the actual button click -> schedule and start thread.

You don't understand what I meant.
The issue is that if there is a script running, there is no way of calling function from that script instance. For example, by pressing a button in the client gui. With nashorn this was possible. Yeah there are some stupid workarounds, but they are rather ugly.
Example of how you could do in nashorn:
Run a script, have a button, and when you press the button, it executes a function from the script, changing state of the instance while it is running. Quite handy for stop buttons etc. I guess? Of course, there are possible concurrency issues, but who cares about those 8)
I don't know how other people use the API themselves, like if they used this feature or not.


Yes you would build a controller on the java side to handle the script changes and plugin threads and then when you want to change the state you call hose methods to handle it. You do not handle the threads and ect on the js side. Rather build a clever way to create and manage your own threads in java on that side that is api calls for the js.
Image
User avatar
LostJustice
 
Posts: 615
Joined: Sun Mar 25, 2012 3:57 am

Re: Purus Pasta Client [Now with NEW botting API!]

Postby shubla » Sun Mar 31, 2019 7:03 pm

LostJustice wrote:Yes you would build a controller on the java side to handle the script changes and plugin threads and then when you want to change the state you call hose methods to handle it. You do not handle the threads and ect on the js side. Rather build a clever way to create and manage your own threads in java on that side that is api calls for the js.

Yeah but I think it would be rather ugly. I'd rather not have something like that.
Especially as there is really no demand for it.
You can still interact with running script via gui labels, text fields etc., just not invoke functions from it.
Image
I got my own cool HnH custom client check it out.
Purus Pasta
http://i.imgur.com/CRrirds.png?1
User avatar
shubla
 
Posts: 9846
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

Re: Purus Pasta Client [Now with NEW botting API!]

Postby Granger » Sun Mar 31, 2019 7:07 pm

shubla wrote:
LostJustice wrote:Yes you would build a controller on the java side to handle the script changes and plugin threads and then when you want to change the state you call hose methods to handle it. You do not handle the threads and ect on the js side. Rather build a clever way to create and manage your own threads in java on that side that is api calls for the js.

Yeah but I think it would be rather ugly. I'd rather not have something like that.
Especially as there is really no demand for it.
You can still interact with running script via gui labels, text fields etc., just not invoke functions from it.

The ability to terminate a running script from the UI (even, and especially, in case of it being uncooperative) is a basic need.
Please check Announcements, Game Guides, GLoSQ before posting questions, search is your friend.
Follow the Bug Report HOWTO to ease solving your issue and, in general, The Rules.
User avatar
Granger
 
Posts: 8981
Joined: Mon Mar 22, 2010 2:00 pm

Re: Purus Pasta Client [Now with NEW botting API!]

Postby shubla » Sun Mar 31, 2019 7:08 pm

Granger wrote:
shubla wrote:
LostJustice wrote:Yes you would build a controller on the java side to handle the script changes and plugin threads and then when you want to change the state you call hose methods to handle it. You do not handle the threads and ect on the js side. Rather build a clever way to create and manage your own threads in java on that side that is api calls for the js.

Yeah but I think it would be rather ugly. I'd rather not have something like that.
Especially as there is really no demand for it.
You can still interact with running script via gui labels, text fields etc., just not invoke functions from it.

The ability to terminate a running script from the UI (even, and especially, in case of it being uncooperative) is a basic need.

I am not sure if the solution was presented here, but you can close the window in client, and then check if it has been closed in the script and then stop the script if it has been closed.
And that works quite well I think.
Image
I got my own cool HnH custom client check it out.
Purus Pasta
http://i.imgur.com/CRrirds.png?1
User avatar
shubla
 
Posts: 9846
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

Re: Purus Pasta Client [Now with NEW botting API!]

Postby shubla » Sun Mar 31, 2019 10:00 pm

Purus Pasta version 3.12.0 has been released!
- Added more FEP info to foods
- Added some PBot functions
- Re-implemented PBot destroyer
- Re-implemented PBot farmer
- Fixed defaultalarm config
- Mirrored everything
- Various minor bugfixes
Image
I got my own cool HnH custom client check it out.
Purus Pasta
http://i.imgur.com/CRrirds.png?1
User avatar
shubla
 
Posts: 9846
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

PreviousNext

Return to The Wizards' Tower

Who is online

Users browsing this forum: No registered users and 1 guest