Skip to content

Instantly share code, notes, and snippets.

@rgov
Created April 28, 2012 07:18
Show Gist options
  • Select an option

  • Save rgov/2516781 to your computer and use it in GitHub Desktop.

Select an option

Save rgov/2516781 to your computer and use it in GitHub Desktop.
Fire Beetle, June 1, 2000
ON SIGNON {
fire_data01 GLOBAL
"Fire Beetle v0.019b05" STATUSMSG
[ "[ " 0 ] fire_data01 =
}
ON ENTER {
fire_data01 GLOBAL
"Fire Beetle v0.019b05" STATUSMSG
NBRROOMUSERS fire_data01 1 PUT
{ [ "Hello" "Hey" "Greetings" "Hi" "Hiya" ] DUP LENGTH RANDOM GET greet =
{ { j last_user = } j ROOMUSER WHOME <> IF j ++ } { j NBRROOMUSERS < } WHILE
{ {
{ greet ", " & i ROOMUSER WHONAME & greet = } NBRROOMUSERS 2 <> i last_user <> AND IF
{ greet ", " & i ROOMUSER WHONAME & greet = } NBRROOMUSERS 2 == IF
{ greet " and " & i ROOMUSER WHONAME & greet = } NBRROOMUSERS 2 <> i last_user == AND IF
0 greeted = fire_data01 0 GET hello_list = i ROOMUSER WHONAME hi_user =
{ name = { 1 greeted = BREAK } name hi_user == IF } hello_list "]" & STRTOATOM EXEC FOREACH
{ hello_list "\"" & hi_user & "\" " & hello_list = } greeted 0 == IF
hello_list fire_data01 0 PUT
} i ROOMUSER WHOME <> IF i ++
} { i NBRROOMUSERS < } WHILE greet "!!" & SAY
} NBRROOMUSERS 1 <> IF
10 ME SETALARM [ 958617182 ] SETPROPS
}
ON ALARM {
fire_data01 GLOBAL
{ fire_data01 0 GET hello_list =
NBRROOMUSERS 1 - ROOMUSER WHONAME hi_user =
{ name = { 1 greeted = BREAK } name hi_user == IF } hello_list "]" & STRTOATOM EXEC FOREACH
{
[ "Hello, %n"
"Hey %n"
"Hello, %n, what's up?"
"How's it going %n?"
"Hey there, %n"
"Greetings, %n"
"Welcome, %n, what's happening?"
"What's up, %n?"
"Hey there, %n, how's it going?"
] DUP LENGTH RANDOM GET greet =
hello_list "\"" & hi_user & "\" " & fire_data01 0 PUT
} {
[ "Welcome back, %n"
"wb, %n. What's new?"
"Nice to see you again, %n."
"Welcome back %n, what's up?"
"!Welcome back %n!!"
"Hey %n, welcome back."
] DUP LENGTH RANDOM GET greet =
} greeted 0 == IFELSE
{ "$1" hi_user & "$2" & GREPSUB greet = } { greet "^(.*)%n(.*)$" GREPSTR } WHILE
greet SAY NBRROOMUSERS fire_data01 1 PUT
} NBRROOMUSERS fire_data01 1 GET > IF
{ NBRROOMUSERS fire_data01 1 PUT } NBRROOMUSERS fire_data01 1 GET < IF
{ {
0 greeted = fire_data01 0 GET hello_list = i ROOMUSER WHONAME hi_user =
{ name = { 1 greeted = BREAK } name hi_user == IF } hello_list "]" & STRTOATOM EXEC FOREACH
{ hello_list "\"" & hi_user & "\" " & hello_list = } greeted 0 == IF
hello_list fire_data01 0 PUT
} i ROOMUSER WHOME <> IF i ++
} { i NBRROOMUSERS < } WHILE
10 ME SETALARM
}
ON INCHAT {
{ "$1" GREPSUB STRTOATOM EXEC } CHATSTR "^;*fb (.*)$" GREPSTR IF
{ CLEARLOOSEPROPS PAINTCLAER } CHATSTR LOWERCASE "bug? clean" == IF
{ PAINTCLEAR } CHATSTR LOWERCASE "bug? clean paint" == IF
{ CLEARLOOSEPROPS } CHATSTR LOWERCASE "bug? clean props" == IF
{ [ "I am fine, thanks for asking " WHOCHAT WHONAME & "." &
"I'm pretty good. How are you, " WHOCHAT WHONAME & "?" &
"If robots had emotions, I bet I'd be pretty good, " WHOCHAT WHONAME & "!" &
"Everythings fine. How are you, " WHOCHAT WHONAME & "?" &
] DUP LENGTH RANDOM GET SAY
} CHATSTR LOWERCASE "^how are [you]+[,.<>/?Mm ]+" GREPSTR
CHATSTR LOWERCASE "^how'*s it going[,.<>/?Mm ]+" GREPSTR OR
CHATSTR LOWERCASE "bug" SUBSTR
CHATSTR LOWERCASE "beetle" SUBSTR OR
CHATSTR LOWERCASE "fire" SUBSTR OR
CHATSTR LOWERCASE "fb" SUBSTR OR AND IF
{ [ "No problem, " WHOCHAT WHONAME & "." &
"Any time, " WHOCHAT WHONAME &
"Your welcome, " WHOCHAT WHONAME &
"np, " WHOCHAT WHONAME & "." &
"yw, " WHOCHAT WHONAME & "." &
] DUP LENGTH RANDOM GET SAY
} CHATSTR LOWERCASE "^thanks[,.<>/?Mm ]+" GREPSTR
CHATSTR LOWERCASE "^thank [you]+[,.<>/?Mm ]+" GREPSTR OR
CHATSTR LOWERCASE "^ty[,.<>/?Mm ]+" GREPSTR OR
CHATSTR LOWERCASE "^thanx[,.<>/?Mm ]+" GREPSTR OR
CHATSTR LOWERCASE "bug" SUBSTR
CHATSTR LOWERCASE "beetle" SUBSTR OR
CHATSTR LOWERCASE "fire" SUBSTR OR
CHATSTR LOWERCASE "fb" SUBSTR OR AND IF
{ [ "Nothing much, " WHOCHAT WHONAME & "." &
"Sitting here listening to you, " WHOCHAT WHONAME &
"Trying to be idle, " WHOCHAT WHONAME &
"What I always do - wait for people to say something I can understand, " WHOCHAT WHONAME &
] DUP LENGTH RANDOM GET
} CHATSTR LOWERCASE "^wh*a[t'zs]+ *up[,.<>/?Mm ]+" GREPSTR
CHATSTR LOWERCASE "^sup[,.<>/?Mm ]+" GREPSTR OR
CHATSTR LOWERCASE "^what[']*cha doin['g]*[,.<>/?Mm ]+" GREPSTR OR
CHATSTR LOWERCASE "bug" SUBSTR
CHATSTR LOWERCASE "beetle" SUBSTR OR
CHATSTR LOWERCASE "fire" SUBSTR OR
CHATSTR LOWERCASE "fb" SUBSTR OR AND IF
{ [ "Yes, " WHOCHAT WHONAME & "?" &
WHOCHAT WHONAME [ "." "?" ] 2 RANDOM GET &
"What do you want, " WHOCHAT WHONAME & "?" &
"What, " WHOCHAT WHONAME & "?" &
"What do you need, " WHOCHAT WHONAME & "?" &
] DUP LENGTH RANDOM GET SAY
} CHATSTR LOWERCASE "^[*]*f[ire ]+bu[gy]+.*$" GREPSTR
CHATSTR LOWERCASE "^[*]*f[ire ]+b[eat]+[el]+.*$" GREPSTR OR
CHATSTR LOWERCASE "^[*]*beetle.*$" GREPSTR OR
CHATSTR LOWERCASE "^[*]*fb.$" GREPSTR OR
CHATSTR LOWERCASE "^[*]*fire.*$" GREPSTR OR IF
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment