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.

Advice in massmsg's

Old posts that have not been replied to for several years.
Locked
B
BiLL
Halfop
Posts: 78
Joined: Wed Sep 26, 2001 8:00 pm
Location: Germany

Advice in massmsg's

Post by BiLL »

Heyya,

A bot (egg 1.6.13 / tcl 8.3.4) should message $msg to EVERY chan he is in.

I currently use that way:

foreach c [channels] {
if {[strlwr $c] != [strlwr $basechan]} {
puthelp "PRIVMSG $c :$msg"
}

But it looks like that sometimes not every chan gets that messages. Is puthelp here the best way? How do I can get sure that every chan gets messages? Please help :-).

Thanks.

BiLL
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Why don't you have a look on the tcl-commands.doc file about the puthelp? It's explained there.
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 »

Code: Select all

if {[strlwr $c] != [strlwr $basechan]} {
means if the channel doesnt match the channels in $basechan it will send the message to it, that means it will only send the message to the channels which are not in $basechan.
If you want it to send to all channels then remove that code.
B
BiLL
Halfop
Posts: 78
Joined: Wed Sep 26, 2001 8:00 pm
Location: Germany

Post by BiLL »

Yeah I know that. Its ok, I wanted that.

I just wanted to know which would be the best choice. putserv or puthelp?

puthelp <text> [options]
Description: sends text to the server, like 'putserv', but it uses a
different queue intended for sending messages to channels or people.

putserv <text> [options]
Description: sends text to the server, like '.dump' (intended for direct
server commands); output is queued so that the bot won't flood itself
off the server.
Options:
-next: push messages to the front of the queue
-normal: no effect
Returns: nothing
Module: server
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

well the description makes it clear that they do the same thing, but putserv is quicker than puthelp
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

Sir_Fz wrote:

Code: Select all

if {[strlwr $c] != [strlwr $basechan]} {
means if the channel doesnt match the channels in $basechan it will send the message to it, that means it will only send the message to the channels which are not in $basechan.
this means: it will send the message to all channels except from $basechan. this is no list search or sth. maybe this is what you meant, but i wanted to make it clear. ;)
aVote page back online!
Check out the most popular voting script for eggdrop bots.

Join the metal tavern!
B
BiLL
Halfop
Posts: 78
Joined: Wed Sep 26, 2001 8:00 pm
Location: Germany

Post by BiLL »

arcane wrote:
Sir_Fz wrote:

Code: Select all

if {[strlwr $c] != [strlwr $basechan]} {
means if the channel doesnt match the channels in $basechan it will send the message to it, that means it will only send the message to the channels which are not in $basechan.
this means: it will send the message to all channels except from $basechan. this is no list search or sth. maybe this is what you meant, but i wanted to make it clear. ;)
Yeah I know - its ok - I wanted that. I shouldnt posted that line here makes ppl to confused ;).

Well I found the problem.
It seems to be a server-side floodprotection. So on many chans the bot can't paste the msg. (Only a few get the msg).

My question know how can I mass msg these chans with an intervall like - 10 secs - then next chan - 10 secs - next chan - 10 secs - next chan. Can anyone give me an example code?? (with foreach channel)
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

I would use puthelp for such informativ things, this lets important things that were send via putserv go first. Addionally I didn't really test if putserv queue will share with pushmode and putkick queue, so best let it wait.
B
BiLL
Halfop
Posts: 78
Joined: Wed Sep 26, 2001 8:00 pm
Location: Germany

Post by BiLL »

If I use puthelp/putserv both wont work 100%, still some channels didnt get the message. I have to use this utimer method (interval about 10secs for each channel) but I dont know how to do it with a foreach function :(. Can someone help me there?
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Code: Select all

set i 0
foreach c [channels] {
	if {[strlwr $c] != [strlwr $basechan]} {
		utimer [incr i 10] [list puthelp "PRIVMSG $c :$msg"]
	}
}
..or if you want the first message with no delay, 'incr i' after starting the utimer (so the first one will have a delay of 0 seconds)
Have you ever read "The Manual"?
B
BiLL
Halfop
Posts: 78
Joined: Wed Sep 26, 2001 8:00 pm
Location: Germany

Post by BiLL »

Thanks for your example and code.

It works perfect now :-).
Locked