Created
June 9, 2010 00:10
-
-
Save MikeGrace/430835 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruleset a60x262 { | |
meta { | |
name "talkative rules" | |
description << | |
talkative rules | |
>> | |
author "Mike Grace" | |
logging on | |
} | |
dispatch {} | |
global { | |
choices = ["one","two","three","four","five","six"]; | |
} | |
rule setup_chat is active { | |
select when pageview ".*" | |
pre { | |
chatRoom = << | |
<script>connect = {}</script> | |
>>; | |
} | |
{ | |
append("head",chatRoom); | |
} | |
} | |
rule randomly_pick_number is active { | |
select when pageview ".*" | |
{ | |
notify("Not random, random number",choices[0]) with sticky = true; | |
emit << | |
connect.random = choices[0]; | |
>>; | |
} | |
} | |
rule what_was_picked is active { | |
select when pageview ".*" | |
pre { | |
toBeInserted = << | |
-> <span id="random-random"></span> <- | |
>>; | |
} | |
{ | |
notify("The previous rule not so randomly picked the random number of", toBeInserted) with sticky = true; | |
emit << | |
$K("#random-random").append(connect.random); | |
>>; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment