Advertisement
danielvoipan

cycle tcl

Jan 12th, 2024
1,332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 0.65 KB | None | 0 0
  1.  
  2. set cycle_channel "#channel"
  3. #cycle time in minutes
  4. set cycle_time "2"
  5. #wait time until rejoin (seconds)
  6. set wait_time "5"
  7.  
  8.  
  9. if {![info exists cycle_start]} {
  10.     timer $cycle_time cycle:process
  11.     set cycle_start 1
  12. }
  13.  
  14.  
  15. proc cycle:process {} {
  16.     global cycle_channel cycle_time wait_time botnick
  17.     if {[validchan $cycle_channel]} {
  18.         if {[onchan $botnick $cycle_channel]} {
  19.             channel set $cycle_channel +inactive
  20.             utimer $wait_time [list join:process]
  21.         }
  22.     }
  23. }
  24.  
  25. proc join:process {} {
  26.     global cycle_time cycle_channel
  27.     channel set $cycle_channel -inactive
  28.     timer $cycle_time cycle:process
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement