mIRC Homepage
Posted By: Lenooox banlist to .htm file - 03/03/12 07:49 AM
someone can help me I want a banlist to html script

i tried to make one , but that not works frown looky my code

Code:
on *:text:!banhtml*:#: {
  set %file banlist.ini
  unset %banlist
  remove Banlist.html
  write Banlist.html <html>
  write Banlist.html <head>
  write Banlist.html <title>Channel Banlist</title>
  write Banlist.html <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  write Banlist.html <link href="layout.css" rel="stylesheet" type="text/css" />
  write Banlist.html </head>
  write Banlist.html <body>
  write Banlist.html <table class="tablec">
  write Banlist.html <tr>
  write Banlist.html <td colspan="2" class="top">
  write Banlist.html <a href="irc://irc.quakenet.org" rel="nofollow"><img src="http://images.cooltext.com/2470420.jpg"</a>
  write Banlist.html </td>
  write Banlist.html </tr>
  write Banlist.html </table>
  write Banlist.html <table>
  write Banlist.html <tr>
  write Banlist.html <td class="eins"></td>
  write Banlist.html <th>Place</th>
  write Banlist.html <th>Nick</th>
  write Banlist.html <th>Mask</th>
  write Banlist.html <th>Banned on</th>
  write Banlist.html <th>Expires on</th>
  write Banlist.html <th>Banned by</th>
  write Banlist.html <td class="eins"></td>
  write Banlist.html </tr>
  write Banlist.html <tr>
  write Banlist.html <td colspan="7" class="seperator"></td>
  write Banlist.html </tr>
  set %max $mini(%file,,nick,0)

  var %x = 1

  while (%x < %max) {

    write Banlist.html <tr>
    write Banlist.html <td class="eins"></td>
    write Banlist.html <td class="toplist"> %x </td>
    write Banlist.html <td class="toplist"><a href="http://insaneboard.comeze.com/bans/ $+ $readini(%file, $ini(%file,%x), nick) $+ .html" target="_blank" rel="nofollow"> $+ $readini(%file, $ini(%file,%x), nick) $+ </a></td>  
    write Banlist.html <td class="toplist"> $readini(%file, $ini(%file,%x), mask) </td>
    write Banlist.html <td class="toplist"> $readini(%file, $ini(%file,%x), bannedon) </td>
    write Banlist.html <td class="toplist"> $readini(%file, $ini(%file,%x), expireson) </td>
    write Banlist.html <td class="toplist"> $readini(%file, $ini(%file,%x), bannedby) </td>
    write Banlist.html  <td class="eins"></td>
    write Banlist.html </tr>
    inc %x
  }
  write Banlist.html </tr>
  write Banlist.html </table>
  write Banlist.html <br>
  write Banlist.html <table>
  write Banlist.html <tr>
  write Banlist.html <td class="seperator"></td>
  write Banlist.html </tr>
  write Banlist.html <tr>
  write Banlist.html <td class="bottom">
  write Banlist.html <a href="http://insaneboard.comeze.com" target="blank" rel="nofollow">[I]Serv</a> BoT @ 2012
  write Banlist.html </td>
  write Banlist.html </tr>
  write Banlist.html </table>
  write Banlist.html </body>
  write Banlist.html </html>
}
Posted By: argv0 Re: banlist to .htm file - 03/03/12 07:59 AM
And what part of it doesn't work?
Posted By: Lenooox Re: banlist to .htm file - 03/03/12 08:05 AM
all when i type !banlist nothing happens
i tried to put Echos , but there is no error

looks i want this :
[img]http://www.ugamer.net/irc/bans/quakenet_ugn.pug.htm[/img]
Posted By: Steeeve Re: banlist to .htm file - 03/03/12 02:33 PM
The ON TEXT event doesn't trigger when you enter the text yourself.

You would have to monitor the ON INPUT event instead.

