mIRC Home    About    Download    Register    News    Help

Print Thread
#116134 02/04/05 02:41 PM
Joined: Nov 2003
Posts: 257
A
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Nov 2003
Posts: 257
Code:
 
on *:sockread:bot2:{
  sockread %zz
  tokenize 32 %zz
  window -k @probe2
  echo @probe2 $lower($remove($gettok(%zz,1,32),:)) : $lower($remove($gettok(%zz,4-,32),:))
  set %nick $mid(%zz,2,$calc($pos(%zz,!,1) - 2)) 
  if ($gettok(%zz,1,32) == PING) { sockwrite -tn bot2 pong $gettok(%zz,2,32) }
 if ($4 == :@remember) && (($right($gettok($1,1,33),-1) == $me) || ($level($address($right($gettok($1,1,33),-1),5)) == aowner)) { 
    if (&nick isin $gettok(%z,6-,32)) { $replace(&nick,$gettok(%z,6-,32),$gettok(%z,6-,32)) | write $gettok(%z,6,32) .txt $gettok(%z,7-,32) | sockwrite -n bot2 privmsg $3 :bot1.0;14 $sock(ot2).mark $+ 1b5(14 $+ $gettok(%z,7-,32) added to $gettok(%boo,6,32) .txt15) }
    else { write $gettok(%z,6,32) .txt $gettok(%z,7-,32) | sockwrite -n bot2 privmsg $3 : $sock(bot2).mark $+ 15(14 $+ $gettok(%z,7-,32) added to $gettok(%z,6,32) .txt15) }
  }
}


When i type @remember< tex>t it writes to a text file but it's enver then same one frown. Can anyone help ?

One Error I already solved is %zz variable, but why is a different text file getting written to each time ? ]

Last edited by alkahol1k; 02/04/05 02:58 PM.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Well I've not tested your code but from what I can see I don't think it's actually writing to a text file. You have a space between $gettok(%z,6,32) .txt.

So maybe $+($gettok(%z,6,32),.txt)

Also, you mentioned %zz variables issue solved so do you mean $+($gettok(%zz,6,32),.txt)

All the best,

-Andy

Joined: Nov 2003
Posts: 257
A
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Nov 2003
Posts: 257
yeah a file is created in my mirc dir but it doesn't have a filename and nothing is getting written to it, i'll try what you just said. Thanks.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
 
on *:sockread:bot2:{
  sockread %zz
  tokenize 32 %zz
  window -k @probe2
  echo @probe2 $lower($remove($gettok(%zz,1,32),:)) : $lower($remove($gettok(%zz,4-,32),:))
  set %nick $mid(%zz,2,$calc($pos(%zz,!,1) - 2)) 
  if ($gettok(%zz,1,32) == PING) {
    sockwrite -tn bot2 pong $gettok(%zz,2,32)
  }
  if ($4 == :@remember) &amp;&amp; (($right($gettok($1,1,33),-1) == $me) || ($level($address($right($gettok($1,1,33),-1),5)) == aowner)) {
    if (&amp;nick isin $gettok([color:blue]%z[/color],6-,32)) {
      [color:green]$replace(&amp;nick,$gettok(%z,6-,32),$gettok(%z,6-,32))[/color]
      write [color:orange]$gettok(%z,6,32) .txt[/color] $gettok(%z,7-,32)
      sockwrite -n bot2 privmsg $3 :bot1.0;14 $sock(ot2).mark $+ 1b5(14 $+ $gettok(%z,7-,32) added to $gettok(%boo,6,32) .txt15)
    }
    else {
      write [color:orange]$gettok(%z,6,32) .txt[/color] $gettok(%z,7-,32)
      sockwrite -n bot2 privmsg $3 : $sock(bot2).mark $+ 15(14 $+ $gettok(%z,7-,32) added to $gettok(%z,6,32) .txt15)
    }
  }
}


(1) %z you never set value %z but use it often so its either $null or its currently being set by something else which if you look down to (3) may answer your question.
(2) $replace(&nick,$gettok(%z,6-,32),$gettok(%z,6-,32)) what but what is that ment to do!?!?!?!?!?!
(3) $gettok(%z,6,32) .txt the 6th word in %z what ever it is or ".txt" is being used as the filename to write to.

Joined: Nov 2003
Posts: 257
A
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Nov 2003
Posts: 257
thanks for you help too DaveC


Link Copied to Clipboard