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.

grabbing localuser info off a raw bind for output

Old posts that have not been replied to for several years.
Locked
S
SmokeyOne
Halfop
Posts: 69
Joined: Tue Jan 14, 2003 6:04 am

grabbing localuser info off a raw bind for output

Post by SmokeyOne »

okay here is the fun part. I managed to get the sub commands working thanks to sleeping and ppslim, and a few others. I'm haveing trouble with this lovely statment.. I'm pretty much pulling this out of thin air, and it doesn't work =/

proc net_lu {nick uhost hand chan arg} {
global lu
if {$chan != $net(chan)} {return 0}
if {[lindex $arg 0] == "local" || [lindex $arg 0] == ""} {
set net(status) "l"
set net(reply) "local "
putquick "LUSERS"
return 0
} else {
set net(status) "u"
set net(reply) "[lindex $arg 0] "
putquick "USERS [lindex $arg 0]"
putquick "STATS $net(cmd) [lindex $arg 0]"
putquick "TIME [lindex $arg 0]"
return 0
}
}
I'm woundering if i should at least add something else to this.. I know I'm missing something. I have to be missing some other sets somewhere but its just not jumping out at me for some odd reason. Getting this to print the output with a "command" has me stumped =/[/code]
S
SmokeyOne
Halfop
Posts: 69
Joined: Tue Jan 14, 2003 6:04 am

Post by SmokeyOne »

This is what I added, i think this will get it, but i do need a little help.

proc net_luser {server num arg} {
global net
append net(reply) $arg
return 0
}
proc net_reply {type arg} {
set lusers [lindex $net(reply) 5]
set lserv [lindex $net(reply) 6]
putmsg $nick "$Local: $lusers and $lserv servers."
if {$type == "u" && $net(status) == "u" ] {
set lserver [lindex $net(reply) 0]
set lusers [lindex $net(reply) 5]
putmsg $nick "Local: $lusers"
return 1
}
}
any idea's ?
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

SmokeyOne wrote:This is what I added, i think this will get it, but i do need a little help.

[snip]

any idea's ?
SmokeyOne, I'm not 100 % sure what you are after, but from the snippets you posted it seems you want to send a command like "LUSERS" to the server, then wait for the server to send back the answer and post the results in a channel.

If this is the case, you will need to dig into rfc1459 to see what RAW numerics the server sends back upon such a request. Maybe there are also scripts available at www.egghelp.org/tcl.htm which can serve as an example.

Additionally, I've uploaded a sample script of sending a LUSERS request to the server and presenting the result back in the channel.

http://members.fortunecity.com/eggheadt ... rs.tcl.txt
S
SmokeyOne
Halfop
Posts: 69
Joined: Tue Jan 14, 2003 6:04 am

Post by SmokeyOne »

the script you uploaded is bascily what I was looking for.. thanks for the big big big help =D
Locked