Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

23
LINES

< > BotCompany Repo | #1016087 // Notebook Lid

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (3213L/17K).

!7

cmodule NotebookLid > DynBigNumber {
  transient Bool openLast;
  transient long openSince;
  
  start {
    setDescription("Notebook Lid");
    ownTimer(doEvery(1.0, r updateMe));
  }
  
  void update {
    Bool open = isNotebookLidOpen();
    if (isTrue(open) && isFalse(openLast)) {
      openSince = now();
      dm_say("Hello");
    } else if (isFalse(open) && isTrue(openLast))
      dm_say("Bye");
    openLast = open;
    setValue(now() < openSince + 10000 ? "JUST OPENED"
      : nullFalseTrue(open, "?", "CLOSED", "OPEN"));
  }
}

Author comment

Began life as a copy of #1016082

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016087
Snippet name: Notebook Lid
Eternal ID of this version: #1016087/15
Text MD5: 0b47b77b6fe7a483a6d8f28cd083cc17
Transpilation MD5: a6a17c908dd50ece825e13b59db69af7
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-08 13:42:50
Source code size: 565 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 383 / 7344
Version history: 14 change(s)
Referenced in: [show references]