Alright, I have bits and pieces from certain people that could help here, but I'm lost on the rest.

Here's what I want:

A script that randomly changes the variable %mood to one of these settings: Happy, Sad, Angry

After that I need it to pull and do a $read from a text file, based on the current value of %mood.

If %mood = happy then pull a $read from happy.txt
If %mood = sad then pull a $read from sad.txt
If %mood = angry then pull a $read from angry.txt

but it needs to be randomized.

[script]
n0=alias -l brandtime {
n1= var %lowtime = 100 | ; quickest duration between messages (in seconds)
n2= var %hightime = 500 | ; longest duration between messages (in seconds)
n3= return $rand(%lowtime,%hightime)
n4=}
n5=alias brandmsg {
n6= var %rline = $read(brand.txt)
n7= if (/me* iswm %rline) /describe $1 $gettok(%rline,2-,32)
n8= else /msg $1 %rline
n9= .timer [ $+ [ $1 ] ] 1 $brandtime brandmsg $1-
n10=}

The above script does a $read from the text named brand based on the random times caused by the settings of the 2 numbers: 100 & 500
I had hoped this could be added with the above %mood variable scripting, so that based on the 2 numbers the mood will randomly shift to another of the options available.
I'd like them both combined, so that the mood will shift randomly based on its 2 numbers, and the bot will speak, or do an action, based on a different set of 2 numbers. So I can customize how often they both happen.

Finally, after thats finished I wanted some text triggers put in, to cause a mood shift based on what is said to the bot.
Something like

If someone says: I love you, [botname]. Then the %mood variable will be changed to happy and the bot will then speak in main: I love you too $nick. (So that she will reply back to whoever spoke the words.

Another type of text triggering I'm interested in is using keywords, like this.

If the words I and hate and [botname] all appear in one line of text then the variable %mood should be changed to angry and the bot will do this as an action /me storms off to be alone.

another example is to set up the same as above, but using if and or, like this

If hate and [botname] or sucks and [botname] appear then the %mood changes to angry and the bot says "Well I hate you!"

I know this is a big job, and I hope someone is capable enough to figure how this entire thing would look.