Union Client Scripts
Moderator: Phades
-
Arcanist
- Posts: 2664
- Joined: Mon Mar 19, 2012 2:01 pm
Re: Union Client Scripts
You must have jbotapi.japi in your scripts folder.
-
Arcanist
- Posts: 2664
- Joined: Mon Mar 19, 2012 2:01 pm
Re: Union Client Scripts
Code: Select all
function waitPFMove(){
jWaitStartMove(300);
jSleep(100);
while (true) {
jWaitEndMove(10000);
jSleep(200);
if (!jIsMoving()) {
return;
}
}
}
function getNearestBasket() {
var basket = jGetObjects(5000, jCoord(0, 0), ["wbasket"]);
var min_len = 100500; var objid = 0;
for (var i = 0; i < basket.length; i++) {
if (basket[i].position().dist(jMyCoords()) < min_len) {
var objid = basket[i];
var min_len = basket[i].position().dist(jMyCoords()); }
}
return objid; }
function moveToBasket() {
var basket2 = getNearestBasket();
jPFMove (basket2);
jSleep(500);
waitPFMove(2000);
return; }
moveToBasket()
-
seba95
- Posts: 15
- Joined: Sat Feb 11, 2012 2:06 pm
Re: Union Client Scripts
i got http://scr.hu/3ui/0jxczArcanist wrote:You must have jbotapi.japi in your scripts folder.
-
gogis
- Posts: 45
- Joined: Tue Jun 25, 2013 9:46 pm
Re: Union Client Scripts
Redone drinkWater for my better liking.
I hated this stupid behavior - always fill waterskin with bucket then drink ad nauseam, with bucket hopping every second. I made in in a more humane way, I think (atleast how I do it)
Algorithm - it drinks from container till it's less than 0.5, then hop bucket over it. Script stops at 90 stamina or everything empty. Plays sound when no water bucket available.
There is a bug also - when you manually empty skin - it's state it's previous currentAmount(), so I added check for innerQuality() > 0
Played with it for couple of hours, didn't noticed any bugs/odd behaviour. But it's not extensively tested.
todo
- refill from very close well
- find a way not to drop bucket on occasion
edit: removed debug info
I hated this stupid behavior - always fill waterskin with bucket then drink ad nauseam, with bucket hopping every second. I made in in a more humane way, I think (atleast how I do it)
Algorithm - it drinks from container till it's less than 0.5, then hop bucket over it. Script stops at 90 stamina or everything empty. Plays sound when no water bucket available.
There is a bug also - when you manually empty skin - it's state it's previous currentAmount(), so I added check for innerQuality() > 0
Played with it for couple of hours, didn't noticed any bugs/odd behaviour. But it's not extensively tested.
todo
- refill from very close well
- find a way not to drop bucket on occasion
edit: removed debug info
Code: Select all
//#! tooltip = Drink
//#! name = Drink and refill
//#! uniq = dfccd2e6-1cd5-495d-8947-9f0d6d4059az
include("jBotAPI");
function main() {
var inventory = checkInventory();
var flasks = inventory.getItems("waterflask", "waterskin");
var buckets = inventory.getItems("bucket-water");
do {
//var well = jFindObjectByName("well", 10); //well
if (flasks.length > 0) {
var flask = flasks[0];
if (flask.isActual() && flask.innerQuality() > 0) {
flask.iact();
if (jWaitPopup(actionTimeout)) {
jSelectContextMenu("Drink");
jWaitProgress();
}
}
}
if (flask.innerQuality() < 0 || flask.currentAmount() < 0.5) {
if (buckets.length > 0) {
inventory.sortItems(buckets, "amount", false);
var bucket = buckets[0];
var bucket_coord = bucket.coord();
if (bucket.isActual()) {
bucket.take();
jWaitDrag();
flask.itemact(0);
jSleep(500);
inventory.drop(bucket_coord);
jWaitDrop();
}
} else {
jPlayBeep(500);
jToConsole('No water in buckets');
}
}
} while (jGetStamina() < 90 && flask.innerQuality() > 0)
}
main();
-
robinx
- Posts: 107
- Joined: Sat Jul 16, 2011 2:40 pm
Re: Union Client Scripts
can someone tell me how work pathfinder? and how i can add it to my script?

-
gogis
- Posts: 45
- Joined: Tue Jun 25, 2013 9:46 pm
Re: Union Client Scripts
jPFmove(coords), where coords is JSGob.position(). You can reverse engineer everything from existing scripts (like farmer), or read thrurobinx wrote:can someone tell me how work pathfinder? and how i can add it to my script?
http://unionclient.ru/doc/jbot/union/jsbot/JSHaven.html. While commentary is in russian, functions names is self talking.
-
robinx
- Posts: 107
- Joined: Sat Jul 16, 2011 2:40 pm
Re: Union Client Scripts
it's possible to select tile by left mouse button in script?
if it's ,which commande do it?
if it's ,which commande do it?

-
quinsta
- Posts: 4
- Joined: Thu Jan 20, 2011 10:05 pm
Re: Union Client Scripts
I wonder if someone made a script that makes it possible to put curios in study? the client fucks up the character sheet if you use jToggleSheet, so I am really curious if anyone had some ideas?
In return my current foraging script:
http://pastebin.com/HwVwavEP
Edit:
Never mind, found out by myself and added it to the script, also updated the pastebin to match
In return my current foraging script:
http://pastebin.com/HwVwavEP
Edit:
Never mind, found out by myself and added it to the script, also updated the pastebin to match
-
roboboy33
- Posts: 94
- Joined: Sun Jul 03, 2011 2:41 am
Re: Union Client Scripts
When I click "Run Scripts" in union client nothing pops up or happens, it just goes back to the original menu. Is there something else I'm supposed to do?
what the fuck say
-
seba95
- Posts: 15
- Joined: Sat Feb 11, 2012 2:06 pm
Re: Union Client Scripts
cananyfix the Farmer scritps i dont want that me farmer eat carrots and beetroot bcouse i want upgrade psyche and Dex 