question

DAVID GARCIA avatar image
0 Likes"
DAVID GARCIA asked DAVID GARCIA edited

Help with Rack and bays

Hello everyone, I have a problem with a rank and I hope you can help me, thank you very much.

I need to set certain objects in a rank but I could not do it, I think it's programming a code but I'm not sure.

I have 9 items (itemtype) or references, and I have to locate them in certain specific bays.

Example:

If I have a rack with 30 bays and 5 levels ... Itemtype 1 .... bay 1 to 10

Itemtype 2.... bay 11 to 18

Itemtype 3 ...bay 19 to 30

how can I do it? Thank you very much for answering

rackcodeitemtypehelp requestbay
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

@DAVID GARCIA you have seen this question a few days ago?

0 Likes 0 ·
DAVID GARCIA avatar image DAVID GARCIA Joerg Vogel commented ·

I have not seen it, thank you

0 Likes 0 ·

1 Answer

Sam Stubbs avatar image
1 Like"
Sam Stubbs answered DAVID GARCIA edited

The easiest way to do it would be to add some custom code in the Rack's "Place in Bay" function. You could add something like the following code:

int baynum = 1;
if (getitemtype(item) == 1)  {
	baynum = duniform(1,10);
}
if (getitemtype(item) == 2)  {
	baynum = duniform(11,18);
}
if (getitemtype(item) == 3)  {
	baynum = duniform(19,30);
}
// etc etc.
return baynum;

This will place item types 1 in a random bay between 1 and 10, item types 2 in random bay between 11 and 18, etc.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

DAVID GARCIA avatar image DAVID GARCIA commented ·

Hi sam, thank you very much for answering

0 Likes 0 ·