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

82
LINES

< > BotCompany Repo | #1004078 // Android Awareness (Battery Bot + Dex Bot + File Op Bot + Proxy Bot + Public Comm Bot)

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (8708L/61K/196K).

!759

!include #1005410 // Awareness Include

static volatile int level = -1; // battery level

static int alarmIntervalMinutes = 10;

p {
  print("Context: " + androidContext());
  
  if (eq("alarm", get(args, 0))) pcall {
    androidCancelRepeatingAlarm("#1004078");
    androidEnableRepeatingAlarm(alarmIntervalMinutes*60000, alarmIntervalMinutes*60000, "#1004078");
  }
  
  if (match("i am aware", sendToLocalBotOpt_original("Awareness Bot", "are you aware"))) {
    print("Has awareness.");
    ret;
  }
  
  pcall {
    androidToast("Yo Setting Up Awareness...");
  }
    
  androidSay_keepEngine = true;
  makeBot("Battery Bot.");
  makeBot("Dex Bot.");
  makeBot("Awareness Bot.");
  phonePublicCommBot();
  findBot_timeout = 1000*60;
  pingThread(r {
    logQuoted("batt.log", chatTime() + " " + (level = androidGetBattery()));
  });
  //androidSayInEnglish(""); // init to english for quick response to say statements
  
  pcall {
    androidToast("Awareness Set Up!");
    print("Awareness Set Up!");
  }
  
  printMyIPs();
}

