mIRC Home    About    Download    Register    News    Help

Print Thread
Is mIRC able to write to a homepage??? #179757 27/06/07 07:31 PM
Joined: Jun 2007
Posts: 1
J
JTR Offline OP
Mostly harmless
OP Offline
Mostly harmless
J
Joined: Jun 2007
Posts: 1
Hey
I've made a bot used in an online game. It needs to update a homepage with some info, but I don't know if it's possible.

So, is it possible to make mIRC write/update a homepage??? If yes, how?

When I have googled it, I have only found topics for other IRC-clients.

Thanks in advance.

Re: Is mIRC able to write to a homepage??? [Re: JTR] #179758 27/06/07 07:45 PM
Joined: May 2007
Posts: 89
T
TropNul Offline
Babel fish
Offline
Babel fish
T
Joined: May 2007
Posts: 89
here are the steps that may be followed:

1. Connect to the FTP server of your site.
2. Retrieve the file that has to be modified.
3. Modify it.
4. Retransfer it by crushing the ancient same file.

requirements:

> you'll have to know the 'File Transfer Protocol' commands.
> you'll have to know how to manipulate sockets in mirc.

hope this helps you.


tropnul
Re: Is mIRC able to write to a homepage??? [Re: TropNul] #179759 27/06/07 07:50 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Alternatively, the FTP transfers can be performed by Windows' ftp.exe utility, which mirc can run with the /run command. This short tutorial describes how to do it.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: Is mIRC able to write to a homepage??? [Re: JTR] #179767 27/06/07 10:36 PM
Joined: Dec 2002
Posts: 580
N
NaquadaServ Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
You could host a simple (mIRC based) web server on the bot's computer, and serve this "custom page" yourself (still hosting other pages on the primary web server), then no need for FTP transfers.

Edit: Try this...

Code:
alias pageoff sockclose webpage*
alias pageon {
  if (!$sock(webpageserver)) socklisten webpageserver 8080
  else echo -a * The web page server is already running
}

on *:socklisten:webpageserver: sockaccept webpage. $+ $rand(0, 1000000)
on *:sockread:webpage.*: dynamic_page $sockname
on *:sockwrite:webpage.*: sockclose $sockname

alias dynamic_page {
  var %out sockwrite -n $1

  %out <html>
  %out <head><title>This is the title</title></head>
  %out <body><h4>
  if ($chan(#channel)) {
    %out There are $nick(#channel, 0) people on the channel #channel
  }
  else {
    %out I am not connected to #channel at the moment.
  }
  %out </h4></body></html>
  %out
}


This works well but is quick and dirty... If you use it, I suggest adding code that limits the number of connections per IP address to prevent DoS attacks. I'd also add a timer (for each socket) that closes the socket after 60 seconds, if for some reason the client connects but never sends any text to the server.

Last edited by NaquadaServ; 28/06/07 01:00 AM.

NaquadaBomb
www.mirc-dll.com