|
Joined: May 2003
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: May 2003
Posts: 14 |
is it possible to paste logfiles (not from irc) in a irc chat window as they update?. someone told me it would be a script to do it and it would be something like this as a base -
if (%currentread == %lastread) { halt } else { $read test.txt }
i wouldn't have a clue about how to complete the script, could someone help me out. or perhaps direct me to a irc script that pastes log files into a chat window as one of its functions, thanks
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
alias pastelines {
var %i = $calc(%lastread +1)
if $read([color:red]file.txt[/color],%i) {
.play -f $+ %i [color:blue]#channelname[/color] [color:red]file.txt[/color] 2000
set %lastread $lines([color:red]file.txt[/color])
}
} You should change file.txt to the actual file, and #channelname to the channelname you want to 'paste' to. Also, if you type /set %lastread <insert the line # you last pasted> (without the < & >)you can avoid catching anything before that line #.
|
|
|
|
Joined: May 2003
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: May 2003
Posts: 14 |
ok i tried that in norm irc and in a script by pressing alt+r and pasting in there and editing the file names and channel. but neither of them worked. did u test that script beforehand? when i did the file name i did the full link (eg. D:\games\blahblah.txt) and the channel name #blah i must have done something wrong, can you help please, thanks
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
I have tested and it does work, both with and without the variable preset. Put "quote marks" around the path & filename, "D:\games\blahblah.txt" Make sure the code has been pasted into the same 7 lines and not all in one long line. I also assume that you do know have to call it via a command, /pastelines , which you can then automate with a timer.
|
|
|
|
Joined: May 2003
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: May 2003
Posts: 14 |
ahh yeah /pastelines worked, but it said -
* /if: invalid format (line 3, script.ini)
my line 3 looks like -
if $read"D:\games\blahblah.txt,%i" {
i think ive made a mistake with the position of the " and " or closing and opening brackets, what should it look like?
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
You have lost the parentheses. if $read("D:\games\blahblah.txt",%i) {
|
|
|
|
Joined: May 2003
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: May 2003
Posts: 14 |
sweet i got it to work, however no i dont know how to automate /pastelines . teach me o great one i can see u live on sunshine coast, i live in brisbane just near you
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
OK, to check it every 10 minutes. /timerplines 0 600 pastelinesBroken down into it's parts, /timerplines - is the command to start the timer, and give it a name (plines) 0 means repeat forever, if you would use 10 in its place the timer would fire 10 times. 600 is the delay (in seconds) between each repetition. pastelines is the command to perform. If you want to automatically start the process when you join #channelon me:*:join:[color:darkblue]#channel[/color]:{
[color:blue].timerplines[/color] [color:red]0[/color] [color:bluee]600[/color] [color:orange]pastelines[/color]
} The .dot in front of the timer there, keeps mirc from displaying * Timer plines activated
|
|
|
|
Joined: May 2003
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: May 2003
Posts: 14 |
well that all worked, but it showed all the past logs but none current, it says - /if: '06' unknown operator (line 3, script.ini)
Last edited by extractor; 06/05/03 11:16 AM.
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
Make sure line 3 looks exactly the same as this. if $read("D:\games\blahblah.txt",%i) {
|
|
|
|
Joined: May 2003
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: May 2003
Posts: 14 |
yeah it is, but its not really d:\games\blahblah.txt i just said that as example, but that file name works, but my proper one doesn't for some stupid reason. if i could get it to duplicate the logs into another file that would work, but i suppose thats another issue. and i dont think i can just edit eh script and tell it to go to a different directory either, but ill have a look
Last edited by extractor; 06/05/03 11:27 AM.
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
Paste in the code exactly as you have it. There is nothing wrong with that line.
|
|
|
|
Joined: May 2003
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: May 2003
Posts: 14 |
ok ill let u see what game im playing :P
if $read("D:\games\Diablo II\d2jsp\scripts\output\qwqalog.txt",%i) {
all on 1 line
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
I don't care what games you play. I meant the whole code block not just the one line.
|
|
|
|
Joined: May 2003
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: May 2003
Posts: 14 |
alias pastelines { var %i = $calc(%lastread +1) if $read("D:\games\Diablo II\d2jsp\scripts\output\qwqalog.txt",%i) { .play -f $+ %i #testggg ("D:\games\Diablo II\d2jsp\scripts\output\qwqalog.txt") 2000 set %lastread $lines("D:\games\Diablo II\d2jsp\scripts\output\qwqalog.txt") } }
on me:*:join:#channel:{ .timerplines 0 30 pastelines }
--
but i dont see how the other lines have anything to do with it, it says line 3
Last edited by extractor; 06/05/03 11:33 AM.
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
Well why I wanted to see the other lines, is because there is nothing wrong with line3, and sometimes a previous line can affect an otherwise perfectly good line. I don't see anything wrong with any line there though, try moving it to a new file or something.
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
This is a sort-of-bug that can happen with $read, normally it can be fixed by using the n switch in $read, i.e.
if $read("D:\games\Diablo II\d2jsp\scripts\output\qwqalog.txt",n,%i) {
|
|
|
|
Joined: May 2003
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: May 2003
Posts: 14 |
can u use a shortcut to the file?
|
|
|
|
Joined: May 2003
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: May 2003
Posts: 14 |
sweet it all works now, it pastes new lines into irc, thanks so much for helping me out. ill have to go off and learn programming/scripting myself now
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
Try Collectives suggestion, and this if $read("D:\games\Diablo II\d2jsp\scripts\output\qwqalog.txt",n,%i) != $null {
|
|
|
|
|