answer {
  try {
    if "please load this dex: *"
      ret loadDex(hexToBytes(m.unq(0)), false); 
    if "please load and run this dex: *"
      ret loadDex(hexToBytes(m.unq(0)), true); 
    if "quick run dex *"
      ret quickRunDex(hexToBytes(m.unq(0)));
        
    try answer proxyBot(s);
    
    synchronized(mc()) {
      if "are you aware" ret "i am aware";
      if "are you android" ret "yes";
      if "Ping" ret "pong";
      if "battery level"
        //ret level + " %";
        ret androidGetBattery() + "%";
      if "say in english *" {
        thread "Speaking" {
          androidSayInEnglish(m.unq(0));
        }
        ret "OK";
      }
      if "say in english now *" {
        androidSayInEnglish(m.unq(0));
        ret "OK";
      }
      try answer fileOpBot(s);
      if "get android home"
        ret ok(f2s((File) call(androidContext, "getFilesDir")));

      try answer awarenessBot(s);
    }
  } catch e {
    ret "ERROR: " + getStackTrace(e);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 171 computer(s): aoiabmzegqzx, bfooyqadtzbb, bhatertpkbcr, brfxcrgsgrhg, buifbzwrwcym, cbtggpbitkpu, cbybwowwnfue, cfunsshuasjs, connxhvfqtma, cpotljmdzwut, crvwmplrxojx, cxqxidysfkth, dbyzmesgzjrf, ddnzoavkxhuk, digkpvzjadop, dlyzodsxvbls, doutfcgsyoqy, dsbpoofgtjnx, dtyaoxivooce, dvunbatbnajs, dvxvdlhqlwwc, dyfldxrfteug, ecqjixtmvxlp, egsshdfjpivr, eozaicwrnmri, ezeddxofnljr, fhfjdzkfxlbj, flwlchajcels, fnmrsykwqckh, fqrowglitjmz, funhxakgkfno, fvctnogetyww, fwsfnrxjlvle, gavnqejikrat, gbdqvketdppm, gqhbhyymrpxx, grraasralroa, gsrwncdeurkl, gtrxugguieza, gveowxfxqtil, gwrvuhgaqvyk, gzronoodcfmh, hkknpzsgoixq, honjdlwrmtdu, htkmirzsdzmu, hvbppbdwfhjy, hzpzjwjgvcrr, idcfvzviszxn, ifxxhhcvckaw, igfbtfetlyvk, ihhfaimhzfdu, inzdgbwbursp, ipcmaqahdjtn, ishqpsrjomds, ivagervvdxrj, jaezsmbrhigw, jbarrfjkhowm, jgjqzccotruy, jhnqykpxgsbl, jlfdhaxjyrpf, jrjpqrqxafhk, jtwzfcwerbbv, jubvyydqgymk, jwlibnwemntm, kiawvgutsbre, kkwybtkpyotm, lcawhpckrzve, ldywjnwigrac, ledgnsvlgdlr, lfjgsyhgiptj, lgdvxdgcpgrv, lkrtzecmugaq, lldtbxzncybz, lnjhkqwteiwi, lpdgvwnxivlt, lqsqiistucwk, lsgdidgppwqq, lwfphbruhgtm, lzgehfbjsfkh, mdbqpbajgrux, mdefezkwdeup, meaqxkopohqc, mmaxggujatqf, mmmwsgafmleu, mnzieskfvskl, mqqgnosmbjvj, mrmohjpeebfc, mwwkogzcbmpq, nbgitpuheiab, ndavzgiapdkk, nmhwwpuvbanc, nrhsverhnpsn, nrvadtjxpxwv, odccbeesmgrc, omrbxrqoiqeh, onxytkatvevr, opsabzhijxss, owkcekpozlzc, pekvfmzvrlzt, pgppnpcqwliz, pidvqqudxurz, plbffmaqlxtr, pnmttuucjkfb, ppwwtnwhztze, projrnnbjcax, pyentgdyhuwx, pzhvpgtvlbxg, qbowdrloqspj, qdihqxvjryuq, qhcvkqotyiga, qhhqrodowzfo, qlbamcgvoztb, qmupjbhcwcol, qnhezvwmdcbn, quisjpqxfggn, recxuykagbtt, rkwmzlyryntx, rmuapfwsxktw, rnmscfuoljlp, rockneqxsfll, sksrqysvpwbz, skttnvmfkzhq, slhtubpyutdj, tcpfgdjhqqpe, tguojfckhoqc, tjmheftkjvzt, tpcbwahvpzrm, tpdfwrfxnmsq, tslmcundralx, tsuzdeebumli, tucydzhuhpyp, tvejysmllsmz, tvkpfieynkqz, twqnfdxxpuxv, txvdafyrfdei, txzhwycxdpzm, tzxuzeklshpk, ucpxxyxryupy, ulfxqbzbkqdu, umpqpbvfwjre, unkrhppcbqnk, uvkibmskjcsb, uzhyvevygbcc, uzkajkufykfo, uzolovmvtubr, vdgqpiitesmp, vgjwidwdhwnw, vouqrxazstgt, vqblocesogdc, vxshqlgoesuw, vzikmbzhlvqi, whwpvezoxzgq, winwedijdyqq, wlpgjdwojrfw, wtjuwcnefrcw, wwghvftpbobq, wxhtzmczqxde, wxzrvoaczrhr, xcaxdvrpbipu, yabhydzhqlvs, ybmhnqzijvxm, yjcobudmfboh, yjprkgrpedlo, ymicnlqhuozx, yqkyyimflwur, yuicjtqnulgz, ywixcsqzavbw, zfxpbznyxnpx, zndhoewobdyk, zrzaeipbowrh, ztgjuucfqghy

No comments. add comment

Snippet ID: #1004078
Snippet name: Android Awareness (Battery Bot + Dex Bot + File Op Bot + Proxy Bot + Public Comm Bot)
Eternal ID of this version: #1004078/2
Text MD5: 988f9a10c481ebf3bc0630359b42873d
Transpilation MD5: 7b264603e109217a57eb4d5edfddf8b1
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-03 14:59:01
Source code size: 2104 bytes / 82 lines
Pitched / IR pitched: No / No
Views / Downloads: 917 / 4045
Version history: 1 change(s)
Referenced in: [show references]