Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- property rockTrigger : "!ROCK"
- property paperTrigger : "!PAPER"
- property scissorsTrigger : "!SCISSORS"
- property rockAnswerList : {"CookieBot plays Scissors. Rock beats Scissors! You have won!", "CookieBot plays Rock. Rock ties with Rock! It's a draw!", "CookieBot plays Paper. Paper beats Rock! You have lost!"}
- property paperAnswerList : {"CookieBot plays Rock. Paper beats Rock! You have won!", "CookieBot plays Paper. Paper ties with Paper! It's a draw!", "CookieBot plays Scissors. Scissors beats Paper! You have lost!"}
- property scissorsAnswerList : {"CookieBot plays Paper. Scissors beats Paper! You have won!", "CookieBot plays Scissors. Scissors ties with Scissors! It's a draw!", "CookeBot plays Rock. Rock beats Scissors! You have lost!"}
- using terms from application "Colloquy"
- on process incoming chat message theMessage from theUser in theView
- set theText to HTML of theMessage as string
- if theText is equal to rockTrigger then
- set c to count of rockAnswerList
- set r to random number from 1 to c
- set i to item r of rockAnswerList
- tell theView
- send message "" & i & ""
- end tell
- end if
- if theText is equal to paperTrigger then
- set c to count of paperAnswerList
- set r to random number from 1 to c
- set i to item r of paperAnswerList
- tell theView
- send message "" & i & ""
- end tell
- end if
- if theText is equal to scissorsTrigger then
- set c to count of scissorsAnswerList
- set r to random number from 1 to c
- set i to item r of scissorsAnswerList
- tell theView
- send message "" & i & ""
- end tell
- end if
- end process incoming chat message
- end using terms from
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement