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 »

tirioll wrote:Please update :)

Code: Select all

0.3:null

java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.lang.String
	at haven.CharWnd$Quest$Box.uimsg(Unknown Source)
	at haven.CharWnd$Quest$DefaultBox.uimsg(Unknown Source)
	at NumenQuest.uimsg(ancquest.cjava:30)
	at haven.UI.uimsg(Unknown Source)
	at haven.RemoteUI.run(Unknown Source)
	at haven.MainFrame.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Also "Prime.WithScripts.rar" in release 1.1.1 does not start, seems that a bunch of files are missing. Is it supposed to be extracted on top of "Prime.rar" contents?

Can't fix an error without more information, Prime seems to be running just fine.

Prime with scripts rar file was somehow packaged wrong. The program I made must have skipped over the files without telling me, I'll look at making it print out better logs so I catch this in the future
User avatar
tirioll
Posts: 144
Joined: Thu Nov 21, 2013 4:05 pm

Re: Prime - Amber Tweaks and Scripting API

Post by tirioll »

Paradoxs wrote:
tirioll wrote:Please update :)

Code: Select all

0.3:null
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.lang.String
	at haven.CharWnd$Quest$Box.uimsg(Unknown Source)
	at haven.CharWnd$Quest$DefaultBox.uimsg(Unknown Source)
	at NumenQuest.uimsg(ancquest.cjava:30)
	at haven.UI.uimsg(Unknown Source)
	at haven.RemoteUI.run(Unknown Source)
	at haven.MainFrame.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Can't fix an error without more information, Prime seems to be running just fine.
It runs, but crashes when I try to log in. Similar was happening with outdated Amber after Numen quests release. Do you have ancestral shrine on the char you are testing with?

Code: Select all

...
at NumenQuest.uimsg(ancquest.cjava:30)
...
User avatar
Paradoxs
Posts: 294
Joined: Tue Aug 25, 2015 7:16 am

Re: Prime - Amber Tweaks and Scripting API

Post by Paradoxs »

tirioll wrote:
Paradoxs wrote:
tirioll wrote:Please update :)

Code: Select all

0.3:null
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.lang.String
	at haven.CharWnd$Quest$Box.uimsg(Unknown Source)
	at haven.CharWnd$Quest$DefaultBox.uimsg(Unknown Source)
	at NumenQuest.uimsg(ancquest.cjava:30)
	at haven.UI.uimsg(Unknown Source)
	at haven.RemoteUI.run(Unknown Source)
	at haven.MainFrame.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Can't fix an error without more information, Prime seems to be running just fine.
It runs, but crashes when I try to log in. Similar was happening with outdated Amber after Numen quests release. Do you have ancestral shrine on the char you are testing with?

Code: Select all

...
at NumenQuest.uimsg(ancquest.cjava:30)
...
Thats update will be releasing soon with the v8 update.
nmbr1stunna23
Posts: 10
Joined: Fri Feb 03, 2017 7:33 pm

Re: Prime - Amber Tweaks and Scripting API

Post by nmbr1stunna23 »

Does anyone have a couple of extended examples of scripting with this client i could look at? Even a simple tree bot would be great! I just am looking for some further reference to learn from :)
mrfrump
Posts: 12
Joined: Mon Aug 17, 2015 1:57 pm

Re: Prime - Amber Tweaks and Scripting API

Post by mrfrump »

nmbr1stunna23 wrote:Does anyone have a couple of extended examples of scripting with this client i could look at? Even a simple tree bot would be great! I just am looking for some further reference to learn from :)

Code: Select all

#loadLib(../FrumpAPI.js);

var SETTING_DISTANCE_RADIUS = 250;
var setup = false;
var TreeList = [];

function main(){
  if(!setup){
    var MapObjects = getMapObjects();
    for (var MapObject = 0; MapObject < MapObjects.length; MapObject++) {
        if(MapObjects[MapObject].FullName.contains("tree") && distance(getCoords(),MapObjects[MapObject].Coords) < SETTING_DISTANCE_RADIUS){
          if(MapObjects[MapObject].FullName.contains("stump") || MapObjects[MapObject].FullName.contains("log")){
            continue;
          }
          else{
            TreeList.push(MapObjects[MapObject]);
          }
        }
    }
    setup = true;
    print(TreeList.length + " trees found");
  }

  while(!isStopped()){
    waitForTask();//if doing task lets not continue
    while(isMoving()){
      sleep(500);//lets not do shit whilst moving
    }
    if(getStamina() < 20){
      drink();
      sleep(500);
      chooseOption("Drink");//incase we missed it
      continue;
    }
    if(getEnergy() < 21){
      print(getEnergy());
      print("Out of Energy, Your about to start dying bro.");
      exit();
      return;
    }

    var nearestTree = findClosest(TreeList);
    if(nearestTree == null){
      print("Out of trees, stopping....");
      exit();
      continue;
    }
    if(__FindGob(nearestTree.Id) == null){
      print("tree dead");
      for(var x = 0 ; x < TreeList.length; x++){
        if(TreeList[x].Id == nearestTree.Id){
          TreeList.splice(x, 1 );
        }
      }
      continue;
    }
    if(!inReach(nearestTree.Coords)){
      pfClick(nearestTree, Prime.MouseButton.Left);
      print("not in reach of tree, lets go there.");
    }
    else{
      print("Chop Chop!");
      pfClick(nearestTree, Prime.MouseButton.Left);
      pfClick(nearestTree, Prime.MouseButton.Right);
      sleep(500);
      chooseOption("Chop");
    }
    sleep(1000);
  }
  exit();
}
Last edited by Granger on Sun Apr 16, 2017 8:28 pm, edited 1 time in total.
Reason: hint: code tag ;)
Thedrah
Posts: 943
Joined: Fri Apr 08, 2011 2:20 am
Location: behind you

Re: Prime - Amber Tweaks and Scripting API

Post by Thedrah »

anyone got a way for a script to exit a boat? ctrl doesn't wanna work
i can't seem to finagle my way to get my guy out of a boat

btw: great client but when's the next update coming? :3
  ▲
▲ ▲
Thedrah
Posts: 943
Joined: Fri Apr 08, 2011 2:20 am
Location: behind you

Re: Prime - Amber Tweaks and Scripting API

Post by Thedrah »

now i can hearth while in a boat due to recent patch

but... is this client now dead?..
i liked it... still using it but i know one day a patch will make it useless :cry:
  ▲
▲ ▲
newaccountlol
Posts: 87
Joined: Sat Jan 07, 2017 8:02 am

Re: Prime - Amber Tweaks and Scripting API

Post by newaccountlol »

Please update. Would love to practice coding with this

Return to “The Wizards' Tower”