mIRC Home    About    Download    Register    News    Help

Topic Options
#116134 - 02/04/05 03:41 PM sending command to my bot
alkahol1k Offline
Fjord artisan

Registered: 22/11/03
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 ? ]


Edited by alkahol1k (02/04/05 03:58 PM)

Top
#116135 - 02/04/05 04:01 PM Re: sending command to my bot
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
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

Top
#116136 - 02/04/05 04:06 PM Re: sending command to my bot
alkahol1k Offline
Fjord artisan

Registered: 22/11/03
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.

Top
#116137 - 03/04/05 04:05 AM Re: sending command to my bot
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
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.

Top
#116138 - 03/04/05 03:49 PM Re: sending command to my bot
alkahol1k Offline
Fjord artisan

Registered: 22/11/03
Posts: 257
thanks for you help too DaveC

Top