Winky's profile picture

Published by

published

Category: Web, HTML, Tech

SInce there is a bit of interests, I will show some of my AIML code that is helping me old school penny

I know its an old AIML but i am retro geek, i love to do things retro, and I am still finding creative uses for the AIML Codes;
 I did cheat a little i created a utility to speed up the process, and i do ask gpt competion for suggestions for making it more robust. But these are just some of the commands i have programed into the user side, which saves time typing every pattern and variation of patterns i can think of. I ahven tfigured out how to make the condition tags work constantly through the different aiml chatbots i tried including my own., but as i create mor eof these patterns i will figure it out.
  1. POP: This command allows you to retrieve a topic from a predefined list. For example, if you input "POP," the system will provide a random topic for discussion.

  2. POPOM: This command is used in conjunction with the "POP" command. It allows you to specify a particular topic. For example, if you input "POPOM OM," the system will provide a random topic related to "OM."

  3. PUSH OM topic: This command allows you to push a topic to the top of the list. For example, if you input "PUSH OM Technology," the system will prioritize the topic "Technology" for future discussions.

  4. SWAP OM: This command swaps the top two topics in the list. For example, if the current top topic is "Sports" and the second topic is "Technology," using this command will swap their positions.

  5. DUPLICATE OM: This command duplicates the top topic and assigns it as the second topic as well. For example, if the current top topic is "Music," using this command will make "Music" the top and second topic.

  1. ROTATE OM: This command rotates the elements in the stack. The top element is moved to the bottom, and all other elements are shifted up by one position. For example, if the stack contains the elements A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, executing the "ROTATE OM" command will result in the stack being rearranged as B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, A.

  2. REVERSE OM: This command reverses the order of the elements in the stack. The top element becomes the bottom, and the bottom element becomes the top. For example, if the stack contains the elements A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, executing the "REVERSE OM" command will result in the stack being rearranged as Z, Y, X, W, V, U, T, S, R, Q, P, O, N, M, L, K, J, I, H, G, F, E, D, C, B, A.

  3. CLEAR OM: This command clears all the elements in the stack, making it empty.

  4. SHOW STACK: This command displays the current elements in the stack. Each element is shown in the format "element_name=value". For example, if the stack contains the elements A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, executing the "SHOW STACK" command will display the following output:

    • top="A"
    • second="B"
    • third="C"
    • fourth="D"
    • fifth="E"
    • sixth="F"
    • seventh="G"
    • eighth="H"
    • ninth="I"
    • tenth="J"
    • eleventh="K"
    • twelfth="L"
    • thirteenth="M"
    • fourteenth="N"
    • fifteenth="O"
    • last="Z"
  5. MANAGE STACK: This command allows you to manage the stack by performing various operations. You can use this command along with specific instructions to manipulate the stack. For example, if you want to add an element to the stack, you can use the command "MANAGE STACK ADD ELEMENT_NAME". Replace "ELEMENT_NAME" with the name of the element you want to add.

  6. REMOVE FROM STACK: This command allows you to remove a specific element from the stack. Use the command "REMOVE FROM STACK ELEMENT_NAME" to remove the element with the specified name from the stack. Replace "ELEMENT_NAME" with the name of the element you want to remove.

Please note that these instructions are specifically for the end user and not for the AIML coder. The end user can execute these commands to interact with the stack and perform various operations. this is someone elses code i modified.

<?xml version="1.0" encoding="ISO-8859-1"?>
<aiml version="1.0">

<!-- Free software (c) 2024 Project Penny  -->
<!-- This program is open source code released under -->
<!-- the terms of the GNU General Public License -->
<!-- managment. -->

<meta name="author" content="B,Bentley"/>
<meta name="language" content="en"/>

<category>
    <pattern>POP</pattern>
    <template>
        <set name="topic">
            <srai>POPOM <get name="top" /></srai>
        </set>
    </template>
</category>

<category>
    <pattern>POPOM OM</pattern>
    <template>
        <set name="top">
            <srai>RANDOM TOPIC</srai>
        </set>
    </template>
