View difference between Paste ID: PzyPduZk and bQQ6KKE9
SHOW: | | - or go back to the newest paste.
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
}