zammer wrote:
In irssi I have something like this (/whois zammer):
....
12:14:11 [freenode] -!- account : zammer
...
Something to be aware of:
The way that line looks when you see it in irssi, is different from the way it looks when it appears in bot.
This is what it looks like to bot:
Code: Select all
<botnick> [12:36:23] [@] barjavel.freenode.net 330 botnick jack3 jack3 :is logged in as
Could someone tell me please how can read into script:
16:14:11 [freenode] -!- account : zammer
I want to check account name and do some things if it match.
I have no idea how to do this with Freenode and the custom IRCd.
...
Here is some stuff to play with. I hope it illustrates what is going on, and how to do it. You can uncomment lines as you wish, to see.
The way it is below, it sets a variable, and then sends you a line of text.
I assume that once you get the value into the variable, then that is what you wanted here... from there, you can do your own matching, etc.
Code: Select all
# Feb 14, 2012
# experimenting with obtaining info from a /whois on freenode
# http://forum.egghelp.org/viewtopic.php?t=18839
# set your nick here. Bot will be sending a query (pm) to it
set mynick "zammer"
# reference:
# http://www.eggheads.org/support/egghtml/1.6.21/tcl-commands.html#binda
# and scroll down to bind raw
bind raw - 330 fn_whois
proc fn_whois {from key text} {
global mynick
#putserv "privmsg $mynick :from is $from"
#putserv "privmsg $mynick :key is $key"
#putserv "privmsg $mynick :text is $text"
#putserv "privmsg $mynick :first element is [lindex [split $text] 0]"
#putserv "privmsg $mynick :second element is [lindex [split $text] 1]"
#putserv "privmsg $mynick :third element is [lindex [split $text] 2]"
#putserv "privmsg $mynick :the rest is [lrange [split $text] 3 end]"
set accountname [lindex [split $text] 2]
putserv "privmsg $mynick :account name is: $accountname "
}
With a quick test, on Freenode, the above worked for me.
I hope it helps to answer your question.