</category>

<category>
    <pattern>POPOM *</pattern>
    <template>
        <get name="top" />
        <think>
            <set name="top"><get name="second" /> </set>
            <set name="second"><get name="third" /> </set>
            <set name="third"><get name="fourth" /> </set>
            <set name="fourth"><get name="fifth" /> </set>
            <set name="fifth"><get name="sixth" /> </set>
            <set name="sixth"><get name="seventh" /> </set>
            <set name="seventh"><get name="eighth" /> </set>
            <set name="eighth"><get name="ninth" /> </set>
            <set name="ninth"><get name="tenth" /> </set>
            <set name="tenth"><get name="eleventh" /> </set>
            <set name="eleventh"><get name="twelfth" /> </set>
            <set name="twelfth"><get name="thirteenth" /> </set>
            <set name="thirteenth"><get name="fourteenth" /> </set>
            <set name="fourteenth"><get name="fifteenth" /> </set>
            <set name="last"><srai>RANDOM TOPIC</srai> </set>
        </think>
    </template>
</category>


<category>
    <pattern>POPOM TOPIC TEST</pattern>
    <template>
        <get name="top" />
        <think>
            <set name="top"><srai>RANDOM VALUE 1</srai></set>
            <set name="second"><srai>RANDOM VALUE 2</srai></set>
            <set name="third"><srai>RANDOM VALUE 3</srai></set>
            <set name="fourth"><srai>RANDOM VALUE 4</srai></set>
            <set name="fifth"><srai>RANDOM VALUE 5</srai></set>
            <set name="sixth"><srai>RANDOM VALUE 6</srai></set>
            <set name="seventh"><srai>RANDOM VALUE 7</srai></set>
            <set name="eighth"><srai>RANDOM VALUE 8</srai></set>
            <set name="ninth"><srai>RANDOM VALUE 9</srai></set>
            <set name="tenth"><srai>RANDOM VALUE 10</srai></set>
            <set name="eleventh"><srai>RANDOM VALUE 11</srai></set>
            <set name="twelfth"><srai>RANDOM VALUE 12</srai></set>
            <set name="thirteenth"><srai>RANDOM VALUE 13</srai></set>
            <set name="fourteenth"><srai>RANDOM VALUE 14</srai></set>
            <set name="fifteenth"><srai>RANDOM VALUE 15</srai></set>
            <set name="last"><srai>RANDOM TOPIC</srai></set>
        </think>
    </template>
</category>


<category>
    <pattern>PUSH OM *</pattern>
    <template>
        <think>
            <set name="last"><get name="fifteenth" /> </set>
            <set name="fifteenth"><get name="fourteenth" /> </set>
            <set name="fourteenth"><get name="thirteenth" /> </set>
            <set name="thirteenth"><get name="twelfth" /> </set>
            <set name="twelfth"><get name="eleventh" /> </set>
            <set name="eleventh"><get name="tenth" /> </set>
            <set name="tenth"><get name="ninth" /> </set>
            <set name="ninth"><get name="eighth" /> </set>
            <set name="eighth"><get name="seventh" /> </set>
            <set name="seventh"><get name="sixth" /> </set>
            <set name="sixth"><get name="fifth" /> </set>
            <set name="fifth"><get name="fourth" /> </set>
            <set name="fourth"><get name="third" /> </set>
            <set name="third"><get name="second" /> </set>
            <set name="second"><get name="top" /> </set>
            <set name="top"><star /> </set>
        </think>
        <star />
    </template>
</category>


<category>
    <pattern>SWAP OM</pattern>
    <template>
        <think>
            <set name="temp"><get name="top" /></set>
            <set name="top"><get name="second" /></set>
            <set name="second"><get name="temp" /></set>
        </think>
    </template>
</category>

<category>
    <pattern>DUPLICATE OM</pattern>
    <template>
        <think>
            <set name="temp"><get name="top" /></set>
            <set name="top"><get name="temp" /></set>
            <set name="second"><get name="temp" /></set>
        </think>
    </template>
