Paying 1 LC of jorbonzola valued around 800 points or 16 pearls
for a script that will do the following in the union client
-transfer curd from the inventory into cheese trays
1st person to post the script *functioning* in  this thread, wins.
			
				Arcanist wrote:Where are the cheese trays?
//#! name = curd mover
//#! uniq = Curd_Mover_Arcanist
//#! tooltip = moves curd
//#! icon = gfx/invobjs/cheese-curd
var inventory = checkInventory();
var inv = jGetWindows("Inventory");
var cupboard = checkCupboard();
function checkCupboard() {
   if(!jHaveWindow("Cupboard")) {
      return;
   }
   return jGetWindow("Cupboard").getInventories()[0];
}
function checkInventory() {
   if(!jHaveWindow("Inventory")) {
      jToggleInventory();
      while(!jHaveWindow("Inventory"))
         jSleep(100);
   }
   return jGetWindow("Inventory").getInventories()[0];
}
/*function main() {
     //var tray = jGetWindow("Cupboard").getInventories()[0].getItems("cheese-tray")[0];
      var curd = jGetWindow("Inventory").getInventories()[0].getItems("cheese-curd")[0];    //getting 1st curd at inventory
     var trays = cupboard.getItems("cheese-tray");
         curd.take();
         jWaitDrag();
         if (trays.length > 0) {
            var trays = trays[0];
            if (trays.isActual()) {
               trays.itemact(0);
               jSleep(200);
            loop();
            }
         }
     jSleep(200);
     loop(); }
     */
     
     
/*function main() {
   inventory = checkInventory();
   var cupboard = checkCupboard();
   var buckets = inventory.getItems("cheese-curd");
   if (buckets.length > 0) {
      inventory.sortItems(buckets, "amount", false);
      var bucket = buckets[0];
      if (bucket.isActual()) {
         bucket.take();
         jWaitDrag();
         var flasks = cupboard.getItems("cheese-tray");
         if (flasks.length > 0) {
            var flask = flasks[0];
               flask.itemact(0);
               jSleep(500);
            transfertray();
            }
         }
      }
   
   loop();
 }
 */
 
 function main() {
    inventory = checkInventory();
   var cupboard = checkCupboard();
   var buckets = inventory.getItems("cheese-curd");
   if (buckets.length > 0) {
      inventory.sortItems(buckets, "amount", false);
      var bucket = buckets[0];
      if (bucket.isActual()) {
         var flasks = cupboard.getItems("cheese-tray");
         if (flasks.length > 0) {
            var flask = flasks[0];
            bucket.take();
            jWaitDrag();
               flask.itemact(0);
               jSleep(500);
            var buckets = inventory.getItems("cheese-curd");
            var bucket = buckets[0];
            bucket.take();
            jWaitDrag();
               flask.itemact(0);
               jSleep(500);
            var buckets = inventory.getItems("cheese-curd");
            var bucket = buckets[0];
            bucket.take();
            jWaitDrag();
               flask.itemact(0);
               jSleep(500);
            var buckets = inventory.getItems("cheese-curd");
            var bucket = buckets[0];
            bucket.take();
            jWaitDrag();
               flask.itemact(0);
               jSleep(500);
            var buckets = inventory.getItems("cheese-curd");
            var bucket = buckets[0];
            transfertray();
            loop();
            }
         }
      }
   
   loop();
 }
 
 function transfertray() {
   inventory = checkInventory();
   var cupboard = checkCupboard();
   var buckets = cupboard.getItems("cheese-tray-curd");
   var freeSlot = inventory.freeSlotsCoords()[0];
   if (buckets.length > 0) {
      inventory.sortItems(buckets, "amount", false);
      var bucket = buckets[0];
      while (bucket.isActual()) {
         bucket.take();
         jWaitDrag();
       inventory.drop(freeSlot)
       jSleep(500)
       }
       }
       return;
       }
   
 
 
function loop() {main();}
loop()var inventory = checkInventory();
var inv = jGetWindows("Inventory");
var cupboard = checkCupboard();
function checkCupboard() {
   if(!jHaveWindow("Cupboard")) {
      return;
   }
   return jGetWindow("Cupboard").getInventories()[0];
}
function checkInventory() {
   if(!jHaveWindow("Inventory")) {
      jToggleInventory();
      while(!jHaveWindow("Inventory"))
         jSleep(100);
   }
   return jGetWindow("Inventory").getInventories()[0];
}
function transfertrayback() {
   inventory = checkInventory();
   var cupboard = checkCupboard();
   var buckets = inventory.getItems("cheese-tray-curd");
   var freeSlot = cupboard.freeSlotsCoords()[0];
   if (buckets.length > 0) {
      inventory.sortItems(buckets, "amount", false);
      var bucket = buckets[0];
      while (bucket.isActual()) {
         bucket.take();
         jWaitDrag();
       cupboard.drop(freeSlot)
       jSleep(500)
       }
       }
       loop();
       }
       
