Advertisement
Guest User

Untitled

a guest
Apr 1st, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.smellapps.smeller;
  2.  
  3. public class DetectSmell {
  4.  
  5. static int USERCANSMELL = 0;
  6. public Nose nose;
  7. public Body body;
  8.  
  9. public DetectSmell(){
  10.  nose = new Nose(getSystemNoseSensor(), null);
  11.  body = new Body(getHostBodyMechanism(), true);
  12. }
  13. public void onSmell(Vars[] vars){
  14. try{
  15.  
  16.  SmellParser smells = new SmellParser();
  17.  Smell smell = smells.identifySmell(vars.get(1)).getSmellObject();
  18. } catch(SmellException e) {
  19. System.out.println("No smell was detected!")
  20. }
  21. TextView smellText = new TextView("");
  22. smellText.setText(smell.getSmellLabel());
  23.  
  24. if (nose.detectedSmell() == Sensory.COCAINE) {
  25. body.setToFreakTheFuckOut(true);
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement