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 »

I'll check your code after work. Shouldn't be a problem with of click but it might be something I overlooked

Found the problem your using obj for an array you need to specify

Obj[0].Coords
User avatar
Paradoxs
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Release 1.0

Post by Paradoxs »

Prime Release 1.0
https://github.com/TimothyCates/amber/releases
This release is more of a merge + preparing for new functions release

Prime now comes in a flavor that doesnt pre-pack the API

Changes
  • You can now name objects with Control + Click
    Take when pressed on a stockpile takes all if the Amount field is empty
    Prime-res is now separate from amber-res to fix merge conflicts
Merged With Amber

Prime-API Release 1.0
https://github.com/TimothyCates/PrimeAPI/releases
Api is switching to semantic versioning starting with this release, it marks the first release using the build system I developed in c++ for organizational purposes.

API now has release versions posted to github

This release was pushed in part of the prime client merges so not everything is completely ready, these functions are marked with -Unused

Fixes
  • Fixed a condition Error in getItem breaking under rare conditions
    closeWindow and closeFlower now send correct closing messages instead of hiding the objects to fix rare odd errors
    All wait and sleep functions listen to the stop button to prevent run-away threads
Objects Added
  • Tile Object - Unsed
    Craft Mode Object
    Key Object -Unused
    Sort Object -Unused
    Added Inventory.Equipment to Inventory Object -Unused (Works for getItems() or getitem but does not interface anywhere else yet)
FunctionsAdded
  • getTile(X, Y)
    • Returns an integer representation of the tile at coords X, Y
    isStopped()
    • returns true or false on whether the stop button has been pressed
    waitForHand(Timeout)
    • returns true if item in hand is found after 10 seconds or Timeout in milliseconds otherwise returns false
    waitForHourglass(Timeout)
    • returns true if hourglass percentage is found and at least 1% after 10 seconds or Timeout in milliseconds otherwise returns false
    craft(ItemName, CraftMode)
    • Attempts to craft ItemName, take CraftMode.All or CraftMode.One. returns true if crafted, returns false otherwise

Below is a list of goals for next version
To Do
  • JSDocs (about half way complete, work really cuts into this)
    Finish equipment related functions
    Add isRidge to tile object
    Incorporate Tile Object into get Tile
    getData and SendData for sqlLite being integrated into client
    SwitchCharater function
    Inventory Size Function
    Free Inventory Slots function
    Sort Map Objects
    Sort Inventory Objects
    Add Quality to Item Object
    Drop All Function
    Close To Function
    get distance Function

    Include larger array of examples

    Redo PrimeAPI GUI
Updated Main post
ae_maderero
Posts: 7
Joined: Fri Jan 13, 2017 4:48 pm

Re: Prime - Amber Tweaks and Scripting API

Post by ae_maderero »

Paradoxs wrote:I'll check your code after work. Shouldn't be a problem with of click but it might be something I overlooked

Found the problem your using obj for an array you need to specify

Obj[0].Coords
That's not the problem, I modified the function and it returned 1 object. The problem is getHighlightedMapObjects returns objects with Coord2d, while getCoords returns Coord.
User avatar
Paradoxs
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber Tweaks and Scripting API

Post by Paradoxs »

ae_maderero wrote:
Paradoxs wrote:I'll check your code after work. Shouldn't be a problem with of click but it might be something I overlooked

Found the problem your using obj for an array you need to specify

Obj[0].Coords
That's not the problem, I modified the function and it returned 1 object. The problem is getHighlightedMapObjects returns objects with Coord2d, while getCoords returns Coord.
Let me take a look. Because last I checked I modified them all to pump into a map object that I custom made
User avatar
Paradoxs
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber Tweaks and Scripting API

Post by Paradoxs »

ae_maderero wrote:
Paradoxs wrote:I'll check your code after work. Shouldn't be a problem with of click but it might be something I overlooked

Found the problem your using obj for an array you need to specify

Obj[0].Coords
That's not the problem, I modified the function and it returned 1 object. The problem is getHighlightedMapObjects returns objects with Coord2d, while getCoords returns Coord.
Make sure your using the latest version because IV tested and succeeded in using

Code: Select all

var boat = getHighlightedMapObjects()[0];
pfClick(boat);
Make sure that getHighlightedMapObjects is not false or length is 1 or greater
ae_maderero
Posts: 7
Joined: Fri Jan 13, 2017 4:48 pm

Re: Prime - Amber Tweaks and Scripting API

Post by ae_maderero »

That works, when it doesnt work is when you add a value, like doing coord.x +10.
User avatar
Paradoxs
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber Tweaks and Scripting API

Post by Paradoxs »

ae_maderero wrote:That works, when it doesnt work is when you add a value, like doing coord.x +10.


I will look at it and see if I can figure out what's going on.
ae_maderero
Posts: 7
Joined: Fri Jan 13, 2017 4:48 pm

Re: Prime - Amber Tweaks and Scripting API

Post by ae_maderero »

Paradoxs wrote:
ae_maderero wrote:That works, when it doesnt work is when you add a value, like doing coord.x +10.


I will look at it and see if I can figure out what's going on.
Ty! Btw, a function to check if u are lifting something would be great. I made one, but its dirty code involving movement speed.

Also, dont use "typeof X != XXX", since you are going to work with Java classes. Use .class.getSimpleName()
User avatar
LostJustice
Posts: 691
Joined: Sun Mar 25, 2012 3:57 am

Re: Prime - Amber Tweaks and Scripting API

Post by LostJustice »

ae_maderero wrote:
Paradoxs wrote:
ae_maderero wrote:That works, when it doesnt work is when you add a value, like doing coord.x +10.


I will look at it and see if I can figure out what's going on.
Ty! Btw, a function to check if u are lifting something would be great. I made one, but its dirty code involving movement speed.

Also, dont use "typeof X != XXX", since you are going to work with Java classes. Use .class.getSimpleName()
I asked him about this as well and I can confirm that he is working on this. Just a bit of difficulties right now in allowing for this but will come eventually. :D
Image
ae_maderero
Posts: 7
Joined: Fri Jan 13, 2017 4:48 pm

Re: Prime - Amber Tweaks and Scripting API

Post by ae_maderero »

If any of u guys got an example of what Im trying to archieve, maybe we find what's wrong.
I want to auto unload what I have lifted. I get an signpost as reference, and try to rightclick at signpost.Coords + X, a tile I left free.

Return to “The Wizards' Tower”