mIRC Home    About    Download    Register    News    Help

Print Thread
#100117 10/10/04 07:20 AM
Joined: Dec 2002
Posts: 99
M
MDA Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2002
Posts: 99
Greetings to each,

I wrote a news socketbot which pulls up headlines in 8 different categorys, stores those into a centralized text file and then automatically randomly posts those to each of our 5 chatrooms thru our mIRC scripts. Chatroom users can also pull up each of those entire 8 selective news categorys thru a whispered reply to them.

What I need help on is pulling that information from the centralized text file into a local window @new

I've tried the -play command to spool that data to that window without success and would appreciate your help and consideration.

Here is one of my attempts which failed:

alias newstest {
window @news
.play -m1tBreaking @news C:\1Report/Newsreader.txt 1000
}

I don't wish to flood out our chatrooms, nor send that to myself as a whisper. Is there a way to simply echo the -play file?

MDA


Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
If you mean you want to load the whole txtfile into the window, use /loadbuf


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Joined: Dec 2002
Posts: 99
M
MDA Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2002
Posts: 99
Greetings LocutusofBorg,

Thanks for your suggestion. We tried that and guessed at the numbers of the lines to pull in which appears to be required with the /loadbuf command. What we found was the information wouldn't word wrap into the @news Window. Instead it would only show about 1/2 of the text regardless of the window size. I guess if we jumped our screen resolution to 1028 or so we could view the headline news window in its entirety.The /loadbuf command is very quick and elequent, the problem with guessing the lines in the file size, and the lack of word wrap thou minimize this command greatly in this application.

What we are attemptng now is a brute force approach, useing dde servers to relay that information into the @news Window just after the same data is written to a centralized text file. Initial test runs indicate information spooled in that manner does indeed perform the needed word wrap which adjusts to any @news Window size.

if (%newsW == 1) { .timer.newswindow9 1 1 /dde plg command "" /newswindow %NewFeedA %newsfeed }

We set the %newsW variable to once a day at 8am, meaning althought we pull up the headlines every 6 hours, only once do we pull those up and dde server those to the @news Window locally.

On the PLG dde Server we have the following alias to catch the resulting DDE server Spool of that data:

alias newswindow {
window @news
set %newscast $1 $2-
echo @news %newscast
set %newscast $null
}

The resulting output in the @news Window is:

Health News.. Kenyan ecologist Wangari Maathai, the first African woman to win the Nobel Peace Prize, today reiterated her claim that the AIDS virus was a deliberately created biological agent.

Thanks again for your time and consideration,
Regards,
MDA

Joined: Dec 2002
Posts: 99
M
MDA Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2002
Posts: 99
Greetings and Well Met LocutusofBorg,

After reviewing the many options and switchs the /loadbuf command supports, we've decided to go back to the more elegant approach that you originally suggested by adding this alias.

alias newswindow {
window @News
.set %newsize $lines(C:\1Report/newsfeed.txt)
loadbuf %newsize -pir @News C:\1Report/newsfeed.txt
}

The %newsize variable is set to the total length of the file.
the switch

The -p switch forces lines of text to wrap when added to the window.

The -i switch makes sure that lines are indented if they wrap.
(Makes the Headlines Stand Out very well when clustered together)

Breaking News.. The price of Brent North Sea crude oil shot
[indent]to $US50 a barrel for the first time on Monday, reaching a
[indent]new record summit on worries over supply shortages [indent]amid surging world demand, traders said.

The -r switch clears the contents of the output window.
(Makes it very easy for us to simply refresh our @News window as we wish without having to first close @News.

Thanks for your tip and consideration
MDA


Link Copied to Clipboard