Simple Commands

By PyThOn on Sep 17, 2011

This script basicly desribes itself
Everything is on a . trigger Which i personaly enjoy.
MUST be admin to use some.
bad words used.
Rate this.
Have fun.

;Made By PyThoN
;Do not copy/crop/change
;;;;;;;;PyThoNScripTz;;;;;;;
on *:input:*: {
  if ( $1 == .ban ) { /ban $chan $$2 | halt }
  if ( $1 == .join ) join $$2
  if ( $1 == .Green ) mode $chan +v $$2  
  if ( $1 == .nGreen ) mode $chan -v $$2
  if ( $1 == .halfop ) mode $chan +h $$2
  if ( $1 == .dehalfop ) mode $chan -h $$2
  if ( $1 == .Mod ) mode $chan +o $$2
  if ( $1 == .dMod ) mode $chan -o $$2
  if ( $1 == .smd ) { /kick $chan $$2 }
  if ( $1 == .Leave ) { /part $chan }
  if ( $1 == .invite ) { /invite $$2 $chan }
  if ( $1 == .Bitch ) { /kill $$2 $Chan }
  if ( $1 == .Cloak ) { /hop $chan }
  if ( $1 == .Kline ) { /kline $$2 $chan }
  if ( $1 == .Quit ) { /quit }
}

Comments

Sign in to comment.
PyThOn   -  Sep 23, 2011

hmm ok.Thanks

 Respond  
Jethro   -  Sep 19, 2011

Point taken. I stand corrected.

 Respond  
jaytea   -  Sep 19, 2011
if ($2 ison $chan) {
if ($me isop $chan) {

i would advise against these checks unless you also plan to handle the complementary cases. think about what the script is doing: if those conditions fail then the message the user typed is sent to the active window leaving the user confused and not knowing whether the script triggered or not, not to mention annoying the rest of the channel (more than usual) with unnecessary text. omitting the checks will at least result in a more informative 'you are not an operator' or 'no such nick'.

 Respond  
Jethro   -  Sep 18, 2011

To make it better though, you need not use but # , because tells mIRC to listen to both channel and PM, and $chan is $null in PM. ( there is no $chan in PM ) So you should've used: > on *:input:#:{Then use

if ($2 ison $chan) {

without it, the $2 can be anything you wish. You can input a value

.ban aksjfhkajsdfha

and get an error. $2 ison $chan tells mIRC if $2 is a nickname on the channel where the code is run.

Finally, and this is optional, if you're not opped at all times, include

if ($me isop $chan) {

to make sure you're opped before some of these commands can be triggered, otherwise you may get an error.

 Respond  
PyThOn   -  Sep 18, 2011

Dani_11 I really Dont care if you have it as green or not.Also Copy as in Frawd It helps to think before you type.
All im looking for is comments on how this snippet could be better.
As for the changes to the script most are good but either way they both work.
No need for excess code when this works as good.

 Respond  
Jethro   -  Sep 18, 2011

What's that gotta do with everything, dani? .green and .ngreen are just two commands to execute +v and -v mode. Don't mess up your mind too hard over this.

 Respond  
Dani_l11   -  Sep 18, 2011

";Do not copy/crop/change"

Seriously? Are we supposed to re-type the whole thing or what? Why post it here if you cannot copy it...

Also
if ( $1 == .Green ) mode $chan +v $$2
if ( $1 == .nGreen ) mode $chan -v $$2

You do realize that not everyone, or in fact, most people do not have the colour for voices set as green?

 Respond  
Jethro   -  Sep 18, 2011
on *:input:#:{
  if ($me isop #) {
    if ($2 ison #) {
      goto $1
      :.ban | ban # $2 2 | halt
      :.smd | kick # $2 $3- | halt
      :.mod | mode # +o $2 | halt
      :.dmod | mode # -o $2 | halt
      :.green | mode # +v $2 | halt
      :.ngreen | mode # -v $2 | halt
      :.halfop | mode # +h $2 | halt
      :.dehalfop | mode # -h $2 | halt
    }
    else {
      goto $1
      :.bitch | kill $2 | halt
      :.kline | kline $2 | halt
    }
  }
  else {
    goto $1
    :.quit | quit
    :.leave | part | halt
    :.join | join $2 | halt
  }
  :error | reseterror
}
 Respond  
Jethro   -  Sep 18, 2011

Then reinforce my suggestion using: if ($me isop #) { to make a comparison.

 Respond  
_Dean_   -  Sep 18, 2011

Of course, we can just prefix the event with @

not in this case, since you can use /part, /quit, /invite and /join without op, using the prefix will only stop these commands, if you're not opped in the room where you performed the command

 Respond  
Jethro   -  Sep 18, 2011

I'll use if ($me isop #) because sometimes you might forget that whether you're opped or else...before some of those commands can be initiated while being an op to do so. Of course, we can just prefix the event with @

I think $active has to be the abused identifier used by many, the second is $target

 Respond  
jaytea   -  Sep 18, 2011

i think its only necessary to use if ($active ischan) so it will check, if $active is a channel which you're on

other way round: it is only necessary to check if ($me ison #) since 'ison' only works for channels, ie. the second condition implies the first.

 Respond  
_Dean_   -  Sep 18, 2011

i dont see a reason to use

if ($active ischan && $me ison $active) {

since $me will be always on $active...in whatever window you're in, it will be automatically your $active window
i think its only necessary to use if ($active ischan) so it will check, if $active is a channel which you're on

 Respond  
Jethro   -  Sep 18, 2011

There are two conditional checks missing:

if ($me isop $chan) {

if ($2 ison $chan) {

They're beneficial to avert errors.

As an aside, there's nothing wrong with using if the way python has. What SReject has done is taking it onto another level, making it more fancier... For those who don't bother with regex may find themselves scratching their heads over it.

 Respond  
SReject   -  Sep 17, 2011

Right you are Dean

 Respond  
_Dean_   -  Sep 17, 2011
if ($acitve ischan && $1 == .cycle)

you meant = $active

if im not making a mistake, /kill command is only allowed for IRCops... and doesnt need to use $chan on kill

most of the commands used, require OP status on channel

 Respond  
SReject   -  Sep 17, 2011

cough

on *:input:*: {
  if ($active ischan && $me ison $active) {
    if ($regex($1,/^\.(d?)(?|(v)(?:o(?:ice)?)?|(h)(?:alf)?op|(o)p)$/i)) mode $chan $iif($regml(1),-,+) $+ $regml(2) $$2
    if ($1 == .ban) ban $chan $$2
    if ($1 == .kick) kick $chan $$2
    if ($1 == .kb) ban -ku30 $chan $$2 2 $3-
    if ($1 == .part) part $chan $2-
    if ($1 == .invite) invite $$2 $chan
  }
  if ($1 == .join) join $$2
  if ($active ischan && $1 == .cycle) $iif($me ison $active,hop $2-,join $active)
  if ($1 == .Quit) /quit $1-
}

.v - voices a user
.dv - devoices a user
.h - halfops a user
.dh - dehalfops a user
.o - ops a user
.dh - deops a user

.Ban - bans a user
.Kick - Kicks a user
.KickBan - Kick bans a user

.Part - parts the active channel
.invite - invites a user to the active channel

.join - joins a channel
.cycle - cycles the currently active channel

.Quit - disconnects from the irc server

 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.