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.

auto add hosts

Old posts that have not been replied to for several years.
Locked
P
Paiakam

Post by Paiakam »

proc myhostis {frombot cmd arg} {
set added 0
set arg [string tolower $arg]
foreach host [split [getuser $frombot HOSTS]] {
set host [string tolower $host]
if {[string match $arg $host]} {
set added 1
}
}
if {!$added} {
putlog "(**) Added host $arg to $frombot"
setuser $frombot HOSTS $arg
}
return 0
}

hey! i have this proc so my bots will auto add hosts when their host changes, but they add it like this.. packiman!paiakam@blah.com, im wondering how to set them to add hosts like this.. *!paiakam@blah.com

:smile:
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Code: Select all

proc myhostis {frombot cmd arg} {
  set added 0
  set arg [string tolower $arg]
  foreach host [split [getuser $frombot HOSTS]] {
    set host [string tolower $host]
    if {[string match $arg $host]} { 
      set added 1 
    }
  }
  if {!$added} {
    putlog "(**) Added host $arg to $frombot"
    setuser $frombot HOSTS [maskhost $arg]
  }
  return 0
}
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

As per the request on IRC.

Code: Select all

proc myhostis {frombot cmd arg} {
  set added 0
  set arg [string tolower $arg]
  foreach host [split [getuser $frombot HOSTS]] {
    set host [string tolower $host]
    if {[string match $arg $host]} { 
      set added 1 
    }
  }
  if {!$added} {
    putlog "(**) Added host $arg to $frombot"
    setuser $frombot HOSTS "*![lindex [split $arg !] 1]
  }
  return 0
}
<font size=-1>[ This Message was edited by: ppslim on 2001-10-07 10:19 ]</font>
P
Paiakam

Post by Paiakam »

thanks :grin:
Locked