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.

[SOLVED] ban times with newban and newchanban

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

[SOLVED] ban times with newban and newchanban

Post by TCL_no_TK »

I've been adding bans by dcc +ban for a while. When i started using a script to add them i noticed that some of the bantimes where off a bit, I think i've got the syntax wrong for the time option in newban/newchanban. I played around in dcc chat with the .tcl newban command. This was the output:
<Me> .tcl newban "*!*@test.com" Me "No Spamming" 360300s none
<bot> Tcl:
<Me> .bans all
<bot> [10:45] #Me# bans all
<bot> Global bans: (! = not active on #Channel)
<bot> ! [ 1] *!*@test.com (expires in 250 days)
<bot> Me: No Spamming
<bot> Created 10:45
<bot> Channel bans for #Channel: (! = not active, * = not placed by bot)
<Me> .tcl newban "*!*@test-2.com" Me "No Spamming" 360300 none
<bot> Tcl:
<Me> .bans all
<bot> [10:45] #Me# bans all
<bot> Global bans: (! = not active on #Channel)
<bot> ! [ 1] *!*@test-2.com (expires in 250 days)
<bot> Me: No Spamming
<bot> Created 10:45
<bot> ! [ 2] *!*@test.com (expires in 250 days)
<bot> Me: No Spamming
<bot> Created 10:45
<Me> .tcl newban "*!*@test-3.com" Me "No Spamming." 4h5m none
<bot> Tcl:
<Me> .bans all
<bot> [10:46] #Me# bans all
<bot> Global bans: (! = not active on #Channel)
<bot> ! [ 1] *!*@test-3.com (expires at 10:50)
<bot> Me: No Spamming.
<bot> Created 10:46
<bot> ! [ 2] *!*@test-2.com (expires in 250 days)
<bot> Me: No Spamming
<bot> Created 10:45
<bot> ! [ 3] *!*@test.com (expires in 250 days)
<bot> Me: No Spamming
<bot> Created 10:45
<bot> Channel bans for #Channel: (! = not active, * = not placed by bot)
<Me> .tcl newban "*!*@test-4.com" Me "No Spamming." 0d4h5m none
<bot> Tcl:
<Me> .bans all
<bot> [10:47] #Me# bans all
<bot> Global bans: (! = not active on #Channel)
<bot> ! [ 1] *!*@test-4.com (perm)
<bot> Me: No Spamming.
<bot> Created 10:47
<bot> ! [ 2] *!*@test-3.com (expires at 10:50)
<bot> Me: No Spamming.
<bot> Created 10:46
<bot> ! [ 3] *!*@test-2.com (expires in 250 days)
<bot> Me: No Spamming
<bot> Created 10:45
<bot> ! [ 4] *!*@test.com (expires in 250 days)
<bot> Me: No Spamming
<bot> Created 10:45
<bot> Channel bans for #Channel: (! = not active, * = not placed by bot)
<Me> .tcl newban "*!*@test-5.com" Me "No Spamming." 4h none
<bot> Tcl:
<Me> .bans all
<bot> [10:47] #Me# bans all
<bot> Global bans: (! = not active on #Channel)
<bot> ! [ 1] *!*@test-5.com (expires at 10:51)
<bot> Me: No Spamming.
<bot> Created 10:47
<bot> ! [ 2] *!*@test-4.com (perm)
<bot> Me: No Spamming.
<bot> Created 10:47
<bot> ! [ 3] *!*@test-3.com (expires at 10:50)
<bot> Me: No Spamming.
<bot> Created 10:46
<bot> ! [ 4] *!*@test-2.com (expires in 250 days)
<bot> Me: No Spamming
<bot> Created 10:45
<bot> ! [ 5] *!*@test.com (expires in 250 days)
<bot> Me: No Spamming
<bot> Created 10:45
<bot> Channel bans for #Channel: (! = not active, * = not placed by bot)
<Me> .tcl newban "*!*@test-6.com" Me "No Spamming." 4h0m none
<bot> Tcl:
<Me> .bans all
<bot> [10:47] #Me# bans all
<bot> Global bans: (! = not active on #Channel)
<bot> ! [ 1] *!*@test-6.com (expires at 10:51)
<bot> Me: No Spamming.
<bot> Created 10:47
<bot> ! [ 2] *!*@test-5.com (expires at 10:51)
<bot> Me: No Spamming.
<bot> Created 10:47
<bot> ! [ 3] *!*@test-4.com (perm)
<bot> Me: No Spamming.
<bot> Created 10:47
<bot> ! [ 4] *!*@test-3.com (expires at 10:50)
<bot> Me: No Spamming.
<bot> Created 10:46
<bot> ! [ 5] *!*@test-2.com (expires in 250 days)
<bot> Me: No Spamming
<bot> Created 10:45
<bot> ! [ 6] *!*@test.com (expires in 250 days)
<bot> Me: No Spamming
<bot> Created 10:45
<bot> Channel bans for #Channel: (! = not active, * = not placed by bot)
The script is changing the given %d%h%m given with the !ban syntax into seconds (ie. 360300) and using it as the ban time. And to report how long the ban has been set for to the channel using [duration <expire>]. Overly complicated this :/ or it just a scripting error :oops:

Working great now :)) thanks for all the help.
Last edited by TCL_no_TK on Sun Dec 09, 2007 10:01 am, edited 1 time in total.
User avatar
CrazyCat
Revered One
Posts: 1359
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

the newban and newchanban time is setted in minutes, nothing else.
If you want to add the time formating (eg 3d2h), you have to create a tcl wich is able to parse the string and convert it in minutes.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Thanks :D thought it would be the same as dcc +ban :roll:
Post Reply