Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3938584
LogJoins.tcl
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
785 B
Referenced Files
None
Subscribers
None
LogJoins.tcl
View Options
# This TCL for an oper eggdrop logs "Client connecting" lines.
#
# Configuration
#
set
LogJoins
(
file
)
join.log
set
LogJoins
(
server
)
Irc.ApniISP.CoM
#
# Events
#
bind
raw
-
NOTICE raw:logjoin
#Handles server notices
proc
raw:logjoin
{
from
keyword text
}
{
global
LogJoins
if
{
$from
==
$LogJoins
(
server
)
&&
$keyword
==
"NOTICE"
}
{
set
pos
[
string
first
"Client connecting"
$text
]
if
{
$pos
>
-1
}
{
log_entry
$LogJoins
(
file
)
[
string
range
$text
$pos
end
]
}
}
}
#
# Helper methods
#
#Returns a log message, prepended by current time
proc
log_message
{
message
}
{
return
"[clock format [unixtime] -format "%x %X"] $message"
}
#Logs a message in the specified file
proc
log_entry
{
file
message
}
{
set
fd
[
open
$file
a
]
puts
$fd
[
log_message
$message
]
close
$fd
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 03:22 (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2314092
Default Alt Text
LogJoins.tcl (785 B)
Attached To
Mode
rVIPERSERV ViperServ scripts [legacy Mercurial repo]
Attached
Detach File
Event Timeline
Log In to Comment