battle programmers alliance
Would you like to react to this message? Create an account in a few clicks or log in to continue.

battle programmers allianceLog in

the LivinGrimoire Artificial General Intelligence software design pattern forum

descriptioncheer skill DJirachi ver 1 (chobit skill) Emptycheer skill DJirachi ver 1 (chobit skill)

more_horiz


Code:

import java.util.ArrayList;

public class DJirachi extends AbsCmdReq implements Neuronable {
 private ArrayList<String> triggerList = new ArrayList<>();
 final private String startTrigger = "cheer me";
 final private String stopTrigger = "ok";
 final private String cheer = "user fighto";
 private Boolean mode = false;
 private Boolean doIt = false;

 public DJirachi() {
 // TODO Auto-generated constructor stub
 triggerList.add("help me");
 triggerList.add("chii");
 }

 @Override
 public void output(Neuron noiron) {
 // TODO Auto-generated method stub
 if (doIt) {
 AbsAlgPart itte = new APSay(1, cheer);
 String representation = "cheer";
 ArrayList<AbsAlgPart> algParts1 = new ArrayList<>();
 algParts1.add(itte);
 Algorithm algorithm = new Algorithm("cheer", representation, algParts1);
 noiron.algParts.add(algorithm);
 doIt = false;
 }
 }

 @Override
 public void input(String ear, String skin, String eye) {
 if (ear.equals(stopTrigger)) {
 mode = false;
 return;
 }
 if (ear.equals(startTrigger)) {
 mode = true;
 return;
 }
 if (mode && triggerList.contains(ear)) {
 doIt = true;
 }
 }
}



yaruki dete kitta :chobit:

descriptioncheer skill DJirachi ver 1 (chobit skill) EmptyRe: cheer skill DJirachi ver 1 (chobit skill)

more_horiz
here it is in the chobit class :

Code:


protected String doIt2(String ear, String skin, String eye) {
      // this is the main function
      // works regardless of permissions
      inOut(detective, ear, skin, eye);
      inOut(dJirachi, ear, skin, eye);// done
      inOut(dPermitter, ear, skin, eye);
      inOut(dRules, ear, skin, eye);
      inOut(dSpeller, ear, skin, eye);
      inOut(dAlarmer, "", "", "");
        if (dPermitter.getPermissionLevel() > 0) {
            // works with friends
         inOut(dSayer, ear, skin, eye);
        }
        if (dPermitter.getPermissionLevel() > 1) {
            // only works with owner
         inOut(dAlarmer, ear, skin, eye);
         inOut(dDirtyTalker, ear, skin, eye);
        }
        fusion.setAlgQueue(noiron);
      DCStrPair<String> result = new DCStrPair<String>();
      result = fusion.act(ear, skin, eye);
        this.emot = fusion.getEmot();
      return itemFilter(result);
    }


one line of code and a skill was added
privacy_tip Permissions in this forum:
You cannot reply to topics in this forum
power_settings_newLogin to reply