mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2013
Posts: 11
B
BuxXray Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Nov 2013
Posts: 11
Hi,
I wanna know

" How To Add trigger than can be only used by ops "

cuz I wnna make !remove and !join <chan>

example :

<@Bux> !remove
<+bot> Remove by Bux, Invite me if you want me here
* bot [~bot@ident] has left #channel [Removed by Bux]

Example :

Chan 1 :
<@Bux> !join #channel2
<+bot> I`ve been joined #channel2

channel 2 :
* bot [~bot@ident] has joined #channel2
<+bot> I`ve been joined here by Bux, You can remove me by using !remove

Thx


Joined: Jan 2014
Posts: 55
J
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Place the following in remotes

This is untested but should work. You use !join channel and !remove channel

Please note: remember to place the # when typing the room name.

Code:
 

on *:TEXT:*:#: { 
  if ($strip($1) == !join) { 
    if ($2 == $null) { .notice $nick Command incomplete. Syntax: !join <#channel>.  | halt }
    if ($2 !== $null) {
      if ($nick !isop $chan) { .notice $nick You must be opped to use this command | halt }
      if ($me ison $2) { .notice $nick I'm already on that channel. | halt }
      if ($me !ison $2) { .join $2 | .notice $nick Joined channel $2 $+  | halt }
    }
  }

  if ($strip($1) == !remove) { 
    if ($2 == $null) { .notice $nick Command incomplete. Syntax: !remove <#channel>.  | halt }
    if ($2 !== $null) {
      if ($nick !isop $chan) { .notice $nick You must be opped to use this command | halt }
      if ($me !ison $2) { .notice $nick I'm not on that channel. | halt }
      if ($me ison $2) { .part $2 | .notice $nick Left channel $2 $+ . | halt }
      if ($nick !isop $chan) { .notice $nick You must be opped to use this command | halt }

    }
  }




If you do not want the whole script the part that makes it work for ops only is this:

Code:
if ($nick !isop $chan) { .notice $nick You must be opped to use this command | halt }

Last edited by jaystew; 20/04/14 10:23 AM. Reason: Added the !isop to the remove command as i forgot to add it.

Regards

JayStew
Joined: Nov 2013
Posts: 11
B
BuxXray Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Nov 2013
Posts: 11
does not works frown


Joined: Jan 2014
Posts: 55
J
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Just tested this with my bot and it works fine. Does it give any error messages?

Commands you should be using are room commands - !join #test or !remove #test

Are you placing it in a bots mIRC or your own mIRC?


Regards

JayStew
Joined: Jan 2014
Posts: 55
J
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Have you got it working?

Please re-copy the above code again as I forgot to make it so the !remove command would only work for ops. Now edited and updated.


Regards

JayStew
Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Sorry for correcting.
I see missing "}" at the end of code, also 3 times "$nick !isop $chan" checking. the last checking is unnecessary.

Joined: Jan 2014
Posts: 55
J
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Originally Posted By: blessing
Sorry for correcting.
I see missing "}" at the end of code, also 3 times "$nick !isop $chan" checking. the last checking is unnecessary.


No you are quite right to do so Blessing... Yep I forgot the end bracket, The etc !isop check was me reading it wrong earlier, for some reason I thought I didn't add it which I then edited and added it again wrongly.

Thanks for pointing it out. Updated below

Code:
on *:TEXT:*:#: { 
  if ($strip($1) == !join) { 
    if ($2 == $null) { .notice $nick Command incomplete. Syntax: !join <#channel>.  | halt }
    if ($2 !== $null) {
      if ($nick !isop $chan) { .notice $nick You must be opped to use this command | halt }
      if ($me ison $2) { .notice $nick I'm already on that channel. | halt }
      if ($me !ison $2) { .join $2 | .notice $nick Joined channel $2 $+  | halt }
    }
  }

  if ($strip($1) == !remove) { 
    if ($2 == $null) { .notice $nick Command incomplete. Syntax: !remove <#channel>.  | halt }
    if ($2 !== $null) {
      if ($nick !isop $chan) { .notice $nick You must be opped to use this command | halt }
      if ($me !ison $2) { .notice $nick I'm not on that channel. | halt }
      if ($me ison $2) { .part $2 | .notice $nick Left channel $2 $+ . | halt }
    

    }
  }
}


Regards

JayStew

Link Copied to Clipboard