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

Prime - Amber Tweaks and Scripting API

Post by Paradoxs »

Prime
Prime is a modified amber client in development. Prime plans to offer changes to amber in the form of modifying how amber achieves certain goals, and replacing things as needed.

Download
Latest Release: https://github.com/TimothyCates/amber/releases/latest

Tweaks
  • You can name Objects with Control + Left Click
    Stockpiles now take all when you press take and nothing is selected
    An optional Scripting Engine
A Note About The Scripting API
While many users of haven are against scripting I feel there can be some balance between scripting and game-play. I myself play the game without any scripts, No matter where you fall on the spectrum of for or against scripting Primes scripting engine is intended to only be a small feature on the client, while it may be one of the larger more paid attention to pieces of the client, it is not intended to be the purpose of the client. This is also not invitation for a discussion on the morals of botting or scripting. If you like I see scripting as an opportunity, rather than sin, look no further for the documentation: https://github.com/TimothyCates/amber/b ... /README.md JDocs to come soon!


Source
https://github.com/TimothyCates/amber
Last edited by Paradoxs on Sat Jan 14, 2017 11:02 pm, edited 2 times in total.
iamahh
Posts: 1806
Joined: Sat Dec 12, 2015 8:23 pm

Re: Prime - Amber tweaks and Scripting API

Post by iamahh »

Looks promising , like userscripts
User avatar
shubla
Posts: 13041
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

Re: Prime - Amber tweaks and Scripting API

Post by shubla »

You could set up javadocs for it as well?
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
slipper
Posts: 816
Joined: Sat Oct 02, 2010 4:28 pm

Re: Prime - Amber tweaks and Scripting API

Post by slipper »

Exit() doen't seem to do anything for me. The stop script window stays open and scripts won't stop executing unless I manually press stop.
User avatar
Paradoxs
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber tweaks and Scripting API

Post by Paradoxs »

shubla wrote:You could set up javadocs for it as well?
I will later this week when I have time after work
slipper wrote:Exit() doen't seem to do anything for me. The stop script window stays open and scripts won't stop executing unless I manually press stop.
Fixed in the latest revision
Last edited by Paradoxs on Mon Dec 19, 2016 1:13 am, edited 1 time in total.
Thedrah
Posts: 943
Joined: Fri Apr 08, 2011 2:20 am
Location: behind you

Re: Prime - Amber tweaks and Scripting API

Post by Thedrah »

this is great but could you add a few suggestions?

