| View previous topic :: View next topic |
| Author |
Message |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Wed Jan 19, 2022 3:04 am Post subject: |
|
|
That's odd, I get a $min of 10080
That should work as a good expire time as it is an integer number.
Have you used the very last code I posted without edits? _________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Wed Jan 19, 2022 3:07 am Post subject: |
|
|
Fix cat's error by adding the [catch]es like I added to mine.
an empty string cant be used in an exp:) _________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Wed Jan 19, 2022 4:09 am Post subject: |
|
|
| simo wrote: | tested your latest code CC and got:
Tcl error [sticky_bansx]: missing operand at _@_
in expression "365*24*60*_@_" |
Well, I'm too used to use languages interpreting "" as 0
Here is the corrected proc:
| Code: | proc delay2min {delay} {
regexp {((\d{1,})y)?((\d{1,})w)?((\d{1,})d)?((\d{1,})h)?(\d{1,})?} $delay - iy by iw bw id bd ih bh bm
set min 0
if {[string is integer by]} { incr min [expr 365*24*60*$by] }
if {[string is integer bw]} { incr min [expr 7*24*60*$bw] }
if {[string is integer bd]} { incr min [expr 24*60*$bd] }
if {[string is integer bh]} { incr min [expr 60*$bh] }
if {[string is integer bm]} { incr min [expr 1*$bm] }
return $min
} |
@SpiKe^^ : you have a small error in your script:
| Code: | | set dur [duration [expr {60*$min}]] |
$min is in minutes, why do you convert it into seconds ? _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Wed Jan 19, 2022 9:52 am Post subject: |
|
|
your code seems to work proper Spike^^
CrazyCat your code seems to set ban duration permanent regardless of what is used
i used like : !addbl *!*@*.RU 2w uit testen
and it sets it as permanent ban i get no errors tho |
|
| Back to top |
|
 |
|