[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[OpenVerse] Text Chat Plugin
Here is a plugin that makes it where it shows the roomname and a user
count.
To install make a directory in your plugins directory and stick this in it
and name it PlugInit.tcl:
--CUT--------------------------------------------------------------------------
#
# Roomname and user count for a room in text chat
#
RegisterPlugin ChatExtra ProcessInput.pre CE_Init
global CE
global MV
set CE(u_count) 0
set CE(r_name) $MV(roomname)
proc CE_Init { what cmd parms rest } {
global CE
global MV
set CE(r_name) $MV(roomname)
if {[winfo exists .chat] && ![winfo exist .chat.ce]} {
frame .chat.ce
pack .chat.ce
label .chat.ce.room -text "Roomname: $CE(r_name)" \
-width 76 -relief sunken
label .chat.ce.u -text "Users: $CE(u_count)" -relief sunken
pack .chat.ce.room -side left
pack .chat.ce.u -side right
}
if {[string compare $cmd "NEW"] == 0} {
incr CE(u_count)
if {[winfo exists .chat.ce]} {destroy .chat.ce} \
else {return 1}
if {[winfo exists .chat]} {
frame .chat.ce
pack .chat.ce
label .chat.ce.room -text "Roomname: $CE(r_name)" \
-width 76 -relief sunken
label .chat.ce.u -text "Users: $CE(u_count)" \
-relief sunken
pack .chat.ce.room -side left -fill both
pack .chat.ce.u -side right -fill both
} else {return 1}
}
if {[string compare $cmd "NOMORE"] == 0} {
set CE(u_count) [expr $CE(u_count) - 1]
if {[winfo exists .chat.ce]} {destroy .chat.ce} \
else {return 1}
if {[winfo exists .chat]} {
frame .chat.ce
pack .chat.ce -side top
label .chat.ce.room -text "Roomname: $CE(r_name)" \
-width 76 -relief sunken
label .chat.ce.u -text "Users: $CE(u_count)" \
-relief sunken
pack .chat.ce.room -side left -fill both
pack .chat.ce.u -side right -fill both
} else {return 1}
}
if {[string compare $cmd "ROOMNAME"] == 0} {
set CE(r_name) "$parms"
set CE(u_count) 0
destroy .chat.ce.room
if {[winfo exists .chat.ce]} {destroy .chat.ce} \
else {return 1}
if {[winfo exists .chat]} {
frame .chat.ce
pack .chat.ce -side top
label .chat.ce.room -text "Roomname: $CE(r_name)" \
-width 76 -relief sunken
label .chat.ce.u -text "Users: $CE(u_count)" \
-relief sunken
pack .chat.ce.room -side left -fill both
pack .chat.ce.u -side right -fill both
} else {return 1}
}
return 1
}
-CUT---------------------------------------------------------------------
Hey it works and it may not be pretty and can be made better, but it works
and i never claimed that this is my opus.
I made this for me, but i released it here for maybe some use to
someone...
thanks,
-jack
-------------------------------------------------------
--
Cruise -
OpenVerse Visual Chat - http://openverse.org/
-----------------------------------------------------------------
To unsubscribe to the OpenVerse mailing list send a message
to openverse-request@openverse.org with the following word
in the BODY of the message.
UNSUBSCRIBE
If you need assistance from a human, email cruise@openverse.org
-----------------------------------------------------------------