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.

[FILLED] kick user at end of month

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
b
bast
Voice
Posts: 37
Joined: Sat Oct 07, 2006 10:24 pm

[FILLED] kick user at end of month

Post by bast »

Is it possible to get a script to kick all on the chan at the end of each month with a kick message?
and excluded users should be op/voice.
Last edited by bast on Wed Feb 28, 2007 8:37 pm, edited 1 time in total.
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

bind time "00 00 01*" kickall

proc kickall args {
 set chan #channel
 foreach n [chanlist $chan] {
  if {[isop $n $chan] || [isvoice $n $chan]} {continue}
  puthelp "kick $chan $n :It's the first of the month!"
 }
}
Edit: Added exempting ops and voices.
b
bast
Voice
Posts: 37
Joined: Sat Oct 07, 2006 10:24 pm

Post by bast »

Nice. and if i want it to kick on more then one chan? just add after each other?
And if possible. want to have a exclude list, where i can add people from being kicked.
like
!add nisse
nisse has been added to exempt list.
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

# Set nicks file:
set enfile scripts/enicks.txt

setudef flag kickmonth

if {[file exists $enfile]} {
 set exnicks [split [read [set enfileo [open $enfile]]] \n][close $enfileo]
} { set exnicks [list] }

bind pub n !addnick addnicks
bind pub n !delnick delnicks
bind time - "00 00 01*" kickall

proc addnicks {nick uhost hand chan arg} {
 global enfile exnicks
 set add [string tolower [lindex [split $arg] 0]]
 if {[lsearch -exact $exnicks $add] == -1} {
  lappend exnicks $add
  puthelp "notice $nick :Added $add to exempted nicks."
  set ef [open $enfile w]
  foreach n $exnicks { if {$n != ""} { puts $ef $n } }
  close $ef
 } { puthelp "notice $nick :$add already exists" }
}

proc delnicks {nick uhost hand chan arg} {
 global enfile exnicks
 set add [string tolower [lindex [split $arg] 0]]
 if {[set i [lsearch -exact $exnicks $add]] != -1} {
  set exnicks [lreplace $exnicks $i $i]
  puthelp "notice $nick :Deleted $add from exempted nicks."
  set ef [open $enfile w]
  foreach n $exnicks { if {$n != ""} { puts $ef $n } }
  close $ef
 } { puthelp "notice $nick :$add does not exist." }
}

proc kickall args {
 global exnicks
 foreach chan [channels] {
  if {![channel get $chan kickmonth]} {continue}
  foreach n [chanlist $chan] {
   if {[lsearch -exact $exnicks [string tolower $n]] != -1} {continue}
   if {[isop $n $chan] || [isvoice $n $chan]} {continue}
   puthelp "kick $chan $n :It's the first of the month!"
  }
 }
}
The channel should be set +kickmonth (channel setting) for the script to work on it.

Edit2: Fixed missing argument for time bind.
Edit: Fixed missing space between }{.
Last edited by Sir_Fz on Wed Dec 27, 2006 11:11 am, edited 3 times in total.
b
bast
Voice
Posts: 37
Joined: Sat Oct 07, 2006 10:24 pm

Post by bast »

nice work, but i get some error here when im trying to load it.

Code: Select all

 while executing
"if {[file exists $enfile]} {
 set exnicks [split [read [set enfileo [open $enfile]]] \n][close $enfileo]
}{ set exnicks [list] }

bind pub n !addnick ..."
    (file "scripts/month.tcl" line 13)
    invoked from within
"source scripts/month.tcl"
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

You didnt include the full error msg.. Read:
http://forum.egghelp.org/viewtopic.php?t=10215
b
bast
Voice
Posts: 37
Joined: Sat Oct 07, 2006 10:24 pm

Post by bast »

to get that to work the bot needs to start first.
i get that info in the dos window, and the bot don´t even start, så kinda hard to get that info.
And i have unloaded all other script. and im just running that one.

Code: Select all

[11:54] Tcl error in file 'eggdrop.conf':
[11:54] extra characters after close-brace
    while executing
"if {[file exists $enfile]} {
 set exnicks [split [read [set enfileo [open $enfile]]] \n][close $enfileo]
}{ set exnicks [list] }

bind pub n !addnick ..."
    (file "scripts/month.tcl" line 6)
    invoked from within
"source scripts/month.tcl"
    (file "eggdrop.conf" line 1341)
[11:54] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

}{ should have a space between them. I edited the code.
b
bast
Voice
Posts: 37
Joined: Sat Oct 07, 2006 10:24 pm

Post by bast »

that did the trick. Now one more question.
I guess the script goes after the computer clock?
If so, then it aint kicking.
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

bind time "00 00 01*" kickall
should be

Code: Select all

bind time - "00 00 01*" kickall
Edited the code again.

Yes, the Eggdrop will use the computer's clock. If you change your computer's time, you need to restart your eggdrop (I think) to avoid any conflicts.
b
bast
Voice
Posts: 37
Joined: Sat Oct 07, 2006 10:24 pm

Post by bast »

Hmm it still dosen´t kick. and +monthkick didn´t work, i had to set +kickmonth :)
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

bast wrote:Hmm it still dosen´t kick. and +monthkick didn´t work, i had to set +kickmonth :)
To state the very obvious, it's not the end of the month!

The script should trigger at the end of the month as requested (now +kickmonth is set). :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
b
bast
Voice
Posts: 37
Joined: Sat Oct 07, 2006 10:24 pm

Post by bast »

Alchera wrote:To state the very obvious, it's not the end of the month!
I did offcource set my system clock to the last of this month and moved the clock to 23:59:00 before i started the eggdrop.
And i can see in the partyline that the date is changing to 1st of Januari.
b
bast
Voice
Posts: 37
Joined: Sat Oct 07, 2006 10:24 pm

Post by bast »

Can anyone else test this and confirm that it´s working, Caus it aint kicking on my chan for some reason.
b
bast
Voice
Posts: 37
Joined: Sat Oct 07, 2006 10:24 pm

Post by bast »

bumping. =)

I cant get this script to work at all.
I have set the chan on +kickmont, but it aint kicking for some odd reason.

*edit*

It did work this month. :D

No idea why it didnt work last month.
So cased closed and thanks for the script if i havent said that. :)
Post Reply