can you add an option to disable graphics? (so i can run this on a cheap computer or multiple on a decent computer)
ability to 'feast' from a table? (feasting would be much more efficient)
get chat log in either array(area/pm) or as an event? (so i could yell at the bot ingame when the bot screws up eventually)
left click the ground so i could mine or fish. (with the addition of cave dust i think it wouldn't be so bad to mine)
able to read walls/floor for mining or foraging. (focus on certain rocks or areas. possibly swimming or use of a boat)
the growth of a plant/tree. (so i can harvest carrots at 3rd stage for seeds and skip the 2nd stage ones or collect then chop trees for harvesting)
right click an item in inventory. (to butcher rabbits/bunnies/bats or splitting lettuce)

i would love to be able to automate a chicken/rabbit coop/hutch rotation with this. being able to have a a function for an array of items (such as a cupboard being a 64item array with -1 for empty spots) and be able to get names and the ess/sub/vit individually. then to get the swill/water amount in the coops/hutches

and possibly add extensions for aiding the player in running scripts. with some icon support and hotkeys like x-a would be sweet :D

possibly a combat set of functions for hunting (or able to press 1-5/ctrl 1-5 for 'hotkeys')

#wishlist

edit: got an error at login using the example, commented out everything in checkchar() and checkgame() and still got an error :(

Code: Select all

0.1:null

java.lang.RuntimeException: Delayed error in resource paginae/custom/treechop (v-1), from forking source backed by HTTP res source (http://game.havenandhearth.com/hres/)
	at haven.Resource$Pool$Queued.get(Unknown Source)
	at haven.Resource$Pool$Queued.get(Unknown Source)
	at haven.Loading.waitforint(Unknown Source)
	at haven.Loading.waitfor(Unknown Source)
	at haven.Resource$Pool.loadwait(Unknown Source)
	at haven.Resource$Pool.loadwait(Unknown Source)
	at haven.FBelt.load(Unknown Source)
	at haven.GameUI.<init>(Unknown Source)
	at haven.GameUI$$_.create(Unknown Source)
	at haven.Widget.makechild(Unknown Source)
	at haven.UI.newwidget(Unknown Source)
	at haven.RemoteUI.run(Unknown Source)
	at haven.MainFrame.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: haven.Resource$LoadException: Load error in resource paginae/custom/treechop(v-1), from forking source backed by HTTP res source (http://game.havenandhearth.com/hres/)
	at haven.Resource$Pool.handle(Unknown Source)
	at haven.Resource$Pool.access$1100(Unknown Source)
	at haven.Resource$Pool$Loader.run(Unknown Source)
	... 1 more
	Suppressed: haven.Resource$LoadException: Load error in resource paginae/custom/treechop(v-1), from cache source backed by FileCache(http://game.havenandhearth.com/hres/)
		... 4 more
		Suppressed: haven.Resource$LoadException: Load error in resource paginae/custom/treechop(v-1), from local res source
			... 4 more
			Suppressed: haven.Resource$LoadException: Load error in resource paginae/custom/treechop(v-1), from filesystem res source (res)
				... 4 more
			Caused by: java.io.FileNotFoundException: res\paginae\custom\treechop.res (The system cannot find the path specified)
				at java.io.FileInputStream.open0(Native Method)
				at java.io.FileInputStream.open(Unknown Source)
				at java.io.FileInputStream.<init>(Unknown Source)
				at haven.Resource$FileSource.get(Unknown Source)
				... 4 more
		Caused by: java.io.FileNotFoundException: Could not find resource locally: paginae/custom/treechop
			at haven.Resource$JarSource.get(Unknown Source)
			... 4 more
	Caused by: java.io.FileNotFoundException: res/paginae/custom/treechop
		at haven.HashDirCache.fetch(Unknown Source)
		at haven.Resource$CacheSource.get(Unknown Source)
		... 4 more
Caused by: java.io.FileNotFoundException: http://game.havenandhearth.com/hres/paginae/custom/treechop.res
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
	at haven.Resource$HttpSource.get(Unknown Source)
	at haven.Resource$TeeSource.get(Unknown Source)
	... 4 more
[/spoiler]
  ▲
▲ ▲
User avatar
Paradoxs
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber tweaks and Scripting API

Post by Paradoxs »

Thedrah wrote: edit: got an error at login using the example, commented out everything in checkchar() and checkgame() and still got an error :(

Code: Select all

0.1:null

java.lang.RuntimeException: Delayed error in resource paginae/custom/treechop (v-1), from forking source backed by HTTP res source (http://game.havenandhearth.com/hres/)
	at haven.Resource$Pool$Queued.get(Unknown Source)
	at haven.Resource$Pool$Queued.get(Unknown Source)
	at haven.Loading.waitforint(Unknown Source)
	at haven.Loading.waitfor(Unknown Source)
	at haven.Resource$Pool.loadwait(Unknown Source)
	at haven.Resource$Pool.loadwait(Unknown Source)
	at haven.FBelt.load(Unknown Source)
	at haven.GameUI.<init>(Unknown Source)
	at haven.GameUI$$_.create(Unknown Source)
	at haven.Widget.makechild(Unknown Source)
	at haven.UI.newwidget(Unknown Source)
	at haven.RemoteUI.run(Unknown Source)
	at haven.MainFrame.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: haven.Resource$LoadException: Load error in resource paginae/custom/treechop(v-1), from forking source backed by HTTP res source (http://game.havenandhearth.com/hres/)
	at haven.Resource$Pool.handle(Unknown Source)
	at haven.Resource$Pool.access$1100(Unknown Source)
	at haven.Resource$Pool$Loader.run(Unknown Source)
	... 1 more
	Suppressed: haven.Resource$LoadException: Load error in resource paginae/custom/treechop(v-1), from cache source backed by FileCache(http://game.havenandhearth.com/hres/)
		... 4 more
		Suppressed: haven.Resource$LoadException: Load error in resource paginae/custom/treechop(v-1), from local res source
			... 4 more
			Suppressed: haven.Resource$LoadException: Load error in resource paginae/custom/treechop(v-1), from filesystem res source (res)
				... 4 more
			Caused by: java.io.FileNotFoundException: res\paginae\custom\treechop.res (The system cannot find the path specified)
				at java.io.FileInputStream.open0(Native Method)
				at java.io.FileInputStream.open(Unknown Source)
				at java.io.FileInputStream.<init>(Unknown Source)
				at haven.Resource$FileSource.get(Unknown Source)
				... 4 more
		Caused by: java.io.FileNotFoundException: Could not find resource locally: paginae/custom/treechop
			at haven.Resource$JarSource.get(Unknown Source)
			... 4 more
	Caused by: java.io.FileNotFoundException: res/paginae/custom/treechop
		at haven.HashDirCache.fetch(Unknown Source)
		at haven.Resource$CacheSource.get(Unknown Source)
		... 4 more
Caused by: java.io.FileNotFoundException: http://game.havenandhearth.com/hres/paginae/custom/treechop.res
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
	at haven.Resource$HttpSource.get(Unknown Source)
	at haven.Resource$TeeSource.get(Unknown Source)
	... 4 more
[/spoiler]
That error looks like an issue with connecting the game.havenandhearth.com, Im unable to reproduce it myself, could you try it again and see if its still producing this error?


As for your feature requests, don't worry I'm working on adding more features and cleaning up the current features. This was just an initial release / proof of concept to get some ideas on functions, and opinions on the project
User avatar
Paradoxs
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Revision 1

Post by Paradoxs »

0.1 Revision 1
Fixed an invalid reference making it so other people could not compile the project. Should be fixed.

Added a check to Exit(); to make sure the running script window closes, while the script should have stopped it was not made clear through the interface
iamahh
Posts: 1806
Joined: Sat Dec 12, 2015 8:23 pm

Re: Prime - Amber tweaks and Scripting API

Post by iamahh »

name it AmberJS :))
User avatar
LostJustice
Posts: 691
Joined: Sun Mar 25, 2012 3:57 am

Re: Prime - Amber tweaks and Scripting API

Post by LostJustice »

This is absolutely beautiful...

Found a bug though. Start a script with no script selected crashes the client.
Image

Return to “The Wizards' Tower”