!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); } }