Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 09, 2016, 03:50:52 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Ignore messages containing a special word  (Read 8353 times)

checkitout

  • Participant
  • Joined in 2006
  • *
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
Ignore messages containing a special word
« on: May 21, 2006, 03:58:22 AM »
Hi Guys,


first of all a big thanx for this great pice of software!

I'm trying to ignore a line of text, when it contains a word, let us say it's "fuckoff".
Well I read through the script code, and got to a section where it says "if you had your own stuff you wanted to do to incoming text, you would do it to %m here" well thats what I did: I inserted:
     
 if (%m($1-,/\bfuckoff\b/iS)) {
        haltdef
      }


But somehow it wont work..... I guess I should notice that I'm not too familiar with mirc scripting. So I'd be glad if someone could correct my code, or tell me how to manage my issue.




Greets,
checkitout

PhilKC

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 117
    • View Profile
    • BlueScreenOfDeath.co.uk
    • Donate to Member
Re: Ignore messages containing a special word
« Reply #1 on: May 21, 2006, 04:42:38 AM »
if (fuckoff isin $1-) {
       haltdef
}

How about that?
It's not a bug, it's an undocumented and unexplainable feature.
Stick it on your site:

checkitout

  • Participant
  • Joined in 2006
  • *
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
Re: Ignore messages containing a special word
« Reply #2 on: May 21, 2006, 05:00:10 AM »
nope aint working either :(

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,421
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Ignore messages containing a special word
« Reply #3 on: May 21, 2006, 07:08:30 AM »
well philkc had the right idea, except in your case you would want to check %m so i guess you want like
if (fuckoff isin %m) {
       haltdef
}

However -
that instruction is misleading - you really should NOT be modifying that mircryption function unless you want to be always remaking any change whenever you ugprade.. since any change would get erased when you upgraded.

instead,
you can use the MircryptionSignalAll signal to add your own handler to catch certain text and do different things.
see the very bottom of mircryption.mrc for the signal and some instructions on how to use it.

checkitout

  • Participant
  • Joined in 2006
  • *
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
Re: Ignore messages containing a special word
« Reply #4 on: May 21, 2006, 07:17:54 AM »
thx mouser for your patiance, I didn't read through your whole code, I'm sorry.
Now I found this piece of code:
;if ($5 == hidethis) {
  ;  ; this test hides all lines (incoming, actions, outgoing, everything - which starts with the word hidethis)

and I guess I'll manage to modify it the way I want it to work.

thxalot!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,421
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Ignore messages containing a special word
« Reply #5 on: May 21, 2006, 07:27:37 AM »
yes, the MircryptionSignalAll thing is designed to help you catch text and do things with it (respond to it, ignore it, etc.) in very flexible ways, without modifying the actual mircryption.mrc script, so its not affected by any upgrades.

make sure you copy the mircryptionsignalall function to your own script file and modify that one - don't edit the one in mircryption.mrc directly.

if you visit #mircryption on efnet you could get some more help as well.

checkitout

  • Participant
  • Joined in 2006
  • *
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
Re: Ignore messages containing a special word
« Reply #6 on: May 21, 2006, 08:36:06 AM »
fixed it now, copyed the code in ownstuff.nns


thxalot for that bit of help, everythings working now, like i wanted it to.

next time i'll check #mircryption, befor posting here.

cu
checkitout

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,421
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Ignore messages containing a special word
« Reply #7 on: May 21, 2006, 08:41:29 AM »
this is a fine place to post such questions actually :)
i was just suggesting that for more prolonged questions that require more back and forth help sometimes the channel is better, but you seem to already know enough mirc scripting to get it working  :up: