Listing current users on a webpage - 25/09/03 08:21 PM
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
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
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