👨‍💻 dev creamers of the corn

development

owly

闇の伝説
Staff member
戦闘 コーダー
we have reached a point where we have many skills. not great not terrible.
thing is, now we need a catalog, to serve as a quick reference as well as a roadmap of shit to come

**********
*defconic*
**********
motivational
philosophy
spider sense
hunger
home returner

****************
*conversational*
****************
logger
reminders
cusser

*******
*filth*
*******
echo

*******
*tools*
*******
recipes
list extractor
auto coder
predictor/story teller
traslator
search engine

*******
*feeds*
*******

news
weather


******************
*gamification(-+)*
******************

********
*friend*
********
empathy
befriender
fitness(workout/yoga)
greeter

*********
*monitor*
*********
trader
emotion awareness
skill awareness
 

fukurou

the supreme coder
ADMIN
Python:
        if temp:
            result = self.rcb.respondDialog(temp)
            if self.filter.strContainsResponse(result):
                return  # filter out
            self.rcb.learnV2(temp, self.elizaDeducer)
            self.setSimpleAlg(Eliza.PhraseMatcher.reflect(result))
 

fukurou

the supreme coder
ADMIN
Python:
class DiDeducer(Skill):
    def __init__(self, deducer: ElizaDeducer):
        super().__init__()
        self.rcb: RailChatBot = RailChatBot()
        self.dialog: AXCmdBreaker = AXCmdBreaker("babe")
        self.filter: UniqueItemSizeLimitedPriorityQueue = UniqueItemSizeLimitedPriorityQueue(5)
        self.bads: AXCmdBreaker = AXCmdBreaker("is bad")
        self.goods: AXCmdBreaker = AXCmdBreaker("is good")
        self.filterTemp: str = ""
        self.elizaDeducer: ElizaDeducer = deducer

    def setQueLim(self, lim):
        self.filter.setLimit(lim)

    def input(self, ear, skin, eye):
        # filter learn:
        self.filterTemp = self.bads.extractCmdParam(ear)
        if self.filterTemp:
            self.filter.insert(self.filterTemp)
            self.filterTemp = ""
            self.setSimpleAlg("i will keep that in mind")
            return
        self.filterTemp = self.goods.extractCmdParam(ear)
        if self.filterTemp:
            self.filter.removeItem(self.filterTemp)
            self.filterTemp = ""
            self.setSimpleAlg("understood")
            return
        if self.filter.strContainsResponse(ear):
            return  # filter in
        temp = self.dialog.extractCmdParam(ear)
        if temp:
            self.rcb.learnV2(temp, self.elizaDeducer)
            result = self.rcb.respondDialog(temp)
            if self.filter.strContainsResponse(result):
                return  # filter out
            self.setSimpleAlg(result)
 

fukurou

the supreme coder
ADMIN
Python:
from AXPython import RegexUtil
from LivinGrimoire23 import Skill, Brain
import serial
import time
import atexit
import serial.tools.list_ports


# terminal: pip install pyserial

def is_port_available(param):
    ports = serial.tools.list_ports.comports()
    for port in ports:
        if port.device == param:
            return True
    return False


name_of_port = 'COM3'
if is_port_available(name_of_port):
    ser = serial.Serial(name_of_port, 9600, timeout=0.1)
    print("Arduino connected successfully.")
else:
    ser = None
    print("Arduino not connected. Please check the connection.")


def close():
    if ser:
        ser.close()


class SerialReader:

    @staticmethod
    def read_serial_data(num_readings=10) -> str:
        try:
            for _ in range(num_readings):
                if ser.in_waiting > 0:
                    line = ser.readline().decode('utf-8').rstrip()
                    line = RegexUtil.extractRegex("[-+]?[0-9]{1,3}", line)
                    if len(line) > 0 and line != "0":
                        return f'{int(line) - 10}'
                time.sleep(1)  # Delay between readings
        except serial.SerialException as e:
            return f"Error reading serial data: {e}"
        return "i do not know"


class DiArduinoTemperature(Skill):
    # example skill for reading Arduino data
    def __init__(self):
        super().__init__()

    # Override
    def input(self, ear: str, skin: str, eye: str):
        if ear == "check temperature":
            self.setVerbatimAlg(4, SerialReader.read_serial_data())


class DiBlinker(Skill):
    # blinks the Arduino led, this is an example of sending commands to the Arduino
    def __init__(self):
        super().__init__()

    # Override
    def input(self, ear: str, skin: str, eye: str):
        if ear == "blink":
            self.setVerbatimAlg(4, "blinking")
            ser.write(b'1')


def add_DLC_skills(brain: Brain):
    atexit.register(close)  # wrap up serial object when program closes
    brain.add_logical_skill(DiArduinoTemperature())
    brain.add_logical_skill(DiBlinker())

Python:
        babble_tmp.append(PhraseMatcher("you are just a (.*)", [
            AXKeyValuePair("you are just a {0}", "i will be the best {0} then"),
            AXKeyValuePair("you are just a {0}", "kiss my {0} butt")
        ]))  # anti bully

Python:
class DiDeducer(Skill):
    def __init__(self, deducer: ElizaDeducer):
        super().__init__()
        self.rcb: RailChatBot = RailChatBot()
        self.dialog: AXCmdBreaker = AXCmdBreaker("babe")
        self.filter: UniqueItemSizeLimitedPriorityQueue = UniqueItemSizeLimitedPriorityQueue(5)
        self.bads: AXCmdBreaker = AXCmdBreaker("is bad")
        self.goods: AXCmdBreaker = AXCmdBreaker("is good")
        self.filterTemp: str = ""
        self.elizaDeducer: ElizaDeducer = deducer

    def setQueLim(self, lim):
        self.filter.setLimit(lim)

    def input(self, ear, skin, eye):
        # filter learn:
        self.filterTemp = self.bads.extractCmdParam(ear)
        if self.filterTemp:
            self.filter.insert(self.filterTemp)
            self.filterTemp = ""
            self.setSimpleAlg("i will keep that in mind")
            return
        self.filterTemp = self.goods.extractCmdParam(ear)
        if self.filterTemp:
            self.filter.removeItem(self.filterTemp)
            self.filterTemp = ""
            self.setSimpleAlg("understood")
            return
        if self.filter.strContainsResponse(ear):
            return  # filter in
        temp = self.dialog.extractCmdParam(ear)
        if temp:
            self.rcb.learnV2(temp, self.elizaDeducer)
            result = self.rcb.respondDialog(temp)
            if self.filter.strContainsResponse(result):
                return  # filter out
            self.setSimpleAlg(result)
 
Top