Moderator: Phades
var meter = jGetWindow("Curding Tub").getMeterValue(1);
jToConsole(meter);
var equip = checkEquipment();
equip.dropTo(6);
if (equip.resName(6).indexOf("fishing pole") >= 0) { // put correct res name for pole
equip.takeAt(6);
waitDragName("pole");
checkInventory().drop(checkInventory().freeSlotsCoords()[0]);
jWaitDrop(actionTimeout);
var bait = checkInventory().getItems("bait")[0]
bait.take();
jSleep(1000);
waitDragName("bait");
while (checkInventory().getItems("pole")[0] == null) jSleep(500);
checkInventory().getItems("pole")[0].itemact(0);
jWaitDrop(actionTimeout);
checkInventory().getItems("pole")[0].take();
waitDragName("pole");
equip.dropTo(6);
jWaitDrop(actionTimeout);
jSleep(1000);
}
equip.iact(6);
//#! name = Om nom nom
//#! tooltip = mon mon mO
//#! icon = gfx/invobjs/gast-cutlery-silver
include("jBotAPI");
include("jBotAPIArcanist");
include("pathfinder");
//Global
jMoveStep(jCoord(0, 1));
var inventory = checkInventory();
var count = 0;
var sitecount = 0;
currentlyPlace = jMyCoords();
var stopflag = false;
var cpos = [];
var foodnumber = 0;
startchoice();
var hemp = choiceHemp();
if (hemp) {
hempcupboard = jSelectObject("Where is your weed stash?");
}
while (1){
var thisfood = choose_food();
if (thisfood == -1) break;
else cpos.push(thisfood);
foodnumber++;
jToConsole(foodnumber + " items selected");
var chosenfood = null;
}
jToConsole(cpos);
//var cpos = choose_food();
var foodcupboards = ScanCup4Ingredients(jGetObjects(35, jCoord(0, 0), ["cupboard"]));
//Settings
var actionTimeout = 1000 * 60 * 2;
var waterPerc = 80;
var winePerc = 80;
function ScanCup4Ingredients(containerlist){
ArrayCupboard = [];
IngredCupboard = [];
var ObjCupboard = [];
var cupboards = containerlist;
for(var i = 0; i < cupboards.length; i++) {
openCupboard(cupboards, i);
jWaitWindow("Cupboard",3000);
for (var k = 0; k < cpos.length; k++){
if(ObjCupboard.length < k + 1) ObjCupboard.push([]);
if(jGetWindow("Cupboard").getInventories()[0].getItems(cpos[k]).length > 0){
ObjCupboard[k].push(cupboards[i]);
jToConsole("Cupboards of "+ cpos[k] + " found = "+ObjCupboard[k].length);
}
}
}
jAbsClick(jMyCoords(), 1, 0);
return ObjCupboard;
}
/* =========================================================================== */
/* ============================== FOOD CHOICE! ============================ */
/* =========================================================================== */
function choiceHemp(){
var blist = ["Yes", "No"];
var selectWindow = jGUIWindow(jCoord(250, 250), jCoord(140, blist.length * 25 + 15), "Fatman");
var label = jGUILabel(selectWindow, jCoord(5, 5), "Do you want to smoke Hemp?");
for(var i = 0; i < blist.length; i++)
jGUIButton(selectWindow, jCoord(5, 25 + i*25), 100, blist[i]);
selectWindow.toggleCloseButton();
var btext = selectWindow.waitButtonClick();
selectWindow.destroy();
if(btext == blist[0]) return true;
if(btext == blist[1]) return false;
}
function choose_food() {
if (chosenfood == null) {
var blist = ["Cheese", "Sausage", "Baked", "Other", "End", "Exit"];
var selectWindow = jGUIWindow(jCoord(250, 250), jCoord(110, blist.length * 25 + 15), "Fatman");
var label = jGUILabel(selectWindow, jCoord(5, 5), "Select Food Type:");
for(var i = 0; i < blist.length; i++)
jGUIButton(selectWindow, jCoord(5, 25 + i*25), 100, blist[i]);
selectWindow.toggleCloseButton();
var btext = selectWindow.waitButtonClick();
if(btext == blist[0]) { // Cheese
selectWindow.destroy();
/* ============================== Cheese ============================ */
var blist2 = ["Brogdar Blue", "Midnight Blue", "Cellar Cheddar", "Musky Milben", "Jorbonzola", "Creamy Camenbert", "Emmentaler","Mothzarella", "Exit"];
selectWindow = jGUIWindow(jCoord(250, 250), jCoord(110, blist2.length * 25 + 15), "Fatman");
label = jGUILabel(selectWindow, jCoord(5, 5), "Select Food Type:");
for(var i = 0; i < blist2.length; i++)
jGUIButton(selectWindow, jCoord(5, 25 + i*25), 100, blist2[i]);
selectWindow.toggleCloseButton();
var btext2 = selectWindow.waitButtonClick();
if(btext2 == blist2[0]) { chosenfood = "invobjs/cheese-brodgarblue"; Food = "Brodgar Blue Cheese" }
if(btext2 == blist2[1]) { chosenfood = "invobjs/cheese-creamycamembert"; Food = "Midnight Blue Cheese" }
if(btext2 == blist2[2]) { chosenfood = "invobjs/cheese-cellarcheddar"; Food = "Cellar Cheddar" }
if(btext2 == blist2[3]) { chosenfood = "invobjs/cheese-muskymilben"; Food = "Musky Milben" }
if(btext2 == blist2[4]) { chosenfood = "invobjs/cheese-jorbonzola"; Food = "Jorbonzola" }
if(btext2 == blist2[5]) { chosenfood = "invobjs/cheese-creamycamembert"; Food = "Camenbert" }
if(btext2 == blist2[6]) { chosenfood = "invobjs/cheese-temmentaler"; Food = "Tasty Emmentaler" }
if(btext2 == blist2[7]) { chosenfood = "invobjs/cheese-mothzarella"; Food = "Mothzarella" }
if(btext2 == blist2[blist2.length - 1]) {
selectWindow.destroy();
jExit();
}
selectWindow.destroy();
jToConsole("Food selected: " + Food);
return chosenfood;
}
if(btext == blist[1]) { // Sausage
selectWindow.destroy();
/* ============================== Sausage ============================ */
var blist2 = ["Lamb Sausage", "Deer Dog", "Bear Banger","Chorizo", "Boar Baloney", "Boar Bouldin", "Exit"];
selectWindow = jGUIWindow(jCoord(250, 250), jCoord(110, blist2.length * 25 + 15), "Fatman");
label = jGUILabel(selectWindow, jCoord(5, 5), "Select Food Type:");
for(var i = 0; i < blist2.length; i++)
jGUIButton(selectWindow, jCoord(5, 25 + i*25), 100, blist2[i]);
selectWindow.toggleCloseButton();
var btext2 = selectWindow.waitButtonClick();
if(btext2 == blist2[0]) { chosenfood = "invobjs/wurst-lambsausages"; Food = "Lamb Sausage" }
if(btext2 == blist2[1]) { chosenfood = "invobjs/wurst-ddd"; Food = "Delicious Deer Dog" }
if(btext2 == blist2[2]) { chosenfood = "invobjs/wurst-bigbearbanger"; Food = "Big Bear Banger" }
if(btext2 == blist2[3]) { chosenfood = "invobjs/wurst-cowchorizo"; Food = "Cow Chorizo" }
if(btext2 == blist2[4]) { chosenfood = "invobjs/wurst-boarbaloney"; Food = "Boar Baloney" }
if(btext2 == blist2[5]) { chosenfood = "invobjs/wurst-boarboudin"; Food = "Boar Boudin" }
if(btext2 == blist2[blist2.length - 1]) {
selectWindow.destroy();
jExit();
}
selectWindow.destroy();
jToConsole("Food selected: " + Food);
return chosenfood;
}
if(btext == blist[2]) { // Baked
selectWindow.destroy();
/* ============================== Baked ============================ */
var blist2 = ["Carrot Cake","Pumpkin Pie", "Apple Pie", "Blueberry Pie", "Exit"];
selectWindow = jGUIWindow(jCoord(250, 250), jCoord(110, blist2.length * 25 + 15), "Fatman");
label = jGUILabel(selectWindow, jCoord(5, 5), "Select Food Type:");
for(var i = 0; i < blist2.length; i++)
jGUIButton(selectWindow, jCoord(5, 25 + i*25), 100, blist2[i]);
selectWindow.toggleCloseButton();
var btext2 = selectWindow.waitButtonClick();
if(btext2 == blist2[0]) { chosenfood = "invobjs/cake-carrot"; Food = "Carrot Cake" }
if(btext2 == blist2[1]) { chosenfood = "invobjs/pie-pumpkin"; Food = "Pumpkin Pie" }
if(btext2 == blist2[2]) { chosenfood = "invobjs/pie-apple"; Food = "Apple Pie" }
if(btext2 == blist2[3]) { chosenfood = "invobjs/cheese-muskymilben"; Food = "Blueberry Pie" }
if(btext2 == blist2[7]) { chosenfood = "invobjs/cheese-temmentaler"; Food = "Fish Sticks" }
if(btext2 == blist2[blist2.length - 1]) {
selectWindow.destroy();
jExit();
}
selectWindow.destroy();
jToConsole("Food selected: " + Food);
return chosenfood;
}
if(btext == blist[3]) { // Other
selectWindow.destroy();
/* ============================== Other ============================ */
var blist2 = ["Chicken Salad", "Pumpkin Pie", "Apple Pie", "Cow Chorizo", "Exit"];
selectWindow = jGUIWindow(jCoord(250, 250), jCoord(110, blist2.length * 25 + 15), "Fatman");
label = jGUILabel(selectWindow, jCoord(5, 5), "Select Food Type:");
for(var i = 0; i < blist2.length; i++)
jGUIButton(selectWindow, jCoord(5, 25 + i*25), 100, blist2[i]);
selectWindow.toggleCloseButton();
var btext2 = selectWindow.waitButtonClick();
if(btext2 == blist2[0]) { chosenfood = "invobjs/cheese-brodgarblue"; Food = "Chicken Salad" }
if(btext2 == blist2[1]) { chosenfood = "invobjs/pie-pumpkin"; Food = "Pumpkin Pie" }
if(btext2 == blist2[2]) { chosenfood = "invobjs/pie-apple"; Food = "Apple Pie" }
if(btext2 == blist2[3]) { chosenfood = "invobjs/wurst-cowchorizo"; Food = "Cow Chorizo" }
if(btext2 == blist2[blist2.length - 1]) {
selectWindow.destroy();
jToConsole("No Food selected! Shutting down!");
jExit();
}
selectWindow.destroy();
jToConsole("Food selected: " + Food);
return chosenfood;
}
if(btext == blist[4]) {
selectWindow.destroy();
jToConsole("End of Selection");
return -1;
}
selectWindow.destroy();
}
jToConsole("Food selected: " + Food);
return chosenfood;
}
/* =========================================================================== */
/* ============================== START OF MAIN FUNCTIONS! ================= */
/* =========================================================================== */
//Get Hungry!!
function isStoned(){
var buffs = jGetBuffs();
for (var i = 0; i < buffs.length; i++) {
if (buffs[i].name().indexOf("In the Fog") >= 0) {
if (buffs[i].time() > 5) {
return true;
}
}
}
return false;
}
function getStoned(){
if (checkInventory().freeSlotsCoords().length == 0) return;
while(jHaveWindow("Cupboard")) {
jAbsClick(jMyCoords(), 1, 0);
if (jHaveWindow("Cupboard")) jSleep(500);
}
while(!jHaveWindow("Cupboard")) {
jPFMoveOffset_LX(hempcupboard.position(), 1);
waitPFEndMove();
jSleep(500);
jDoClick(hempcupboard.getID(), 3, 0);
jSleep(1000);
}
var equip = checkEquipment();
var hemp = jGetWindow("Cupboard").getInventories()[0].getItems("hemp-cured")[0];
// if (!hemp) return;
if (equip.resName(1).indexOf("pipe") >= 0) {
equip.takeAt(1);
waitDragName("pipe");
checkInventory().drop(checkInventory().freeSlotsCoords()[0]);
jWaitDrop(actionTimeout);
hemp.take();
jSleep(1000);
waitDragName("hemp-cured");
while (checkInventory().getItems("pipe")[0] == null) jSleep(500);
checkInventory().getItems("pipe")[0].itemact(0);
jWaitDrop(actionTimeout);
checkInventory().getItems("pipe")[0].take();
waitDragName("pipe");
equip.dropTo(1);
jWaitDrop(actionTimeout);
jSleep(1000);
equip.iact(1);
if (jWaitPopup(actionTimeout)) {
jSelectContextMenu("Light");
}
}
}
function getHungry_digger() {
var chair = jFindObjectByName("chair",10);
jPFMoveOffset_LX(chair.position(),1);
while (jIsMoving() || jMyCoords().dist(chair.position()) > 11){
jPFMoveOffset_LX(chair.position(), 1);
jSleep(500);
}
drinkWater();
jSendAction("plow");
jWaitCursor("dig", actionTimeout);
jOffsetClick(jCoord(0, 0), 1, 0);
jWaitProgress();
jWaitCursor("dig", actionTimeout);
jOffsetClick(jCoord(0, 0), 1, 0);
jWaitProgress();
jWaitCursor("dig", actionTimeout);
jOffsetClick(jCoord(0, 0), 1, 0);
jWaitProgress();
jOffsetClick(jCoord(0, 0), 3, 0);
jWaitCursor("arw", actionTimeout);
}
//Get Food
function getFood(number) {
var inventory = checkInventory();
var cupboards = foodcupboards;
var inv_freeSlot = inventory.freeSlots();
toInt(inv_freeSlot / cpos.length);
jAbsClick(jMyCoords(), 1, 0);
jSleep(1000);
//jToConsole("Freeslots:" + inv_freeSlot); //For debugging purposes
for (var k = 0; k < cpos.length; k++){
getItemsFromContainers (cpos[k], foodcupboards[k], "Cupboard", number, 1);
jAbsClick(jMyCoords(), 1, 0);
jSleep(1000);
jSleep(1000);
}
//Eat Food
}
//Eat Food Standing
function eatFood(food) {
inventory = checkInventory();
var foods = inventory.getItems(food);
jToConsole("Food to Eat:" + foods.length); //For debugging purposes
//for (var i = 0; i < foods.length; i++) {
if (jGetHungry() > 95) { return; }
foods[0].iact();
jSleep(500);
jWaitPopup(actionTimeout);
jSleep(500);
jSelectContextMenu("Eat");
jSleep(500);
// }
}
function startchoice(){
var blist = ["Eat Stuff", "Starve", "Exit"];
var selectWindow = jGUIWindow(jCoord(250, 250), jCoord(110, blist.length * 25 + 15), "Fatman");
var label = jGUILabel(selectWindow, jCoord(5, 5), "Select function:");
for(var i = 0; i < blist.length; i++)
jGUIButton(selectWindow, jCoord(5, 25 + i*25), 100, blist[i]);
selectWindow.toggleCloseButton();
var btext = selectWindow.waitButtonClick();
selectWindow.destroy();
if(btext == blist[0]) { return; }
if(btext == blist[1]) {
while (jGetHungry() > 55) {
jToConsole("Getting Hungry!");
getWaterFromBarrel ()
getHungry_digger();
}
}
jExit();
}
//Find Table sit and feast!
function main() {
inventory = checkInventory();
var inv_freeSlot = checkInventory().freeSlots();
var number = toInt(inv_freeSlot / cpos.length);
jAbsClick(jMyCoords(), 1, 0);
if (!isStoned() && hemp){
jMoveStep(jCoord(0, 2));
getStoned();
}
getFood(number);
//var foods = [];
for (var q = 0; q < number; q++){
for (var i = 0; i < cpos.length; i++) {
// var foods[i] = inventory.getItems(cpos[i]);
// jToConsole("Food to Eat:" + foods.length); //For debugging purposes
if (jGetHungry() > 95) {
jMoveStep(jCoord(0,2));
while (jGetHungry() > 55) {
jToConsole("Getting Hungry!");
getWaterFromBarrel ()
getHungry_digger();
}
}
var table = jFindObjectByName("table",10);
while(!jHaveWindow("Table")) {
var chair = jFindObjectByName("chair",10);
jPFMoveOffset_LX(chair.position(),1);
while (jIsMoving() || jMyCoords().dist(chair.position()) > 15){
jPFMoveOffset_LX(chair.position(), 1);
jSleep(500);
}
jSleep(500);
currentlyPlace = jMyCoords();
jSleep(500);
chair.doClick(3,0);
jSleep(500);
jDoClick(table.getID(), 3, 0);
jSleep(1000);
}
var inv_food = inventory.getItems(cpos[i]);
inv_food[0].transfer();
jSleep(500);
var open_table = jGetWindow("Table").getInventories()[1];
var check_food = [];
var check_food = open_table.getItems(cpos[i]);
jSleep(500);
jToConsole("Food in Table: " + check_food.length); //For debugging purposes
jGetWindow("Table").pushButton("Feast!");
try {
while (!jIsCursor("eat")) {
jSleep(100);
jGetWindow("Table").pushButton("Feast!");
}
check_food[0].take();
jWaitProgress(actionTimeout);
resetCursor();
}
catch(e){
jToConsole(e.message);
}
jSleep (500);
//jToConsole("Food in Table, Feasting... "); //For debugging purposes
//tile = jPFMove_LX(currentlyPlace);
jSleep(500);
if (!isStoned() && hemp){
jMoveStep(jCoord(0, 2));
getStoned();
}
}
}
jMoveStep(jCoord(0, 2));
jSleep(1000);
}
/* =========================================================================== */
/* ============================== END OF MAIN FUNCTIONS! ================== */
/* =========================================================================== */
starter();
function starter() {
if (jGetHungry() > 95){
while (jGetHungry() > 55) {
jToConsole("Getting Hungry!");
getWaterFromBarrel ();
getHungry_digger();
}
}
while(1){
main();
}
}
while(1) {
main();
}
static void jImgClick(java.lang.String window, int pos, int BTN, int mod)
static int jImgFreeSlots(java.lang.String window)
static java.lang.String jImgName(java.lang.String window, int pos)
static int jImgSlotsCount(java.lang.String window)
Users browsing this forum: Claude [Bot], Google [Bot] and 0 guests