Channel Limiter (Bot Version) v1.2

Published  Jun 11, 2005
Updated 

Description

This is a Channel Limiter for a Bot script which basicly sets a limit on the channels your bot is on with your desired margin/offset within a certain time to avoid mass join floods. The limit offset & the amount of time to update is configurable for each channel.

Download

Filename
Size
Date
Downloads
2.79 KB
Jun 11, 2005
52

Comments

Sign in to comment.
master_zwerg   -  May 12, 2010

very Good Script. but i will intern set limit on Dialog . 1) #Chan 2) limitzahl 15 user +5 ) 3) update Time i post this script with Dialog.

alias -l chl.dlg { dialog -m chlimit chlimit }
alias -l chl.dlg2 { dialog -m chadd chadd }
alias -l chl.del {
var %c = $hget(chltbl,$did(2).sel).item
if (%chl.emode == on) { var %m = on | set %chl.emode off }
if ($me isop %c) { mode %c -l }
hdel chltbl %c
if (%m == on) { set %chl.emode on }
chl.load
}

alias -l chl.load {
var %x = 1
did -r chlimit 2
while ($hget(chltbl,%x).item != $null) {
var %y = $hget(chltbl,%x).item
did -a chlimit 2 %y
inc %x
}
}

dialog chlimit {
title "Channel Limiter"
size -1 -1 177 98
option dbu
list 2, 3 11 130 59, size vsbar
button "Ok", 6, 74 85 35 11, ok
check "Force channel limit when set -l?", 3, 3 71 86 10
button "Add", 4, 139 11 35 11
button "Edit", 5, 139 28 35 11
button "Delete", 7, 139 45 35 11
text "Channels", 1, 3 2 25 8
}

on :dialog:chlimit:sclick::{
if ($did == 3) {
if ($did(3).state == 0) { set %chl.emode off }
if ($did(3).state == 1) { set %chl.emode on }
}
if ($did == 4) { chl.dlg2 }
if ($did == 5) {
chl.dlg2
did -a chadd 8 $hget(chltbl,$did(2).sel).item
did -a chadd 10 $hget(chltbl,$did(2).sel)
}
if ($did == 7) { chl.del }
}

on :dialog:chlimit:init::{
if (%chl.emode == on) { did -c $dname 3 }
chl.load
}

dialog chadd {
title "Channel Limiter"
size -1 -1 137 46
option dbu
text "Channel:", 7, 3 5 25 8
edit "", 8, 29 4 105 10
text "Limit (users above actual user count):", 9, 3 18 92 8
edit "", 10, 96 17 38 10
button "Add", 3, 55 33 35 11
button "Button", 1, 95 33 37 12, hide ok
}

on *:dialog:chadd:sclick:3:{
if ($did(8) != $null) && ($did(10) != $null) {
if ($left($did(8),1) != $chr(35)) {
var %x = $chr(35) $+ $did(8),%y = $did(10)
hadd chltbl %x $did(10)
}
if ($left($did(8),1) == $chr(35)) {
var %x = $did(8),%y = $did(10)
hadd chltbl %x $did(10)
}
if ($me isop %x) {
var %a = $nick(%x,0)
mode %x +l $calc(%a + %y)
}
dialog -x chadd chadd
chl.load
}
}

menu menubar,channel {
Channel limiter
.Setup:{ chl.dlg }
.Help:{ run $+(",$scriptdirchanlimit-help.txt,") }
.-
.Unload:{ if ($input(Are you sure you want to unload this script?,136,Unload Confirmation)) .unload -rs $+(",$script,") }
}

on @*:join:#:{
var %x = 0
while ($hget(chltbl,%x).item != $null) {
var %a = $hget(chltbl,%x).item
if ($chan == %a) {
var %y = $nick(#,0),%z = $hget(chltbl,$chan)
.timer 1 90 mode $chan +l $calc(%y + %z)
halt
}
inc %x
}
}

on @!*:part:#:{
var %x = 0
while ($hget(chltbl,%x).item != $null) {
var %a = $hget(chltbl,%x).item
if ($chan == %a) {
var %y = $nick(#,0),%z = $hget(chltbl,$chan)
.timer 1 10 mode $chan +l $calc((%y + %z)-1)
halt
}
inc %x
}
}

