mIRC Home    About    Download    Register    News    Help

Print Thread
J
JTR
JTR
J
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.

T
TropNul
TropNul
T
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.

Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
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.

Joined: Dec 2002
Posts: 580
N
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.

Link Copied to Clipboard