| View previous topic :: View next topic |
| Author |
Message |
bast Voice
Joined: 07 Oct 2006 Posts: 37
|
Posted: Sun Dec 24, 2006 6:13 am Post subject: [FILLED] kick user at end of month |
|
|
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 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Dec 24, 2006 9:48 am Post subject: |
|
|
| Code: | 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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
bast Voice
Joined: 07 Oct 2006 Posts: 37
|
Posted: Mon Dec 25, 2006 1:36 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Dec 25, 2006 5:05 pm Post subject: |
|
|
| Code: | # 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 }{. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts
Last edited by Sir_Fz on Wed Dec 27, 2006 11:11 am; edited 3 times in total |
|
| Back to top |
|
 |
bast Voice
Joined: 07 Oct 2006 Posts: 37
|
Posted: Tue Dec 26, 2006 3:33 am Post subject: |
|
|
nice work, but i get some error here when im trying to load it.
| Code: | 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" |
|
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
|
| Back to top |
|
 |
bast Voice
Joined: 07 Oct 2006 Posts: 37
|
Posted: Tue Dec 26, 2006 6:58 am Post subject: |
|
|
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: | [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) |
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Dec 26, 2006 12:03 pm Post subject: |
|
|
}{ should have a space between them. I edited the code. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
bast Voice
Joined: 07 Oct 2006 Posts: 37
|
Posted: Tue Dec 26, 2006 3:25 pm Post subject: |
|
|
that did the trick. Now one more question.
I guess the script goes after the computer clock?
If so, then it aint kicking. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Dec 26, 2006 7:06 pm Post subject: |
|
|
| Code: | | bind time "00 00 01*" kickall |
should be
| Code: | | 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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
bast Voice
Joined: 07 Oct 2006 Posts: 37
|
Posted: Wed Dec 27, 2006 6:11 am Post subject: |
|
|
Hmm it still dosenīt kick. and +monthkick didnīt work, i had to set +kickmonth  |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Wed Dec 27, 2006 7:21 am Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
bast Voice
Joined: 07 Oct 2006 Posts: 37
|
Posted: Wed Dec 27, 2006 7:24 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
bast Voice
Joined: 07 Oct 2006 Posts: 37
|
Posted: Mon Jan 01, 2007 6:48 am Post subject: |
|
|
| Can anyone else test this and confirm that itīs working, Caus it aint kicking on my chan for some reason. |
|
| Back to top |
|
 |
bast Voice
Joined: 07 Oct 2006 Posts: 37
|
Posted: Mon Feb 12, 2007 10:14 am Post subject: |
|
|
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.  |
|
| Back to top |
|
 |
|