egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
kn1ghtt
Voice


Joined: 01 Aug 2022
Posts: 10

PostPosted: Wed Oct 12, 2022 7:09 pm    Post subject: msj and nick random chan and 5 min other nick channel list Reply with quote

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..
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Thu Oct 13, 2022 5:41 am    Post subject: Reply with quote

Code:
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.
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber