mIRC Home    About    Download    Register    News    Help

Page 1 of 2 1 2 >
Topic Options
#148694 - 10/05/06 04:10 AM Script Help plz
D00M Offline
Babel fish

Registered: 28/10/05
Posts: 71
hi all,im using an echo script and im trying to filter out some stuff that i dont want to see into a chan im in by myself.
It seems to be working good for the most part but it still doesnt filter out somethings,this is what i have so far:

Code:
ON 1:TEXT:*:#CHAN_ECHO'S_FROM:{
  if (PRETIME isin $1-) || (French isin $1-) || (SWEDiSH isin $1-) || (DANiSH isin $1-) || (German isin $1-) || (DUTCH isin $1-) || (.KOR. isin $1-) || (.iTALiAN. isin $1-) || (.SATRip. isin $1-) || (.PL. isin $1-) || (.*-pre*. isin $1-) {
    set %echo.say OFF
  }
  if (DVD-R isin $1-) && (%echo.say == ON) { /msg #CHAN_ECHO'S_TO $1- }
  if (SVCD isin $1-) && (%echo.say == ON) { /msg #CHAN_ECHO'S_TO $1- }
  if (VCD isin $1-) && (%echo.say == ON) { /msg #CHAN_ECHO'S_TO $1- }
  if (XviD isin $1-) && (%echo.say == ON) { /msg #CHAN_ECHO'S_TO $1- }
  if (XBoX isin $1-) && (%echo.say == ON) { /msg #CHAN_ECHO'S_TO $1- }
  if (Games isin $1-) && (%echo.say == ON) { /msg #CHAN_ECHO'S_TO $1- }

  set %echo.say ON
}


like i said this is working for the most part but if someone types in the chan
-pre DVD-R or -pre SVCD etc etc.. or even just says DVDR or SVCD etc...it will also echo that into my chan,

e.g. chan i echo from
Quote:

[11:45am] <@D00M> -pre SVCD
[11:45am] <Pre> [-PRETIME-] [SVCD] Release:(BlahBlah.DVDRip.SVCD-Blah) Age:(57 minutes 17 seconds ago)

e.g. chan i echo to
Quote:

[11:45am] <@EchoBot> -pre SVCD


is there a way to get it to block the -pre command or when a user just types SVCD or DVDR etc.. in their convo?.
I'v tried to add it to the filter with (.*-pre*. isin $1-) but it isnt working and still shows in my chan,
so if anyone can help me that would be great,TIA wink

Top
#148695 - 10/05/06 04:47 AM Re: Script Help plz
schaefer31 Offline
Fjord artisan

Registered: 27/08/05
Posts: 525
I am thoroughly confused by your post. I get that you are wanting to relay certain info from a prebot, but I don't see what specifically. Also, if you are in a channel alone and sending the info there, then why not just use an @window instead?

Top
#148696 - 10/05/06 05:23 AM Re: Script Help plz
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
Looking through your code I think that should be:

|| (.*-pre*. iswm $1-) {

Or whatever, just make sure it's iswm for a wildcard match.

Top
#148697 - 10/05/06 06:12 AM Re: Script Help plz
D00M Offline
Babel fish

Registered: 28/10/05
Posts: 71
Quote:
I am thoroughly confused by your post. I get that you are wanting to relay certain info from a prebot, but I don't see what specifically. Also, if you are in a channel alone and sending the info there, then why not just use an @window instead?


hey schaefer31 and SladeKraven thanx for the replys,

@schaefer31

ok if any user/op/voice whoever types -pre Blahblah.DVDR-release or just even -pre DVDR to get pre times etc..,
this script will echo the users txt to my filtered chan,thats not what i wanted.
I have a filter in place >> if (PRETIME isin $1-) << which blocks the responce that the bot gives to them so thats working fine.
I only want what the prebot announces whats new and not any 1 else's quiries or txt.
I have filters in place to filter out all the languages i dont want to see and thats working great,
but if someone just makes a quiry in the chan for a release,

e.g Chan echo's from
Quote:

<Some_User> -pre Blahblah.DVDR-release


e.g Chan echo's to
Quote:

<@EchoBot> -pre Blahblah.DVDR-release


it will echo what they typed into my filtered chan,i want it to ignore/filter all users commands/txt etc...

@SladeKraven

i tried what you suggested but it still has the same results,

Quote:

ON 1:TEXT:*:#CHAN_ECHO'S_FROM:{

if (PRETIME isin $1-) || (French isin $1-) || (SWEDiSH isin $1-) || (DANiSH isin $1-) || (German isin $1-) || (DUTCH isin $1-) || (.KOR. isin $1-) || (.iTALiAN. isin $1-) || (.SATRip. isin $1-) || (.PL. isin $1-) || (.*-pre*. iswm $1-) {

set %echo.say OFF
}


if anyone typed into the chan -pre DVDR or -pre XBOX etc... it will still show up in my filtered chan.
Thanks heaps for the replies guys but still looking for a solution if anyone is able to assist wink

Top
#148698 - 10/05/06 06:48 AM Re: Script Help plz
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
Didn't realse it was set out like that try:

(-pre isin $1-) or (-pre * iswm $1-)

Top
#148699 - 10/05/06 06:56 AM Re: Script Help plz
schaefer31 Offline
Fjord artisan

Registered: 27/08/05
Posts: 525
Is there someway of distinguishing a requested pre message and a new pre message?

For example:

A requested pre:

<User> -pre something
<PreBot> [-PRETIME-] Something 123 minutes ago

Or for a new pre:

<PreBot> [NEW] [Pre] Something2

It would be a lot easier to base the code on this if possible.

Top
#148700 - 10/05/06 07:49 AM Re: Script Help plz
D00M Offline
Babel fish

Registered: 28/10/05
Posts: 71
@schaefer31

ok here is what the prebot announces for new releases

e.g. bot announcing new stuff
Quote:

<pre> [-PRE-] [DVD-R] Date:(2006-05-10) Release:(BlahBlah.NTSC.DVDR-RELEASE)
<pre> [-PRE-] [XviD] Date:(2006-05-10) Release:(BlahBlah.NTSC.XviD-RELEASE)
<pre> [-PRE-] [XBoX] Date:(2006-05-10) Release:(BlahBlah.NTSC.XBoX-RELEASE)
<pre> [-PRE-] [SVCD] Date:(2006-05-10) Release:(BlahBlah.NTSC.SVCD-RELEASE)


e.g user looking up pretime
Quote:

<some_user> -pre BlahBlah.XviD-Relese
<pre> [-PRETIME-] [XviD] Date:(2006-04-27) Release:(BlahBlah.XviD-Relese) Age:(1 week 6 days 3 hours 31 minutes 37 seconds ago)
some_user> -pre BlahBlah.DVD-R-Relese
<pre> [-PRETIME-] [DVD-R] Date:(2006-04-27) Release:(BlahBlah.DVDR-Relese) Age:(1 week 6 days 3 hours 31 minutes 37 seconds ago)
some_user> -pre BlahBlah.SVCD-Relese
<pre> [-PRETIME-] [SVCD] Date:(2006-04-27) Release:(BlahBlah.SVCD-Relese) Age:(1 week 6 days 3 hours 31 minutes 37 seconds ago)
some_user> -pre BlahBlah.VCD-Relese
<pre> [-PRETIME-] [VCD] Date:(2006-04-27) Release:(BlahBlah.VCD-Relese) Age:(1 week 6 days 3 hours 31 minutes 37 seconds ago)
[quote]

as you can see from the script:
[quote]
ON 1:TEXT:*:#CHAN_ECHO'S_FROM:{

if (PRETIME isin $1-) || (French isin $1-) || (SWEDiSH isin $1-) || (DANiSH isin $1-) || (German isin $1-) || (DUTCH isin $1-) || (.KOR. isin $1-) || (.iTALiAN. isin $1-) || (.SATRip. isin $1-) || (.PL. isin $1-) || (.*-pre*. isin $1-) {

set %echo.say OFF

}

if (DVD-R isin $1-) && (%echo.say == ON) { /msg #CHAN_ECHO'S_TO $1- }

if (SVCD isin $1-) && (%echo.say == ON) { /msg #CHAN_ECHO'S_TO $1- }

if (VCD isin $1-) && (%echo.say == ON) { /msg #CHAN_ECHO'S_TO $1- }

if (XviD isin $1-) && (%echo.say == ON) { /msg #CHAN_ECHO'S_TO $1- }

if (XBoX isin $1-) && (%echo.say == ON) { /msg #CHAN_ECHO'S_TO $1- }

if (Games isin $1-) && (%echo.say == ON) { /msg #CHAN_ECHO'S_TO $1- }


set %echo.say ON

}


it blocks/filters PRETIME so i dont see the bots responce to the users quiry,thats good (what i want) and working fine.
The prob is where i have further down the script,i have it set to echo on for when the bots announces new
DVD-R , VCD , SVCD , XBoX and XviD so i think there lies the prob, if anyone in the chan types in DVD-R etc.. it echo's the users txt/quiry to my filtered chan.
I'm not very good with scripts etc.. maybe there is a better way to write it i dont know,i had help with this as it was to get it to do what its doing so far but just seem to be stumbling on this last part.

Top
#148701 - 10/05/06 08:21 AM Re: Script Help plz
schaefer31 Offline
Fjord artisan

Registered: 27/08/05
Posts: 525
This should work for you. Note that I placed an access level requirement of 10. So you will need to add the PreBot to your userlist with an access level of 10. To do this:

Alt + R
Switch to user's tab
Add the following line
10:*!*@hostmask

Where hostmask is the hostmask of the PreBot. This will prevent the script from triggering if someone other than the PreBot says for example DVD-R.

Code:
on 10:TEXT:*:#Channel:{
  [color:blue]; The message MUST match the following format exactly
  ; [-PRE-] [Type] Date:(yyyy-mm-dd) Release:(T)
  ; Where Type is any of the following: DVD-R SVCD VCD XBoX XviD Games
  ; T is any string of text, it cannot be blank[/color]
  var %r = /^\[-PRE-\] \[(?:DVD-R|SVCD|VCD|XBoX|XviD|Games)\] Date:\([\d]{4}-[\d]{2}-[\d]{2}\) Release:\(.+\)$/iS
  if ($regex($1-,%r)) {
    [color:blue]; Next check if any of the following are in the 4th token, which is the release name:
    ; french swedish danish german dutch .kor. .italian. .satrip. .pl
    ; If none of these are found, send the message[/color]
    if (!$regex($4,/(?:french|swedish|danish|german|dutch|\.kor\.|\.italian\.|\.satrip\.|\.pl)/iS)) {
      msg #echochannel $1-
    }
  }
}

Top
#148702 - 10/05/06 08:23 AM Re: Script Help plz
schaefer31 Offline
Fjord artisan

Registered: 27/08/05
Posts: 525
I still suggest to use an @window for this if it's intended only for you to see. There's really no reason to use a channel for that.

Top
#148703 - 10/05/06 09:24 AM Re: Script Help plz
D00M Offline
Babel fish

Registered: 28/10/05
Posts: 71
@schaefer31

laugh cool :tongue:
Mate you are a True legend,its working perfect so far and it's exactly what i wanted. grin
You mentioned an @window in your last post,can you explain a little more about this,
i can see it would be better than in a chan (if its just like a PM window) as it is for just my eyes only,
look forward to your reply. wink

Top
#148704 - 10/05/06 11:11 AM Re: Script Help plz
D00M Offline
Babel fish

Registered: 28/10/05
Posts: 71
hey hey back again,i was wondering if it was possible to add nuked and unnuked into the script (filtered just like the releases)

e.g nuked and unnuked announcement from bot
Quote:

<pre> [NUKED] [BlahBlah.Release-DVD-R] [Reason BlahBlahBlah]
<pre> [UNNUKED] [BlahBlah.Release-DVD-R] [Reason BlahBlahBlah] [Release was nuked for BlahBlah.2006-05-08]


i had a go at it myself and with my original script i got it to work but not sure where to add this into the script you came up with schaefer31 confused any advice/point in the right direction would be great (im also interested in this @window you mentioned earlyer),TIA for any responce wink

Top
#148705 - 10/05/06 05:47 PM Re: Script Help plz
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
If you want to match a digit you can use \d, you don't need to put it in a character class.
_________________________
Gone.

Top
#148706 - 10/05/06 06:37 PM Re: Script Help plz
schaefer31 Offline
Fjord artisan

Registered: 27/08/05
Posts: 525
@FiberOPtics:

I figured you would reply to that one wink

I know I can use just \d to match a digit but I didn't know I could just do \d{3} instead of [\d]{3}. I think early on when I was first trying my luck with regex I did something like that and it didn't work, so it stuck with me to use []. See, now if you'd just finish your regex bible I could have likely avoided this wink. Thanks for keeping me in check with the regex as always, I'm still learning. These little things are appreciated even if you don't think so.



@D00M:

An @window is just a blank window by default that you can add whatever you care to into it. I modified the code to use an @window named @preINFO as well as making it display NUKES and UNNUKES on top of what it was already displaying. It will still filter out the messages (releases, nukes and unnukes) if they contain anything you don't want to see. I made a small correction to that exclude list by changing .pl to .pl.

Code:
on 10:TEXT:*:#Channel:{
  var %r = /^\[-PRE-\] \[(?:DVD-R|SVCD|VCD|XBoX|XviD|Games)\] Date:\(\d{4}-\d{2}-\d{2}\) Release:\(.+\)$/iS
  [color:blue]; Again, the format has to match exactly for NUKES and UNNUKES. 
  ; The required format is based on the example you gave.[/color]
  var %n = /^\[NUKED\] \[.+\] \[Reason .+\]$/iS
  var %u = /^\[UNNUKED\] \[.+\] \[Reason .+\] \[Release .+\]$/iS
  var %noshow = /(?:french|swedish|danish|german|dutch|\.kor\.|\.italian\.|\.satrip\.|\.pl[color:red].[/color])/iS
  if ($regex($1-,%r) || $regex($1-,%n) || $regex($1-,%u)) {
    if (!$regex($4,%noshow) || !$regex($2,%noshow)) {
      [color:blue]; Before adding to the window, check if it is open or not and if
      ; not, open it and add the line. Here is what the switches are doing:
      ;
      ; n - Opens the window minimized so it does not steal focus
      ; z - Forces the window to open at the bottom/end of the switchbar[/color]
      if (!$window(@preINFO)) window -nz @preINFO
      aline @preINFO [[ $+ $asctime(h:nn) $+ ]] $1-
    }
  }
}

Top
#148707 - 11/05/06 03:36 AM Re: Script Help plz
D00M Offline
Babel fish

Registered: 28/10/05
Posts: 71
grin grin grin grin grin grin grin grin

ty ty ty ever so much schaefer31 for helping me with this (and also to anyone else who commented)
everything is working great so far and i like the @window ( very nice idea indeed grin )
this started as a basic script,e.g:
Code:
on 1:TEXT:*DVD-R*:#CHAN_ECHO'S_FROM:{

  /msg #CHAN-ECHO'S_TO $1-
}

and now look what its evolved to smile.I'v added a few lines at the top of your script so it will show loaded and unloaded
(i must admit i cheated and took it from another script).
I again thank you ever so much and i really appreciate the PM explaing the code
(about to sit and read it letter by letter now) its so much better learning how to,
rather than just having others write it for you,again thanks to all and keep up the great work schaefer31,
you are a true legend wink

Top
#148708 - 11/05/06 03:41 AM Re: Script Help plz
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
You just know that wont be the end of it. There'll be a time you'll go back and add something else to it. I'm forever finding ideas to further my scripts. It will just keep getting better. smile

Top
#148709 - 11/05/06 07:32 AM Re: Script Help plz
D00M Offline
Babel fish

Registered: 28/10/05
Posts: 71
heheh how right you are ,im already thinking of other things to add(window flashes on new announcement etc..)
but for now it seems the chan has changed the format of how it displays nuke and unnuke so the script no longer picks them up:
Code:
&lt;pre&gt; [-NUKE-] Date:(2006-05-11) Release:(BlahBlah.Release-Blah) Reason:(Blah Blah Blah)

&lt;pre&gt; [-UNNUKE-] Date:(2006-05-10) Release:(BlahBlah.Release-Blah) Reason:(Blah Blah Blah)


would the following work so it will match the new format on nuke and unnuke announcements?

Code:
  var %n = /^\[-NUKE-\] Date:\([\d]{4}-[\d]{2}-[\d]{2}\) Release:\(.+\) Reason:\(.+\)$/iS

  var %u = /^\[-UNNUKE-\] Date:\([\d]{4}-[\d]{2}-[\d]{2}\) Release:\(.+\) Reason:\(.+\)$/iS


(remember im still on my L plates grin),TIA wink

Top
#148710 - 11/05/06 07:51 AM Re: Script Help plz
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
Oh I really couldn't tell you. I'm not familiar with regex. But there's a fair few that can help with that. But what you want could probably done with wild card matches anyways.

Top
#148711 - 11/05/06 11:58 AM Re: Script Help plz
schaefer31 Offline
Fjord artisan

Registered: 27/08/05
Posts: 525
Yes, those will match correctly. You can make a small change however. For each [\d] you can just put \d as FiberOPtics pointed out.

Top
#148712 - 11/05/06 05:52 PM Re: Script Help plz
D00M Offline
Babel fish

Registered: 28/10/05
Posts: 71
hehehe back to pick you brain again schaefer31,it seems that for some reason the filters are not working anymore.
Can you or anyone see if there is something wrong?
Im sure it was working before i changed the nuke/unnuke msg to match new format
but now all the items i have in the filter does not seem to be getting block:
Code:
;=====================================================================
; ECHO Script (filtered) @Window v0.2a by schaefer31 (Tweaked by D00M)
;=====================================================================

on *:LOAD: {
  if ($version &lt; 6.03) {
    .unload -rs $+(",$script,")
    echo -ts 4ECHO Script (filtered) @Window v0.2a Requires mIRC v6.03 or newer to be installed successfully, script auto-unloaded.
  }
  else { echo -ts 3ECHO Script (filtered) @Window v0.2a, Successfully loaded. }
}
on *:UNLOAD: {
  .unload -rs $+(",$script,")
  echo -ts 7ECHO Script (filtered) @Window v0.2a, Successfully unloaded.
}
on 10:TEXT:*:#CHAN_ECHO_FROM:{

  var %p = /^\[-PRE-\] \[(?:DVD-R|SVCD|VCD|XBoX|XviD|Games)\] Date:\(\d{4}-\d{2}-\d{2}\) Release:\(.+\)$/iS

  var %n = /^\[-NUKE-\] Date:\(\d{4}-\d{2}-\d{2}\) Release:\(.+\) Reason:\(.+\)$/iS

  var %u = /^\[-UNNUKE-\] Date:\(\d{4}-\d{2}-\d{2}\) Release:\(.+\) Reason:\(.+\)$/iS

  var %noshow = /(?:french|swedish|danish|german|dutch|czech|swesub|iceland|nordic|fansubbed|multisubs|subfix|\.heb\.|\.norsub\.|\.custom\.|\.swe\.|\.es|\.kor\.|\.italian\.|\.satrip\.|-pl-|\.pl\.)/iS

  if ($regex($1-,%p) || $regex($1-,%n) || $regex($1-,%u)) {

    if (!$regex($4,%noshow) || !$regex($2,%noshow)) {

      if (!$window(@preINFO)) window -nz @preINFO

      aline @preINFO [[ $+ $asctime(h:nn) $+ ]] $1-

    }

  }

}


e.g of output now:
Code:
[1:59] [-PRE-] [SVCD] Date:(2006-05-11) Release:(BlahBlah.Der.German.DVDRiP.SVCD-BlahBlah)
[1:59] [-PRE-] [DVD-R] Date:(2006-05-11) Release:(BlahBlah.FRENCH.DVD-R-BlahBlah)
[1:59] [-PRE-] [XviD] Date:(2006-05-11) Release:(BlahBlah.Der.ITALIAN.DVDRiP.XviD-BlahBlah)


as i said it all works fine except now the filters are broken (i notice the filters are writen a little different from your original echo to chan script),

alsoi cant seem to be able to reposition the @window,
im in a lot of chans so its way down the bottom of my list,would be great if it was at the top (first window).
I dare ask but also is it possible to make the window flash (like a PM window does when someone msg's you?)
when there is a new announcement, (hope im not asking to much grin TIA for any help wink

Top
#148713 - 11/05/06 09:46 PM Re: Script Help plz
schaefer31 Offline
Fjord artisan

Registered: 27/08/05
Posts: 525
No, it's not a problem with the format it's a mistake in the code I gave you.

On this line here:

Code:
if (!$regex($4,%noshow) || !$regex($2,%noshow)) {


It should be

Code:
if (!$regex($4,%noshow) [color:red]&amp;&amp;[/color] !$regex($2,%noshow)) {





Second, this does not affect the output currently, it's just an enhancement, this line:


Code:
var %noshow = /(?:french|swedish|danish|german|dutch|czech|swesub|iceland|nordic|fansubbed|multisubs|subfix|\.heb\.|\.norsub\.|\.custom\.|\.swe\.|\.es|\.kor\.|\.italian\.|\.satrip\.|-pl-|\.pl\.)/iS



Can be changed to:

Code:
var %noshow = /\.(?:french|swedish|danish|german|dutch|czech|swesub|iceland|nordic|fansubbed|multisubs|heb|norsub|custom|swe|es|kor|italian|satrip|pl)\./iS


By making that change it means any of the words in the match list must be surrounded by periods, instead of having to do \.filter1\.|\.filter2\.|etc



As for changing the position of the window, there is no way that I know of to force it to the top if there are already other windows open. What you might want to do instead is open it as a desktop window.

To try that, change the the switches from -nz to -nzd

Making it flash is quite easy. Find the line:

Code:
aline @preINFO [[ $+ $asctime(h:nn) $+ ]] $1-


Below it, add:

Code:
flash @preINFO


You can also make it play a sound, beep or whatever else you wish.

Have a look at these (type them in mIRC, scroll down and find the respective sections):

/help /window
/help /flash
/help /beep
/help /splay

Top
Page 1 of 2 1 2 >