On Join Actions

By Relurk_ on Mar 12, 2010

Screenshots

On Join Actions Controller. (Couldn't think of name)
.welcome (Toggles Welcome user on join)
.joins (Toggles display join number on join)
.stats (tells if they are on or off)

Please give any advice in the comment box. No hate comments please!

on *:JOIN:#: {
  inc %join [ $+ [ $chan ] ]
  if ( %welcome [ $+ [ $chan ] ] == yes ) && ( %joinss [ $+ [ $chan ] ] == yes ) { msg $chan 8,1Welcome $nick $+ ! You are viewer 0,1#  $+ %join [ $+ [ $chan ] ] }
  if ( %joinss [ $+ [ $chan ] ] != yes ) && ( %welcome [ $+ [ $chan ] ] == yes ) { msg $chan 8,1Welcome $nick $+ ! }
  if ( %welcome [ $+ [ $chan ] ] != yes ) && ( %joinss [ $+ [ $chan ] ] == yes ) { msg $chan 8,1Welcome $nick $+ ! You are viewer 0,1#  $+ %join [ $+ [ $chan ] ] }
}
on *:TEXT:*:#: {
  if ($1 == .welcome) && ( %welcome [ $+ [ $chan ] ] != yes ) { msg $chan Welcoming users on join is now 9 ENABLED | set %welcome [ $+ [ $chan ] ] yes }
  if ($1 == .welcome) && ( %welcome [ $+ [ $chan ] ] == yes ) { msg $chan Welcoming users on join is now 4 DISABLED | set %welcome [ $+ [ $chan ] ] no }
  if ($1 == .joins) && ( %joinss [ $+ [ $chan ] ] != yes ) { msg $chan Displaying join number on join is now 9 ENABLED | set %joinss [ $+ [ $chan ] ] yes }
  if ($1 == .joins) && ( %joinss [ $+ [ $chan ] ] == yes ) { msg $chan Displaying join number on join is now 4 DISABLED | set %joinss [ $+ [ $chan ] ] no }
  if ($1 == .stats) msg $chan 4,1Joins:0,1 %joinss [ $+ [ $chan ] ] 4,1Welcome:0,1 %welcome [ $+ [ $chan ] ]
}

Comments

Sign in to comment.
Jethro   -  Mar 14, 2010

I know. This is what I meant by paradox!

As they say, "what works best for one person may not work best for another." Do what you think best is what counts then. lol

 Respond  
napa182   -  Mar 14, 2010

true it's not but like every one thinks regex is the answer to all for some strange reason.. well it's true that regex works for some things where it's needed an yet it ends up everywhere where it shouldn't lol go figure.

 Respond  
Jethro   -  Mar 14, 2010

but why make the regex work when it don't have to?Exactly! That's sort of the paradox I'm trying to get across...:|
If fact, I don't think the regex is needed at all in the first place. =)

 Respond  
napa182   -  Mar 14, 2010

well the same can be said about

 on $*:TEXT:/^.(\w+)$/iS:#: {

with

 on *:text:.*:#:{

but why make it trigger when it don't have to?

yes i concur about to each their own

 Respond  
Jethro   -  Mar 14, 2010

Well, to me, having a string within the match section of a regex and then using the $regml(1) to reference it is no different than using a regular on text event with the $1:> on $*:TEXT:/^.(welcome)$/iS:#: {
if ($regml(1) == welcome) {
Versus:

on *:TEXT:*:#: {
 if ($strip($1) == .welcome) {

are the exact same things.

And both can also be combined to do the same task:

on $*:TEXT:/^[.]\w+$/iS:#: {
  if ($1 == .welcome) {
}

But it sort of defeats the purpose of regex.

I guess we're each our own when it comes to MSL.

 Respond  
napa182   -  Mar 13, 2010

jethro with the \w+ why make it trigger on anything with . infront an make it search the if statements for? better to only make it trigger on the triggers said imo.

and about who ever is sending the welcome message imo it would be better if it was an +o an not a reg user.

 Respond  
Jethro   -  Mar 13, 2010

slacker, I know it's force of habit, but you don't really need to reiterate the regex match section with welcome, joins and stats. The $regeml(1) already does the job for you. So just

on $*:TEXT:/^.(\w+)$/iS:#: {

will suffice.

Also, the prefix @ should have been ! (there's no mode settings involved, just msg command)

Or else the join event won't work if the client is not opped.

P.S. the dot used in the trigger doesn't have to be escaped.

 Respond  
slacker   -  Mar 13, 2010

there are many ways to make something like this. here is just one more way..

on @*:JOIN:#: {
  inc $+(%,join,#)
  if ($($+(%,welcome,#),2) && $($+(%,joinss,#),2)) { msg # 8,1Welcome $nick $+ ! You are viewer 0,1#  $+ $($+(%,join,#),2) }
  elseif (!$($+(%,joinss,#),2) && $($+(%,welcome,#),2)) { msg # 8,1Welcome $nick $+ ! }
  elseif (!$($+(%,welcome,#),2) && $($+(%,joinss,#),2)) { msg # 8,1Welcome $nick $+ ! You are viewer 0,1#  $+ $($+(%,join,#),2) }
}
on $*:TEXT:/^\.(welcome|joins|stats)$/iS:#: {
  if ($regml(1) = welcome) { msg # Welcoming users on join is now 04 $+($iif($($+(%,welcome,#),2),DIS,EN),ABLED) | $iif($($+(%,welcome,#),2),unset,set) $+(%,welcome,#) on }
  elseif ($regml(1) = joins) { msg # Displaying join number on join is now 04 $+($iif($($+(%,joinss,#),2),DIS,EN),ABLED) | $iif($($+(%,joinss,#),2),unset,set) $+(%,joinss,#) on }
  elseif ($regml(1) = stats) { msg # 4,1Joins:0,1 $iif($($+(%,joinss,#),2),on,off) 04,1Welcome:0,1 $iif($($+(%,welcome,#),2),on,off) }
}
 Respond  
Jethro   -  Mar 13, 2010

Instead of using two repeated commands and messages under your text event, you could do this:

on *:text:*:#: {
  if ($1 == .welcome) {
    $iif(%welcome [ $+ [ # ] ] != yes,set %welcome [ $+ [ # ] ] yes,$iif(%welcome [ $+ [ # ] ] == yes,set %welcome [ $+ [ # ] ] no))
    msg # Welcoming users on join is now $iif(%welcome [ $+ [ # ] ] == yes,9 ENABLED,4 DISABLED)
  }
  if ($1 == .joins) {
    $iif(%joinss [ $+ [ # ] ] != yes,set %joinss [ $+ [ # ] ] yes,$iif(%joinss [ $+ [ # ] ] == yes,set %joinss [ $+ [ # ] ] no))
    msg # Displaying join number on join is now $iif(%joinss [ $+ [ # ] ] == yes,9 ENABLED,4 DISABLED)
  }
  if ($1 == .stats) { msg # 4,1Joins:0,1 %joinss [ $+ [ # ] ] 4,1Welcome:0,1 %welcome [ $+ [ # ] ] }
}

And no /halt is necessary.

 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.