mIRC Home    About    Download    Register    News    Help

Topic Options
#67676 - 13/01/04 06:44 PM alias
MTec89 Offline
Hoopy frood

Registered: 25/07/03
Posts: 742
Loc: Ohio, U.S.A.
i have this alias, that writes a html ifle based on a text file that looks like this:
Code:
09/01/2004 	 192.168.1.101 	 Chaos 	 1on1 	 West 	 1.6 	 Win 	


im trying to write that info to the html file in a tabe, heres my alias:
Code:
alias cs.rec.g {
  write -c CSRecords.html <html><head><title>CS Scrim Records</title></head>
  write CSRecords.html <body bgcolor=black text=white link=red alink=red vlink=red><center>
  write CSRecords.html $cs.rec.gscri Scrims<br>
  write CSRecords.html $cs.rec.gwins Wins<br>
  write CSRecords.html $cs.rec.gloss Losses<br><br>
  write CSRecords.html <table bgcolor=black border=2 cellspacing=1 cellpadding=1>
  write CSRecords.html <tr><td>Date</td><td>Server IP</td><td>Clan</td><td>XonX</td><td>Location</td><td>Version</td><td>Outcome</td>
  write CSRecords.html
  ;Stuff here, but cant figure out how to do it
  write CSRecords.html </table>
}
_________________________
http://MTec89Net.com
irc.freenode.net #MTec89Net

Top
#67677 - 13/01/04 08:05 PM Re: alias
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
alias cs.rec.gwrite {
var %i 1
while $read($txtfile(cs.txt),%i) {
write CsRecords.html <tr><td> $replace($read($txtfile(cs.txt),%i),$chr(32),</td><td>) </tr></td>
inc %i
}
}
providing each piece of info is seperated by only 1 space, that should work smile.
-untested
_________________________
New username: hixxy

Top
#67678 - 13/01/04 08:52 PM Re: alias
MTec89 Offline
Hoopy frood

Registered: 25/07/03
Posts: 742
Loc: Ohio, U.S.A.
you misspelled my $tstdir var, but its still not working i get a table looking like this:
Code:
&lt;table bgcolor=black border=2 cellspacing=1 cellpadding=1&gt;
&lt;tr&gt;&lt;td&gt;Date&lt;/td&gt;&lt;td&gt;Server IP&lt;/td&gt;&lt;td&gt;Clan&lt;/td&gt;&lt;td&gt;XonX&lt;/td&gt;&lt;td&gt;Location&lt;/td&gt;&lt;td&gt;Version&lt;/td&gt;&lt;td&gt;Outcome&lt;/td&gt;
&lt;tr&gt;&lt;td&gt; 09/01/2004&lt;/td&gt;	&lt;/td&gt;192.168.1.101&lt;/td&gt;	&lt;/td&gt;Chaos&lt;/td&gt;	&lt;/td&gt;1on1&lt;/td&gt;	&lt;/td&gt;West&lt;/td&gt;	&lt;/td&gt;1.6&lt;/td&gt;	&lt;/td&gt;Win&lt;/td&gt;	 &lt;/tr&gt;
&lt;/table&gt;

Code:
alias cs.rec.g {
  write -c CSRecords.html &lt;html&gt;&lt;head&gt;&lt;title&gt;CS Scrim Records&lt;/title&gt;&lt;/head&gt;
  write CSRecords.html &lt;body bgcolor=black text=white link=red alink=red vlink=red&gt;&lt;center&gt;
  write CSRecords.html &lt;table bgcolor=black border=2 cellspacing=1 cellpadding=1&gt;
  write CSRecords.html &lt;tr&gt;&lt;td&gt;Date&lt;/td&gt;&lt;td&gt;Server IP&lt;/td&gt;&lt;td&gt;Clan&lt;/td&gt;&lt;td&gt;XonX&lt;/td&gt;&lt;td&gt;Location&lt;/td&gt;&lt;td&gt;Version&lt;/td&gt;&lt;td&gt;Outcome&lt;/td&gt;
  cs.rec.gwrite
  write CSRecords.html &lt;/table&gt;
}
alias cs.rec.gwrite {
  var %i 1
  while $read($txtfile(cs.txt),%i) {
    write CSRecords.html &lt;tr&gt;&lt;td&gt; $replace($read($txtfile(cs.txt),%i),$chr(32),&lt;/td&gt;) &lt;/tr&gt;
    inc %i
  }
}


Edited by MTec89 (13/01/04 08:57 PM)
_________________________
http://MTec89Net.com
irc.freenode.net #MTec89Net

Top
#67679 - 13/01/04 08:57 PM Re: alias
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
edited^
_________________________
New username: hixxy

Top
#67680 - 13/01/04 08:58 PM Re: alias
MTec89 Offline
Hoopy frood

Registered: 25/07/03
Posts: 742
Loc: Ohio, U.S.A.
edited^ :P
_________________________
http://MTec89Net.com
irc.freenode.net #MTec89Net

Top