iChat Scripting In Leopard? NOT WORKING!

Howdy,
I am having trouble with this script. It is a mashup of the example iChat script that changes iTunes over iChat messages. I am trying to make a bot/auto-responder. here is code


using terms from application "iChat"
	-- handler to respond to all incoming messages.
	on sayToBot(theMessage)
		
		set theResponse to "I don't Understand That!"
		
		if theMessage contains "hello" then
			set theResponse to "Howdy!"
		else if theMessage is "keep.alive" then
			set theResponce to "keep.alive"
		else if theMessage contains "link of day" or "link of the day" then
			set theResponse to "Link of the day: http://www.nuttysoftware.com"
		end if
		return theResponse
	end sayToBot
	
	on received text invitation theMessage from theBuddy for theChat
		accept theChat
		send "You are connected to Vex! Alpha 0.1" & sayToBot("link of the day") to theChat
	end received text invitation
	
	on message received theMessage from theBuddy for theChat
		set theResponse to sayToBot(theMessage)
		send theResponse to theChat
	end message received
end using terms from

The script should make it so when someone sends me an iChat message it outo accepts it and sends some messages to the user, then the use can have a conversation with the script. But it doesn’t do ANYTHING! I have tested on several computers with several other computers inviting me to a text session. If anyone can tell me why this script doesn’t work (there are no errors returned) I would be forever greatful!
Thanks :slight_smile:

Howdy Captainhams,

have you connected your script to both alert events (Message Received and Text Invitiation) in the Preferences > Alerts of iChat?

The script works fine on my machine (G5 Dual)