function loop() {transfertrayback();}
transfertrayback()   //#! name = curd mover
//#! uniq = Curd_Mover_Arcanist
//#! tooltip = moves curd
//#! icon = gfx/invobjs/cheese-curd
var inventory = checkInventory();
var inv = jGetWindows("Inventory");
var cupboard = checkCupboard();
function checkCupboard() {
   if(!jHaveWindow("Cupboard")) {
      return;
   }
   return jGetWindow("Cupboard").getInventories()[0];
}
function checkInventory() {
   if(!jHaveWindow("Inventory")) {
      jToggleInventory();
      while(!jHaveWindow("Inventory"))
         jSleep(100);
   }
   return jGetWindow("Inventory").getInventories()[0];
}
/*function main() {
     //var tray = jGetWindow("Cupboard").getInventories()[0].getItems("cheese-tray")[0];
      var curd = jGetWindow("Inventory").getInventories()[0].getItems("cheese-curd")[0];    //getting 1st curd at inventory
     var trays = cupboard.getItems("cheese-tray");
         curd.take();
         jWaitDrag();
         if (trays.length > 0) {
            var trays = trays[0];
            if (trays.isActual()) {
               trays.itemact(0);
               jSleep(200);
            loop();
            }
         }
     jSleep(200);
     loop(); }
     */
     
     
/*function main() {
   inventory = checkInventory();
   var cupboard = checkCupboard();
   var buckets = inventory.getItems("cheese-curd");
   if (buckets.length > 0) {
      inventory.sortItems(buckets, "amount", false);
      var bucket = buckets[0];
      if (bucket.isActual()) {
         bucket.take();
         jWaitDrag();
         var flasks = cupboard.getItems("cheese-tray");
         if (flasks.length > 0) {
            var flask = flasks[0];
               flask.itemact(0);
               jSleep(500);
            transfertray();
            }
         }
      }
   
   loop();
 }
 */
 
 function main() {
    inventory = checkInventory();
   var cupboard = checkCupboard();
   var buckets = inventory.getItems("cheese-curd");
   var bucket_coord = bucket.coord();
   if (buckets.length > 0) {
      inventory.sortItems(buckets, "amount", false);
      var bucket = buckets[0];
      if (bucket.isActual()) {
         var flasks = cupboard.getItems("cheese-tray");
         if (flasks.length > 0) {
            var flask = flasks[0];
            bucket.take();
            jWaitDrag();
               flask.itemact(0);
               jSleep(500);
            var buckets = inventory.getItems("cheese-curd");
            var bucket = buckets[0];
            bucket.take();
            jWaitDrag();
               flask.itemact(0);
               jSleep(500);
            var buckets = inventory.getItems("cheese-curd");
            var bucket = buckets[0];
            bucket.take();
            jWaitDrag();
               flask.itemact(0);
               jSleep(500);
            var buckets = inventory.getItems("cheese-curd");
            var bucket = buckets[0];
            bucket.take();
            jWaitDrag();
               flask.itemact(0);
               jSleep(500);
            var buckets = inventory.getItems("cheese-curd");
            var bucket = buckets[0];
            bucket.take();
            jWaitDrag;
            inventory.drop(bucket_coord)
            transfertray();
            loop();
            }
         }
      }
   
   loop();
 }
 
 function transfertray() {
   inventory = checkInventory();
   var cupboard = checkCupboard();
   var buckets = cupboard.getItems("cheese-tray-curd");
   var freeSlot = inventory.freeSlotsCoords()[0];
   if (buckets.length > 0) {
      inventory.sortItems(buckets, "amount", false);
      var bucket = buckets[0];
      while (bucket.isActual()) {
         bucket.take();
         jWaitDrag();
       inventory.drop(freeSlot)
       jSleep(500)
       }
       }
       return;
       }
   
 
 
function loop() {main();}
loop()Arcanist wrote:
Worked for the 7 curd I managed to find to test it on. It doesn't seem possible for the bot engine to differentiate between "cheese-tray" and "cheese-tray-curd", so the only way of doing this is to take "cheese-tray-curd" out of the cupboard after it is full.
The second script puts them all back in.
