the same if i query the bot with !chaninfo <somechan> after which the bot performs a /chanserv info #somechan and queries me with this info:<botname> -NickServ- Info for LordAshe:
<botname> -NickServ- (Currently on IRC) For extra info: /whois LordAshe
<botname> -NickServ- Last seen address : Ashe@apocrypha.jirehnet.net
<botname> -NickServ- Last seen time : Sun 29-Apr-2007 17:52:16 UTC
<botname> -NickServ- Time registered : Tue 13-Feb-2007 12:14:14 UTC
<botname> -NickServ- Time now : Mon 30-Apr-2007 00:12:15 UTC
<botname> -NickServ- Options: Enforced
<botname> -NickServ- *** End of Info ***
i hope m clear with this. thanks again for the help. i hope sum1 can come up with this nifty and very usable script. (my server is DALNET by the way in case if the servers are an issue)<botname> -ChanServ- Info for #icon:
<botname> -ChanServ- Founder : LordAshe (enforcer@microsoft.net-ph.com)
<botname> -ChanServ- Mode Lock : +nt-ispklmc
<botname> -ChanServ- Last Topic : 'This is the channel Topic' (LordAshe)
<botname> -ChanServ- Description: PrivateChannel
<botname> -ChanServ- Options : SecuredOps, Ident, Verbose, Topic Lock(S)
<botname> -ChanServ- Memo Level : AOP
<botname> -ChanServ- Registered : Wed 17-Jan-2007 02:39:31 UTC
<botname> -ChanServ- Last opping: Sun 29-Apr-2007 16:33:07 UTC
<botname> -ChanServ- *** End of Info ***
Code: Select all
## Give your channel name here.
set scriptchannel "#channel"
bind pub -|- !nickinfo script:text1
bind pub -|- !chaninfo script:text2
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 -|- "*URL*" script:notices1
bind notc -|- "*Options*" script:notices1
bind notc -|- "*Founder*" script:notices1
bind notc -|- "*Mode Lock*" script:notices1
bind notc -|- "*Last Topic*" script:notices1
bind notc -|- "*Description:*" script:notices1
bind notc -|- "*Memo Level*" script:notices1
bind notc -|- "*Registered*" script:notices1
bind notc -|- "*Last opping*" script:notices1
bind notc -|- "*End of Info*" 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@services.dal.net :info $user"
}
proc script:text2 { nick host handle chan text } {
global scriptchannel
set text [split $text]
set text [lindex $text 0]
if {$text == ""} {puthelp "NOTICE $nick :You need to supply a channel name."; return}
putserv "PRIVMSG chanserv@services.dal.net :info $text"
}
proc script:notices1 {nick uhost hand text dest} {
global scriptchannel
putquick "PRIVMSG $scriptchannel :$text"
}
putlog "!nickinfo and !chaninfo script loaded by iamdeath."
pls bear with the request.. if its too much just say so... the help u gave is actually enuf already... but will appreciate it if u can add this one up. thanks dude.<botnick> LordAshe is enforce@oper.c0ntrol.com * root|fix
<botnick> LordAshe on @#adzu +#icon #tclhelp
<botnick> LordAshe using punch.va.us.dal.net Spelling is a lossed art.
<botnick> LordAshe has identified for this nick
<botnick> LordAshe has been idle 4mins 54secs, signed on Mon Apr 30 03:36:19
<botnick> LordAshe End of /WHOIS list.
Thanks alot for pointing that out nml, actually yes I don't need to make $user global at that time I was doing some experiences so I used that it in Global then I forgot to remove it.nml375 wrote:You really want it to trigger in any channel, but write to a preset channel (regardless of the channel it was triggered in)?
@iamdeath: there's no point in making the variable "user" access globalspace within script:text1, and neither "scriptchannel" in both script:text1 and script:text2
Code: Select all
proc script:notices1 {nick uhost hand text dest} {
global scriptchannel
putquick "PRIVMSG $scriptchannel :$text"
}
bind pub -|- !nickinfo script:text1
bind pub -|- !chaninfo script:text2
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 -|- "*URL*" script:notices1
bind notc -|- "*Options*" script:notices1
bind notc -|- "*Founder*" script:notices1
bind notc -|- "*Mode Lock*" script:notices1
bind notc -|- "*Last Topic*" script:notices1
bind notc -|- "*Description:*" script:notices1
bind notc -|- "*Memo Level*" script:notices1
bind notc -|- "*Registered*" script:notices1
bind notc -|- "*Last opping*" script:notices1
bind notc -|- "*End of Info*" script:notices1
proc script:text1 { nick host handle chan text } {
global towhom
set text [split $text]
set text [lindex $text 0]
set towhom "$nick"
if {$text == ""} {puthelp "NOTICE $nick :You need to supply a nickname."; return}
putserv "PRIVMSG nickserv@services.dal.net :info $text"
}
proc script:text2 { nick host handle chan text } {
global towhom
set text [split $text]
set text [lindex $text 0]
set towhom "$nick"
if {$text == ""} {puthelp "NOTICE $nick :You need to supply a channel name."; return}
putserv "PRIVMSG chanserv@services.dal.net :info $text"
}
proc script:notices1 {nick uhost hand text dest} {
global towhom
putquick "PRIVMSG $towhom :$text"
}
putlog "!nickinfo and !chaninfo script loaded by iamdeath."
Code: Select all
proc get_ns {nick host hand text {dest ""}} {
global get_ns
if {![info exists get_ns(target)] || [string equal $get_ns(target) ""]} {return 0}
puthelp "NOTICE $get_ns(target) :$text"
if {[string match "*End of Info*" $text]} {
unset get_ns(target)
if {[info exists get_ns(queue)] && [llength $get_ns(queue)] > 0} {
set next [lindex $get_ns(queue) 0]
set get_ns(queue) [lreplace $get_ns(queue) 1 end]
set get_ns(target) [lindex $next 0]
putserv "PRIVMSG [lindex $next 1] :info [lindex $next 2]"
}
}
}
proc request_ns {nick host hand chan text} {
global get_ns
if {[string lenght $text] <= 0} {
puthelp "NOTICE $nick :You must supply a nickname."
return 1
}
if {[info exists get_ns(target)] && ![string equal $get_ns(target) ""]} {
puthelp "NOTICE $nick :There is already a request in progress. Your request has been queued."
lappend get_ns(queue) [list $nick "nickserv@services.dal.net" [lindex [split $text] 0]"]
} else {
set get_ns(target) $nick
putserv "PRIVMSG nickserv@services.dal.net :info [lindex [split $text] 0]"
puthelp "NOTICE $nick :Request sent."
}
}
proc request_cs {nick host hand chan text} {
global get_ns
if {[string lenght $text] <= 0} {
puthelp "NOTICE $nick :You must supply a nickname."
return 1
}
if {[info exists get_ns(target)] && [string equal $get_ns(target) ""]} {
puthelp "NOTICE $nick :There is already a request in progress. Your request has been queued."
lappend get_ns(queue) [list $nick "chanserv@services.dal.net" [lindex [split $text] 0]"]
} else {
set get_ns(target) $nick
putserv "PRIVMSG chanserv@services.dal.net :info [lindex [split $text] 0]"
puthelp "NOTICE $nick :Request sent."
}
}
bind pub -|- !nickinfo request_ns
bind pub -|- !chaninfo request_cs
bind notc -|- "*Info for *" get_ns
bind notc -|- "*For extra info*" get_ns
bind notc -|- "*Last seen address*" get_ns
bind notc -|- "*Last seen time*" get_ns
bind notc -|- "*Time registered*" get_ns
bind notc -|- "*Time now*" get_ns
bind notc -|- "*URL*" get_ns
bind notc -|- "*Options*" get_ns
bind notc -|- "*Founder*" get_ns
bind notc -|- "*Mode Lock*" get_ns
bind notc -|- "*Last Topic*" get_ns
bind notc -|- "*Description:*" get_ns
bind notc -|- "*Memo Level*" get_ns
bind notc -|- "*Registered*" get_ns
bind notc -|- "*Last opping*" get_ns
bind notc -|- "*End of Info*" get_ns
Code: Select all
proc get_ns {nick host hand text {dest ""}} {
global get_ns
if {[info exists get_ns(target)] && ![string equal $get_ns(target) ""]} {return 0}
puthelp "NOTICE $get_ns(target) :$text"
if {[string match "*End of Info*" $text]} {
unset get_ns(target)
if {[info exists get_ns(queue)] && [llength $get_ns(queue)] > 0} {
set next [lindex $get_ns(queue) 0]
set get_ns(queue) [lreplace $get_ns(queue) 1 end]
set get_ns(target) [lindex $next 0]
putserv "PRIVMSG [lindex $next 1] :info [lindex $next 2]"
}
}
}
proc request_ns {nick host hand chan text} {
global get_ns lastbind
if {[string lenght $text] <= 0} {
puthelp "NOTICE $nick :You must supply a nickname."
return 1
}
switch -- $lastbind {
"!nickinfo" {set target nickserv@services.dal.net}
"!chaninfo" {set target chanserv@services.dal.net}
default {return}
}
if {![info exists get_ns(target)] || [string equal $get_ns(target) ""]} {
puthelp "NOTICE $nick :There is already a request in progress. Your request has been queued."
lappend get_ns(queue) [list $nick $target [lindex [split $text] 0]"]
} else {
set get_ns(target) $nick
putserv "PRIVMSG $target :info [lindex [split $text] 0]"
puthelp "NOTICE $nick :Request sent."
}
}
bind pub -|- !nickinfo request_ns
bind pub -|- !chaninfo request_ns
bind notc -|- "*Info for *" get_ns
bind notc -|- "*For extra info*" get_ns
bind notc -|- "*Last seen address*" get_ns
bind notc -|- "*Last seen time*" get_ns
bind notc -|- "*Time registered*" get_ns
bind notc -|- "*Time now*" get_ns
bind notc -|- "*URL*" get_ns
bind notc -|- "*Options*" get_ns
bind notc -|- "*Founder*" get_ns
bind notc -|- "*Mode Lock*" get_ns
bind notc -|- "*Last Topic*" get_ns
bind notc -|- "*Description:*" get_ns
bind notc -|- "*Memo Level*" get_ns
bind notc -|- "*Registered*" get_ns
bind notc -|- "*Last opping*" get_ns
bind notc -|- "*End of Info*" get_ns
Code: Select all
set mychannel "#channel"
bind pub -|- !whois script:whois
proc script:whois { nick host handle chan text } {
set text [split $text]
set user [lindex $text 0]
if {$user == ""} {puthelp "NOTICE $nick :You need to supply a nickname."; return}
putquick "WHOIS $user"
}
bind raw - "311" script:whois1
bind raw - "312" script:whois1
bind raw - "318" script:whois1
bind raw - "319" script:whois1
bind raw - "401" script:whois1
proc script:whois1 {from key args} {
global mychannel
set text [split $args]
set topaste [lrange $text 1 end]
regsub -all {\{} $topaste "" topaste
regsub -all {\}} $topaste "" topaste
regsub -all {\\} $topaste "" topaste
putserv "PRIVMSG $mychannel :$topaste"
}
putlog "!whois script loaded by iamdeath."