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.

Can I do

Help for those learning Tcl or writing their own scripts.
Post Reply
s
sattam
Voice
Posts: 20
Joined: Sat Jan 02, 2010 8:42 am

Can I do

Post by sattam »

Code: Select all

## Give your channel name here.
set scriptchannel "#info"

bind pub -|- !nick script:text1
bind notc -|- "*Info for *" script:notices1
bind notc -|- "*For extra info*" script:notices1
bind notc -|- "*Last seen address*" script:notices1
bind notc -|- "*Last seen time*" script:notices1
bind notc -|- "*Time registered*" script:notices1
bind notc -|- "*Time now*" script:notices1
bind notc -|- "*E-Mail address*" script:notices1
bind notc -|- "*This nick has been*" script:notices1


proc script:text1 { nick host handle chan text } {
global scriptchannel user
set text [split $text]
set user [lindex $text 0]
if {$user == ""} {puthelp "NOTICE $nick :You need to supply a nickname.";
return}
putserv "PRIVMSG nickserv :info $user"
}
it`s work
but how i can add
[06:18:10‹pm›] (=KLINE) Msg to nickserv: list *@x.x.x.x
[06:18:10‹pm›] (=KLINE) [12:18] -NickServ (Service@WeArab.Net)- LIST of nicks (Search paramater = *@x.x.x.x)
[06:18:10‹pm›] (=KLINE) [12:18] -NickServ (Service@WeArab.Net)- 1) GaX (~Cell@x.x.x.x) [hours]
[06:18:10‹pm›] (=KLINE) [12:18] -NickServ (Service@WeArab.Net)- Displayed 1 of 1 match results. (0 private)
[06:18:10‹pm›] (=KLINE) [12:18] -NickServ (Service@WeArab.Net)- *** End of list ***
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

Full marks for persevering!

You could use logic something like the following :-

Code: Select all

# nsinfo.tcl

set vNsinfoServices "nickserv@services.dal.net"
set vNsinfoChannel #eggtcl

bind PUB - !nsinfo pNsinfoSend
bind NOTC - * pNsinfoReceive

proc pNsinfoSend {nick uhost hand chan text} {
    global vNsinfoChannel vNsinfoServices
    if {[string equal -nocase $chan $vNsinfoChannel]} {
        set target [string tolower [regsub -all -- {[\s]{2,}} [string trim $text] { }]]
        if {[llength [split $target]] == 1} {
            if {[regexp -- {^[\x41-\x7D][-\d\x41-\x7D]*$} $target]} {
                putserv "PRIVMSG $vNsinfoServices :INFO $target"
            } else {putserv "PRIVMSG $vNsinfoChannel :$target is not a valid nick"}
        } else {putserv "PRIVMSG $vNsinfoChannel :correct usage !nsinfo <nick>"}
    }
    return 0
}

proc pNsinfoReceive {nick uhost hand text dest} {
    global vNsinfoChannel vNsinfoServices
    if {([isbotnick $dest]) && ([string match -nocase ${nick}* $vNsinfoServices])} {
        set msg [stripcodes bcruag [string trim $text]]
        if {[string match -nocase "*info for*" $msg]} {
            putserv "PRIVMSG $vNsinfoChannel :$msg"
        } elseif {[string match -nocase "*currently on irc*" $msg]} {
            putserv "PRIVMSG $vNsinfoChannel :$msg"
        } elseif {[string match -nocase "*last seen address*" $msg]} {
            putserv "PRIVMSG $vNsinfoChannel :$msg"
        } elseif {[string match -nocase "*last seen time*" $msg]} {
            putserv "PRIVMSG $vNsinfoChannel :$msg"
        } elseif {[string match -nocase "*time registered*" $msg]} {
            putserv "PRIVMSG $vNsinfoChannel :$msg"
        } elseif {[string match -nocase "*time now*" $msg]} {
            putserv "PRIVMSG $vNsinfoChannel :$msg"
        } elseif {[string match -nocase "*options: *" $msg]} {
            putserv "PRIVMSG $vNsinfoChannel :$msg"
        } elseif {[string match -nocase "*end of info*" $msg]} {
            putserv "PRIVMSG $vNsinfoChannel :$msg"
        } elseif {[string match -nocase "*is not registered*" $msg]} {
            putserv "PRIVMSG $vNsinfoChannel :$msg"
        } elseif {[string match -nocase "*is frozen*" $msg]} {
            putserv "PRIVMSG $vNsinfoChannel :$msg"
        } elseif {[string match -nocase "*cannot be registered*" $msg]} {
            putserv "PRIVMSG $vNsinfoChannel :$msg"
        }
    }
    return 0
}

putlog "nsinfo.tcl loaded"

# eof
[20:42] <@arfer> !nsinfo arfer
[20:42] <@osmosis> Info for arfer:
[20:42] <@osmosis> (Currently on IRC) For extra info: /whois arfer
[20:42] <@osmosis> Last seen address : arfer@xxx
[20:42] <@osmosis> Last seen time : Fri 08-Jan-2010 20:33:00 UTC
[20:42] <@osmosis> Time registered : Sat 04-May-2002 14:22:47 UTC
[20:42] <@osmosis> Time now : Fri 08-Jan-2010 20:42:22 UTC
[20:42] <@osmosis> *** End of Info ***
I must have had nothing to do
s
sattam
Voice
Posts: 20
Joined: Sat Jan 02, 2010 8:42 am

Post by sattam »

Wonderful job
But how
/ns list *@125.*
[11:40‹NickServ›] LIST of nicks (Search paramater = *@125.*)
[11:40‹NickServ›] ) ahmadnaweed (~WeArab@x.x.x.x) [months]
[11:40‹NickServ›] ) popzaa (~WeArab@x.x.x.x) [months]
[11:40‹NickServ›] ) Story (~a@x.x.x.x) [weeks]
[11:40‹NickServ›] ) Wahab (~Wahab@x.x.x.x) [weeks]
[11:40‹NickServ›] Displayed 4 of 4 match results. (0 private)
[11:40‹NickServ›] *** End of list ***
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

Sorry I misread your question.

The command /ns list is either not available on the network I frequent (DALnet), or is restricted to ircops or above. Hence, I can't be sure of its usage.
I must have had nothing to do
s
sattam
Voice
Posts: 20
Joined: Sat Jan 02, 2010 8:42 am

Post by sattam »

arfer wrote:Sorry I misread your question.

The command /ns list is either not available on the network I frequent (DALnet), or is restricted to ircops or above. Hence, I can't be sure of its usage.
ok thanks

can i add u msn ?
s
sattam
Voice
Posts: 20
Joined: Sat Jan 02, 2010 8:42 am

Post by sattam »

Thank you I did it
B
BhasIRC
Voice
Posts: 27
Joined: Sat Jan 02, 2010 7:05 am
Location: south africa
Contact:

Post by BhasIRC »

is there a way to work out how long a person is registered for expl say i typ !infonick and it must just say nick is registered for 2 months an 2 weeks
s
sotengboy
Voice
Posts: 14
Joined: Sun Jan 03, 2010 3:43 am

Post by sotengboy »

excuse me

can nsinfo.tcl change to csinfo.tcl

so, the bot can perform chanel info to the chanel target

please reply

thanks
Post Reply