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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
bast
Voice
Posts: 37 Joined: Sat Oct 07, 2006 10:24 pm
Post
by bast » Sun Dec 24, 2006 6:13 am
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.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sun Dec 24, 2006 9:48 am
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.
bast
Voice
Posts: 37 Joined: Sat Oct 07, 2006 10:24 pm
Post
by bast » Mon Dec 25, 2006 1:36 pm
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.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Mon Dec 25, 2006 5:05 pm
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.
bast
Voice
Posts: 37 Joined: Sat Oct 07, 2006 10:24 pm
Post
by bast » Tue Dec 26, 2006 3:33 am
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"
rosc2112
Revered One
Posts: 1454 Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania
Post
by rosc2112 » Tue Dec 26, 2006 6:40 am
bast
Voice
Posts: 37 Joined: Sat Oct 07, 2006 10:24 pm
Post
by bast » Tue Dec 26, 2006 6:58 am
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)
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Tue Dec 26, 2006 12:03 pm
}{ should have a space between them. I edited the code.
bast
Voice
Posts: 37 Joined: Sat Oct 07, 2006 10:24 pm
Post
by bast » Tue Dec 26, 2006 3:25 pm
that did the trick. Now one more question.
I guess the script goes after the computer clock?
If so, then it aint kicking.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Tue Dec 26, 2006 7:06 pm
should be
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.
bast
Voice
Posts: 37 Joined: Sat Oct 07, 2006 10:24 pm
Post
by bast » Wed Dec 27, 2006 6:11 am
Hmm it still dosen´t kick. and +monthkick didn´t work, i had to set +kickmonth
Alchera
Revered One
Posts: 3344 Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:
Post
by Alchera » Wed Dec 27, 2006 7:21 am
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
bast
Voice
Posts: 37 Joined: Sat Oct 07, 2006 10:24 pm
Post
by bast » Wed Dec 27, 2006 7:24 am
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.
bast
Voice
Posts: 37 Joined: Sat Oct 07, 2006 10:24 pm
Post
by bast » Mon Jan 01, 2007 6:48 am
Can anyone else test this and confirm that it´s working, Caus it aint kicking on my chan for some reason.
bast
Voice
Posts: 37 Joined: Sat Oct 07, 2006 10:24 pm
Post
by bast » Mon Feb 12, 2007 10:14 am
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.
No idea why it didnt work last month.
So cased closed and thanks for the script if i havent said that.