If you want channel users to use the command as well, you could abstract it to an alias:

e.g.
Code:
alias banlist {
[...] most of your code goes here [...]
}

; Modify your on text event:
on *:text:!banhtml*:#: { /banlist }


You can then enter /banlist to generate the file yourself, and channel users (excluding yourself) can use !banlist . If you still want it triggered when you write !banlist yourself, you can add:
Code:
on *:input:#:{
  if ($1 == !banlist) { /banlist }
}

Posted By: Lenooox Re: banlist to .htm file - 03/03/12 08:01 PM
i understand , but dont know what happend i got nothing frown

Posted By: sparta Re: banlist to .htm file - 03/03/12 08:13 PM
You need to loop true the banlist, then gather the info from the loop.
Code:
alias testing {
 var %x = $banlist(#,0)
 while (%x) {
  echo -a $banlist(#,%x)
  dec %x
 }
}

Code untested, but it should give you the iformation from the banlist, then you need to write it to your file.
Posted By: Lenooox Re: banlist to .htm file - 03/03/12 08:40 PM
I have it so much, can you make this script for me please? :$$
Posted By: sparta Re: banlist to .htm file - 03/03/12 09:13 PM
No, to much work with that one.
Posted By: hixxy Re: banlist to .htm file - 04/03/12 01:56 AM
Originally Posted By: Lenooox
all when i type !banlist nothing happens
i tried to put Echos , but there is no error

looks i want this :
[img]http://www.ugamer.net/irc/bans/quakenet_ugn.pug.htm[/img]


The trigger is !banhtml not !banlist.
Posted By: Lenooox Re: banlist to .htm file - 04/03/12 10:56 AM
Damn this script , does not work frown

thank all answers , but i give it up , im so stupid for this laugh frown
Posted By: pball Re: banlist to .htm file - 04/03/12 03:16 PM
Well if you want to give this another shot, try this alias. It will echo out the banlist for the current channel.

Code:
alias bl {
  if (!$chan($chan).ibl) { mode $chan +b | .timerbl 1 1 bl | halt }
  set -l %num 1
  while ($ibl($chan,%num)) {
    echo -a Nick: $v1 / By: $ibl($chan,%num).by / Date: $ibl($chan,%num).date
    inc %num
  }
}


one thing I noticed about the example above using $banlist, it doesn't check if the internal ban list is updated. So if you use it before your client gets the ban list it will return nothing. Also you can't get expiration times since unban timers are local to the client that set the ban.
Posted By: Lenooox Re: banlist to .htm file - 04/03/12 06:16 PM
yeah , Thanks very much!

I would like to save this information in html smile
Posted By: sparta Re: banlist to .htm file - 04/03/12 10:24 PM
Replace:
echo -a Nick: $v1 / By: $ibl($chan,%num).by / Date: $ibl($chan,%num).date

With:
write Banlist.html Nick: $v1 / By: $ibl($chan,%num).by / Date: $ibl($chan,%num).date
Posted By: pball Re: banlist to .htm file - 05/03/12 01:38 AM
you might have to do a bit more to integrate the code I posted. Since if the ibl isn't up to date it has to issue a command to update and then run itself again. Though an easy way around that would be to run the /mode $chan +b when the whole script is triggered and use a timer to start the rest of it.
Posted By: Lenooox Re: banlist to .htm file - 05/03/12 01:18 PM
ahh thank you pball im so sorry i dont saw your post :$

thank you folks smile
Posted By: Lenooox Re: banlist to .htm file - 05/03/12 06:23 PM
how can i put other tables or backgrounds? :$
i get only this! [img]http://lenoox.insaneboard.comeze.com/Banlist.html[/img]

im sorry for my stupid questions frown
Posted By: sparta Re: banlist to .htm file - 05/03/12 09:47 PM
In your first post u had code writed to the html file, try around a bit with that code..

By the way, no picture at that url.
© mIRC Discussion Forums