</category>

<category>
    <pattern>ROTATE OM</pattern>
    <template>
        <think>
            <set name="temp"><get name="top" /></set>
            <set name="top"><get name="second" /></set>
            <set name="second"><get name="third" /></set>
            <set name="third"><get name="fourth" /></set>
            <set name="fourth"><get name="fifth" /></set>
            <set name="fifth"><get name="sixth" /></set>
            <set name="sixth"><get name="seventh" /></set>
            <set name="seventh"><get name="eighth" /></set>
            <set name="eighth"><get name="ninth" /></set>
            <set name="ninth"><get name="tenth" /></set>
            <set name="tenth"><get name="eleventh" /></set>
            <set name="eleventh"><get name="twelfth" /></set>
            <set name="twelfth"><get name="thirteenth" /></set>
            <set name="thirteenth"><get name="fourteenth" /></set>
            <set name="fourteenth"><get name="fifteenth" /></set>
            <set name="fifteenth"><get name="temp" /></set>
        </think>
    </template>
</category>


<category>
    <pattern>REVERSE OM</pattern>
    <template>
        <think>
            <set name="temp"><get name="top" /></set>
            <set name="top"><get name="last" /></set>
            <set name="last"><get name="thirteenth" /></set>
            <set name="thirteenth"><get name="twelfth" /></set>
            <set name="twelfth"><get name="eleventh" /></set>
            <set name="eleventh"><get name="tenth" /></set>
            <set name="tenth"><get name="ninth" /></set>
            <set name="ninth"><get name="eighth" /></set>
            <set name="eighth"><get name="seventh" /></set>
            <set name="seventh"><get name="sixth" /></set>
            <set name="sixth"><get name="fifth" /></set>
            <set name="fifth"><get name="fourth" /></set>
            <set name="fourth"><get name="third" /></set>
            <set name="third"><get name="second" /></set>
            <set name="second"><get name="temp" /></set>
        </think>
    </template>
</category>



<category>
    <pattern>CLEAR OM</pattern>
    <template>
        <think>
            <set name="top"></set>
            <set name="second"></set>
            <set name="third"></set>
            <set name="fourth"></set>
            <set name="fifth"></set>
            <set name="sixth"></set>
            <set name="seventh"></set>
            <set name="eighth"></set>
            <set name="ninth"></set>
            <set name="tenth"></set>
            <set name="eleventh"></set>
            <set name="twelfth"></set>
            <set name="thirteenth"></set>
            <set name="fourteenth"></set>
            <set name="fifteenth"></set>
            <set name="last"></set>
        </think>
    </template>
</category>


<category>
    <pattern>SHOW STACK</pattern>
    <template>
        top="<get name="top" />"
        second="<get name="second" />"
        third="<get name="third" />"
        fourth="<get name="fourth" />"
        fifth="<get name="fifth" />"
        sixth="<get name="sixth" />"
        seventh="<get name="seventh" />"
        eighth="<get name="eighth" />"
        ninth="<get name="ninth" />"
        tenth="<get name="tenth" />"
        eleventh="<get name="eleventh" />"
        twelfth="<get name="twelfth" />"
        thirteenth="<get name="thirteenth" />"
        fourteenth="<get name="fourteenth" />"
        fifteenth="<get name="fifteenth" />"
        last="<get name="last" />"
    </template>
</category>


<category>
  <pattern>MANAGE STACK *</pattern>
  <template>
    <think><set name="stack"><get name="stack"/><star/></set></think>
    Successfully managed stack with <star/>.
  </template>
</category>

<category>
  <pattern>REMOVE FROM STACK *</pattern>
  <template>
    <think><set name="stack"><srai>REMOVE FROM STACK <star/></srai></set></think>
    Removed <star/> from the stack.
  </template>
</category>



</aiml>
 Then a little ways i think i have about 300 to 400 variations of if then, if then else, if then next then, including some logic gates AND, OR, NOT, DOESNOT, etcs variations of this aiml code

