This is the code, the idea of it is to work like a check list for each of the buckets, say you have buckets 1-4 it'll check bucket 1 for a infrared signal if it doesn't get one it moves on to bucket 2, if it does then it dumps the block in the bucket and moves to the closest ramp.
AutonomousIR.c, I apologize I don't know how to get the code to display in the post