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.

.save and tcl help plz

Old posts that have not been replied to for several years.
Locked
A
AW

.save and tcl help plz

Post by AW »

Hi,

everytime i do .save in a partyline, i see the following
Tcl error in script for 'timer36816':
<eggy> [00:35] extra characters after close-quote, any help please?


Also i was working on stats for users, are known to the bot, like Ops.. but i try my best, couldn't figure out , why its not working, may be any expert can help me, please.

## THE VERSION OF THIS WEBWRITER
set wwver 1.0
set updatetimer 60
set wwpath "/home/aw/public_html"
set statchans "#testing"

proc write_status {} {
global statchans
foreach chan $statchans {ww_next $chan}
}
## THE MAIN PROC
proc ww_next {statchan} {
global wwver updatetimer botnick wwpath
if {$wwpath == ""} {set wf [open status_[string trim $statchan #].htm w]} else {set wf [open $wwpath/status_$statchan.htm w]}
puts $wf "<HTML>"
put $wf "<body bgcolor="#EEEEEE" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">"
put $wf "<table border="0" width="100%">"

puts $wf "<BR><BR>Recorded users:"
puts $wf "<BR>"

foreach u [userlist -b+ovf|ovf $statchan] {
if {![onchan [hand2nick $u $statchan] $statchan]} {
set ss [getuser $u LASTON]
if {$ss == 0} {set ss -} {set ss [ntime $ss]}
set e [getuser $u XTRA EMAIL]
if {$e == ""} {set e -}
set a [chattr $u $statchan]
put $wf "<tr>"
put $wf " <td><img src="../images/spacer.gif" width="20" height="1"></td>"
put $wf " <td colspan="2">"
put $wf " <p class="head2">"
put $wf " $u </p>"
put $wf " </td>"
put $wf " </tr>"
put $wf " <tr>"
put $wf " <td valign="top"> </td>"
put $wf " <td valign="top">"
put $wf " <p><b>Attr:</b></p>"
put $wf " </td>"
put $wf " <td>"
put $wf " <p>"
put $wf " $a </p>"
put $wf " </td>"
put $wf " </tr>"
put $wf " <tr>"
put $wf " <td valign="top"> </td>"
put $wf " <td valign="top">
put $wf " <p><b>Laston:</b></p>"
put $wf " </td>"
put $wf " <td>"
put $wf " <p class="description">"
put $wf " $ss </p>"
put $wf " </td>"
put $wf " </tr>"
put $wf " <tr>"
put $wf " <td> </td>"
put $wf " <td>"
put $wf " <p> </p>"
put $wf " </td>"
put $wf " <td>"
put $wf " <p> </p>"
put $wf " </td>"
put $wf " </tr>"

}
}

puts $wf "</table></HTML>"
close $wf
if {![texists write_status]} {utimer $updatetimer write_status}
}

## REMOVES THE YEAR FORMAT FROM THE DATE/TIME
proc ntime {time} {
set v0 [lrange [ctime $time] 0 0]
set v1 [lrange [ctime $time] 1 1]
set v2 [lrange [ctime $time] 2 2]
set v3 [lrange [ctime $time] 3 3]
set v4 [lrange [ctime $time] 4 4]
set v3 [lindex [split $v3 :] 0]:[lindex [split $v3 :] 1]
return "$v0 $v1. $v2. ($v3)"
}

# THIS CHECKS I THERE IS ALREADY A TIMER ASSIGNED TO UPDATE THE WEB FILE
# !!! not similar to the timerexist-proc in all_tools.tcl !!!
proc texists {utimer_proc} {
set y "0"
foreach x [utimers] {
if {[string match [lindex $x 1] $utimer_proc]} {set y "1"}
}
return $y
}

# STARTS THE UPDATE TIMER
if {![texists write_status]} {utimer $updatetimer write_status}

putlog "WW $wwver by aw loaded.."

I will apprecite for your kind help
thanks
regards
Aw
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

This is all related to your html writing code.

Notice how all the puts lines look like

EG

Code: Select all

puts $blah "<font face="hello">And he said "Look at this"</font>"
You can't just use " in the text, as Tcl will interpret it as part of the command, rather than part of the string.

There are 2 ways around it.

1: Use ' rather than " inside the ""
2: Escape the characters.

2 examples

1:

Code: Select all

puts $blah "<font face='hello'>And he said 'Look at this'</font>"
2:

Code: Select all

puts $blah "<font face=\"hello\">And he said \"Look at this\"</font>"
A
AW

Post by AW »

Thanks PPslim, it worked.

i will appreciate if you can help me, i am able to get a user name($u), but no luck to get a host, i wanted this format Nick(host)
and want to display just ops, no master or owner, just wanna display userlist at site.

foreach u [userlist -b+o $statchan] {
if {![onchan [hand2nick $u $statchan] $statchan]} {
set ss [getuser $u LASTON]
if {$ss == 0} {set ss -} {set ss [ntime $ss]}
set e [getuser $u XTRA EMAIL]
if {$e == ""} {set e -}
set a [chattr $u $statchan]

Thanks a lot
regards
Aw
A
AW

Post by AW »

Hi, ok i figure out about hosts, but ops have multiple hosts in a userlist, is there anyway i can get one the most recent one or if not, then the first one in the list??? but still i couldn't figure out, how do i just display ops, no masters or owners??

thanks
regards
Aw
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

I failed to fully understand either of the 2 posts.

The code you presented did not make much sense to getting any nicknames or hosts.

You can get a list of handles hosts by using "getuser $handle HOSTS"

This will return a list of hosts, and you simply use "lindex" on it.

As for getting the most used, or the most reciently used. This is impossible, unless you create a script to track hostmask usage.
A
AW

Post by AW »

Sorry i think i had mixed up, well i am trying to make a opstat page from a userlist of the bot, where i wanna display their informations like
email, info..etc

but since mostly ppl in a userlist have multiple hosts, i want to display at site
handle!host<--just one

foreach u [userlist -b+o $statchan] {
set h [getuser $u HOSTS]

but how do i use lindex, to get just one host??

and is there anyway i can just get +o users froma userlist, but no +m,+n

thanks
regards
AW
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

I think a match for +o-mn would do the matching (so the documentation states).

As for getting the host, using your example, you would

Code: Select all

foreach u [userlist -b+o $statchan] { 
set h [lindex [getuser $u HOSTS] 0]
A
AW

Post by AW »

Hi ppslim,
Thank you so much, it worked, but
+o-mn didn't work, don't know how to get just Op list, no Master/owner

anyother suggestions plz

thanks
regards
AW
Locked