mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2014
Posts: 18
K
Kawalli Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: Apr 2014
Posts: 18
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.
Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
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: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
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)


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Code:
on *:text:*:#: {
  var %regex = /word1|word2|word3|word4/iS
  if ($regex(%regex,$1-) return

  write chatlog.txt $1-
}

Joined: Apr 2014
Posts: 18
K
Kawalli Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: Apr 2014
Posts: 18
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!

Joined: Apr 2014
Posts: 18
K
Kawalli Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: Apr 2014
Posts: 18
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: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
if ($0 < 4) return


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Link Copied to Clipboard