If you're using DBC enhanced, you should use this code :
sync on
sync rate 30
load dll "user32.dll",1
H=CALL DLL(1,"GetActiveWindow")
hide mouse
ink rgb(255,255,0),rgb(50,50,50)
circle 10,10,9
set text opaque
text 6,3,"1"
box 40,40,240,440
center text 205,180,"Coins"
Ink 1,1
box 100,330,180,370
box 200,200,210,230
sync:set text size 32
ink rgb(255,0,0),1
text 60,60,"COCA COLA"
sync
get image 1,0,0,20,20
get image 2,40,40,240,440
set text size 16
ink rgb(0,255,0),1
randomize timer()
position mouse 300,200
C=3
Do
cls
X=mouseX()
Y=mouseY()
O=M
M=mouseclick()
position mouse X+(5-rnd(10)),Y+(5-rnd(10))
Print "Put the coin into the Cola Machine to get a free drink"
Print "You still have ",C,"x coins. Click to use"
paste image 2,40,40
paste image 1,X,Y,1
If O=1 and M=0
If X>180 and X<210 and Y>180 and Y<230
cls
sync
S=1
For x=1 to 12
If x>6:S=16
endif
CALL DLL 1,"MessageBeep",S
sleep 150
next x
show mouse
CALL DLL 1,"MessageBoxA",H,"Click OK to get served Coca-Cola at Home.","Coca-Cola Coming...",48
load dll "winmm.dll",2
CALL DLL 2,"mciSendStringA","set CDAudio door open"," ",1,0
CALL DLL 1,"MessageBoxA",H,"Coca-Cola served into your own computer CD player. I love technology !!","Served.",48
CALL DLL 1,"MessageBoxA",H,"As you see, this is just another stupid way of wasting time...","Shame on me, Pyre, for coding this...",48
End
Else
Dec C
If C=0
End
Endif
endif
Endif
sync
loop
- Mind the gap -