mIRC Home    About    Download    Register    News    Help

Print Thread
Notice and @window #159717 19/09/06 05:32 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
this code was made by hixxy so its copyright on him ^^


Code:
 
on ^*:notice:*:*:{
  if (%nwin == on) {
    var %win = $+(@Notice.,$cid,.,$nick)
    if (!$window(%win)) window -ek %win
    aline %win $+($timestamp,$chr(32),$nick,$iif($target ischan,: $+ $v1),:) $1-
    haltdef
  }
  else { .echo -a $timestamps $theme(notice,$nick,$1-) | halt }
}

on *:input:@:{
  if (@notice.*.* iswm $active) {
    .notice $gettok($v2,-1,46) $1-
    echo -at $me $+ : $1-
  }
}


menu @notice.*.* {
  Save Log: savebuf 1-200 $active $+(logs\Misc\Notice.,$network,.log)
  -
  Close: window -c $active
}
 


anyhows i have few questions regarding this:

1. what does this code do: ,$iif($target ischan,: $+ $v1),:) $1-
in 1st part (on notice), i mean why is it added for IF target is channel... in this case it never will be coz everything is in @window no?

2. i changed this:
var %win = $+(@Notice.,$cid,.,$nick)

to this:
var %win = $+(@Notice $+ $chr(160) $+ $nick)
coz $chr(32) dont work...

but then Event of this does not work:
user who supposed to get notice doesnt even get notice

Code:
 
on *:input:@:{
  if (@notice* iswm $active) {
    .notice $gettok($v2,-1,46) $1-
    echo -at $me $+ : $1-
  }
}
 



and this also is not working :
(i get only empty name of log but content is there)

Code:
 
menu @notice* {
  Save Log: savebuf 1-200 $active $+(logs\Misc\Notices\ $+ $nick $+ .log)
  -
  Close: window -c $active
}
 



Anyone can help ? grin
or explain ? grin


IceCapped
Re: Notice and @window #159718 19/09/06 06:04 PM
Joined: Mar 2005
Posts: 420
X
xDaeMoN Offline
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Quote:
1. what does this code do: ,$iif($target ischan,: $+ $v1),:) $1-
in 1st part (on notice), i mean why is it added for IF target is channel... in this case it never will be coz everything is in @window no?


That means if you receive a notice from a user that was sent to the channel, instead of directly to you, then the name of the channel would be shown in the line @window.


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
Re: Notice and @window #159719 19/09/06 06:16 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Quote:

1. what does this code do: ,$iif($target ischan,: $+ $v1),:) $1-
in 1st part (on notice), i mean why is it added for IF target is channel... in this case it never will be coz everything is in @window no?


That code is for display purposes only. If you receive a private notice, it will be displayed as -nick- text, but if you receive a notice on a channel it will be displayed as -nick:#channel- text, just like mIRC does.

Quote:

2. i changed this:
var %win = $+(@Notice.,$cid,.,$nick)

to this:
var %win = $+(@Notice $+ $chr(160) $+ $nick)
coz $chr(32) dont work...


Code:
 
on *:input:@:{
  if (@notice* iswm $active) {
    .notice $gettok($v2,[color:red]2[/color],[color:red]160[/color]) $1-
    echo -at $me $+ : $1-
  }
}


Quote:

and this also is not working :
(i get only empty name of log but content is there)


Code:
 
menu @notice* {
  Save Log: savebuf 1-200 $active $+(",$logdir,Misc\Notices\,$mkfn($gettok($active,2,160)),.log")
  -
  Close: window -c $active
}

Re: Notice and @window #159720 19/09/06 06:31 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
hey =)
thanks for reply.

i still have 2 problems :P

1st issue with that $iif
i get 2 notices in 1 row:

Code:
 
(20:19) <|16bit|> some looooong text :#channel some looooong text
 


and issue with logs:

filename is not saved as "nick" but as _nick_
and they all have colorcodes... now dont laugh :P

i tried woth strip:

savebuf 1-200 $active $+($strip(",$logdir,Misc\Notices\,$mkfn($gettok($active,2,160)),.log"),burc)

but ofcourse i get errors _


IceCapped
Re: Notice and @window #159721 19/09/06 06:33 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
#1: Post everything you have now (after switching the code I've posted in answer to #2).

#2:

Code:
[color:red]$+([/color][color:blue]$strip([/color]",$logdir,Misc\Notices\,$mkfn($gettok($active,2,160)),.log"),burc)


Should be:

Code:
[color:blue]$strip([/color][color:red]$+([/color]",$logdir,Misc\Notices\,$mkfn($gettok($active,2,160)),.log"),burc)

Re: Notice and @window #159722 19/09/06 06:46 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
for $IIF line is this:
Code:
aline -k %win $+($timestamps [color:green]$theme(text,$nick,$1-)[/color]), $iif($target ischan,: $+ $v1),:) $1-
  


disregard things in GREEN, coz i adapted it for my theme system :P

as for save buff it still saves in non stripped way with colors

Last edited by raZOR; 19/09/06 06:47 PM.

IceCapped
Re: Notice and @window #159723 19/09/06 07:12 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
The part in green is what is making it show up twice.

Code:
aline %win $timestamps $theme(text,$nick,$1-)


Why the -k switch in /aline? It doesn't do anything :tongue:

As for the colours still being in the log, I thought you meant you wanted them stripped from the filename. Try this instead:

Code:
Save Log:{ 
  set %log_file $+(",$logdir,Misc\Notices\,$mkfn($gettok($active,2,160)),.log")
  filter -rwk 1-200 $active _write
  unset %log_file
} 


Then you need a _write alias:

Code:
alias _write {
  if ($isfile(%log_file)) { write %log_file $strip($1) }
}

Re: Notice and @window #159724 19/09/06 07:30 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
you were right about that 2x line :P
i fuxed it up ^^

as for log, it doesnt save now anything at all o_O


IceCapped
Re: Notice and @window #159725 19/09/06 07:48 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Try:

Code:
Save Log:{ 
  set %log_file $+(",$logdir,Misc\Notices\,$mkfn($gettok($active,2,160)),.log")
  if (!$isfile(%log_file)) { write %log_file }
  filter -rwk 1-200 $active _write
  unset %log_file
} 

Re: Notice and @window #159726 19/09/06 07:50 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
now it makes log without content =)


IceCapped
Re: Notice and @window #159727 19/09/06 07:56 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
:tongue:

As long as it's writing the file it should also be filtering the content. I'm not sure what's happening, sorry.

Re: Notice and @window #159728 19/09/06 07:57 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
hehe its ok =)

im gratefull for all you done =)

thanks.


IceCapped
Re: Notice and @window #159729 19/09/06 10:44 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
darn :P

dont shoot me im innocent grin

problem was i renamed alias so it didnt called your _write

/me hides =)

now it works cool

thanks ^^


IceCapped
Re: Notice and @window #159730 19/09/06 10:46 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Lol.

No problem smile

Re: Notice and @window #159731 19/09/06 11:25 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
yay !
i forgot to ask 1 question...

ususaly when something happens in custom window or non custom, it gets highlighted by user selected colour...

but this Notice windows never do get highlighted.

any idea why?


IceCapped
Re: Notice and @window #159732 19/09/06 11:34 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
After adding the text use window -g1 <window>

Re: Notice and @window #159733 19/09/06 11:51 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
ahh sweet !
thank you so very much !


IceCapped