!Join and !Leave script

By Alex007562 on Nov 24, 2009

Use !Join #Channelnamehere

And !leave to leave with your bot

And my simple !op namehere and !deop namehere :)

FIRST SCRIPT!

on *:TEXT:!join*:#: {
  join $2
}
on *:TEXT:!leave*:#: {
  part $chan
}
on *:TEXT:!op*:#: {
  if ($nick isop $chan) (
  mode $chan +o $2
}
on *:TEXT:!deop*:#: {
  if ($nick isop $chan) (
  mode $chan -o $2
}

Comments

Sign in to comment.
ProIcons   -  Dec 21, 2009

when bot leave the channel if you type !join it will not see it..

More
 Respond  
mytvnetwork   -  Dec 21, 2009

The !leave command works, but I can't get the !join command to work for some reason.

More
 Respond  
skylife_805eh   -  Dec 20, 2009

and also i am new to this can someone show me a exsample on how to add a message like- !join skylife....... joining skylife;s channel be right there or something like that thinks again

More
 Respond  
skylife_805eh   -  Dec 20, 2009

i got it to join a channel when they go in my justin.tv room but it bumps me into another room can anyone HELP me plzzzzzzzz thanks !!!

More
 Respond  
ProIcons   -  Nov 30, 2009

1st and 2nd must be in userlist one Admin:NICK and then with the command !add you can add more Admin: and OP:

The OP Can be !op and !deop like Admin The Admin Can be !op and !deop and !add admin/op.

3rd

The nick with the level 3:Nick can add new admin (!add) can (!op and !deop) The 2:Nick can be only !op and !deop

More
 Respond  
SnoooP   -  Nov 29, 2009

Proclons care to explain what they do? Some people won't have any idea?

More
 Respond  
ProIcons   -  Nov 29, 2009
on *:text:*:#:{
  if ($ulevel == Admin) {
    if ($1 == !add) {
      if ($2-3) {
        if ($2 == OP) { auser op $3 }
        if ($2 == Admin) { auser admin $3 }
      }
      else { notice $nick !add level nick }
    }
    if ($1 == !op) { if ($2) && ($me isop $chan) && ($2 ison $chan) { mode $chan +o $2 } }
    if ($1 == !deop) { if ($2) && ($me isop $chan) && ($2 !isop $chan) && ($2 ison $chan) { mode $chan -o $2 } }
  }
  if ($ulevel == OP) {
    if ($1 == !op) { if ($2) && ($me isop $chan) && ($2 ison $chan) { mode $chan +o $2 } }
    if ($1 == !deop) { if ($2) && ($me isop $chan) && ($2 !isop $chan) && ($2 ison $chan) { mode $chan -o $2 } }
  }
}

Or

on *:text:*:#:{
  if ($ulevel == Admin) {
    if ($1 == !add) {
      if ($2-3) {
        if ($2 == OP) { auser op $3 }
        if ($2 == Admin) { auser admin $3 }
      }
      else { notice $nick !add level nick }
    }
  }
  if ($ulevel == Admin) || ($ulevel == OP) {
    if ($1 == !op) { if ($2) && ($me isop $chan) && ($2 ison $chan) { mode $chan +o $2 } }
    if ($1 == !deop) { if ($2) && ($me isop $chan) && ($2 !isop $chan) && ($2 ison $chan) { mode $chan -o $2 } }
  }
}

Or

on *:text:*:#:{
  if ($ulevel == 3) {
    if ($1 == !add) {
      if ($2-3) {
        if ($2 == OP) { auser 2 $3 }
        if ($2 == Admin) { auser 3 $3 }
      }
      else { notice $nick !add level(OP/ADMIN) nick }
    }
  }
  if ($ulevel >= 2) {

    if ($1 == !op) { if ($2) && ($me isop $chan) && ($2 ison $chan) { mode $chan +o $2 } }
    if ($1 == !deop) { if ($2) && ($me isop $chan) && ($2 !isop $chan) && ($2 ison $chan) { mode $chan -o $2 } }
  }
}
More
 Respond  
Master-Of-Death   -  Nov 29, 2009

ty I have my moments lol, few but I have them although Jethro_ or gooshie probably coul do better...

More
 Respond  
SnoooP   -  Nov 29, 2009

Good suggestion Master-Of-Death

More
 Respond  
Master-Of-Death   -  Nov 27, 2009

you would be better using user levels. you could use this..

on @*:TEXT:!reg:#:{ if ($nick isop #) { 
.auser -a op $nick
}
on op:TEXT:*:#:{ if ($1 == !op) { 
.mode # +o $2
}
elseif ($1 == !deop) { 
.mode # -o $2 
}
}

