I'm afraid Ephialtes is right, people aren't going to just give you the code because then you don't learn, you just copy and paste it and never look at it again.
I'm guessing that you don't know about dump or trace. These will be your best friends.
dump tells you all of an objects functions and variables, to dump and object first you need to get it's handle. Once you have the object's handle you simply type <objecthandle>.dump(); (Replacing <objecthandle> with the the object's handle). If you don't know what a handle is it's basically a number assigned to that object, Eg; 4444. Dumps don't just have to be called through the console though, you can also put them in a function to dump an object that only lasts a couple of seconds, Eg; a projectile. If you're calling it from a function you can just %myvariable.dump(); keeping in mind that the variable must be assigned to an object.
trace prints all functions being called into the console along with the handles being sent to the function. It's great for finding functions and the function's variables. To trace simply type trace(1); in the console, this will turn tracing on now be careful, if you have any schedules in the background continuously calling a function your console will be spammed. To turn trace off you simply type trace(0);