commands

By God425 on Jan 03, 2010

Hello im god425. Well this is my frist time posting on hawkee.com

on Owner:TEXT:#:{
if ($1 == !voice)
 mode $chan +v nick
}
if ($1 == !Devoice)
 mode $chan -v $nick
}
if ($1 == !op)
mode $chan +o $nick
}
if ($1 == !deop)
mode $chan -o $nick
}
If ($1 == !halfop)
mode $chan +h $nick
}
if ($1 == !dehalfop)
mode $chan -h $nick
}
if ($1 == !protect)
mode $chan +a $nick)
}
if ($1 == !deprotect)
mode $chan -a $nick
}
if ($1 == !join)
/join $2
msg $chan i join the channel>
}
if ($1 == !part)
/part $chan
parting channeling now $nick.
}
if ($1 == !nick)
 /nick $nick
}
if ($1 == !comamnds)
msg $nick My commands are !voice, !op, !join, !part, !halfop, !dehalfop,
msg $nick !protect, !deprotect, !devoice, !deop, !nick

Comments

Sign in to comment.
Jethro   -  Jan 04, 2010

Oh yeah napa, I didn't think of the typo issue involved, but it's easily fixable:

/!((de)?(half)?(?=op|voice|protect).*|join|part|nick)/iS
 Respond  
napa182   -  Jan 04, 2010

@Master-Of-Death if you do that then you will error out on typos
plus it seems ur regex is incomplete. maybe test it before you post it.

 Respond  
Master-Of-Death   -  Jan 04, 2010

nice but you can even shorten it to this:

on $@*:TEXT:(!)(join|part|\S+):#:{
if ($regml(2) == (join|part)) {
. $+ $regml(2) $2
}
else {
.cs $regml(2) # $nick
}
}
 Respond  
God425   -  Jan 04, 2010

how

 Respond  
napa182   -  Jan 04, 2010

@God425 just update the old snippet
@Jethro_ the only problem is if someone typos !deop as !peop or whatever it will error on that match.
also you can use this pattern
i changed the ! to @ cuz of the service bot

on $@*:TEXT:/@((de)?(op|protect|halfop|voice)|join|part|nick)/iS:#:{
 Respond  
God425   -  Jan 04, 2010

ill make a new anippet and show u the upates me and my friends made

 Respond  
Jethro   -  Jan 04, 2010

You are welcome, Master-Of-Death. You can also shorten the regex to this:

on $@*:TEXT:/!(\w*(?=op|voice|protect)\w*|join|part|nick)/iS:#: {

This will match all the commands in relation to the original script's.

 Respond  
Master-Of-Death   -  Jan 04, 2010

whats a nick script

who mentioned a nick script?

 Respond  
God425   -  Jan 04, 2010

nm

 Respond  
Master-Of-Death   -  Jan 04, 2010

Good point Jethro_ I forgot about that.

 Respond  
God425   -  Jan 04, 2010

whats a nick script

 Respond  
Jethro   -  Jan 04, 2010

Master of death, you don't have to include the exclamation mark in the $regml(1) to return. Thus you don't even have to use $remove() in the first place. Check this out:

alias test if $regex($1,/!(master)/i) { echo -a $regml(1) }

/test !master will return: master

But if you include it in the enclosed matching range like this:> alias test if $regex($1,/(!master)/i) { echo -a $regml(1) }Then it'll return: !master

When you use $regml() you must enclose the regex pattern with a set of parenthesis.

 Respond  
Master-Of-Death   -  Jan 04, 2010
  1. Your correct about the @

  2. Your wrong about the $remove, without it $regml(1) returns !deop instead of deop making /cs deop # $nick invalid.
 Respond  
Slickone   -  Jan 04, 2010

@Master-Of-Death
no need for the if $me line as well no need for the $remove.
here is the same as ur's without the $me !isop line and the $remove

on $@*:TEXT:/!(op|deop|protect|deprotect|halfop|dehalfop|voice|devoice|join|part)/iS:#:{
$iif($istok(join part,$regml(1),32),$regml(1) $2,.cs $regml(1) # $2) }
}
 Respond  
Master-Of-Death   -  Jan 04, 2010

could use this:

on $*:TEXT:((!op|!deop|!protect|!deprotect|!halfop|!dehalfop|!voice|!devoice|!join|!part)):#:{
if ($me !isop #) { 
.halt
}
elseif ($regml(1) == (!join|!part)) { 
. $+ $remove($regml(1),!) $2
}
else { 
.cs $remove($regml(1),!) # $nick
}
}

regex ftw!

 Respond  
God425   -  Jan 03, 2010

ty i just new at it

 Respond  
Jethro   -  Jan 03, 2010

There are three things to take note of your script:

  1. You have to make sure if you've been given a status; if not, make the running client give you one. Your existing code will give out status regardless of whether you're already one or not. A check for that would be nice.

  2. For your part command, you can specify a $2 so the client running the code will part the channel you choose. Conversely, if no $2 has been specified, part the current channel.

  3. Your nick command should have been a $2, not $nick. Your join one will need a double $$ for $2, so that when entering !join without it, you won't get an insufficient parameter error.

Below is an example using /goto without the use of one if statement per command, along with checks added:

on @Owner:TEXT:*:#: {
  var %x $1 | goto %x
  :!voice | mode $iif($nick !isvoice #,$v2 +v $v1) | halt
  :!devoice | mode $iif($nick isvoice #,$v2 -v $v1) | halt
  :!op | mode $iif($nick !isop #,$v2 +o $v1) | halt
  :!deop | mode $iif($nick isop #,$v2 -o $v1) | halt
  :!halfop | mode $iif($nick !ishelp #,$v2 +h $v1) | halt
  :!dehalfop | mode $iif($nick ishelp #,$v2 -h $v1) | halt
  :!protect | mode # $iif(!$nick(#,$nick,&),+a $nick) | halt
  :!deprotect | mode # $iif($nick(#,$nick,&),-a $nick) | halt
  :!join | join $$2 | halt | :!nick | nick $$2 | halt
  :!part | part $iif(!$2,#,$iif($2 ischan,$v1)) | halt
  :!commands | msg $nick My commands are: !voice, !op, !join, $&
    !part, !halfop, !dehalfop, !protect, !deprotect, !devoice, !deop, !nick
  :%x | return
} 

P.S. you should make sure the running client is opped by adding a @ prefix to your text event.

 Respond  
God425   -  Jan 03, 2010

ty

 Respond  
Shinybot   -  Jan 03, 2010

Seems good Beta135

 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.