From Sharp Hummingbird, 4 Years ago, written in JavaScript.
Embed
  1. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  2.  //^ I am referencing in jquery from googles CDN, just for the mouseover and click event selector thingers.
  3. <script src="clippy/clippy.min.js"></script>
  4.  //^ This is where I call clippy
  5. <script type="text/javascript">
  6. $(function(){
  7. //^This is the document load function, so anything inside executes when the page is loaded, cept for the click and hover functions.
  8.     clippy.load('Bonzi', function(agent) {
  9. //^ Bonzi is the agent I am loading
  10.         // Do anything with the loaded agent
  11.         agent.show();
  12. //^shows the agent on page load
  13.                 agent.speak('It looks like you\'re in the wrong place!.');
  14. //^makes it speak
  15.                 agent.animate();
  16. //^A random animation
  17.                 $('#u_name').click(function() {
  18. //^ This is a function that is called when you click the element with id "u_name", it can be damn near anything. IE: <a href="#" id="u_name">Click me for talking!</a> <--- This would not go in the script tag.
  19.                 agent.speak('You don\'t want to login here!');
  20.                 });
  21. //^ This marks the end of my uname click function, any events you want to call when that link/button/whatever is clicked should go between that and function start
  22.                 $('#u_password').click(function() {
  23.                 agent.speak('Stop it!');
  24.                 });
  25.                 $('#submit1').hover(function() {
  26. //^This function is when you hover over the submit button, which I gave the ID "submit1"
  27.                 agent.speak('Why don\'t you make like a tree, and get the fuck out of here?');
  28.                 agent.play("GoodBye");
  29.                 });
  30.     });
  31.        
  32.  
  33.  
  34. });
  35.  
  36. </script>