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.

msj and nick random chan and 5 min other nick channel list

Help for those learning Tcl or writing their own scripts.
Post Reply
k
kn1ghtt
Voice
Posts: 10
Joined: Mon Aug 01, 2022 12:54 am

msj and nick random chan and 5 min other nick channel list

Post by kn1ghtt »

hello group and help

I need help for an announcement code of a message to each nick in the room every 5 min

example:

hello nick1 don't fall asleep
and 5 min later
hello nick2 don't fall asleep
etc..
User avatar
CrazyCat
Revered One
Posts: 1305
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Code: Select all

namespace eval randmsg {

   setudef flag randmsg

   bind cron - "*/5 * * * *" ::randmsg::do

   proc do {mi ho da mo dow} {
      foreach chan [channels] {
         if {![channel get $chan randmsg]} { continue }
         set ulist [chanlist $chan]
         set vict [lindex $ulist [rand [llength $ulist]]]
         putserv "PRIVMSG $chan :hello $vict, don't fall asleep"
      }
   }
}
Add the +randmsg to the channels you want the script works on them, and wait.
Post Reply