Purus Pasta Client [W14 COMPATIBLE]

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

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

Postby danklord » Thu Mar 22, 2018 10:58 pm

shubla wrote:
danklord wrote:
shubla wrote:
Code: Select all
PBot.doClick(gob, 1, 0);

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.
danklord
 
Posts: 9
Joined: Mon Jul 28, 2014 12:19 pm

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

Postby shubla » Thu Mar 22, 2018 11:54 pm

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
shubla
 
Posts: 13043
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

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

Postby Comodo » Sat Mar 24, 2018 12:01 pm

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
Comodo
 
Posts: 494
Joined: Mon Apr 01, 2013 4:23 pm

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

Postby shubla » Sat Mar 24, 2018 2:50 pm

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
User avatar
shubla
 
Posts: 13043
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

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

Postby Mario_Demorez » Sat Mar 24, 2018 6:40 pm

Could you make the farmer bot be able to select multiple containers to fill.
Mario_Demorez
 
Posts: 596
Joined: Sun Jan 11, 2015 9:32 pm

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

Postby Astarisk » Sat Mar 24, 2018 6:52 pm

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 Haven & Hearth Discord if you need help and our community will surely help you:
Image
Image
User avatar
Astarisk
 
Posts: 869
Joined: Fri Aug 13, 2010 7:08 am

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

Postby shubla » Sun Mar 25, 2018 6:57 pm

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
shubla
 
Posts: 13043
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

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

Postby Ardennesss » Mon Mar 26, 2018 3:31 am

.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>
ImageImage
ImageImageImageImage
User avatar
Ardennesss
 
Posts: 1127
Joined: Sun Oct 06, 2013 4:22 pm

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

Postby shubla » Mon Mar 26, 2018 10:39 am

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
User avatar
shubla
 
Posts: 13043
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

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

Postby danklord » Fri Mar 30, 2018 11:17 am

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.
danklord
 
Posts: 9
Joined: Mon Jul 28, 2014 12:19 pm

PreviousNext

Return to The Wizards' Tower

Who is online

Users browsing this forum: No registered users and 12 guests