I had actaully attempted to do something similar. However, the numbers were signifigantly off. When I did a check every second, a fall of 500m (which should take a hair more than 10 seconds) took 13 seconds. When I changed the numbers so it measured in 1/50 second chunks, it got worse, but I think my math may have been the blame there.
My current trial gets me a number of ~9 seconds.
make matrix 1,1000,1000,1,1
autocam off
dim v#(255,3)
dim a#(255,3)
dim m#(255)
make object sphere 1,100
x#=500
z#=500
y#=500
v#(1)=0,0,0
a#(1)=0,0,0
m#(1)=100
position camera 500,500,1000
position object 1,x#,y#,z#
sync on
gotime=timer()
starttime=timer()
ended=0
do
obj=1
v#(obj,1)=v#(obj,1)+(a#(obj,1))
v#(obj,2)=v#(obj,2)+(a#(obj,2))-(9.8)
v#(obj,3)=v#(obj,3)+(a#(obj,3))
x#=x#+(v#(obj,1))
y#=y#+(v#(obj,2))
z#=z#+(v#(obj,3))
if y#<get ground height(1,x#,z#)
y#=0
if ended=0
endtime=timer()
ended=1
endif
endif
position object obj,x#,y#,z#
point camera 500,0,500
set cursor 0,0
print x#
print y#
print z#
print timer()-gotime
print endtime-starttime
sync
while timer()<gotime+1000
wait 1
endwhile
gotime=timer()
loop
Thanks for the help, though. Is there any way to make the function send a click at exactly one second instead of waiting for the subroutines under it to finish? Basically, can the function run while something else is going?