can anyone teach me how lastonto works?

I am trying to create a code that checks if the last attempt of moving items failed using depotaction() ,

I tried this code but it doesnt seem to work properly :/


if $lastonto < 1 then
gotolabel('x')
end


maybe anyone can help out?