- Code: Select all
Can't find method haven.OCache.getgob(org.mozilla.javascript.Undefined).
when pfClick is invoked in my script. Error occurs on 0.3, on 0.2 it works fine.
UPD: my bad, edited to reflect last changes in API, now works ok.
Can't find method haven.OCache.getgob(org.mozilla.javascript.Undefined).
mentokeep wrote:Paradoxs wrote:mentokeep wrote:Some reports from linux
One more thing: if scripts folder name like in release archive -- on linux no scripts is seen inside client, but if rename to Scripts (with frist uppercase S) -- scripts apears in client. I think on windows no differences on filepaths and scripts dir name also works fine, but not on unix-capable.
I noticed this too and its been fixed for the latest release (which will be uploaded within an hour)
As far as your issues with run.sh, its odd because I simply put an amber release file in it, so there shouldn't be a difference. I'll grab a new one to see if that fixes it
Still broken run.sh file. In release 0.3 of prime its 117 bytes (like before), in amber release its 115 bytes. You can see diff -u for this two files btw.
LostJustice wrote:The reason this happens is because in windows, there is a next line symbol which linux interprets as ^M causing the file to be invalid. So to fix this, simply just open the file in linux as is, copy what you see into a different file exactly as you see it without the ^M and then save it as a .sh file. Then it will work. Otherwise, from a window's perspective, make sure you make the file run from either all one line or use an editor that uses a universal new line, like notepad++.
deboon wrote:LostJustice wrote:The reason this happens is because in windows, there is a next line symbol which linux interprets as ^M causing the file to be invalid. So to fix this, simply just open the file in linux as is, copy what you see into a different file exactly as you see it without the ^M and then save it as a .sh file. Then it will work. Otherwise, from a window's perspective, make sure you make the file run from either all one line or use an editor that uses a universal new line, like notepad++.
Yes, I fixed somehow like this. More correct info can be found here, for example. I am just want this will be fixed on upstream (in release archive).
P.S. previous comments was mine, alts account
var WaterBarrels = [];
var Survey = null;
var Startup = true;
var Stockpiles = [];
function main(){
if(Startup) {
getBarrels();
getSurvey();
getStockpiles();
Startup = false;
}
while(Survey != null){
while(getStamina() > 30 && getEnergy() > 55){
DoSurvey();
if(!hasHand()){
sleep(1000);
while(Prime.__GameUI.prog >= 0)
Prime.sleep(10);
}else{
drop("soil");
sleep(500);
fillPile();
}
}
if(getStamina() < 100)
doDrink();
if(getEnergy() < 55) {
Survey = null;
print("Not enough Energy");
}
}
print("Survey Done");
exit();
}
function getSurvey(){
var Surveys = getMapObjects("survobj");
if(Surveys.length == 0) {
print("No Surveys, exiting");
exit();
}
Survey = Surveys[0];
}
function fillPile(){
pfClick(Stockpiles[0], MouseButton.Right);
waitForTask();
while(hasItem("soil")) {
pfClick(Stockpiles[0], MouseButton.Right);
waitForWindow("Stockpile");
if(getStockpile().Current == getStockpile().Max) {
UpdateStockpile();
closeWindow("Stockpile");
}else{
if (!hasHand())
take("soil");
sleep(500);
useItem(Stockpiles[0]);
}
}
useItem(Stockpiles[0]);
sleep(500);
drop("soil");
}
function UpdateStockpile(){
var newStockpiles = [];
for(var Index = 1; Index < Stockpiles.length ; Index++){
newStockpiles.push(Stockpiles[Index]);
}
if(newStockpiles.length == 0) {
print("No more Stockpiles");
exit();
}
Stockpiles = newStockpiles;
}
function getBarrels(){
var Barrels = getMapObjects("barrel");
for(var Index = 0; Index < Barrels.length; Index++){
if(barrelType(Barrels[Index]) == "water")
WaterBarrels.push(Barrels[Index]);
}
}
function getStockpiles(){
var Dirt = getMapObjects("stockpile-soil");
if(Dirt.length == 0){
print("At least one stockpile is needed");
exit();
}
Stockpiles = Dirt;
}
function DoSurvey(){
pfClick(Survey, MouseButton.Right);
waitForTask();
if(!startSurvey())
exit();
}
function doDrink(){
drink();
if(getStamina() < 100)
Refill();
}
function Refill(){
pfClick(WaterBarrels[0], MouseButton.left);
waitForTask();
take("waterflask");
sleep(1000);
useItem(WaterBarrels[0]);
drop("waterflask", Inventory.Hand, Inventory.Player)
sleep(500);
drink();
take("waterflask");
sleep(1000);
useItem(WaterBarrels[0]);
sleep(500);
useItem(WaterBarrels[0]);
drop("waterflask", Inventory.Hand, Inventory.Player)
DoSurvey();
};
function main(){
print("Hey test");
}
Users browsing this forum: Claude [Bot] and 119 guests