Prime - Amber Tweaks and Scripting API

Forum for alternative clients, mods & discussions on the same.
User avatar
Paradoxs
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber Tweaks and Scripting API

Post by Paradoxs »

roskuwacz wrote:Is there a possibility to get into buildings? Function PfClick and click do not work well is any other option?

Also a function which will read from specific chat will be usefull.
Right now no, clicking on doors passes extra arguments that I'm working on

Reading chat is on the list of things to add for next release

RedSkies wrote: Thanks a bunch! Is there somewhere these changes are documented? I've been using the GitHub readme you have linked on the front page.
There listed throughout this thread, but Im currently working on documentation that is up to date and will always be up to date.
Thedrah
Posts: 943
Joined: Fri Apr 08, 2011 2:20 am
Location: behind you

Re: Prime - Amber Tweaks and Scripting API

Post by Thedrah »

since this is to support a player more than script/bot

can we get some indicators? such as able to set a ring around something? i want a blue ring around a forage item or a cyan ring around myself. or allow the script to mark things on the mini map with or without an object, like just x, y
and an alarm or something (or show us how to add it)

possibly an option to hide a script/library like the api and login. like a #hidden tag at the start for less clutter. possibly folders and allowing keyboard events
  ▲
▲ ▲
User avatar
Fostik
Posts: 2513
Joined: Tue Jul 05, 2011 4:08 pm
Location: EU

Re: Prime - Amber Tweaks and Scripting API

Post by Fostik »

How do i proper plant things?
After harvesting i have harvested object saved in 'plant', have a plantable beet in my hand. Trying to work with it:

Code: Select all

pfClick(plant,MouseButton.Right);
And also

Code: Select all

pfClick(plant.Coords.x,plant.Coords.y,MouseButton.Right);
Both no work.
Also tried use getCoords() function, as i standing directly on place where want to plant, but same no works.
Known as zunzon. Contact discord: zunzon.
My experience of market building in W13
User avatar
Paradoxs
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber Tweaks and Scripting API

Post by Paradoxs »

Fostik wrote:How do i proper plant things?
After harvesting i have harvested object saved in 'plant', have a plantable beet in my hand. Trying to work with it:

Code: Select all

pfClick(plant,MouseButton.Right);
And also

Code: Select all

pfClick(plant.Coords.x,plant.Coords.y,MouseButton.Right);
Both no work.
Also tried use getCoords() function, as i standing directly on place where want to plant, but same no works.
try

Code: Select all

click(plant.Coords.x,plant.Coords.y,MouseButton.Right);
PFclick wont work with things like that because pf click will pathfind to the spot so it will try to left click and then right click. so you need to use click to prevent that behavior. I'm working on a click that pathfinds and does the wanted action.

Right now though my main priority and is -writing the parser and script manager. Which is nearly complete
User avatar
LostJustice
Posts: 691
Joined: Sun Mar 25, 2012 3:57 am

Re: Prime - Amber Tweaks and Scripting API

Post by LostJustice »

Two questions that I can't seem to figure out... Is it possible to get the chat or read from chat? Aka I send a chat message and the bot replies?

Second, there is naming of objects in game via hotkeys. Is it possible to programmatically check for these custom names?
Image
User avatar
Paradoxs
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber Tweaks and Scripting API

Post by Paradoxs »

LostJustice wrote:Two questions that I can't seem to figure out... Is it possible to get the chat or read from chat? Aka I send a chat message and the bot replies?

Second, there is naming of objects in game via hotkeys. Is it possible to programmatically check for these custom names?
Not at the moment, I'm working on implementing both but I'm currently moving prime from rhino to googles v8 JavaScript engine which is taking some time.

V8 will give us access to all the ECMAScript features chrome has access to while also giving us a very noticeable speed boost.
Currently I am working on giving V8 access to haven from JavaScript so that the API doesn't have to come bundled with a client update every time I want to add new features.

When V8 is properly implemented I will continue with the API Update that I have been working on. The new API update has JSDocs as well, so look forward to that when everything is finally read to be pushed
User avatar
Fostik
Posts: 2513
Joined: Tue Jul 05, 2011 4:08 pm
Location: EU

Re: Prime - Amber Tweaks and Scripting API

Post by Fostik »

Paradoxs wrote:

Code: Select all

click(plant.Coords.x,plant.Coords.y,MouseButton.Right);
No works. Even no error.
Are you sure function works properly?
Known as zunzon. Contact discord: zunzon.
My experience of market building in W13
User avatar
Paradoxs
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber Tweaks and Scripting API

Post by Paradoxs »

Fostik wrote:
Paradoxs wrote:

Code: Select all

click(plant.Coords.x,plant.Coords.y,MouseButton.Right);
No works. Even no error.
Are you sure function works properly?
I know it works, I havent however tested it for every action in the game.

click for example is responsible for how prime lifts and drops objects. it is responsible for making stockpiles. so I know it works, but Id have to do testing to figure out why you can't plant, and right now I'm tied up getting V8 to work with prime and thats going to take me some time before I can look at everything.
kapytanhook
Posts: 16
Joined: Tue Mar 01, 2011 1:11 pm

Re: Prime - Amber Tweaks and Scripting API

Post by kapytanhook »

Hey guys, working with prime here, long ago the api had "dropHandItem" how do you do this now?
I don't have the old api anymore and can't find how to drop what is in my hand on the floor.
Thanks :)

(found an answer to my own question, it may help someone else.)
var invItem = new Prime.__ItemObject(Prime.__GameUI.vhand); // get item in hand
invItem.Object.item.wdgmsg("drop", Packages.haven.Coord.z); // plot item in hand on ground
Thedrah
Posts: 943
Joined: Fri Apr 08, 2011 2:20 am
Location: behind you

Re: Prime - Amber Tweaks and Scripting API

Post by Thedrah »

request for a method to get the tile resource such as getTile(x,y); would return the tile resource name such as beechgrove or grass, mainly for water and cave navigation
  ▲
▲ ▲

Return to “The Wizards' Tower”