Union Client Scripts

Forum for alternative clients, mods & discussions on the same.

Moderator: Phades

Re: Union Client Scripts

Postby Arcanist » Mon Aug 25, 2014 1:15 am

I was going to use some functions from Talon's API, but I didn't get around to it, so don't worry about that file.
As I said, I'll find that function and add it to the api when I get home (I'm at polytech at the moment).
User avatar
Arcanist
 
Posts: 2664
Joined: Mon Mar 19, 2012 2:01 pm

Re: Union Client Scripts

Postby Zarxes » Tue Aug 26, 2014 7:55 pm

Hey Arcanist, there seems to be also a Problem with the autobutcher bot. He does not start butchering at the beginning and after he dumps the meat (skin is already removed). He does unload it into cupboards though. So the script kinda works if you klick butcher manually.
Zarxes
 
Posts: 143
Joined: Mon Feb 21, 2011 6:06 pm

Re: Union Client Scripts

Postby Arcanist » Tue Aug 26, 2014 10:32 pm

The carcass must be in the centre of the tile.
User avatar
Arcanist
 
Posts: 2664
Joined: Mon Mar 19, 2012 2:01 pm

Re: Union Client Scripts

Postby Zarxes » Wed Aug 27, 2014 12:10 am

Thanks for the answer, it works now. I really could have come up with that solution by myself.
Zarxes
 
Posts: 143
Joined: Mon Feb 21, 2011 6:06 pm

Re: Union Client Scripts

Postby Arcanist » Sat Aug 30, 2014 9:22 am

Code: Select all
//#! name = Banner
//#! tooltip = Take fibre from ground, and make into banners
//#! uniq = arcanist_banner
//#! icon = gfx/invobjs/flaxfibre
include("jBotAPI");
include("jBotAPIArcanist");
include("pathfinder");

function main() {
var signs = selectMultiple("sign", "Banner Signs");
while(1){
   var hemp = jFindObjectByName("flaxfibre", 50);
   while (checkInventory().freeSlots() > 1 && hemp != null) {            // picking up fibre
      var hemp = jFindObjectByName("flaxfibre", 50);
      if (!jIsPathFree(hemp.position()) && jMyCoords().dist(hemp.position()) > 11) jPFMoveOffset_LX(hemp.position(), 0);
      jDoClick(hemp.getID(), 3, 0);
      jWaitMove(1000);
      jSleep(100);
      if (jGetDraggingItem()) {
        jDropObject(0);
      }
      var hemp = jFindObjectByName("flaxfibre", 15);
   }
   
   
   var loom = findObjectbyBLOB("loom", 1, 1, 1, 1, 1);
   while (loom == null){
      if (!jFindObjectByName("loom", 50)) {
         jToConsole("Loom not found");
         jExit();
      }
      jSleep(1000);
      var loom = findObjectbyBLOB("loom", 1, 1, 1, 1, 1);
   }
   
   
   jSendDoubleAction("craft", "linencloth");
   var craftno = toInt(checkInventory().getItems("flaxfibre").length / 5);
   if (craftno > 0) {
   jPFMoveOffset_LX(loom.position(), 2);
   while (jIsMoving() || jMyCoords().dist(loom.position()) > 25) jSleep(500);
   var player_pos = jMyCoords();
   jDoClick(loom.getID(),3,0);
   jSleep(1000);
   var count = 0;
   
      while (checkInventory().getItems("linencloth").length < craftno) {  // crafting
         jCraftItem(true);
         jWaitProgress(actionTimeout);
         jSleep(500);
         dropFromCursor(1);
         drinkWater(30);
         count++;
         if (count > 2 && checkInventory().getItems("linencloth").length < 1) {  // if bot has not found loom
            jDoClick(loom.getID(),3,0);
            jSleep(5000);
         }
      }
      jAbsClick(player_pos, 1, 0);
      jSleep(1000);
      putItemsToSigns ("linen", signs, "Village Banner", 1, 1);
      }
   }
}

main();


Takes fibre from ground, puts linen into banner signs
User avatar
Arcanist
 
Posts: 2664
Joined: Mon Mar 19, 2012 2:01 pm

Re: Union Client Scripts

Postby Zarxes » Mon Sep 01, 2014 9:18 pm

I got a problem with the foragebot maker. Anyone got a clue what might cause this error message?

[JSBot ScriptSyntax Error] ReferenceError: "Random" is not defined. (Foragebotma
ker.jbot#170)
Zarxes
 
Posts: 143
Joined: Mon Feb 21, 2011 6:06 pm

Re: Union Client Scripts

Postby Mernil » Tue Sep 02, 2014 12:45 am

Zarxes wrote:I got a problem with the foragebot maker. Anyone got a clue what might cause this error message?

[JSBot ScriptSyntax Error] ReferenceError: "Random" is not defined. (Foragebotma
ker.jbot#170)


You may have some luck replacing it with
Code: Select all
Math.random();


This function returns a number between 0 and 1.
User avatar
Mernil
 
Posts: 133
Joined: Tue Jul 29, 2014 9:54 pm

Re: Union Client Scripts

Postby Zarxes » Tue Sep 02, 2014 3:20 pm

f.write("//#! uniq = "+uniqName[modeNum]+Random(10000000, 100000000)+"\n");
i think that might be the line which is causing these problems

gonna try this then:
f.write("//#! uniq = "+uniqName[modeNum]+Math.Random(10000000, 100000000)+"\n");


Edit: Nice one, that seems to have fixed it!

Edit2:
A new Problem appeared when trying to start the resulting script:
[JSBot ScriptSyntax Error] ReferenceError: "CollectMount2" is not defined. (dere
sre - Mountain#61)
Zarxes
 
Posts: 143
Joined: Mon Feb 21, 2011 6:06 pm

Re: Union Client Scripts

Postby Lordtimo » Tue Sep 02, 2014 7:42 pm

Open Mountain bot, and show line 61.
User avatar
Lordtimo
 
Posts: 437
Joined: Wed Jun 01, 2011 12:00 pm

Re: Union Client Scripts

Postby Zarxes » Tue Sep 02, 2014 9:35 pm

That should be the line: CollectMount2(accName, charName, collectCurios, dropCurios, dropQuality, startPos, waypoints);

(I just copied a working version of a friend in the meantime)
Zarxes
 
Posts: 143
Joined: Mon Feb 21, 2011 6:06 pm

PreviousNext

Return to The Wizards' Tower

Who is online

Users browsing this forum: Claude [Bot] and 0 guests