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.

Host exempt

Old posts that have not been replied to for several years.
Locked
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

Host exempt

Post by Nexus6 »

I wanna bot do nothing if it gets msg from exempt host for example *!*@*.dal.net
here is line from script, I'd like bot to do nothing if it's user matches *!*@*.dal.net address.
if {([isbotnick $nick]) || ([string tolower $nick] == "ChanServ")} {return 0}

Thanks in advance
P
Photon
Op
Posts: 170
Joined: Wed Aug 28, 2002 8:00 am
Location: Liverpool, England

Post by Photon »

Um ... I hate to point this out but you are comparing a string which has be 'tolower'ed (i.e all characters in lower case) to a string which has captials in it.

Plus you might wanna check their hostmask as well - currently you're just checking nicks. Presumably this is in a msg bind?

Other than that I'm not sure of your problem.
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

Post by Nexus6 »

yes in a msg,
if {([isbotnick $nick]) || ([string tolower $nick] == "chanserv") || ([string tolower $host] == "dal.net")} {return 0}
would it work?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

The answer could be yes, and it can quite easily be no.

What information is stored in what variable.

If you are using a msg bind, I am guessing you are using somthing along the lines of
proc procname {nick host hand arg} {
If so, you are allmost there.

1: nick obviously is equal to the nickname triggering the bind. Host is equal to the user@hostname portion of the address.

IE nickname chanserv is chanserv!services@services.dal.net

In a script, you can get a full IRC host-address, using "${nick}!${host}".

2: using just == in your if statments, is checking for a "if X equals Y" style check. You can't just throw a wildcard into a if statment, as IF will interpret it as a astrix, and not a wildcard.

To solve this, use the [string match] function.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

if {[string tolower $nick] == "NickServ"} { .. bla bla bla .. }
and
if {[string match "$foo" "$bar"]} { .. bla bla bla .. }

Or something like this :) .. hope this helps.
Locked