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.

script request if 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

script request if possible

Post by kitsaras »

Hello. I want to request a tcl script if possible.
I want a script to log all the public commands ex ( ! . ) in my channel when a user give a command !blabla or .blabla to log it in a txt and if its possible ( if ) to sent it in a specific email.

Thank u.
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

This will place public commands starting with "!" or "." in the bot's log file (also shows on partyline with the correct console flags).

Code: Select all

bind pubm - "% !*" cmd:log
bind pubm - "% .*" cmd:log

proc cmd:log {n u h c t} {
        putlog "Public Command Logger: $t used by $n in $c"
}
k
kitsaras
Voice
Posts: 29
Joined: Thu Feb 02, 2006 4:57 pm

Post by kitsaras »

DragnLord wrote:This will place public commands starting with "!" or "." in the bot's log file (also shows on partyline with the correct console flags).

Code: Select all

bind pubm - "% !*" cmd:log
bind pubm - "% .*" cmd:log

proc cmd:log {n u h c t} {
        putlog "Public Command Logger: $t used by $n in $c"
}

Works fine i check it but is there any way to change the log dir ex /home/blabla/public_html/bot.log ?

thank u.
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

Code: Select all

set logfile "/home/blabla/public_html/bot.log"
bind pubm - "% !*" cmd:log
bind pubm - "% .*" cmd:log

proc cmd:log {n u h c t} {
        set cmdlog [open ${::logfile} a+]
        set timestamp [clock format [clock seconds]]
        puts $cmdlog "\[$timestamp\] $t used by $n in $c"
        close $cmdlog
}
This should be what you're looking for.
k
kitsaras
Voice
Posts: 29
Joined: Thu Feb 02, 2006 4:57 pm

Post by kitsaras »

DragnLord wrote:

Code: Select all

set logfile "/home/blabla/public_html/bot.log"
bind pubm - "% !*" cmd:log
bind pubm - "% .*" cmd:log

proc cmd:log {n u h c t} {
        set cmdlog [open ${::logfile} a+]
        set timestamp [clock format [clock seconds]]
        puts $cmdlog "\[$timestamp\] $t used by $n in $c"
        close $cmdlog
}
This should be what you're looking for.
I just change the logfile from config to the public_html and works fine
:D thank u very much DragnLord
Post Reply