Purus Pasta Client [W14 COMPATIBLE]

Forum for alternative clients, mods & discussions on the same.
User avatar
shubla
Posts: 13041
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

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

Post by shubla »

danklord wrote:
shubla wrote:
danklord wrote: Don't know how I missed that, thanks for the release though has been a blast writing stuff for it.
Would be interesting to know what kind of stuff is possible to do with API.
And what is not, so it could be made possible.
So far seems with nashorn and a bit of time you can do anything really, long as you have class instances to work with can call anything from the haven client directly pretty easily.

For example I was messing with this to get details off items outside the PBot api calls(like getname getid ect) which uses the WItem Class passed from the api -> GItem Class -> Quality Class -> Quality Value.

Code: Select all

    var containers = ["branch"];
    var items = PBot.getInventoryItemsByNames(PBot.playerInventory(), containers);
    for(var i=0; i<items.length; i++) {
        PBot.sysMsg(items[i].item.getname(), 255, 102, 0); 
        PBot.sysMsg(items[i].item.quality().q, 255, 102, 0);  
        PBot.sysMsg("------", 255, 102, 0); 
    }    
I'll post anything else as I figure other stuff out, but its a pretty cool system and leaves the door open to alot of stuff outside of the api if you have the time to figure it out.
With nashorn you can indeed call basically all client functions quite easily.
PBotAPI is there just to clear things up.
Image
I'm not sure that I have a strong argument against sketch colors - Jorb, November 2019
http://i.imgur.com/CRrirds.png?1
Join the moderated unofficial discord for the game! https://discord.gg/2TAbGj2
Purus Pasta, The Best Client
User avatar
Comodo
Posts: 494
Joined: Mon Apr 01, 2013 4:23 pm

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

Post by Comodo »

Why not use Groovy instead for the scripting language, seems more natural than using JavaScript. Nashorn engine doesn't even fully support ECMA6, so the syntax for making objects is ugly.
With Groovy Engine you can easily make wrapper classes for haven classes such as Gob and Inventory, and add new API functions elegantly without recompiling.
User avatar
shubla
Posts: 13041
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

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

Post by shubla »

Comodo wrote:Why not use Groovy instead for the scripting language, seems more natural than using JavaScript. Nashorn engine doesn't even fully support ECMA6, so the syntax for making objects is ugly.
With Groovy Engine you can easily make wrapper classes for haven classes such as Gob and Inventory, and add new API functions elegantly without recompiling.
All the cool kids do JavaScript these days.
Nashorn is getting ECMA6 in Java 9, or so they say.
Also javascript is a language known by many, so it eases the use, probably. Though groovy does advertise itself with "fast learning curve".

Though in reality I just picked out the first thing that google gave me.
Image
I'm not sure that I have a strong argument against sketch colors - Jorb, November 2019
http://i.imgur.com/CRrirds.png?1
Join the moderated unofficial discord for the game! https://discord.gg/2TAbGj2
Purus Pasta, The Best Client
Mario_Demorez
Posts: 599
Joined: Sun Jan 11, 2015 9:32 pm

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

Post by Mario_Demorez »

Could you make the farmer bot be able to select multiple containers to fill.
User avatar
Astarisk
Posts: 882
Joined: Fri Aug 13, 2010 7:08 am

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

Post by Astarisk »

shubla wrote:
Comodo wrote:Why not use Groovy instead for the scripting language, seems more natural than using JavaScript. Nashorn engine doesn't even fully support ECMA6, so the syntax for making objects is ugly.
With Groovy Engine you can easily make wrapper classes for haven classes such as Gob and Inventory, and add new API functions elegantly without recompiling.
All the cool kids do JavaScript these days.
Nashorn is getting ECMA6 in Java 9, or so they say.
Also javascript is a language known by many, so it eases the use, probably. Though groovy does advertise itself with "fast learning curve".

Though in reality I just picked out the first thing that google gave me.
Groovy is what some of the old botting clients used to use, its a fairly simple language. But I was personally too lazy to ever learn /real/ groovy and mostly just treated and programmed in it like Java. I think I remember having some minor issues related to scoping or something. Personally I never got to try a JS engine, I had contemplated doing a nashorn implementation of my own, but in the end I went with Python for mine. I felt like it was easier to teach people Python over the other choices, and I've been liking it personally. Sad thing is im just limited to whats in Python 2.7, which isn't the end of things since I hardly need the newer features.

End of the day, It shouldn't really matter what language you use, its just a tool for the job after all.
IRC/IGN: Rawrz

Join the (HedgeHugs) Haven & Hearth Discord if you need help.
https://discord.com/invite/Uy8yzm4
User avatar
shubla
Posts: 13041
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

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

