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.

what's the problem?

Help for those learning Tcl or writing their own scripts.
Post Reply
p
pektek
Halfop
Posts: 51
Joined: Sat Jul 01, 2023 4:51 pm

what's the problem?

Post by pektek »

I don't speak much English , sorry
I want to have this done
ban clearing not working ?


Code: Select all

### BanTemizleme.tcl by pektek ###
### Botun Olduğu Kanallarda Geçerlidir ###
### Burdaki "60" Zamanı belirler dakika cinsinden ###

set chan "#Sohbet"

bind cron - "*/60 * * * *" time:removebans

proc time:removebans {min hour day month year} {
    global botnick
    foreach chan [channels] {
    resetbans $chan
    if {![string match -nocase "#Sohbet" $chan]} {return 0} 
    putserv "PRIVMSG $chan :$botnick Tarafından Ban Listesi Temizlendi..!"
}    
}

putlog "BanTemizleme.Tcl by pektek"
User avatar
CrazyCat
Revered One
Posts: 1304
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: what's the problem?

Post by CrazyCat »

Your bind will never run: minutes are never a multiple of 60.
bind cron <flags> <mask> <proc>

procname <minute 0-59> <hour 0-23> <day 1-31> <month 1-12> <weekday 0-6>

Description: similar to bind TIME, but the mask is evaluated as a cron expression, e.g. “16/2 */2 5-15 7,8,9 4”. It can contain up to five fields: minute, hour, day, month, weekday; delimited by whitespace. Week days are represented as 0-6, where Sunday can be either 0 or 7. Symbolic names are not supported. The bind will be triggered if the mask matches all of the fields, except that if both day and weekday are not ‘*’, only one of them is required to match. If any number of fields are omitted at the end, the match will proceed as if they were ‘*’. All cron operators are supported. Please refer to the crontab manual for their meanings. Flags are ignored.

Code: Select all

* * * * * command
| | | | `- day of week (0 to 6 - Sunday = 0)
| | | `- month (1 to 12)
| | `- day of month (1 to 31)
| `- hour (0 to 23)
`- min (0 to 59)
User avatar
Carlin0
Voice
Posts: 35
Joined: Tue Dec 04, 2018 3:41 pm
Location: Italy

Re: what's the problem?

Post by Carlin0 »

You don't need a script to do this, in partyline:

Code: Select all

.chanset <channel> ban-time <minutes>
"From the diamonds nothing is born, from the manure the flowers are born ..."
--- F. De Andrè ---
Post Reply