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.

autolimit error

Old posts that have not been replied to for several years.
Locked
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

autolimit error

Post by r0t3n »

im using a autolimit script by perpleXa and there is a error

The error:

<[-Guard-]> [19:29] Tcl error [autolimit:pub]: illegal channel option: autolimit
<[-Guard-]> illegal channel option: 15
<[-Guard-]>

The script:

Code: Select all

# Auto-limit 0.52 by perpleXa.
# This script is similar to Q's auto-limit feature (+c).
# It must not be used in conjunction with chanmode +D (auditorium mode).
# Type $autolimt in a channel for more info..


bind pub  n|o !autolimit autolimit:pub
bind join -|- * autolimit:join

setudef str "autolimit"

proc autolimit:start {} {
  foreach channel [channels] {
    if {[channel get $channel "autolimit"] == ""} {
      channel set $channel "autolimit" "0"
    }
  }
  utimer 60 autolimit
}

proc autolimit:join {nickname hostname handle channel} {
  if {![isbotnick $nickname]} {
    return 0
  }
  if {[channel get $channel "autolimit"] == ""} {
    channel set $channel "autolimit" "0"
  }
}

proc autolimit:pub {nickname hostname handle channel arguments} {
 global lastbind
  set argumentc [llength [split $arguments { }]]
  set option [lindex $arguments 0]
  set users [llength [chanlist $channel]]
  if {$argumentc < 1} {
    set currentlimit [channel get $channel "autolimit"]
    if {$currentlimit > 0} {
      putserv "NOTICE $nickname :Current auto-limit is: [channel get $channel "autolimit"]"
    } else {
      putserv "NOTICE $nickname :Argument should start with a '#' and a digit. (eg. #10 or on|off)"
    }
    return
  }
  if {([regexp -nocase -- {(#[0-9]+|off|on)} $option tmp result]) && (![regexp -nocase -- {\S#} $option])} {
    switch $result {
      on {
        channel set $channel "autolimit" "10"
        putserv "MODE $channel +l [expr $users + 10]"
        puthelp "NOTICE $nickname :Auto-limit is changed to: +10"
      }
      off {
        channel set $channel "autolimit" "0"
        putserv "MODE $channel -l *"
        puthelp "NOTICE $nickname :Done. Auto-limit disabled successfully."
      }
      default {
        if {([regexp {#[0-9]} $result]) && ([string index $result 0] == "#")} {
          regexp {#([0-9]+)} $result tmp result
          if {($result < 2)} {
            set result 2
          } elseif {($result > 500)} {
            set result 500
          }
          channel set $channel "autolimit" "$result"
          putserv "MODE $channel +l [expr $users + $result]"
          puthelp "NOTICE $nickname :Auto-limit is changed to: $result"
        }
      }
    }
  } else {
    puthelp "NOTICE $nickname :Argument should start with a '#' and a digit. (eg. #10 or on|off)"
  }
}

proc autolimit {} {
  if {![string match *autolimit* [utimers]]} {
    utimer 60 autolimit
  }
  foreach channel [channels] {
    set autolimit [channel get $channel "autolimit"]
    if {(![botisop $channel]) || ($autolimit == "0")} {
      continue
    }
    set users [llength [chanlist $channel]]
    set newlimit [expr $users + $autolimit]
    set chanmodes [getchanmode $channel]
    if {[string match *l* [lindex $chanmodes 0]]} {
      regexp {\S[\s]([0-9].*)} $chanmodes tmp currentlimit
    } else {
      set currentlimit 0
    }
    if {$newlimit == $currentlimit} {continue}
    if {$newlimit > $currentlimit} {
      set difference [expr $newlimit - $currentlimit]
    } elseif {$newlimit < $currentlimit} {
      set difference [expr $currentlimit - $newlimit]
    }
    if {($difference <= [expr round($autolimit * 0.5)]) && ($autolimit > 5)} {
      continue
    } elseif {($difference < [expr round($autolimit * 0.38)]) && ($autolimit <= 5)} {
      continue
    }
    putserv "mode $channel +l $newlimit"
  }
}

autolimit:start

putlog "Script loaded: auto-limit by perpleXa"
Can someone please fix this, i have no clue whats wrong ;p!!

Thanks in advance!!
r0t3n @ #r0t3n @ Quakenet
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Try this script. I have been using it for years and cant fault it.

Click Me
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

looks good, but i was looking for one which holds data for each channel. Like channel specific limits where people can type !autolimit on/off #10 or something like that. All channel specific. Thats why i used that script, but its got that error ;p can you please help me, thanks!!
r0t3n @ #r0t3n @ Quakenet
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

have triied to use "udef-" as suffix for your setting like "udef-autolimit"? I dont know what you have to exactly use, but maybe it just must be defined somewhere as a udef channel value.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

the autolimit scrips does use "udef"

Code: Select all

setudef str "autolimit"
r0t3n @ #r0t3n @ Quakenet
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

could you maybe help me make a autolimit script with the commands:
!autolimit on/off
!autolimit #10 etc
!autolimit to show the autolimit status, like amount of users on chan, what the autolimit is set to e.g +10

And make it so when a user parts the channel, it checks the limit and sets a new limit if needed. Please help, thanks!!
r0t3n @ #r0t3n @ Quakenet
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

there are zillions of autolimit scripts out there, do your homework
Locked