mIRC Home    About    Download    Register    News    Help

Print Thread
#158683 07/09/06 10:15 PM
Joined: Aug 2006
Posts: 44
X
Xtibian Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 44
My greet will spam the person if they join multi channels when they conect. Because its a notice. Is there a way to stop that from happening and only greet the person for each channel they join instead of having all the greets in one. I know if it was a msg it should stop that but, I dont want it as a msg. :|

Code:
on *:JOIN:#: {
  if $nick = $me goto 1
  if $asctime(HH:nn:ss) >= 05:00:00 && $asctime(HH:nn:ss) <= 11:59:59 goto 2
  if $asctime(HH:nn:ss) >= 12:00:00 && $asctime(HH:nn:ss) <= 16:59:59 goto 3  
  if $asctime(HH:nn:ss) >= 17:00:00 && $asctime(HH:nn:ss) <= 23:59:59 goto 4
  if $asctime(HH:nn:ss) >= 00:00:00 && $asctime(HH:nn:ss) <= 04:59:59 goto 5 
  halt
  :1
  halt
  :2
  notice $nick 6Good morning4 $nick 6and welcome to4 $chan  $+ 6.
  notice $nick 6Current Time Is4 $asctime(HH:nnTT) 13- 6Please enjoy your stay
  halt
  :3
  notice $nick 6Good afternoon4 $nick 6and welcome to4 $chan $+ 6.
  notice $nick 6Current Time Is4 $asctime(HH:nnTT) 13- 6Please enjoy your stay.
  halt 
  :4
  notice $nick 6Good evening4 $nick 6and welcome to4 $chan $+ 6.
  notice $nick 6Current Time Is4 $asctime(HH:nnTT) 13- 6Please enjoy your stay.
  halt
  :5
  notice $nick 6Hope you are having a good night4 $nick 6and welcome to4 $chan $+ 6.
  notice $nick 6Current Time Is4 $asctime(HH:nnTT) 13- 6Please enjoy your stay.
  halt
}  


Thank you.


Newbie Scripter. Learning pretty fast...lol :P
#158684 07/09/06 10:37 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
what you want iis msg $chan
that will send to the channel they joined, not to the person as a private msg

#158685 07/09/06 10:43 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Unfortunately I can't think of any way to stop this behaviour, since you are wanting the greet to show, and just to the nick, rather than to everyone. Even using /msg would still spam them, as they would get all of the greetings in the single msg window from the bot. The closest that I can think of, would be to use notice $chan rather than notice $nick, however, this gives the problem of the message being seen by everyone in the channel, rather than just the person that joined.

While I can't assist with your request, I did take a look at your code, and noticed a few small things that would make your code a bit better.

Here's the re-write, if you'd like to use it.
Code:
 on !*:JOIN:#: {
  if $asctime(HH:nn:ss) >= 05:00:00 && $asctime(HH:nn:ss) <= 11:59:59 {
    notice $nick 6Good morning4 $nick 6and welcome to4 $chan  $+ 6.
    notice $nick 6Current Time Is4 $asctime(HH:nnTT) 13- 6Please enjoy your stay
  }
  elseif $asctime(HH:nn:ss) >= 12:00:00 && $asctime(HH:nn:ss) <= 16:59:59 {
    notice $nick 6Good afternoon4 $nick 6and welcome to4 $chan $+ 6.
    notice $nick 6Current Time Is4 $asctime(HH:nnTT) 13- 6Please enjoy your stay.
  }
  elseif $asctime(HH:nn:ss) >= 17:00:00 && $asctime(HH:nn:ss) <= 23:59:59 {
    notice $nick 6Good evening4 $nick 6and welcome to4 $chan $+ 6.
    notice $nick 6Current Time Is4 $asctime(HH:nnTT) 13- 6Please enjoy your stay.
  }
  else {
    notice $nick 6Hope you are having a good night4 $nick 6and welcome to4 $chan $+ 6.
    notice $nick 6Current Time Is4 $asctime(HH:nnTT) 13- 6Please enjoy your stay.
  }
}  
 

