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 op a certain hostmask

Old posts that have not been replied to for several years.
Locked
b
bratt
Voice
Posts: 4
Joined: Tue Jul 05, 2005 6:03 am

auto op a certain hostmask

Post by bratt »

hi been trying to make a quick script that will make the bot op a certain hostmask or ident.
but simply can't do it here it what i did so far and it aint working

Code: Select all

set hostname "IDENT@IP.ADDRESS"
bind join - * join:ophost
proc join:ophost { nick host hand chan } {
if { $host == $hostname } {
pushmode $chan +o $nick
}
}
the error message i get is something along the lines of cannot read hostname no such variable.

thanx in advance

Bratt
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

you can do this without a script by adding a user with the desired host and the o flag (+ chanset autoop) or the a flag.

to fix your error use $::hostname (or add "global hostname") at the top of your proc.
photon?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

You can do it by spocks method also or here by correcting your script, which would be like this:

Code: Select all

set hostname "*!*@aol.com"

bind join - "*" join:ophost

proc join:ophost {nick uhost hand chan} {
 global hostname
  if {[string match -nocase *$hostname* "$nick!$uhost"]} {
   pushmode $chan +o $nick
   }
} 
Note: In this example I have included the full mask: nick!ident@host.domain.com
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
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

string match -nocase $hostname $nick!$uhost
would be a better choice.
Locked