what does this error mean?

Posted by Mushclientuser on Tue 01 Nov 2005 11:48 PM — 6 posts, 25,334 views.

#0
Error number: 0
Event: Run-time error
Description: [string "Trigger: "]:2: bad argument #2 to `EnableTrigger' (number expected, got nil)
stack traceback:
[C]: in function `EnableTrigger'
[string "Trigger: "]:2: in main chunk
Called by: Immediate execution
Australia Forum Administrator #1
Can you paste the script code that caused this error please? And which version of MUSHclient are you using?
Australia Forum Administrator #2
The documentation states the 2nd argument should be true or false, and defaults to true.


http://www.gammon.com.au/scripts/doc.php?function=EnableTrigger


This works for me:


EnableTrigger "mytrigger"

EnableTrigger ("mytrigger", true)

EnableTrigger ("mytrigger", false)


However this gives that error message:


EnableTrigger ("mytrigger", nil)
Amended on Wed 02 Nov 2005 05:33 AM by Nick Gammon
Australia Forum Administrator #3
See the release notes for version 3.68 - it has been changed to allow nil to be explicitly provided, and still take the default:


http://www.gammon.com.au/scripts/showrelnote.php?version=3.68&productid=0

#4
thanks thanks
i found out the reason why
i had it as EnableTrigger("mytrigger", True)
caps on the word True...

thanks =)
Australia Forum Administrator #5
Ah, ok. That would do it, as True would be undefined and thus nil. Oh well, you found a subtle bug in MUSHclient anyway, although you need to be careful, as using True and False will have unintended effects if you misspell them like that.