here is a very simpler skill to explain the AGIs method of operation :



all it does is say "i love you" on MGTOW day which is feb 14th



Code:

public class DiMGTOWDay extends DiSkillV2 {

    private TrgExactDate trgExactDate = new TrgExactDate();



    public DiMGTOWDay(Kokoro kokoro) {

        super(kokoro);

        trgExactDate.setDate("2", "14");

    }



    @Override

    public void input(String ear, String skin, String eye) {

        // MGTOW day ?

        if (trgExactDate.trigger()) {

            // cook and send algorithm that will say "i love you"

            this.outAlg = super.diSkillUtils.simpleVerbatimAlgorithm("mgtow_day", "i love you");

            return;

        }

        // reenable the skill providing it's still MGTOW day

        if (ear.contains("day")) {

            trgExactDate.reset();

        }



    }

}




trgExactDate.trigger() simply sends true once, if it is the determined date :



Code:

public class TrgExactDate {

    // this trigger will sent true only once in the preset day

    private PlayGround pl = new PlayGround();

    private Boolean sent = false;

    private String dDay = "";



    public Boolean trigger() {

        String today = (pl.getMonthAsInt() + 1) + " " + pl.getDayOfTheMonthAsInt();

        if (dDay.equals(today) && !sent) {

            sent = true;

            return true;

        }

        // for the case the AI runs over a year straight

        if (!dDay.equals(today)) {

            sent = false;

        }

        return false;

    }



    public void reset() {

        sent = false;

    }



    public void setDate() {

        dDay = (pl.getMonthAsInt() + 1) + " " + pl.getDayOfTheMonthAsInt();

    }



    public void setDate(String dateOfMonth1, String month1) {

        dDay = dateOfMonth1 + " " + month1;

    }

}




in this skills case these 2 classes are the skill

if I want the AGI to have that skill, all I need to do is add it using 1 line of code :

(see if you can spot that line)



Code:

public class Personality2 extends Personality {

    public Personality2(AbsDictionaryDB absDictionaryDB) {

        super(absDictionaryDB);

        // add a skill here, only 1 line needed !!!

        // dClassesLv1.add(new Detective(fusion));

        dClassesLv1.add(new DSayer());

        dClassesLv1.add(new DiWorldClock(kokoro));

    }



    public Personality2() {

        super();

        dClassesLv1.add(new DSayer());

        dClassesLv1.add(new DiWorldClock(kokoro));

        dClassesLv1.add(new DiMGTOWDay(kokoro));

    }

}