#158686 08/09/06 03:37 AM
Joined: Oct 2004
Posts: 73
M
Babel fish
Offline
Babel fish
M
Joined: Oct 2004
Posts: 73
Untested, also refined it a bit more:
Code:
on !*:JOIN:#: {
  var %at = $asctime(HH:nn:ss)
  if (%at >= 00:00:00 && %at <= 04:59:59) {
    greetnotice $nick 6Hope you are having a good night4 $nick 6and welcome to4 $chan $+ 6.
  }
  else {
    greetnotice $nick 6Good $+($iif(%at >= 05:00:00 && %at <= 11:59:59,morning,$iif(%at >= 12:00:00 && %at <= 16:59:59,afternoon,evening)),4) $nick 6and welcome to4 $chan $+ 6.
  }
}
alias greetnotice {
  if (!$timer(notice)) {
    timernotice 1 10 notice $1-
    timer 1 10 notice $1 6Current Time Is4 $asctime(HH:nnTT) 13- 6Please enjoy your stay
  }
}
 


edit: This forum's submit has screwed up the end of the messages for some reason, maybe to do with the colorcodes

#158687 08/09/06 04:13 AM
Joined: Aug 2006
Posts: 44
X
Xtibian Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 44
Ok, thank you again. Ill just deal with it for flooding the person. Unless I just set it to msg chan.

Anyways, as you know Im still learning and have alot to learn for scripting. But, mind adding a op can only use this command.

Code:
 on *:TEXT:!byemperor:#:{
.part $chan 6Thank you for using 4!byemperor6. If you wish to have me back, type 4/invite Emperor #channel6. This part had been requested by4 $nick $+ 6.
}
} 


Newbie Scripter. Learning pretty fast...lol :P
#158688 08/09/06 04:37 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
  on *:TEXT:!byemperor:#:{
if ($nick isop $chan) {
.part $chan 6Thank you for using 4!byemperor6. If you wish to have me back, type 4/invite Emperor #channel6. This part had been requested by4 $nick $+ 6.
}
}  

#158689 08/09/06 09:33 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
How about a simple variable?

This isn't inserted in the current script, but just an example to show what I mean. Inserting it should be easy. You can also increase the unset timer from 5 to 10 if the auto-join is a bit slow.
Code:
set -u5 %greet.msg. $+ $nick 1
if (%greet.msg. [ $+ [ $nick ] ]) { .notice $nick blah blah }


Invision Support
#Invision on irc.irchighway.net
#158690 09/09/06 02:44 AM
Joined: Oct 2004
Posts: 73
M
Babel fish
Offline
Babel fish
M
Joined: Oct 2004
Posts: 73
Quote:
Inserting it should be easy.

Needed to insert the lines reversed and do the opposite of the check in the example wink
My timer version wasn't the best either. It'd fail to send the notice to a second person if they happened to join within 10 seconds of the first even if they joined a different channel.
Code:
 on !*:JOIN:#: {
  var %at = $asctime(HH:nn:ss)
  if (%greet.msg. [ $+ [ $nick ] ]) return
  else {
    if (%at >= 00:00:00 && %at <= 04:59:59) {
      .notice $nick 6Hope you are having a good night4 $nick 6and welcome to4 $chan $+ 6.
    }
    else {
      .notice $nick 6Good $+($iif(%at >= 05:00:00 && %at <= 11:59:59,morning,$iif(%at >= 12:00:00 && %at <= 16:59:59,afternoon,evening)),4) $nick 6and welcome to4 $+(chan,.)
    }
    set -u10 %greet.msg. $+ $nick 1
    .notice $nick 6Current Time Is4 $asctime(HH:nnTT) 13- 6Please enjoy your stay
  }
}
 

#158691 11/09/06 09:49 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
So, is it working the way you want now?


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard