i have three questions

...:
1. how do you open and save functions, variables, etc to text files
2. in codes with stuff like if scancode()>0 if mouseclick()=1 etc you can just hold down a button... like i am trying to make it where if you click at the right time something happens how do you make it where you cant just hold down the button?
3.i am also trying to make something where you click on a sprite to trigger something and i coded something like:
if mouseclick>0 and mousex()>c and mousex()<c+82 ...etc etc
where c is the x placement of the sprite and 82 is the width
it only responds to the clicks sometimes...
ps i probably wont read this again til the morning as i am about to go to sleep... lol it is almost morning anyway..and i have been gettin up really early lately to help my dad with a milk route which takes around 12 hours... but that is a different story..but anyway good night and thanx in advance
any tips (i just started with this program)