is it possible ?

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
k
kitsaras
Voice
Posts: 29
Joined: Thu Feb 02, 2006 4:57 pm

is it possible ?

Post by kitsaras »

im just wondering if is possible in this great script who make mr Sir_Fz to show and the server with the stats u

ex !stats
<bot> Server Up 0 days, 0:06:45 shadow.uk.eu.hellas.net
or
<bot> shadow.uk.eu.hellas.net Server Up 0 days, 0:06:45
somethink like this

thanks alot.

Code: Select all

bind pub - !statsu statsu
bind raw - 242 show:statsu

proc statsu {nick uhost hand chan arg} {
 global statsu
 if {![info exists statsu([set chan [string tolower $chan]])]} {
  set statsu($chan) 0
  putserv "stats u"
 }
}

proc show:statsu {from kw arg} {
 global statsu
 foreach {c v} [array get statsu] {
  puthelp "privmsg $c :[string range $arg [expr {[string first : $arg]+1}] end]"
  array unset statsu $c
 }
}
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

use this show:statsu proc:

Code: Select all

proc show:statsu {from kw arg} {
 global statsu
 foreach {c v} [array get statsu] {
  puthelp "privmsg $c :$from [string range $arg [expr {[string first : $arg]+2}] end]"
  array unset statsu $c
 }
}
k
kitsaras
Voice
Posts: 29
Joined: Thu Feb 02, 2006 4:57 pm

Post by kitsaras »

thanks a lot Sir_Fz i need to make one change in code

Code: Select all

proc show:statsu {from kw arg} {
 global statsu
 foreach {c v} [array get statsu] {
  puthelp "privmsg $c :$from [string range $arg [expr {[string first : $arg]+2}] end]"
  array unset statsu $c
 }
}
resoults redemption.ix.us.dal.net erver Up 36 days, 17:13:33

Code: Select all

proc show:statsu {from kw arg} {
 global statsu
 foreach {c v} [array get statsu] {
  puthelp "privmsg $c :$from [string range $arg [expr {[string first : $arg]+1}] end]"
  array unset statsu $c
 }
}
resoults now redemption.ix.us.dal.net Server Up 36 days, 17:25:48

works fine thanks again Sir_Fz for the valiable help :)
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Ahh my bad, I meant

Code: Select all

proc show:statsu {from kw arg} {
 global statsu
 foreach {c v} [array get statsu] {
  puthelp "privmsg $c :$from [join [lrange [split $arg] 2 end]]"
  array unset statsu $c
 }
}
So the reply would look like
redemption.ix.us.dal.net Up 36 days, 17:13:33
k
kitsaras
Voice
Posts: 29
Joined: Thu Feb 02, 2006 4:57 pm

Post by kitsaras »

thanks Sir_Fz it works :)

thanks again.
Post Reply