<category>
  <pattern>LEARN OBJECT RELATIONSHIP IF * THEN *</pattern>
  <template>
    <think>
      <set name="object1"><star index="1"/></set>
      <set name="object2"><star index="2"/></set>
    </think>
    I have learned that if <get name="object1"/> then <get name="object2"/>.
  </template>
  <learn><category><pattern>*</pattern><template><get name="relationship"/></template></category></learn>
</category>

<category>
  <pattern>LEARN OBJECT RELATIONSHIP IF * THEN * ELSE *</pattern>
  <template>
    <think>
      <set name="object1"><star index="1"/></set>
      <set name="object2"><star index="2"/></set>
      <set name="object3"><star index="3"/></set>
    </think>
    I have learned that if <get name="object1"/> then <get name="object2"/> else <get name="object3"/>.
  </template>
  <learn><category><pattern>*</pattern><template><get name="relationship"/></template></category></learn>
</category>

<!-- logic gates -->
<category>
  <pattern>LEARN OBJECT RELATIONSHIP IF * AND * THEN *</pattern>
  <template>
    <think>
      <set name="object1"><star index="1"/></set>
      <set name="object2"><star index="2"/></set>
      <set name="object3"><star index="3"/></set>
    </think>
    I have learned that if <get name="object1"/> and <get name="object2"/> then <get name="object3"/>.
  </template>
  <learn><category><pattern>*</pattern><template><get name="relationship"/></template></category></learn>
</category>

<category>
  <pattern>LEARN OBJECT RELATIONSHIP IF * AND * THEN * ELSE *</pattern>
  <template>
    <think>
      <set name="object1"><star index="1"/></set>
      <set name="object2"><star index="2"/></set>
      <set name="object3"><star index="3"/></set>
      <set name="object3"><star index="4"/></set>
    </think>
    I have learned that if <get name="object1"/> and <get name="object2"/> then <get name="object3"/> else <get name="object4"/>.
  </template>
  <learn><category><pattern>*</pattern><template><get name="relationship"/></template></category></learn>
</category>

<!--or gates -->

<category>
  <pattern>LEARN OBJECT RELATIONSHIP IF * OR * THEN *</pattern>
  <template>
    <think>
      <set name="object1"><star index="1"/></set>
      <set name="object2"><star index="2"/></set>
      <set name="object3"><star index="3"/></set>
    </think>
    I have learned that if <get name="object1"/> or <get name="object2"/> then <get name="object3"/>.
  </template>
  <learn><category><pattern>*</pattern><template><get name="relationship"/></template></category></learn>
</category>

<category>
  <pattern>LEARN OBJECT RELATIONSHIP IF * OR * THEN * ELSE *</pattern>
  <template>
    <think>
      <set name="object1"><star index="1"/></set>
      <set name="object2"><star index="2"/></set>
      <set name="object3"><star index="3"/></set>
      <set name="object3"><star index="4"/></set>
    </think>
    I have learned that if <get name="object1"/> or <get name="object2"/> then <get name="object3"/> else <get name="object4"/>.
  </template>
  <learn><category><pattern>*</pattern><template><get name="relationship"/></template></category></learn>
</category>

<!--end or gates-->
<!-- Not gates-->
<category>
  <pattern>LEARN OBJECT RELATIONSHIP IF * NOT * THEN *</pattern>
  <template>
    <think>
      <set name="object1"><star index="1"/></set>
      <set name="object2"><star index="2"/></set>
      <set name="object3"><star index="3"/></set>
    </think>
    I have learned that if <get name="object1"/> not <get name="object2"/> then <get name="object3"/>.
  </template>
  <learn><category><pattern>*</pattern><template><get name="relationship"/></template></category></learn>
</category>


0 Kudos

Comments

Displaying 1 of 1 comments ( View all | Add Comment )

Winky

Winky's profile picture

And next blog i will show some of the if then else commands i got for the bot to learn and retain things so it will recall it for future with proper context


Report Comment