egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

need a script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Sat Apr 15, 2006 1:28 am    Post subject: need a script Reply with quote

i need a script what can make a live index page that will show all public msg fron a channel & it will update that html page in evry 1 min that can help me out to see all the public msg of a channel live ...
_________________
SuMiT
iRC.CuteBangla.Com


Last edited by CuteBangla on Sat Apr 15, 2006 1:55 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sat Apr 15, 2006 1:51 am    Post subject: Reply with quote

Look at the second script I wrote in this thread.
Back to top
View user's profile Send private message
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Sat Apr 15, 2006 2:01 am    Post subject: Reply with quote

is this will be the script?

Code:

set logfile "/home/blabla/public_html/index.html"
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
}


i want to have that as html file
that any1 can see & mayb that index file ill refresh after evry X seconds or after a new public message in the channel .... & delet old line after evry 20 new lines ...

DragnLord wrote:
Look at the second script I wrote in this thread.

_________________
SuMiT
iRC.CuteBangla.Com
Back to top
View user's profile Send private message Visit poster's website
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sat Apr 15, 2006 2:20 am    Post subject: Reply with quote

A single 'bind pubm - * cmd:log' is all that is needed.
The script would update the page in real time.
Changing
Code:
puts $cmdlog "\[$timestamp\] $t used by $n in $c"

to
Code:
puts $cmdlog "\[$timestamp\] <$n> $t <br>"

will format the file for html.

Code:
set timestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}]
will give a better timestamp for webpages
Back to top
View user's profile Send private message
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Sat Apr 15, 2006 2:36 am    Post subject: Reply with quote

so is this the final script?
will it delete evry old line after X new lines?

Code:

set logfile "/home/blabla/public_html/index.html"
bind pubm - * cmd:log

proc cmd:log {n u h c t} {
   set cmdlog [open ${::logfile} a+]
   set timestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}]
   puts $cmdlog "\[$timestamp\] <$n> $t <br>"
   close $cmdlog
}

_________________
SuMiT
iRC.CuteBangla.Com
Back to top
View user's profile Send private message Visit poster's website
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sat Apr 15, 2006 4:16 am    Post subject: Reply with quote

Code:
set logfile "/home/blabla/public_html/index.html"
# set for logfile length
set linecount 20
bind pubm - * cmd:log
set filecount 0
proc cmd:log {n u h c t} {
   set cmdlog [open ${::logfile} a+]
   set timestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}]
   puts $cmdlog "\[$timestamp\] <$n> $t <br>"
   close $cmdlog
   set pline [lindex [exec wc -l ${::logfile}] 0]
   if {${::filecount} >= ${::linecount}}{
      exec tail -n${::linecount} ${::logfile} > ${::logfile}
      set ::filecount 0
   }
   incr ::filecount
}


Give this a try. Should update the webpage the way you want.
Back to top
View user's profile Send private message
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Sat Apr 15, 2006 8:04 am    Post subject: Reply with quote

will u please tell me how can i define a singel channel??



DragnLord wrote:
Code:
set logfile "/home/blabla/public_html/index.html"
# set for logfile length
set linecount 20
bind pubm - * cmd:log
set filecount 0
proc cmd:log {n u h c t} {
   set cmdlog [open ${::logfile} a+]
   set timestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}]
   puts $cmdlog "\[$timestamp\] <$n> $t <br>"
   close $cmdlog
   set pline [lindex [exec wc -l ${::logfile}] 0]
   if {${::filecount} >= ${::linecount}}{
      exec tail -n${::linecount} ${::logfile} > ${::logfile}
      set ::filecount 0
   }
   incr ::filecount
}


Give this a try. Should update the webpage the way you want.

_________________
SuMiT
iRC.CuteBangla.Com
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Apr 15, 2006 8:23 am    Post subject: Reply with quote

Change
Code:
bind pubm - * cmd:log

to
Code:
bind pubm - "#chan *" cmd:log

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Sat Apr 15, 2006 9:55 am    Post subject: Reply with quote

one more thnk is it possible to upload this html file to a remote host folder
i mean not in shell in some other host ??
_________________
SuMiT
iRC.CuteBangla.Com
Back to top
View user's profile Send private message Visit poster's website
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Sun Apr 16, 2006 5:34 am    Post subject: Reply with quote

is there any way to save tha log to a remote ftp folder??
_________________
SuMiT
iRC.CuteBangla.Com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber