This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Simple (?) problem

Old posts that have not been replied to for several years.
Locked
User avatar
Tristam
Voice
Posts: 17
Joined: Sun Sep 21, 2003 11:28 am
Location: Finland

Simple (?) problem

Post by Tristam »

Hello everyone! I'm new to tcl and I want to learn it :) I've been reading FAQs and guides but I just cant get a simple command to work. I want it like this: When someone says "muuh" in the channel, the bot responds saying "Muuuuuuuuuuh yourself $nick!" in the channel... Here's the code:

Code: Select all

bind pubm - muuh pubm:muuh
proc pubm:muuh { nick host hand chan } {
    puthelp "PRIVMSG $chan :Muuuuuuuuuuh yourself $nick!"
  }
The bot says in partyline: "Tcl error [pub:muuh]: wrong # args: should be "pub:muuh nick host hand chan""
I'm using the lates version of WinDrop, could anyone help me? :)
Tristam - tristam@iki.fi
e
era5or

Post by era5or »

bind pubm - muuh pubm:muuh

proc pubm:muuh { nick host hand chan text} {
puthelp "PRIVMSG $chan :Muuuuuuuuuuh yourself $nick!"
}

u need to have TEXT because u are awaiting a text input
User avatar
Tristam
Voice
Posts: 17
Joined: Sun Sep 21, 2003 11:28 am
Location: Finland

Post by Tristam »

Thanks, that was part of the reason, but I think I needed to change "pubm" to "pub"... Anyway, thanks, I got it working now :)
Tristam - tristam@iki.fi
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Yes, it's pub and you should check the tcl-commands.doc file ;)
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

it can be pubm too, in this case it doesn't matter, the main problem was that the 5th element was missing from the proc (fixed by era5or).

read tcl-commands.doc to see the difference between pub and pubm
Locked