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.

getting user's host

Old posts that have not been replied to for several years.
Locked
User avatar
entrapmen
Voice
Posts: 27
Joined: Tue Jul 08, 2003 9:08 am
Location: TR

getting user's host

Post by entrapmen »

hi i m writing a script for a kind of spammer which spam's by using away messages. there is a bot on my channel which messages all users. i make something like that:

Code: Select all

set kanal "#achan"

proc ctrl:filter {str} {
  regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str
  return $str
}

bind RAW * 301 away:gor
proc away:gor { from key msg } {
	global kanal
			set msg [ctrl:filter $msg]
	if {[regexp (www) $msg] || [regexp (.net) $msg] || [regexp (.com) $msg] || [regexp (http://) $msg]} {		
	putlog "RAW: $from | $key | $msg "
							}
					}
putlog "RAW: $from | $key | $msg" gives out something like that
RAW: soho-r.ix.us.dal.net | 301 | helebe aquil :www.
helebe is bots name. aquil is the spammer. www. is away message.
i want to get aquil's host name with in that script. and then ban it.
im not pro on tcl :-?
i think i m gonna use hand2nick but how and with which commands?

if someone show me the way i ll be glad.
<@ll the world is about smiles and cries>
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

why don't u just use getchanhost..
getchanhost <nickname> [channel]

Returns: user@host of the specified nickname (the nickname is not included in the returned host). If a channel is not specified, bot will check all of its channels. If the nickname is not on the channel(s), "" is returned.

Module: irc

hand2nick = works only when its a known user..
XplaiN but think of me as stupid
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

you know how to use regsub and regexp but you dont know about getchanhost?

/me blinks
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Well yeah, you can use string match here, since you are doing basic matching with regexp and string match can do it faster.

And you don't need the ctrl:filter to filter out control codes anymore, because if you are using eggdrop1.6.17 it has a stripcodes function. See the "stripcodes" function in the tcl-commands.doc file. :mrgreen:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

MeTroiD wrote:you know how to use regsub and regexp
No, he doesn't.
[regexp (.net) $msg] || [regexp (.com) $msg]
I doubt they do what he expects. :wink:
And the ctrl:filter thing is not perfect and probably borrowed from ppslim
Have you ever read "The Manual"?
Locked