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.

error rehash

Help for those learning Tcl or writing their own scripts.
Post Reply
p
pilouuu
Halfop
Posts: 82
Joined: Mon Dec 26, 2005 8:03 pm

error rehash

Post by pilouuu »

hi and thx for all help

when I type .rehash my bot crash with the reason:
can't rename to "maskhost_org": command already exists
while executing
"rename maskhost maskhost_org"
invoked from within
"if {"" == [info commands maskhost_old]} { ;#only rename if its not already done
rename maskhost maskhost_org
}"
(file "scripts/hostqnet.tcl" line 20)
invoked from within
"source scripts/hostqnet.tcl"
the tcl

Code: Select all

##########################################
#
# maskhost.tcl
#  by Elven <elven@elven.de>
#  under the GNU/GPL
#  http://www.gnu.org/copyleft/gpl.html
#
#  Overwrites "maskhost" to support
#  efficient Quakenet-Mask bans.
#
#  To remove the script without restart-
#  ing the bot, run 'maskhost_remove'.
#
#  You can easily add support for more
#  masks/hosts/networks by adding more
#  if {}s.
#
##########################################

if {"" == [info commands maskhost_old]} { ;#only rename if its not already done
  rename maskhost maskhost_org
}


proc maskhost {host} {

  #Quakenet
  if {[string match -nocase "*.users.quakenet.org" $host]} {
    set rhost [lindex [split $host @] 1]
    if {$rhost == ""} { return [maskhost_org $host] } ;#let the original thing worry about that
    return "*!*@${rhost}"
  }
  
  return [maskhost_org $host]
}


proc maskhost_remove {} {
  catch { info body maskhost } res_mask
  if {"" == [info commands maskhost_old]} { return }
  rename maskhost ""
  rename maskhost_org maskhost
  rename maskhost_remove ""
}

For what? because when I restart my eggdrop it restart without error.Error only detected on type .rehash

Thx
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

if {"" == [info commands maskhost_old]} { ;#only rename if its not already done
  rename maskhost maskhost_org
}
should be

Code: Select all

if {"" == [info commands maskhost_org]} { ;#only rename if its not already done
  rename maskhost maskhost_org
}
and

Code: Select all

if {"" == [info commands maskhost_old]} { return }
should be

Code: Select all

if {"" == [info commands maskhost_org]} { return }
but that maskhost_remove proc is not being used in this script.
p
pilouuu
Halfop
Posts: 82
Joined: Mon Dec 26, 2005 8:03 pm

Post by pilouuu »

thx Good staff thx u very much
Post Reply