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 

[FILLED] kick user at end of month

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
bast
Voice


Joined: 07 Oct 2006
Posts: 37

PostPosted: Sun Dec 24, 2006 6:13 am    Post subject: [FILLED] kick user at end of month Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Dec 24, 2006 9:48 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
bast
Voice


Joined: 07 Oct 2006
Posts: 37

PostPosted: Mon Dec 25, 2006 1:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Dec 25, 2006 5:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
bast
Voice


Joined: 07 Oct 2006
Posts: 37

PostPosted: Tue Dec 26, 2006 3:33 am    Post subject: Reply with quote

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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Tue Dec 26, 2006 6:40 am    Post subject: Reply with quote

You didnt include the full error msg.. Read:
http://forum.egghelp.org/viewtopic.php?t=10215
Back to top
View user's profile Send private message
bast
Voice


Joined: 07 Oct 2006
Posts: 37

PostPosted: Tue Dec 26, 2006 6:58 am    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Dec 26, 2006 12:03 pm    Post subject: Reply with quote

}{ should have a space between them. I edited the code.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
bast
Voice


Joined: 07 Oct 2006
Posts: 37

PostPosted: Tue Dec 26, 2006 3:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Dec 26, 2006 7:06 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
bast
Voice


Joined: 07 Oct 2006
Posts: 37

PostPosted: Wed Dec 27, 2006 6:11 am    Post subject: Reply with quote

Hmm it still dosenīt kick. and +monthkick didnīt work, i had to set +kickmonth Smile
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Dec 27, 2006 7:21 am    Post subject: Reply with quote

bast wrote:
Hmm it still dosenīt kick. and +monthkick didnīt work, i had to set +kickmonth Smile

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). Smile
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
bast
Voice


Joined: 07 Oct 2006
Posts: 37

PostPosted: Wed Dec 27, 2006 7:24 am    Post subject: Reply with quote

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
View user's profile Send private message
bast
Voice


Joined: 07 Oct 2006
Posts: 37

PostPosted: Mon Jan 01, 2007 6:48 am    Post subject: Reply with quote

Can anyone else test this and confirm that itīs working, Caus it aint kicking on my chan for some reason.
Back to top
View user's profile Send private message
bast
Voice


Joined: 07 Oct 2006
Posts: 37

PostPosted: Mon Feb 12, 2007 10:14 am    Post subject: Reply with quote

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. Very Happy

No idea why it didnt work last month.
So cased closed and thanks for the script if i havent said that. Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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