|
Joined: Aug 2003
Posts: 136
Vogon poet
|
OP
Vogon poet
Joined: Aug 2003
Posts: 136 |
Ive written a sloppy script where it lists the current users their position ie Op Halfop Voice Regular, and the last 10 lines said in the room, 2 problems, sometimes the script wont list the users like the /who commands want activated and also the save buf command brings in colors, should I just strip colors always? or could I somehow strip them as I read i tried and failed also suggestions on cleaning it up would be nice. the .pif is a shortcut to run a bat that ftp's the file to my site heres the code
alias users {
who $chan
users2
}
alias users2 {
/lastwords
/topic $chan
write -c users.html <html><head><title>Current Users on $chan </title></head><body bgcolor="black" text="yellow"><center>
write users.html The current topic is <br> $strip(%topic,burcmo) <hr width="50%"> <h2>Current Users in #USA</h2><table border="1" bordercolor="blue">
listppl
}
alias lastwords {
savebuf 10 #usa lastwords.txt
}
alias listppl {
set %i 1
:next
set %nick $nick(#,%i)
if %nick == $null goto done
if %nick isop #usa { /write users.html <tr><td><center> %nick is an Op</center></tr></td> }
elseif %nick ishop #usa { /write users.html <tr><td><center> %nick is a HalfOp</center></tr></td> }
elseif %nick isvoice #usa { /write users.html <tr><td><center> %nick is voiced</center></tr></td> }
elseif %nick isreg #usa { /write users.html <tr><td><center> %nick is a regular user</center></tr></td> }
inc %i
goto next
:done
/write users.html </table><br>
closehtml
}
alias closehtml {
write users.html <hr width="50%"> Last 10 lines of text said.<br> $read(lastwords.txt, 1) <br> $read(lastwords.txt, 2) <br> $read(lastwords.txt, 3) <br> $read(lastwords.txt, 4) <br> $read(lastwords.txt, 5) <br> $read(lastwords.txt, 6) <br> $read(lastwords.txt, 7) <br> $read(lastwords.txt, 8) <br> $read(lastwords.txt, 9) <br> $read(lastwords.txt, 10) <br> <hr width=50%"> Updated Every 10 minutes<br>Last update $asctime(h:nn:ss tt z) GMT <br> This has been updated by : $nick </center></body></html>
upload
}
alias upload {
run transer.bat.pif
.timer 1 15 /msg $chan Hey your famous, your on the net @ http://mrurl.com/
}
Sorry about how it scrolls I hate that to. Also itll list the users if I /who #chan first then run the script, yes i have my interal address book on
Last edited by MrPeepers; 25/09/03 08:28 PM.
In Virginia, chickens cannot lay eggs before 8:00 a.m., and must be done before 4:00 p.m.
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
Right click here and select "Save target as..." to download the file. Please note that the @@ window must pop up during the process, otherwise due to a bug long topics or text lines will not be wrapped (if you don't care about it, add a -h switch to the /window command to make it hidden). Tested on MSIE 6.
|
|
|
|
Joined: Jul 2003
Posts: 132
Vogon poet
|
Vogon poet
Joined: Jul 2003
Posts: 132 |
how about reversed situation? is it possible to give all text to @window FROM 1 webpage?
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
Sure, search this forum for http/1 and make sure the search date is expanded to "All posts". You'll then find plenty of downloading scripts. Pay special attention to posts by Hammer
|
|
|
|
Joined: Aug 2003
Posts: 136
Vogon poet
|
OP
Vogon poet
Joined: Aug 2003
Posts: 136 |
Sorry was an a-hole commeted before dling, thankyou
Last edited by MrPeepers; 26/09/03 02:06 AM.
In Virginia, chickens cannot lay eggs before 8:00 a.m., and must be done before 4:00 p.m.
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Here's another way, using the new file-handling commands (which are really fast), so you MUST be using 6.1 to use this script. alias users {
.remove users.html
.fopen -n a users.html
.fwrite -n a <html><head><title>Current Users on # </title></head><body bgcolor="black" text="yellow">
.fwrite -n a <center>The current topic is<br> $strip($chan(#).topic) <hr width="50%"> $&
<h2>Current Users in # </h2><table border="1" bordercolor="blue">
var %i = 1
while $nick(#,%i).pnick {
if $left($ifmatch,1) isin @%+ {
.fwrite -n a <tr><td><center> $nick(#,%i) $&
$gettok(is an Op:is a HalfOp:is Voiced,$pos(@%+,$ifmatch,1),58) </center></tr></td>
}
else .fwrite -n a <tr><td><center> $nick(#,%i) is a regular user <center></tr></td>
inc %i
}
.fwrite -n a </table><br><hr width="50%"><br><u>The last 10 lines from # </u><br><br><br></center>
; Used Online's code for grabbing the channel lines :grin:
var %o = $line(#,0),%i = $iif(%o > 10,$calc(%o - 10),0)
while %i <= %o {
.fwrite a $strip($line(#,%i)) <br><br>
inc %i
}
.fwrite -n a <center><hr width=50%"> Updated Every 10 minutes<br>Last update $asctime(h:nn:ss tt z) $&
GMT <br> This has been updated by : $me </center></body></html>
.fclose a
run transer.bat.pif
.timer 1 15 msg # Hey you are famous, you're on the net @ http://mrurl.com/
}
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
Yes this is a nice use of the file-handling system.
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Thanks. Yeah, I like the speed of the /f* commands a lot.
|
|
|
|
|