mIRC Home    About    Download    Register    News    Help

Print Thread
#120562 19/05/05 03:58 AM
Joined: Apr 2005
Posts: 72
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2005
Posts: 72
hello...
i have following:
Code:
on *:TEXT:*:#blaa:{
  if ($nick = jojojo) && (hello isin $2) {
    write file.txt $date $time $1 $3
  }
}

...this write a text if "hello" on 2. place in a textfile
but if text:
hmmm welcome.hello.you/P1
hmmm welcome.hello.you/P6
hmmm welcome.hello.she/P1
hmmm welcome.hello.she/P6
...i will not write after "/" in a txt (inklusive "/")
and the script check on duplikates lines

sory for english :-)

thx bodo

#120563 19/05/05 07:58 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
on *:TEXT:& *hello*:#blaa:{
  if ($nick = jojojo) && (hello isin $2) {
    var %text = $1 $iif($gettok($2,2-,$asc(/)),$+(/,$v1)) $3-
    if ($read(file.txt,ntw,??/??/???? ??:??:?? %text,1)) { write -dl $+ $readn } | ; delete the old entry
    write file.txt $date $time %text
  }
}


or

Code:
on *:TEXT:& *hello*:#blaa:{
  if ($nick = jojojo) && (hello isin $2) {
    var %text = $1 $iif($gettok($2,2-,$asc(/)),$+(/,$v1)) $3-
    if (!$read(file.txt,ntw,??/??/???? ??:??:?? %text,1)) { write file.txt $date $time %text } | ; write only if not already present
  }
}


* code untested

#120564 19/05/05 09:56 AM
Joined: Apr 2005
Posts: 72
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2005
Posts: 72
in first code error:
/write: insufficient parameters (line 4, write.mrc)

in second code:
"write only if not already present" <---that works :-)
but the " / " is always there :-(
19/05/2005 11:54:14 hmmm welcome.hello.you/P1

thx bodo

Last edited by bodo0815; 19/05/05 09:57 AM.
#120565 19/05/05 01:59 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
...i will not write after "/" in a txt (inklusive "/")


That sounded to me like you wanted the / kept in the text file.

So you dont huh?

try

Code:
on *:TEXT:&amp; *hello*:#blaa:{
  if ($nick = jojojo) &amp;&amp; (hello isin $2) {
    var %text = $1 $iif($gettok($2,2-,$asc(/)),$v1) $3-
    if ($read(file.txt,ntw,??/??/???? ??:??:?? %text,1)) { write -dl $+ $readn file.txt } | ; delete the old entry in FILE.TXT (forgot before to put the filename in)
    write file.txt $date $time %text
  }
}


or

Code:
on *:TEXT:&amp; *hello*:#blaa:{
  if ($nick = jojojo) &amp;&amp; (hello isin $2) {
    var %text = $1 $iif($gettok($2,2-,$asc(/)),$v1) $3-
    if (!$read(file.txt,ntw,??/??/???? ??:??:?? %text,1)) { write file.txt $date $time %text } | ; write only if not already present
  }
}

#120566 19/05/05 06:07 PM
Joined: Apr 2005
Posts: 72
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2005
Posts: 72
hmmm... my english is not good :-(
still once of beginning:
text in channel:
bot> hi hmmm welcome.hello.you/P1 nice
bot> hi hmmm welcome.hello.you/P2 nice
bot> hi hmmm welcome.hello.she/P1 nice
bot> hi hmmm welcome.hello.she/P2 nice

i will write in txt only $date $time $1 $3 (this works)
date time hi welcome.hello.you/P1
date time hi welcome.hello.you/P2
date time hi welcome.hello.she/P1
date time hi welcome.hello.she/P2

but i will this without /P1 or /P2:
date time hi welcome.hello.you
date time hi welcome.hello.you
date time hi welcome.hello.she
date time hi welcome.hello.she

...and then delete dublicate lines:
date time hi welcome.hello.you
date time hi welcome.hello.she

i hope this will help you :-)

thx bodo

Last edited by bodo0815; 19/05/05 06:09 PM.
#120567 20/05/05 09:34 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
bot> hi hmmm welcome.hello.you/P1 nice

$1 = hi
$2 = hmmm
$3 = welcome.hello.you/P1
$4 = nice

Quote:
on *:TEXT:*:#blaa:{
if ($nick = jojojo) && (hello isin $2) {
write file.txt $date $time $1 $3
}
}


"if ($nick = jojojo) && (hello isin $2) {"

$2 = hmmm
hello is NOT in $2

No write to file.

******

You well need to explain exactly what you want.

#120568 23/05/05 03:26 AM
Joined: Apr 2005
Posts: 72
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2005
Posts: 72
... and "bot" is not "jojojo" i know
but this is not the fact :-(
my problem is: how to delet the slash "/" and write without this in a txt...


Link Copied to Clipboard