• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Pull item to backpack

lord vortexx

New Member
Joined
Dec 14, 2008
Messages
92
Reaction score
3
My question is simple, how do I get the item to be automatically pulled into the backpack? Looked at the candybot I had a notion but it does not work 100%, it pulls the item to position {x = 65535, y = 64, z = 0}.

Can someone tell me why pulling into that position?


Thank you so much
 
because it is a container position.
65535 x value represents container/cylinder
64+ y value represents cylinder id
 
Many thanks for the reply.
Not wanting to abuse your goodwill, could you kindly give an explanation about cylinder and if possible how it works?

Thank you again
 
cylinders are containers that hold items (such as a tile/inventory slot/backpack, chest, etc)

X: 65535 Y: 1-11 -> inventory id
X: 65535 Y: 64+ -> container id

dont really understand how to explain cylinders other than that, they're just something that can contain items inside of it
 
I understand, thank you Xeraphus, I think I can continue with my project :D
i never actually answered your question, i just answered why it happens
you can get the item (not through candybot) through the player event called onMoveItem.
onMoveItem has fromCylinder and toCylinder arguments which both hold values of (you guessed it) the last cylinder userdata the item was at, and the cylinder userdata of the item being thrown into.
i also forgot to say cylinder z positions are the index of which the item is (indexing starts at 0 rather than 1)
so if i have a brown backpack inventory, and i move a blue backpack inside of it from index 0 in my backpack (the first slot) into a red backpack with index 3 (the fourth slot), fromCylinder and toCylinder will be the same cylinder because i'm still technically moving it from the brown backpack (from cylinder) to the brown backpack (to cylinder)

fromCylinder position in the above case would be: (X: 65535, Y: 64, Z: 0)
toCylinder position would be: (X: 65535, Y: 64, Z: 3)

moving the blue backpack back to the original brown backpack would then be different cylinders, since fromCylinder would be the red backpack (the backpack i moved the blue backpack inside to), and toCylinder would be the brown backpack.
the positions would be:

fromCylinder: (X: 65535, Y: 65, Z: 0)
toCylinder: (X: 65535, Y: 64, Z: max backpack size) (moving to new cylinder z position is the number of max items held + 1)
 
I can not find this event, onMoveItem, I found only the event, onAddItem, but that does not have the parameters that you cited.

This event is on the Client side, right?
 
Back
Top