Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.smellapps.smeller;
- public class DetectSmell {
- static int USERCANSMELL = 0;
- public Nose nose;
- public Body body;
- public DetectSmell(){
- nose = new Nose(getSystemNoseSensor(), null);
- body = new Body(getHostBodyMechanism(), true);
- }
- public void onSmell(Vars[] vars){
- try{
- SmellParser smells = new SmellParser();
- Smell smell = smells.identifySmell(vars.get(1)).getSmellObject();
- } catch(SmellException e) {
- System.out.println("No smell was detected!")
- }
- TextView smellText = new TextView("");
- smellText.setText(smell.getSmellLabel());
- if (nose.detectedSmell() == Sensory.COCAINE) {
- body.setToFreakTheFuckOut(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement