Libraryless. Click here for Pure Java version (15723L/110K).
1 | !7 |
2 | |
3 | module TurnOnWebCamRandomly > DynPrintLogAndEnabled {
|
4 | start {
|
5 | doLater(random(5.0, 20.0), r startCam); |
6 | } |
7 | |
8 | void startAgain {
|
9 | doLater(random(180.0), r startCam); |
10 | } |
11 | |
12 | void startCam enter {
|
13 | // TODO: choose favorite web cam |
14 | if (enabled) pcall {
|
15 | printWithTime("Starting web cam");
|
16 | dm_startWebCam(); |
17 | BufferedImage img = dm_waitForWebCamImage(10.0); |
18 | if (img != null) {
|
19 | printWithTime("[showing image]");
|
20 | S text = dm_kevin("You look so stupid dude");
|
21 | showAnim(img, printWithTime(text), 5.0); |
22 | doLater(5.0, r { infoBox(dm_kevin("(just kidding)")) });
|
23 | } |
24 | } |
25 | doLater(random(20.0, 30.0), r stopCam); |
26 | } |
27 | |
28 | void stopCam enter {
|
29 | if (enabled) pcall {
|
30 | printWithTime("Stopping web cam");
|
31 | dm_stopWebCam(); |
32 | } |
33 | startAgain(); |
34 | } |
35 | } |
download show line numbers debug dex old transpilations
Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1019961 |
| Snippet name: | Turn On Web Cam Randomly [OK] |
| Eternal ID of this version: | #1019961/22 |
| Text MD5: | 7176389860125cc834e83a3235b61268 |
| Transpilation MD5: | c64a91aa733eb2c322cf1ce755ed3f76 |
| Author: | stefan |
| Category: | javax / automation |
| Type: | JavaX source code (Dynamic Module) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-12-02 13:47:44 |
| Source code size: | 867 bytes / 35 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 905 / 2025 |
| Version history: | 21 change(s) |
| Referenced in: | [show references] |