on @*:kick:#:{
if ($knick == $me) { halt }
var %x = 0
while ($hget(chltbl,%x).item != $null) {
var %a = $hget(chltbl,%x).item
if ($chan == %a) {
var %y = $nick(#,0),%z = $hget(chltbl,$chan)
.timer 1 10 mode $chan +l $calc((%y + %z)-1)
halt
}
inc %x
}
}

on @*:quit:{
var %x = 1
while ($comchan($nick,%x) != $null) {
var %a = $hget(chltbl,%x).item,%b = $comchan($nick,%x)
if (%b == %a) {
var %y = $nick(%a,0),%z = $hget(chltbl,%a)
.timer 1 10 mode %a +l $calc((%y + %z)-1)
halt
}
inc %x
}
}

on @*:mode:#:{
if (%chl.emode == on) {
if ($1- == -l) {
var %x = 0
while ($hget(chltbl,%x).item != $null) {
var %a = $hget(chltbl,%x).item
if ($chan == %a) {
var %y = $nick(#,0),%z = $hget(chltbl,$chan)
.timer 1 1 mode $chan +l $calc(%y + %z)
halt
}
inc %x
}
}
}
}

on *:load:{
if ($version >= 6.15) {
set %chl.emode off
chl.dlg
}
else { echo -a 2Sorry, this addon requires mIRC 6.15. Please download the latest version from www.mirc.com
.unload -rs $+(",$script,")
}
}

on *:unload:{
unset %chl.emode
if ($hget(chltbl) != $null) { hfree chltbl }
echo -a 2Channel Limiter successfully unloaded.
}

on :exit:{ hsave -o chltbl $+(",$scriptdirchanlimit.dat,") }
on
:start:{ hmake chltbl 50
if ($isfile($+(",$scriptdirchanlimit.dat,"))) { hload chltbl $+(",$scriptdirchanlimit.dat,") }
}

this "addon" make ONLY +1 on Timer its not so Good

sorry for my English .. i'm German :D

 Respond  
Bullet_Dodger   -  Sep 30, 2008

Very Good
i would rate it {{7/10}}

 Respond  
eeep   -  Jul 08, 2008

Xdaemon:

This is a fantastic script; however, if I may speak candidly, I\'d like to offer a few suggestions for a future update/rewrite:

1: Limit should be completely removed during a netsplit and should not be set until users have returned. Or at least the limit should not be modified/adjusted during a netsplit. This will give everyone a chance to come back without having to wait for the bot to make appropriate adjustments.

2: Limit should be set on a timer [perhaps 30 seconds to a minute], and after every 2, 5, or even 10 joins, parts, kicks and quits. I am running v1.2 in one of my bots and it seems to be setting the limit after EVERY j/p/k/q, and instantly instead of waiting. That is beginning to frustrate some users.

Great job...Hope to see a new version soon. :)

8/10.

Regards,
eEEp

 Respond  
Zachery   -  Mar 27, 2007

accually it was very easy to use and setup, im using it on one of my bots now :P

 Respond  
Cage   -  Jul 22, 2006

Seemed fairly easy to use and understand to me.

Nice job xDaeMon.

 Respond  
petrillo2000   -  May 27, 2006

i sorry i have added this to my bot but i still dont get how i add the offset i want a limite of 10 and update every minute do i set it like this !climit 10/60 or like this !climit +10/60 cause every time i try them i get this message Usage: You must fill in the limit offset before you enable the channel limiter could u plz help thanks.

 Respond  
xDaeMoN   -  Apr 21, 2006

@WiseR, read the readme.txt ;)

 Respond  
WiseR   -  Apr 21, 2006

were should i put the file in?... and what is it good for?

 Respond  
`Kazuma   -  Nov 04, 2005

Very nice xDaeMon.

 Respond  
xDaeMoN   -  Aug 26, 2005

Have you read the readme.txt file?

 Respond  
Network   -  Aug 26, 2005

haha... my english sux... so i not so understand :)

 Respond  
Network   -  Aug 26, 2005

can show me the exmple of the setup?

 Respond  
xDaeMoN   -  Jun 11, 2005

Thanks for the review. Difficult to use and understand? I made it pretty easy for everybody to understand & use it.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.