Now it will op you. just type !reg after first loading it.

More
 Respond  
SnoooP   -  Nov 27, 2009

thanks for pointing that out I didn't notice that, however, even though there is a space inbetween the else & if it still functioned lol.

(15:55:21) <@Bertrum> !deop Bertrum
(15:55:22) * Corinthian sets mode: -o Bertrum
(15:55:31) <Bertrum> !op Bertrum
(15:55:35) <Bertrum> !leave #boo
(15:55:36) * @Corinthian (Corinth@NixtrixIRC.net) has left #boo

it !deops me but because i'm not op doesn't op me lol, so even though there is a space, it still works?

More
 Respond  
Master-Of-Death   -  Nov 27, 2009

I see ur point oh btw you have a space between ur elseif on line 4 snoop.

More
 Respond  
SnoooP   -  Nov 26, 2009
on 1:text:*:*:{
  if (!join isin $1-) { join $2   }
  if (!leave isin $1-) { part $2  }
  else  if ($nick isop $chan) {
    if (!op isin $1-) { mode $chan +o $2 }
    if (!deop isin $1-) { mode $chan -o $2 }
  }
}

That would be how I would do it?

Rather than having an on @:text::*:{ event I prefer for it just to check if $nick isop $chan.

Regarding the one text event, it can be one or four, it doesn't matter. I would just say it is uneccessary to have more than one if it can be helped. Although I do realise some people prefer to have an on text event for each command/trigger because it looks neater. Having one is just my preference.

Also considering it is this users first script try not to be too harsh as it may discourage them from making further scripts, & explain why you would or wouldn't do certain things and how different things would work. Oh yeah, it works the way it is so good job!

More
 Respond  
Master-Of-Death   -  Nov 26, 2009

it should only be one text event more than one is pointless and wastes time, also you NEED brackets otherwise it can cause multiple errors especially in large scripts, the next thing is one line scripts they are pointless and harder to correct any errors i advise you to consider using meditor for coding it is simple but very effective.

More
 Respond  
ProIcons   -  Nov 25, 2009
 on @*:TEXT:!op*:#: {
  if ($nick isop $chan) {
    mode $chan +o $2
  }
}

Should Be

on @*:TEXT:!op*:#: {
  if ($nick !isop $chan) {
    mode $chan +o $2
  }
}
More
 Respond  
blitzz   -  Nov 24, 2009
on *:TEXT:!op*:#: {
  if ($nick isop $chan) (
  mode $chan +o $2
}
on *:TEXT:!deop*:#: {
  if ($nick isop $chan) (
  mode $chan -o $2
}

Should be

on @*:TEXT:!op*:#: {
  if ($nick isop $chan) {
    mode $chan +o $2
  }
}
on @*:TEXT:!deop*:#: {
  if ($nick isop $chan) {
    mode $chan -o $2
  }
}

You need to check if you are channel operator.

Ghost-Writer, i don't think by removing the {} can make it better. As Neptune stated, it makes the code more easier to read. Expert coder also use it. You make it more ugly. I think you know why the Author of mIRC create { and }.

More
 Respond  
^Neptune   -  Nov 24, 2009

{ } brackets make a program run faster and make it easier to read, don't remove them. Stop giving bad advice Ghost-writer. :B

More
 Respond  
Ghost-writer   -  Nov 24, 2009

to be honest you dont need to use 1 text event but you could make it better, like 1 line, no need to {} abuse.

on *:TEXT:!join*:#: {
  join $2
}
on *:TEXT:!leave*:#: {
  part $chan
}
on *:TEXT:!op*:#: {
  if ($nick isop $chan) (
  mode $chan +o $2
}
on *:TEXT:!deop*:#: {
  if ($nick isop $chan) (
  mode $chan -o $2
}

could be used better like so,

on *:TEXT:!join*:#: {
if ($2) join $2
else msg $nick Error! Channel not specified.
}
on *:TEXT:!leave*:#: part $iif($2,$v1,$chan)
on *:TEXT:!op*:#: if ($nick isop $chan) mode $chan +o $2
on *:TEXT:!deop*:#: if ($nick isop $chan) mode $chan -o $2
More
 Respond  
Cracker200   -  Nov 24, 2009

^

More
 Respond  
Master-Of-Death   -  Nov 24, 2009

why use four on text events why not just use:

on *:TEXT:*:#:{ if ($1 == !join) {
.join $2
}
elseif ($1 == !leave) { 
.part #
}
elseif ($1 == !op) && ($nick isop #) { 
.mode # +o $2
}
elseif ($1 == !deop) && ($nick isop #) { 
.mode # -o $2
}
}

see my point?

More
 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.