Post by shubla »

Purus Pasta version 3.5.2 released!
- Farmer now replants and merges seeds before placing them into container
Image
I'm not sure that I have a strong argument against sketch colors - Jorb, November 2019
http://i.imgur.com/CRrirds.png?1
Join the moderated unofficial discord for the game! https://discord.gg/2TAbGj2
Purus Pasta, The Best Client
User avatar
Ardennesss
Posts: 1171
Joined: Sun Oct 06, 2013 4:22 pm

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

Post by Ardennesss »

.d57bffff
Windows 10 10.0 x64, 1.8.0_161 amd64
ATI Technologies Inc. (AMD Radeon (TM) R9 380 Series) - 4.4.13506 Compatibility Profile Context 23.20.15002.11

java.lang.NullPointerException
at haven.purus.BotUtils.getAmount(BotUtils.java:43)
at haven.purus.SeedCropFarmer.run(SeedCropFarmer.java:123)
at java.lang.Thread.run(Unknown Source)


Running flax seedcropfarmer on replant mode. 18 flax seeds in 1 stack in my inventory when crashed.

Edit-
I also frequently get this crash whenever I run the bot after just starting the game. Seems to not happen if I manually farm the first tile, possibly checking for the flax-seed res too fast before it's in cache?

.d57bffff
Windows 10 10.0 x64, 1.8.0_161 amd64
ATI Technologies Inc. (AMD Radeon (TM) R9 380 Series) - 4.4.13506 Compatibility Profile Context 23.20.15002.11

#<Resource gfx/invobjs/seed-flax>
User avatar
shubla
Posts: 13041
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

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

Post by shubla »

Ardennesss wrote:.d57bffff
Windows 10 10.0 x64, 1.8.0_161 amd64
ATI Technologies Inc. (AMD Radeon (TM) R9 380 Series) - 4.4.13506 Compatibility Profile Context 23.20.15002.11

java.lang.NullPointerException
at haven.purus.BotUtils.getAmount(BotUtils.java:43)
at haven.purus.SeedCropFarmer.run(SeedCropFarmer.java:123)
at java.lang.Thread.run(Unknown Source)


Running flax seedcropfarmer on replant mode. 18 flax seeds in 1 stack in my inventory when crashed.
I blame server lag, might fix.

Edit-
I also frequently get this crash whenever I run the bot after just starting the game. Seems to not happen if I manually farm the first tile, possibly checking for the flax-seed res too fast before it's in cache?

.d57bffff
Windows 10 10.0 x64, 1.8.0_161 amd64
ATI Technologies Inc. (AMD Radeon (TM) R9 380 Series) - 4.4.13506 Compatibility Profile Context 23.20.15002.11

#<Resource gfx/invobjs/seed-flax>
I have been thinking of the same.
Image
I'm not sure that I have a strong argument against sketch colors - Jorb, November 2019
http://i.imgur.com/CRrirds.png?1
Join the moderated unofficial discord for the game! https://discord.gg/2TAbGj2
Purus Pasta, The Best Client
danklord
Posts: 9
Joined: Mon Jul 28, 2014 12:19 pm

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

Post by danklord »

Not sure how to make a pile with an item from your inventory, seems what ever I do after I pick the item up from the inventory none of the default commands can turn it into a pile and place it even tried right clicking my self and having it place it to no avail if you have any advice before I dig into the haven code for it.
User avatar
shubla
Posts: 13041
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

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

Post by shubla »

danklord wrote:Not sure how to make a pile with an item from your inventory, seems what ever I do after I pick the item up from the inventory none of the default commands can turn it into a pile and place it even tried right clicking my self and having it place it to no avail if you have any advice before I dig into the haven code for it.
I guess I'll ad some bad functionality to make stockpiles.

In the new version that I will release soon you can use PBot.makePile() to make pile from an object in the cursor (of course, assuming that it can be turned into a stockpile)
And to place the item, you use PBot.placeThing(x, y) with x and y being offset from the players current location that you want to place the stockpile. I should probably look into how coordinates are handled in PBot and make it more clear, coordinates are a mess currently. But with the two functions mentioned above, you can in theory place stockpiles.


Purus Pasta version 3.6.0 Released!!
- New features to PBot API, related to stockpile placement
- Latest merges from Amber & Default client
Last edited by shubla on Fri Mar 30, 2018 12:57 pm, edited 1 time in total.
Image
I'm not sure that I have a strong argument against sketch colors - Jorb, November 2019
http://i.imgur.com/CRrirds.png?1
Join the moderated unofficial discord for the game! https://discord.gg/2TAbGj2
Purus Pasta, The Best Client

Return to “The Wizards' Tower”