Union Client Scripts

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

Moderator: Phades

User avatar
Mernil
Posts: 133
Joined: Tue Jul 29, 2014 9:54 pm

Re: Union Client Scripts

Post by Mernil »

Thanks for boat stuff.
Arcanist wrote:Does anybody know how to tell the difference between a young animal and a mature animal?

They seem to have the same res file, and the same BLOB
Cows, bulls and calves all have different name :

Code: Select all

gfx/kritter/cow/bull|cow|calf/walking|standing/...
What kind of animal are you talking about?
User avatar
Arcanist
Posts: 2664
Joined: Mon Mar 19, 2012 2:01 pm

Re: Union Client Scripts

Post by Arcanist »

oh, my mistake :lol: :lol: :lol:
I was looking at their shadow res
User avatar
SovietUnion
Posts: 266
Joined: Mon Mar 12, 2012 4:42 am
Location: Brno, Czech Republic

Re: Union Client Scripts

Post by SovietUnion »

Quick question: how to see the amount of liquid that an inventory container has? Or to see if it's empty?

Example: want to check if waterflask is empty.

I only saw functions where the containers were sorted according to the amount, not actually checking the value itself.

Thanks in advance!
Notable characters: Cpt. Danko, Kng. Danko

LS of MorningWood (as of W7)
North Star market owner (W11)
King of North Star Kingdom & Market (W12)
LS of MorningWood (W13), quit early cause reasons
Open village of North Star (W14)

"Not really. But meh.. who needs proper communication anyways"
User avatar
Mernil
Posts: 133
Joined: Tue Jul 29, 2014 9:54 pm

Re: Union Client Scripts

Post by Mernil »

SovietUnion wrote:Quick question: how to see the amount of liquid that an inventory container has? Or to see if it's empty?
Example: want to check if waterflask is empty.
I only saw functions where the containers were sorted according to the amount, not actually checking the value itself.
Thanks in advance!
It's in its name :

Code: Select all

water_skin = checkInventory().getItems('invobjs/waterskin')[0]
water_quantity = parseFloat(water_skin.name().split(' ')[1].replace('(','').split('/')[0]);
EDIT :

Actually there is a method to get current amount...

Code: Select all

sayArea(checkInventory().getItems('invobjs/waterskin')[0].currentAmount());
User avatar
Mernil
Posts: 133
Joined: Tue Jul 29, 2014 9:54 pm

Re: Union Client Scripts

Post by Mernil »

Hi fellow wizards.

I'm looking for the cartography icon (the cartography skill one).
So I'm able to put that line in my script : //#! icon = gfx/invobjs/small/paxe (that's for the pickaxe...)

That's for an incoming public script ;)

Thanks!

(+ any insights on how to be able to find icon name for each image would be greatly appreciated).

Also, is it possible to automatically launch a script when a session is loaded?
User avatar
julian12it
Posts: 787
Joined: Sat Sep 11, 2010 8:01 pm
Location: Topaz

Re: Union Client Scripts

Post by julian12it »

Mernil wrote:Hi fellow wizards.

I'm looking for the cartography icon (the cartography skill one).
So I'm able to put that line in my script : //#! icon = gfx/invobjs/small/paxe (that's for the pickaxe...)

That's for an incoming public script ;)

Thanks!

(+ any insights on how to be able to find icon name for each image would be greatly appreciated).

Also, is it possible to automatically launch a script when a session is loaded?

Code: Select all

gfx/hud/skills/cartography
User avatar
Arcanist
Posts: 2664
Joined: Mon Mar 19, 2012 2:01 pm

Re: Union Client Scripts

Post by Arcanist »

Mernil wrote:Thanks for boat stuff.
Arcanist wrote:Does anybody know how to tell the difference between a young animal and a mature animal?

They seem to have the same res file, and the same BLOB
Cows, bulls and calves all have different name :

Code: Select all

gfx/kritter/cow/bull|cow|calf/walking|standing/...
What kind of animal are you talking about?

Although they have different res names, I cannot get those res names to work at all...
Image
User avatar
Mernil
Posts: 133
Joined: Tue Jul 29, 2014 9:54 pm

Re: Union Client Scripts

Post by Mernil »

Maybe use

Code: Select all

cow/calf
.

Alternatively you could get all objects and work on them :

Code: Select all

objs = jGetObjects(5000, jCoord(0,0),'gfx/');
for (var i=0; i<objs.length; i++){
  jPrint(objs[i].name());
  if(objs[i].name().strpos('calf') != -1){
    jPrint('is that a calf?')
  }
}

Also a script to place signposts every 3 tiles from west to east (place first one, stick to it, and launch the script).
Simple one, but still interesting to understand how to place a "building", I did struggle a bit.

Code: Select all

//#! tooltip = Test
//#! name = Signs placer
//#! uniq = 0000000-000000-000000-MINE-SIGNS



include('jBotAPI');

//place sign every 3 tiles
for(var i=0; i<50; i++){
	jOffsetClick(jCoord(4,0), 1); //move back
	jSleep(200);jWaitEndMove();
	jSendDoubleAction('bp','pow'); //make sign
	jSleep(300);
	jPlace(jCoord(-2,0), 1);
	jSleep(200);jWaitEndMove();
	while(!jHaveWindow("Pile of Wood")){
		jSleep(10);
	}
	checkInventory().getItems('branch')[0].transfer();
	jSleep(300);
	
	if(checkInventory().getItems('branch').length == 0){
		if(checkInventory().getItems('wood').length == 0){
			break;
		}else{
			checkInventory().getItems('wood')[0].iact();
			jSleep(200);
			jWaitPopup();
			jSelectContextMenu("Split");
			jSleep(200);
		}
	}
}
User avatar
Arcanist
Posts: 2664
Joined: Mon Mar 19, 2012 2:01 pm

Re: Union Client Scripts

Post by Arcanist »

Had to change it a little as I don't have strpos()
Image
For some reason the res of each animal is only the shadow res??
User avatar
Mernil
Posts: 133
Joined: Tue Jul 29, 2014 9:54 pm

Re: Union Client Scripts

Post by Mernil »

That's weird.

Maybe try with 'jFindObjectByName' or you could use : 'jSelectObject' select a calf, and see what's in the object.

If that works you'd have to script it so that when you launch the script you manually have to select the calves. Not perfect but better than nothing.

Return to “The Wizards' Tower”