|
Joined: Feb 2003
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Feb 2003
Posts: 27 |
I'm making a logviewer at the moment it works ok but only if the directory of the log is something like C:\mirc\logs\log.log but my script is in C:\Documents and Settings\Ross\My Documents\mIRC so when I load a log file into an @window using loadbuf something goes wrong and i get something like SomeArtist - SomeSong
SomeArtist - SomeSong
SomeArtist - SomeSong
SomeArtist - SomeSong
[and]
Settings\Ross\My=Documents\mIRC\dmp3.ini options player 2
I've tried to move a log file around My Documents but I get the same thing I've also tried using other scripts that are in My Documents, does anyone know what the problem is? the code i use to load the file, if ($did == 4) {
window @log2
did -r logviewer 1
loadbuf -r @log2 $line(@logviewer,$did(logviewer,4).sel)
if ($line(@logviewer,N) != 0) {
var %llst 1
while (%llst <= $line(@log2,N)) {
did -a logviewer 1 $strip($line(@log2,%llst))
inc %llst
}
}
}
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
if ($did == 4) {
window @log2
did -r logviewer 1
loadbuf -r @log2 $line(@logviewer,$did(logviewer,4).sel)
while $line(@log2, 1) {
var %line = $ifmatch
did -a logviewer 1 $iif($chr(32) isin %line, $+(",%line,"), %line)
dline @log2 1
}
window -c @log2
}
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Feb 2003
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Feb 2003
Posts: 27 |
i get the same sort of thing but with " "'s "SomeArtist - SomeSong"
"SomeArtist - SomeSong"
"SomeArtist - SomeSong"
"SomeArtist - SomeSong"
"[and]"
"Settings\Ross\My=Documents\mIRC\dmp3.ini options player 2"
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
Post the section of the file that's generating that odd output, please. Without seeing what you're trying to actually loadbuf-ing, we're guessing.
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Feb 2003
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Feb 2003
Posts: 27 |
This is it all On *:dialog:logviewer:sclick:*:{
if ($did == 3) {
set %ldir $sdir($mircdir,Choose a log Dir)
did -ra logviewer 2 %ldir
haltdef $findfile(%ldir,*.log,0,aline @logviewer $1-)
haltdef $findfile(%ldir,*.log,0,did -a logviewer 4 $nopath($1-))
}
if ($did == 4) {
window @log2
did -r logviewer 1
loadbuf -r @log2 $line(@logviewer,$did(logviewer,4).sel)
if ($line(@logviewer,N) != 0) {
var %llst 1
while (%llst <= $line(@log2,N)) {
did -a logviewer 1 $strip($line(@log2,%llst))
inc %llst
}
}
}
}
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
No, the data file. :tongue:
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Feb 2003
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Feb 2003
Posts: 27 |
data file? you've confused me if you mean the file im reading from then i've used a few and there just normal for example i've used Session Start: Fri Feb 28 20:49:19 2003
Session Ident: #scripts
Session Start: Fri Feb 28 20:49:40 2003
Session Ident: #scripts
[20:49] :::: Now talking in: (#scripts)
[20:49] :::: Modes: (+)
[20:49] • Joins: Ross (Lowest@blackh0le-605AB09.pool.broadband.ntl.com) : (Clones Detected! Number: 2 Names: Lowest Ross)
[20:49] (8:49pm) : (@Lowest) testing
[20:49] (8:49pm) : (@Lowest) testing
[20:51] (8:51pm) : (@Lowest) brb
[20:51] (8:51pm) : (@Lowest) brb
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
Oddly enough, I don't see a single SomeArtist - SomeSong in that file segment, nor any reference to My Documents.
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Feb 2003
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Feb 2003
Posts: 27 |
ok i told you you confused me so that was a log file i tried to load and this is what i would get in the window where the log text should be InMe - Wounds
InMe - Crushed Like Fruit
InMe - Energy
InMe - FireFly
InMe - Her Mask
InMe - IceWarm
InMe - Lava Twilight
InMe - Mosaic
InMe - Natural
InMe - Neptune
InMe - Trenches
InMe - UnderDose
InMe - Wounds
[and]
Settings\Ross\My=Documents\mIRC\dmp3.ini options player 2
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
OK, I'll admit it. You've completely confused me. I can't tell what you want where, and more particularly, I can't tell where the data to loadbuf is coming from.
loadbuf -r @log2 $line(@logviewer,$did(logviewer,4).sel)
Split that into 2 lines:
var -s %file $line(@logviewer,$did(logviewer,4).sel) loadbuf -r @log2 %file
The -s will tell you what the variable %file is getting set to. Perhaps you need to quote that.
loadbuf -r @log2 $+(",$line(@logviewer,$did(logviewer,4).sel),")
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Feb 2003
Posts: 27
Ameglian cow
|
OP
Ameglian cow
Joined: Feb 2003
Posts: 27 |
loadbuf -r @log2 $+(",$line(@logviewer,$did(logviewer,4).sel),") that did it, it works fine now, thanks.. and sorry for confusing you :P
|
|
|
|
|