Nick Alert

By Kevinsito on May 29, 2010

Well this is my first script for you I hope you enjoy it, is simple but usefull, when you talk about a proper Nick Alert and not a normal one. Any comment or suggestion is welcome I'm new here

Channel #PlayerX
[21:16:04] Kevinzito
[21:16:12] * %Mex_LokoOo slaps Kevinzito around a bit with a large trout

In my status Window

[21:16:04] -> -Kevinzito- Hey Kevinzito Jc18 has nick alert you in #playerx

Channel #Miami-Dade
[21:16:04] -Kevinzito- Hey Kevinzito Jc18 has nick alert you in #playerx

I showed you the logs that shows that my script, isn't just working for status window, actually works for all windows ON that net.

on *:TEXT:*:#: {
  if (YOUR_NICK_HERE* iswm $1) { notice $me Hey you, $nick has nick alert you in $chan
  }
}

Comments

Sign in to comment.
Gummo   -  Jun 02, 2010

Sorry, I read your first paragraph and then remembered the !=. I probably shouldn't have responded at 3am.. Bad for the logic part of the brain.

 Respond  
Jethro   -  Jun 02, 2010

Ouch. Gummo and I probably missed seeing the || in jaytea's initial post, let alone the third one, which you have now explained.

 Respond  
jaytea   -  Jun 02, 2010

Gummo, i'm not sure what you're referring to :P the first 2 lines of code in my post are equivalent; one is Jethro_'s original line and the other is to show why that line is incorrect. the 3rd behaves just as your example does and is also correct

i realize that the condition i used might be quite confusing to understand :p perhaps this will help explain it:

if ($chan $cid == $active $activecid) checks if ($chan == $active) && ($cid == $activecid), ie. it checks the channel is the correct one. to check it is not the correct one, you need only negate that condition and the negation of == is !=

 Respond  
Jethro   -  Jun 02, 2010

Yes, it's OR, not AND.

Well, about the parentheses, I've seen people do it with or without but enclose them at the end all together. Perhaps I should have enclosed them the formal way like Gummmo did above for clarity. :/

 Respond  
Gummo   -  Jun 02, 2010

jaytea, it's supposed to be $true if the channel is different OR the cid is different. Otherwise you can't be in the same room on another server. The correct code would be this:

if (!%f) && ($istok($strip($1-),$me,32)) && (($chan != $active) || ($cid != $activecid)) {

Obviously you don't need that many () but added for clarity.

 Respond  
jaytea   -  Jun 02, 2010

Jethro, it appears you might have made a small typo given that you have two pairs of parentheses surrounding that group of if conditions :p

if ((!%f && $istok($strip($1-),$me,32) && $chan != $active || $cid != $activecid)) {

is interpreted as:

if (((!%f) && ($istok($strip($1-),$me,32))) && ($chan != $active)) || ($cid != $activecid) {

meaning if $cid != $activecid, it would trigger regardless of the result of the previous conditions. the solution is of course to use extra () to group the last 2 conditions. there's also a neat little method you can use to combine them:

if (!%f) && ($istok($strip($1-),$me,32)) && ($chan $cid != $active $activecid) {
 Respond  
Gummo   -  May 31, 2010

I found that ($chan != $active) || ($cid != $activecid) worked well, actually.

 Respond  
Jethro   -  May 31, 2010

I suppose nothing is perfect. If the online world was perfect, we wouldn't have hackers, crackers, internet crimes, etc...to begin with. :P But then again, people do try find ways to improve upon things that have been done before that didn't turn out well than expected.

 Respond  
Gummo   -  May 31, 2010

I've tried using $chan != $active and if you have two rooms with the same name on two networks and are active in the second but someone calls you in the first your command won't execute.

 Respond  
Jethro   -  May 31, 2010

That goes to iswm too. I was just basing it off of what the author has. Perhaps use $istok($1-,$me,32)

on *:text:*:#:{
  if ((!%f && $istok($strip($1-),$me,32) && $chan != $active || $cid != $activecid)) {
    inc -u5 %f | noop $tip('Tray Tip', $nick has alerted you: $+ ,$1-,10)
  }
}

I've included the $chan != $active because I don't see the point in being active while having someone call out to you. I also think it's better to take advantage of the $tip identifier for this.

-Edited as per Gummo's recommendation.

 Respond  
Gummo   -  May 31, 2010

You know, Jethro_.. Your $me method is exactly the same as $me isin. Just sayin'.

 Respond  
Kevinsito   -  May 30, 2010

lol, didn't know those ways but anyway thanks, i'm not a good scripter but i still working on it.

 Respond  
Jethro   -  May 30, 2010

WorldDMT has said that time and time and time again. But guess what, some people are going to use isin in a similar situation. lol

 Respond  
WorldDMT   -  May 30, 2010

using "isin" is a bad idea

E.G:
if your nick is "Bam" and another is "BamBoo"
result:

hey BamBoo how r u? >>>> Hey you, worldDMT has nick alert you in #chan **<= and that is irrelevant i caled Bamboo not you**
 Respond  
Remuser   -  May 30, 2010

;;; ALERT CODE

on :TEXT::#: {
if ($me isin $1-) && ($active != $chan) {
echo $active $me Hey you, $nick has nick alert you in $chan
halt
}
}

;;; END ALERT CODE

or like this :))

 Respond  
Jethro   -  May 30, 2010
on *:TEXT:$($+(*,$me,*)):#: {
  if (!%f) {
    inc -u5 %f
    notice $me Hey you, $nick has nick alert you in $chan
  }
}

You can do it like this, and be sure you have a trigger flood control so that you don't get abused by spam or flood if that happens.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.