mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#22659 06/05/03 02:13 AM
Joined: May 2003
Posts: 14
E
Pikka bird
OP Offline
Pikka bird
E
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

#22660 06/05/03 03:05 AM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Code:
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 #.

#22661 06/05/03 03:36 AM
Joined: May 2003
Posts: 14
E
Pikka bird
OP Offline
Pikka bird
E
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

#22662 06/05/03 08:07 AM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
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. smile

#22663 06/05/03 10:15 AM
Joined: May 2003
Posts: 14
E
Pikka bird
OP Offline
Pikka bird
E
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?

#22664 06/05/03 10:19 AM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
You have lost the parentheses.
if $read("D:\games\blahblah.txt",%i) {

#22665 06/05/03 10:44 AM
Joined: May 2003
Posts: 14
E
Pikka bird
OP Offline
Pikka bird
E
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 smile

i can see u live on sunshine coast, i live in brisbane just near you laugh

#22666 06/05/03 10:59 AM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
OK, to check it every 10 minutes.
/timerplines 0 600 pastelines
Broken 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 #channel

Code:
on 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

#22667 06/05/03 11:16 AM
Joined: May 2003
Posts: 14
E
Pikka bird
OP Offline
Pikka bird
E
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.
#22668 06/05/03 11:21 AM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Make sure line 3 looks exactly the same as this.
if $read("D:\games\blahblah.txt",%i) {

#22669 06/05/03 11:24 AM
Joined: May 2003
Posts: 14
E
Pikka bird
OP Offline
Pikka bird
E
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.
#22670 06/05/03 11:26 AM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Paste in the code exactly as you have it. There is nothing wrong with that line. smile

#22671 06/05/03 11:28 AM
Joined: May 2003
Posts: 14
E
Pikka bird
OP Offline
Pikka bird
E
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

#22672 06/05/03 11:31 AM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
I don't care what games you play. laugh

I meant the whole code block not just the one line. wink

#22673 06/05/03 11:32 AM
Joined: May 2003
Posts: 14
E
Pikka bird
OP Offline
Pikka bird
E
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.
#22674 06/05/03 11:44 AM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
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.

#22675 06/05/03 11:52 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
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) {

#22676 06/05/03 11:52 AM
Joined: May 2003
Posts: 14
E
Pikka bird
OP Offline
Pikka bird
E
Joined: May 2003
Posts: 14
can u use a shortcut to the file?

#22677 06/05/03 12:04 PM
Joined: May 2003
Posts: 14
E
Pikka bird
OP Offline
Pikka bird
E
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 smile

#22678 06/05/03 12:04 PM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Try Collectives suggestion, and this
if $read("D:\games\Diablo II\d2jsp\scripts\output\qwqalog.txt",n,%i) != $null {

Page 1 of 2 1 2

Link Copied to Clipboard