mIRC Home    About    Download    Register    News    Help

Print Thread
K
Kawalli
Kawalli
K
Hey mates,
i was writeing a mini log script - that is only saveing the Text (without nick!) to a .txt file smile i want a "filter" when a word appears into the written line - this line wont be saved!

Code:
on *:text:*:#: {
var %logchat = word1,word2,word3,word4
if (%logchat isin $1-) { return }
else { write chatlog.txt $1- }
}


But this script is still loggin EVERYTHING even with the words in it ^^
Perhaps someone can help me? Would be so nice!

Thanks!

Last edited by Kawalli; 10/04/14 12:27 PM.
B
blessing
blessing
B
Hope this helped

Code:
on *:text:*:#: {
  var %logchat = word1,word2,word3,word4
  var %a = 1
  while ($gettok(%logchat,%a,44)) {
    var %logword = $v1
    if (%logword isin $1-) { 
      var %nolog = $true 
      break
    }
    inc %a
  }
  if (%nolog) { return }
  else { write chatlog.txt $1- }
}

Joined: Mar 2014
Posts: 214
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 214
It looks like your commas are in the wrong place or something. I tried changing the words to word[random num] and tested it out.
my chat log=

at the end i removed all words in the script and made it 1 "word12".
Code:
test log
1
word41
i love word word12
chest1
word12
check2
testing

So i would expect it's based on where the words are in relationship to commas and spaces (i don't know much about variables, so don't know what to do there)

Joined: Jan 2004
Posts: 1,330
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,330
Code:
on *:text:*:#: {
  var %regex = /word1|word2|word3|word4/iS
  if ($regex(%regex,$1-) return

  write chatlog.txt $1-
}

K
Kawalli
Kawalli
K
Originally Posted By: blessing
Hope this helped

Code:
on *:text:*:#: {
  var %logchat = word1,word2,word3,word4
  var %a = 1
  while ($gettok(%logchat,%a,44)) {
    var %logword = $v1
    if (%logword isin $1-) { 
      var %nolog = $true 
      break
    }
    inc %a
  }
  if (%nolog) { return }
  else { write chatlog.txt $1- }
}


WORKS 100%.
Thank you smile

@Loki, didnt tested but thank you too!

K
Kawalli
Kawalli
K
Ahhh im useing the script from blessing, its working.
Is there a solution that only lines with more then 3 words will saved too?

So i can sort out single word Lines!

Thank you so much for the Help!!

Last edited by Kawalli; 10/04/14 05:28 PM.
Joined: Dec 2013
Posts: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
if ($0 < 4) return


Link Copied to Clipboard