mIRC Homepage
Posted By: danzigrules sockets - 22/02/07 01:26 AM
can sockets be made to read txt files all the time and post the changes in irc?

I would like to grab the info from http://a.swirve.com/data , but you can see the txt file name changes at random times.

I would like to be able to read the current .txt file and output the info into a channel each time a new line is added.

The format of the line entries is:

6243 20 1 tanks to you retal (#950) Tenacious SOLer (#2396) 10 0 1 658 1472 Paradigm SOL

6243 - date i not sure how this is formatted
20 - the hour
1 - win or lose either 1 or 0
tanks to you retal(#950) - the attacker
Tenacious soler(#2396) - the attacked
10 - results from the attack
0 - results from the attack
1 - the type of attack - SS(1), PS(2), GS(5), BR(6), AB(7), Nuke(10), Chem(11), Cruise(12)
658 - rank of the attacker
1472 - rank of the attacked
paradigm - clan of the attacker
sol - clan of the attacked

I would like the output to be like:

SS-Capertown (#2895)(Rival)()->The Land of the OCracy (#2243)() and won 652A

Thank you in advance
Posted By: Riamus2 Re: sockets - 22/02/07 04:16 AM
You can pretty much use the same script that I made for your other thing on that site. Just change the socket names and where it's getting the data from and how the data is output. Try making the changes to it and see how you do with it. Then, post what you've changed it to and we'll help with any problems. That way, you'll get a better idea of how to work with sockets.

Btw, if the filename changes, you'll need to have some way of telling the script the name of the file. You may have to grab the name through a second socket that reads the filename from a main page and then uses that in the main socket that gets the data.
Posted By: danzigrules Re: sockets - 22/02/07 04:26 AM
I had planned on messing with the other script, but I don't want to have to use a trigger to call the info. I guess I left that out in my post, I seem to always forget something :\

I wasn't sure if that was possible to do
Posted By: Riamus2 Re: sockets - 22/02/07 04:47 AM
You can just take the stuff from the on TEXT and put it into an alias and have a timer call that alias.
© mIRC Discussion Forums