mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2009
Posts: 10
C
cr3 Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Apr 2009
Posts: 10
Hi Guys,
I am not the greatest mirc scripter and was hoping someone could give me some major help with a script i would like to run in my channel.
I'd like all users in the channel to be able to do a command like !latest and mybot to list the last 10 or so items i had added to it just via a simple /msg mybot add collection_of_samples.rar command.
I assume it would just use a .txt file to store the additions ?
I'm sure this wouldn't be the hardest thing to create to some of you guys and it would make my life complete!!
Thanks for any comments in advance.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Using a text file would be the easiest.
By default, mIRC writes new lines to a text file at the bottom of the file.
Please note that the .rar extension is normally allocated for a rar archive file, which is similar to a zip and contains multiple files.
Code:
on *:text:add*:?:{
  .write $qt($scriptdircollection_of_samples.txt) $$2-
}
on *:text:!latest:#:{
  var %lines = $lines($qt($scriptdircollection_of_samples.txt))
  dec %lines 10
  .play $iif(%lines > 0,-f $+ %lines) $nick $qt($scriptdircollection_of_samples.txt)
}


Joined: Apr 2009
Posts: 10
C
cr3 Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Apr 2009
Posts: 10
wow Russel you're a genius !! laugh as easy and quick as that ..
However it does add the latest addition to the bottom of the text file and so reading it backwards and making the newest seem older, if you get what i mean ?!?
Still great tho, would it be just as easy to get it to post the latest addition into a specified channel, say #ECHO-BASE ? and in bold text ?
Awesome .. thx again.

Last edited by cr3; 04/04/09 01:35 AM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You can have bold text displayed with the /play command, but it means that you have to save the text to the text file in bold, and use the -c switch.

Note that doing it this way will always display the text that is bolded in bold.

Same thing goes with any and all other text control characters.

As to having the information displayed in the channel, just change $nick in the /play line to the channel name.

See /help /play for other details.

Last edited by RusselB; 04/04/09 01:47 AM.
Joined: Apr 2009
Posts: 10
C
cr3 Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Apr 2009
Posts: 10
appreciated.


Link Copied to Clipboard