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.

Detect the username of everynick join achannel

Old posts that have not been replied to for several years.
Locked
R
Reynaldo
Halfop
Posts: 54
Joined: Wed May 11, 2005 2:51 am

Detect the username of everynick join achannel

Post by Reynaldo »

I need ascript, that can detect the specific username of everynick join #
only the first character the username, the character is "space"
ex: ytfwtj is ~zfmq@hots.domain * yohxrtru
fist character the username is "space", so the bot can kick out!!
Thanks, :shock:
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Re: Detect the username of everynick join achannel

Post by De Kus »

Reynaldo wrote:I need ascript, that can detect the specific username of everynick join #
only the first character the username, the character is "space"
ex: ytfwtj is ~zfmq@hots.domain * yohxrtru
fist character the username is "space", so the bot can kick out!!
Thanks, :shock:
the server raw reply is:
server.com 311 botnick whoisednick ident the.host.com * :Username

so to get the Username with all characters you should bind to RAW 311 and use something like:
set uname [join [lrange [split $arg :] 1 end] :]
this way the only restriction what uname cannot contain this way is a line break, because the server message will be cut there from the bot ^-^.

Code: Select all

tcl: evaluate (.tcl): join [lrange [split "server.com 311 botnick whoisednick ident the.host.com * : Username: I am cool" :] 1 end] :
Tcl:  Username: I am cool
tcl: evaluate (.tcl): join [lrange [split "server.com 311 botnick whoisednick ident the.host.com * : Username \{ I am \$cool\]" :] 1 end] :
Tcl:  Username { I am $cool]
if you look close, you can see the double space between : and Username, what idinticates, that space is part of the return 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...
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Which is the space character here?

Code: Select all

ytfwtj ~zfmq@hots.domain * yohxrtru 
If you are talking about "~" you can detect it by:

Code: Select all

if {[string equal "~" [string index [lindex [split $uhost @] 0] 0]]} {
By the way you don't need to /whois or /who the user for the raw bind, its more easy to bind join and use user@host. :)
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
R
Reynaldo
Halfop
Posts: 54
Joined: Wed May 11, 2005 2:51 am

Post by Reynaldo »

There's aspace!!
ytfwtj ~zfmq@hots.domain * yohxrtru
aspace before "yohxrtru", so there is two space between "*" and "yohxrtru"
normaly only 1 space.
i need to ban the nick
is on the spammer bots
(the posting forum disable the space!) :wink:
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Code: Select all

~zfmq
Unless i am really missing something here THAT is the username and there is NO space!

Code: Select all

yohxrtru
... and this is the "RealName".

You can use RAW 311 (RPL_WHOISUSER) to get a user's real name, username and server host.

Now, which is it you wish to ban?
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Something like this should get you started

Code: Select all

bind join - * lookup:realname 
proc lookup:realname {nick uhost hand chan} { 
 puthelp "WHOIS $nick" 
} 

bind raw - 311 parse:realname 
proc parse:realname {from key arg} { 
 set nick [lindex [split $arg] 1]
 set ident [lindex [split $arg] 2]
 set host [lindex [split $arg] 3]
 set realname [string trimleft [lrange $arg 5 end] :]

 if {[string first " " $realname]==0} {
   # the first char in realname is a space
 }
}
R
Reynaldo
Halfop
Posts: 54
Joined: Wed May 11, 2005 2:51 am

Post by Reynaldo »

Here's the script i wrote it in my mirc scripts!

Code: Select all

on 1:join:#chan: { whois $nick }
raw 311:*:if ($len($gettok($rawmsg,8,32)) == 1) { .kick #chan $2 }
ytfwtj ~zfmq@hots.domain_*__yohxrtru <-- that i will kick out!!

i changed the "space" with "_" :?

ytfwtj ~zfmq@hots.domain_*_yohxrtru <-- anormal user only 1 space "_"

Thanks :wink:
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Reynaldo wrote:ytfwtj ~zfmq@hots.domain_*_yohxrtru <-- anormal user only 1 space "_"
Actually there's no space, that's the mIRC script formatting I believe.

Code: Select all

set realname  [string range [lrange $arg  4 end] 1 end]
..and if I am correct, the above code will give you what you wish.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

or something like this?

Code: Select all

if {[string equal "  " [string range $arg [expr [lindex $arg 3]-2] [expr [lindex $arg 3]-1]]]} {

if {[string equal "  " [string range $arg [expr [lindex $arg 2]+1] [expr [lindex $arg 2]+2]]]} {
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
R
Reynaldo
Halfop
Posts: 54
Joined: Wed May 11, 2005 2:51 am

Post by Reynaldo »

Thanks guys for the scripts. :wink:
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

We aim to please. :P
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Locked