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.

Bot not chatting

Help for those learning Tcl or writing their own scripts.
Post Reply
S
Spartacus
Voice
Posts: 5
Joined: Fri Jan 19, 2007 11:55 am

Bot not chatting

Post by Spartacus »

Hello,
I have this script:

Code: Select all

bind dcc - sayit dcc:sayit
proc dcc:sayit {handle, idx, handler} {
	putserv "PRIVMSG #channel :$handler"
	putmsg #channel "$handler"
}
#channel is the channel, it's not the real channel, this is just an example

When I say .sayit test, both putserv and putmsg don't work, because when I am in #channel, the bot won't say a thing (and the script won't give me an error either)

Can anybody help me? :)

Thanks
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Don't use , in the variable-listing... Use a proper tcl list-structure:

Code: Select all

proc dcc:sayit {handle idx handler} {
Also, for such simple tasks as sending texts, etc.. considder using puthelp rather than putserv (same syntax, just uses a low-priority queue rather than the one used for "important" stuffs such as opping, banning, kicking, etc).
NML_375
S
Spartacus
Voice
Posts: 5
Joined: Fri Jan 19, 2007 11:55 am

Post by Spartacus »

Thanks :)
This is inside my proc:

Code: Select all

	putlog "test1"
	putserv "PRIVMSG #channel :just a test"
	puthelp "PRIVMSG #channel :just a test"
	putlog "test2"
It shows test1 and test2 in the log, but it doesn't say anything in the channel #channel.. what could be wrong?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Smells like a server-issue to me (desync'ed channel or such). Could you verify if you get the same behaviour if you make it msg you instead of that channel?
NML_375
S
Spartacus
Voice
Posts: 5
Joined: Fri Jan 19, 2007 11:55 am

Post by Spartacus »

Code: Select all

	putserv "PRIVMSG $handle :just a test"
	puthelp "PRIVMSG $handle :just a test"
These two do work, I get a private message
S
Spartacus
Voice
Posts: 5
Joined: Fri Jan 19, 2007 11:55 am

Post by Spartacus »

Sorry problem solved :P
The channel mode was +m
So when the bot wasn't an op, he couldn't talk :P
Post Reply