I'm just guessing here but perhaps you could use something like
to check if there is an item in a certain slot. Normally, the slots fill from 1 till the end, so in theory if you can see if there is something in the last slot you can determine that it is full.