Board: Treasure Grove. Lang: Javascript
Bugs or bad coding? You be the judge.
Oddity:
I keep getting “Upper or lowercase problem. Try this.distanceTo().” for the 2nd line of following function.
function findTheBestItem(obj3) { // function to sort array for highest value and range
if (this.distanceTo(obj3) < 30) {
if ((obj3.bountyGold > itemValue) || (obj3.bountyGold === itemValue && targetDis > this.distanceTo(obj3))) { // best item of nearest items
itemValue = obj3.bountyGold;
itemPos = obj3.pos;
this.say("Item Set");
actionNow = "goForIt";
} //end of qual sorter if
else {
this.say("I didn't see anything I like.");
} //end qual sorter else
} // end of distance filter if
else {
this.say("Nothing in range, boss.");
} // end of distance filter else
} // end findTheBestItem
Still working on the function. So don’t beat me up too badly. Got stuck on this error.
The object passed to it a variable created from an array:
var items = this.findItems(); //create array of items
var item = items[iii];
Off topic idea: I think it would be useful to have a forum for trading code. I bet I could learn a lot from the C-level code of some of the top dogs.
I think that’s all of it. Thanks for the help!
Josh