Economy-x-Talk - Sample Scripts
Clock
This is a clock I made once, try to figure this one out he he.
Martin Antell
on clock
put "x, --->" into cd fld "spelar nu2"
if cd fld "in there"="" then
answer "Hittade inga tidskoder." with "OK"
if it=ok then
exit clock
end if
end if
if line cd fld klockhjSlp2 of cd fld "in there"="" then
put 1 into cd fld klockhjSlp
put 2 into cd fld klockhjSlp2
end if
if cd fld "deltid" is not "" or cd fld "delnamn" is not "" then
answer "Det finns oinmatad data i inmatnigskonsolen, vill du sStta till detta till programlistan?" with "nej" or "OK"
if it is "ok" then
do script of btn "mata in2"
end if
end if
if cd fld klocka="0.0" or cd fld klocka=0 then
put line cd fld klockhjSlp of cd fld "in there" into cd fld "spelar nu"
put line cd fld klockhjSlp2 of cd fld "in there" into cd fld "klocka"
select line 1 to 2 of cd fld "in there"
add 0.01 to cd fld klocka
end if
if cd fld klocka="" then
flash 1
beep
put "0.0" into cd fld klocka
answer "Program is complete" with "OK"
if it=ok then
put line 1 of cd fld "in there" into cd fld "spelar nu"
exit clock
end if
end if
if char 2 of cd fld klocka="." then
put char 3 to 4 of cd fld klocka into bo
end if
if char 3 of cd fld klocka="." then
put char 4 to 5 of cd fld klocka into bo
end if
if char 2 of bo="" then put 0 into char 2 of bo
put 0 into bob
repeat
if cd fld darkness=eki then
if char 2 of cd fld datortid2="." then
put char 3 to 4 of cd fld datortid2 into bob
end if
if char 3 of cd fld datortid2="." then
put char 4 to 5 of cd fld datortid2 into bob
end if
if char 4 of cd fld datortid2="." then
put char 5 to 6 of cd fld datortid2 into bob
end if
put "" into cd fld darkness
end if
put the seconds into am
if the mouseclick then
if the mouseloc is within rect of btn "skippa program" then
put 1 into cd fld klockhjSlp
put 2 into cd fld klockhjSlp2
subtract 0.01 from cd fld datortid2
flash 1
beep
put "0.0" into cd fld klocka
answer "Program is complete" with "OK"
if it=ok then
put line 1 of cd fld "in there" into cd fld "spelar nu"
exit repeat
end if
end if
if the mouseloc is within rect of btn "nSsta programdel ->" then
subtract cd fld klocka from cd fld extratid
if cd fld extratid<0 then
if char 2 of cd fld extratid="." then
if char 3 of cd fld extratid>5 then
add 0.60 to cd fld extratid
subtract 1 from cd fld extratid
end if
end if
if char 3 of cd fld extratid="." then
if char 4 of cd fld extratid>5 then
add 0.60 to cd fld extratid
subtract 1 from cd fld extratid
end if
end if
if char 4 of cd fld extratid="." then
if char 5 of cd fld extratid>5 then
add 0.60 to cd fld extratid
subtract 1 from cd fld extratid
end if
end if
if char 5 of cd fld extratid="." then
if char 6 of cd fld extratid>5 then
add 0.60 to cd fld extratid
subtract 1 from cd fld extratid
end if
end if
if cd fld extratid<0 then
hide cd fld korss
end if
end if
add 3 to cd fld klockhjSlp
add 3 to cd fld klockhjSlp2
put line cd fld klockhjSlp of cd fld "in there" into cd fld "spelar nu"
put line cd fld klockhjSlp2 of cd fld "in there" into cd fld "klocka"
select line cd fld klockhjSlp2 of cd fld "in there"
if char 2 of cd fld "klocka"="." then
put char 3 to 4 of cd fld klocka into bo
end if
if char 3 of cd fld "klocka"="." then
put char 5 to 6 of cd fld klocka into bo
end if
add 1 to bo
add 0.01 to cd fld klocka
end if
end if
subtract 1 from bo
subtract 0.01 from cd fld klocka
if bo=0 then
if cd fld klocka=0 then
put cd fld "spelar nu" into cd fld "spelar nu2"
if second item of cd fld "spelar nu2" is not " --->" then
put bob into cd fld kill
put bo into cd fld kill2
do script of btn fortsStt
end if
add 3 to cd fld klockhjSlp
add 3 to cd fld klockhjSlp2
put line cd fld klockhjSlp of cd fld "in there" into cd fld "spelar nu"
put line cd fld klockhjSlp2 of cd fld "in there" into cd fld "klocka"
select line cd fld klockhjSlp2 of cd fld "in there"
if char 2 of cd fld "klocka"="." then
put char 3 to 4 of cd fld klocka into bo
end if
if char 3 of cd fld "klocka"="." then
put char 5 to 6 of cd fld klocka into bo
end if
if bo=0 then
wait until the seconds is not am
add 0.01 to cd fld datortid2
add 1 to bob
if bob=60 then
put 0 into bob
subtract 0.60 from cd fld datortid2
add 1 to cd fld datortid2
end if
put 59 into bo
add 0.59 to cd fld klocka
subtract 1 from cd fld klocka
put the seconds into am
end if
else
wait until the seconds is not am
add 0.01 to cd fld datortid2
add 1 to bob
if bob=60 then
put 0 into bob
subtract 0.60 from cd fld datortid2
add 1 to cd fld datortid2
end if
put 59 into bo
add 0.59 to cd fld klocka
subtract 1 from cd fld klocka
put the seconds into am
end if
end if
put the long time into cd fld datortid
add 0.01 to cd fld datortid2
add 1 to bob
if bob=60 then
put 0 into bob
subtract 0.60 from cd fld datortid2
add 1 to cd fld datortid2
end if
wait until the seconds is not am
if cd fld klocka="" or cd fld klocka<0 or cd fld klocka=0 then
subtract 0.01 from cd fld datortid2
flash 1
beep
put "0.0" into cd fld klocka
answer "Program is complete" with "OK"
if it=ok then
put line 1 of cd fld "in there" into cd fld "spelar nu"
exit repeat
end if
end if
end repeat
end clock
-- following lines for demo purposes
on openCard
hide bg btn "Use Clipboard"
drawCD
end openCard
on closeCard
show bg btn "Use Clipboard"
pass closeCard
end closeCard
Keep this extensive resource of tutorials and samples on-line! Support RunRev.info!
| Yes, this script is useful. I make a donation and choose freely how much I want to donate on-line (PayPal). Click here if you want to make a donation in dollars. | This script has not (completely) solved my problem and I want Economy-x-Talk to take care of it. Let me contact you. |
Copyright©2002-2008 by Mark Schonewille, Nijmegen, the Netherlands. This web site is in no way affiliated with Runtime Revolution Ltd., but we do recommend the Revolution development platform.