http://services.runescape.com/m=itemdb_oldschool/api/catalogue/detail.json?item=3831 ^ This is the OSRS ge API, there's also one for rs3 https://medium.com/@paulgambill/how-to-import-json-data-into-google-spreadsheets-in-less-than-5-minutes-a3fede1a014a EDIT: doesn't seem to work quite well, so I wrote a custom function: EDIT2: fixed comma issue
CELL FORMULA: =GetPriceRS3(<id>) or =GetPriceOSRS(<id>)
function GetPriceOSRS(id) {
return GetPrice('http://services.runescape.com/m=itemdb_oldschool/api/catalogue/detail.json?item=', id);
}
function getPriceRS3(id) {
return GetPrice('http://services.runescape.com/m=itemdb_rs/api/catalogue/detail.json?item=', id);
}
function GetPrice(url, id) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var response = UrlFetchApp.fetch(url + id);
var data = JSON.parse(response.getContentText());
price = (''+data['item']['current']['price']).replace(/,/g, "");
if(price[price.length-1] === 'b') price = price.substr(0,price.length-1)*1000000000;
else if(price[price.length-1] === 'm') price = price.substr(0,price.length-1)*1000000;
else if(price[price.length-1] === 'k') price = price.substr(0,price.length-1)*1000;
return parseInt(price);
}
Yep kinda annoying. Tempfix: you could just add a check for client.isLoggedIn() before walking or handling an obstacle. I'm pretty sure that fixed this issue in my script. If you're using walkPath this might not work tho. In that case you could try to create a thread which terminates all (walking) events if isMirrror and !isPaused and !loggedIn or something similar.
I'm not sure what this issue is, and I'm also not sure what those cases would be since indexing an array means you don't have to use a switch anymore for this. Perhaps I can help if you show some of your code.
Ye, for example:
WalkingEvent e = new WalkingEvent(new Position(0,0,0));
e.setEnergyThreshold(100);
boolean ret = bot.getEventExecutor().execute(e).hasFinished();
I'm not sure why every setter is chainable except setEnergyThreshold
Could also just use an array like this
Position[][] paths = new Position[][] {
{
new Position(0,0,0), new Position(0,0,0) //path 0
},
{
new Position(0,0,0), new Position(0,0,0) //path 1
}
};
Position[] myPath = paths[random(0, paths.length-1)];
I'm not sure what you mean by "condition it the right way", is it the logic or java / the API you're having difficulties with? The logic is quite simple:
if we have enough ores and near furnace then SMELT
if we have enough ores and not near furnace then WALK_TO_FURNACE
if we don't have enough ores and near bank then BANK
if we don't have enough ores and not near bank then WALK_TO_BANK
Yes it is an abstract class, subclassed by concrete classes Objects, NPCS and GroundItems. So you could do objects.get(x,y) or npcs.get(x,y) or groundItems.get(x,y)
EntityAPI.get(x,y) returns a list of entities on pos x,y,z with z = myPlayer.getZ() !EntityAPI.get(x,y).isEmpty() --> there is something at position x,y EntityAPI is one of npcs, objects, grounditems