Prime - Amber Tweaks and Scripting API

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

Re: Prime - Amber Tweaks and Scripting API

Postby Paradoxs » Thu Mar 02, 2017 5:48 pm

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.
User avatar
Paradoxs
 
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber Tweaks and Scripting API

Postby Thedrah » Mon Mar 06, 2017 4:03 pm

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
  ▲
▲ ▲
Thedrah
 
Posts: 936
Joined: Fri Apr 08, 2011 2:20 am
Location: behind you

Re: Prime - Amber Tweaks and Scripting API

Postby Fostik » Mon Mar 06, 2017 11:42 pm

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.
User avatar
Fostik
 
Posts: 2003
Joined: Tue Jul 05, 2011 4:08 pm
Location: EU

Re: Prime - Amber Tweaks and Scripting API

Postby Paradoxs » Tue Mar 07, 2017 12:04 am

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
Paradoxs
 
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber Tweaks and Scripting API

Postby LostJustice » Wed Mar 08, 2017 6:31 pm

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
LostJustice
 
Posts: 677
Joined: Sun Mar 25, 2012 3:57 am

Re: Prime - Amber Tweaks and Scripting API

Postby Paradoxs » Wed Mar 08, 2017 7:36 pm

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
Paradoxs
 
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber Tweaks and Scripting API

Postby Fostik » Thu Mar 09, 2017 7:02 pm

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.
User avatar
Fostik
 
Posts: 2003
Joined: Tue Jul 05, 2011 4:08 pm
Location: EU

Re: Prime - Amber Tweaks and Scripting API

Postby Paradoxs » Thu Mar 09, 2017 8:33 pm

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.
User avatar
Paradoxs
 
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber Tweaks and Scripting API

Postby kapytanhook » Sat Mar 11, 2017 12:02 am

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
kapytanhook
 
Posts: 16
Joined: Tue Mar 01, 2011 1:11 pm

Re: Prime - Amber Tweaks and Scripting API

Postby Thedrah » Sat Mar 11, 2017 12:54 am

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
  ▲
▲ ▲
Thedrah
 
Posts: 936
Joined: Fri Apr 08, 2011 2:20 am
Location: behind you

PreviousNext

Return to The Wizards' Tower

Who is online

Users browsing this forum: Naylok and 8 guests