How would I use this to add a delay of 2 minutes to my Lua program, here is the code for the delay, but I dont know how to add the delay.
function sleep(n)
The os.clock function returns the number of seconds of CPU time for the program. So the sleep function of yours waits for n seconds, if you need to delay 2 minutes, just call:
sleep(2*60)
Note that there are some better solutions to implement sleep functions other than busy waiting, see Sleep Function for detail.