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.

A mass pmsg script

Old posts that have not been replied to for several years.
Locked
C
Chris

A mass pmsg script

Post by Chris »

If someone could just point me in the right direction for writing this script that'd be great, you don't have to write it or anything, I'm just searching for ideas....

I'm looking to have eggdrop message a privatemsg sent by an op to all the people with similar tags in their name (i.e. everyone's tag in the channel that starts with "n|"). Does anyone have any ideas on how to go about doing this? I'm relatively new to tcl and I've read through a couple tutorials but I'm not sure how to approach the situation. I'm guessing it would be a foreach loop of some kind?

-Chris
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

You are correct. Using an foreach with an chanlist will do what you want.
Once the game is over, the king and the pawn go back in the same box.
C
Chris

Post by Chris »

Okay, here's where I've gotten so far. I'm just having trouble getting eggdrop to distinguish the "n|" at the beginning of everyone's name who should be receiving the PRIVMSG.

Code: Select all

#my first tcl script
#
# .nmsg <text> 
bind pub +o .nmsg pub:nmsg 
proc pub:nmsg {nick host handle channel text} { 
  foreach u [chanlist #mychangoeshere] { 
    if {$u == n|*} { putserv "PRIVMSG $u :$text" } 
  } 
} 
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

no use thats wrong, use [chanlist #mychangoeshere n|-] to only match +n users, then msg the nicks it will work.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Sir_Fz wrote:no use thats wrong, use [chanlist #mychangoeshere n|-] to only match +n users, then msg the nicks it will work.
He didn't say +n users... he said nicks starting with n| ....

Code: Select all

#my first tcl script 
# 
# .nmsg <text> 
bind pub +o .nmsg pub:nmsg 
proc pub:nmsg {nick host handle channel text} { 
  foreach u [chanlist #mychangoeshere] { 
    if {[string match "n|*" [string tolower $u]]} { putserv "PRIVMSG $u :$text" } 
  } 
} 
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

sorry, wasn't payin attention.
C
Chris

Post by Chris »

Thanks for the help guys. I tried that script from strikelight but it didn't seem to work. The command should just be ".nmsg <text>" (without the quotes or <>) in the channel, right? If I wanted it to work so that I just pm'ed the bot to spead a message, that should be possible as well I'm guessing?

Sorry to be a pain but thanks for the tips. Learning in progress. :)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

it should work, did you .rehash after loading ?
C
Chris

Post by Chris »

Sir_Fz wrote:it should work, did you .rehash after loading ?
Got it to work :) Typo in the script.

Thanks again guys!

:)
Locked