mIRC Home    About    Download    Register    News    Help

Print Thread
#201506 29/06/08 06:32 PM
Joined: Jun 2008
Posts: 9
J
Jamezzz Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Jun 2008
Posts: 9
Code:
on *:TEXT:!tb *:#: { if ($2 !ison $chan) && ($nick isop $chan) && ($3 isnum) && ($2 != $me) { 
  }
  elseif ($nick isop $chan) && ($3 isnum || $2 != $me) {
    timer 1 0 ban -ku $+ $calc($3 * 1) $chan $2 $4-
    timer 1 1 msg $chan 5(o_O)7 $2 05has been temporarily banned from07 $chan 05for07 $3 05seconds (Reason:07 $4- $+ 5).
    timer 1 1 notice $2 You've been temporarily banned from7 $chan 5for7 $3 5seconds (7Reason5:7 $4- $+ 5) 7(>_<)5.
    timer 1 $3 notice $2 You've been unbanned from7 $chan 5(^_^)7.
  }
}


Hey i got this script from a friend, how would i edit this script so that only i can use it, at the moment it only works for other ops in the same channel as me, which is more like a bot, but i'd like the script to work only for me. I'm not good at scipting at all but i know it's meant to be an input script? But not sure how to go about it :$.

Thanks in advance.

Jamezzz #201530 30/06/08 06:13 AM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Code:
on *:TEXT:!tb*:#: { if ($2 !ison $chan) && ($nick isop $chan) && ($3 isnum) && ($2 != $me) || ($nick == Jamezzz) {
  }
  elseif ($nick isop $chan) && ($3 isnum || $2 != $me) { 
    .timer 1 0 ban -ku $+ $calc($3 * 1) $chan $2 $4-
    .timer 1 1 msg $chan 5(o_O)7 $2 05has been temporarily banned from07 $chan 05for07 $3 05seconds (Reason:07 $4- $+ 5).
    .timer 1 1 notice $2 You've been temporarily banned from7 $chan 5for7 $3 5seconds (7Reason5:7 $4- $+ 5) 7(>_<)5.
    .timer 1 $3 notice $2 You've been unbanned from7 $chan 5(^_^)7.
  }
}


Change
Code:
($nick == Jamezzz)
to the nickname of your own used in chat.

Tomao #201533 30/06/08 07:46 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Don't quote me but I believed the OP asked how he can use this on his own, being an INPUT script.

edited code.

Code:
on *:INPUT:!tb*:#: { if ($2 !ison $chan) && ($me isop #) && ($3 isnum) && ($2 != $me) {
  }
  elseif ($me isop $chan) && ($3 isnum || $2 != $me) { 
    .timer 1 0 ban -ku $+ $calc($3 * 1) $chan $2 $4-
    .timer 1 1 msg $chan 5(o_O)7 $2 05has been temporarily banned from07 $chan 05for07 $3 05seconds (Reason:07 $4- $+ 5).
    .timer 1 1 notice $2 You've been temporarily banned from7 $chan 5for7 $3 5seconds (7Reason5:7 $4- $+ 5) 7(>_<)5.
    .timer 1 $3 notice $2 You've been unbanned from7 $chan 5(^_^)7.
  }
halt
}


either way if the OP was just asking for it to be a bot script so that he can only access it rather then him having it as is own script he should of been told to use ($nick == $me) while that if the OP changed nicks from example Jamezzz to JamesApple then his script would work.



Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Lpfix5 #201549 30/06/08 04:21 PM
Joined: Jun 2008
Posts: 9
J
Jamezzz Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Jun 2008
Posts: 9
Originally Posted By: Lpfix5
Don't quote me but I believed the OP asked how he can use this on his own, being an INPUT script.

edited code.

Code:
on *:INPUT:!tb*:#: { if ($2 !ison $chan) && ($me isop #) && ($3 isnum) && ($2 != $me) {
  }
  elseif ($me isop $chan) && ($3 isnum || $2 != $me) { 
    .timer 1 0 ban -ku $+ $calc($3 * 1) $chan $2 $4-
    .timer 1 1 msg $chan 5(o_O)7 $2 05has been temporarily banned from07 $chan 05for07 $3 05seconds (Reason:07 $4- $+ 5).
    .timer 1 1 notice $2 You've been temporarily banned from7 $chan 5for7 $3 5seconds (7Reason5:7 $4- $+ 5) 7(>_<)5.
    .timer 1 $3 notice $2 You've been unbanned from7 $chan 5(^_^)7.
  }
halt
}


either way if the OP was just asking for it to be a bot script so that he can only access it rather then him having it as is own script he should of been told to use ($nick == $me) while that if the OP changed nicks from example Jamezzz to JamesApple then his script would work.



hmm i tried your edited version and it still doesn't work. Basically, i want to load the script, and be able to use the !tb command, just me and not other OPS/HOPS in the channel. Is it possible :$?

Thanks in advance

Jamezzz #201551 30/06/08 04:30 PM
Joined: Aug 2003
Posts: 144
M
Vogon poet
Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
Hi

The on input even´t it´s rong.

/help on input
Format: on <level>:INPUT:<*#?=!@>:<commands>
example:. on *:input:#: {

Code:
on *:input:#: {
if ( $1 == !tb ) {
echo -s correct
}
}


good luck

Jamezzz #201563 30/06/08 06:18 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Based on Miguel's say, your code should work this way:

Code:
on *:INPUT:#: {
    if (!tb == $1) && ($2 !ison $chan) && ($3 isnum) && ($2 != $me) {
  }
  elseif ($me isop $chan) && ($3 isnum || $2 != $me) { 
    .timer 1 0 ban -ku $+ $calc($3 * 1) $chan $2 $4-
    .timer 1 1 msg $chan 5(o_O)7 $2 05has been temporarily banned from07 $chan 05for07 $3 05seconds (Reason:07 $4- $+ 5).
    .timer 1 1 notice $2 You've been temporarily banned from7 $chan 5for7 $3 5seconds (7Reason5:7 $4- $+ 5) 7(>_<)5.
    .timer 1 1 $3 notice $2 You've been unbanned from7 $chan 5(^_^)7.
  }
halt
}

Last edited by Tomao; 30/06/08 06:18 PM.
Tomao #201604 01/07/08 05:47 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
LoL my bad, i wasnt thinking of edited the code in after the : honest mistake.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Tomao #201617 01/07/08 11:55 AM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
...but you corrected neither the weird if-elseif, nor the third timer... frown
This should do it, I also added some quick echo feedback.

Code:
on &*:INPUT:#: {
  if ($1 == !tb) {
    if ($me isop $chan) {
      if ($2) {
        if (($v1 ison $chan) && ($v1 != $me)) {
          if ($3 isnum 1-) {
            ban -ku $+ $int($3) $chan $2 $4-
            .timer 1 1 msg $chan 5(o_O)7 $2 05has been temporarily 7banned 5from07 $chan 05for07 $duration($3) $iif(($4),05(Reason:07 $4- $+ 5)) $+ 5.
            .timer 1 2 notice $2 5You've been temporarily 7banned 5from7 $chan 5for7 $duration($3) $iif(($4),05(Reason:07 $4- $+ 5)) 7(>_<)5.
            .timer 1 $3 notice $2 5You've been 7unbanned 5from7 $chan (^_^)5.
          }
          else { echo -ac info TempBan: No/Invalid duration given. Syntax: !tb <nick> <duration in s> [reason] }
        }
        else { echo -ac info TempBan: No such user $qt($2) on chan $chan $+ . Syntax: !tb <nick> <duration in s> [reason]  }
      }
      else { echo -ac info TempBan: No parameters given. Syntax: !tb <nick> <duration ins s> [reason] }
    }
    else { echo -ac info TempBan: You're not opped in $chan $+ . }
    halt
  }
}

Horstl #201647 01/07/08 07:52 PM
Joined: Jun 2008
Posts: 9
J
Jamezzz Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Jun 2008
Posts: 9
Originally Posted By: Horstl
...but you corrected neither the weird if-elseif, nor the third timer... frown
This should do it, I also added some quick echo feedback.

Code:
on &*:INPUT:#: {
  if ($1 == !tb) {
    if ($me isop $chan) {
      if ($2) {
        if (($v1 ison $chan) && ($v1 != $me)) {
          if ($3 isnum 1-) {
            ban -ku $+ $int($3) $chan $2 $4-
            .timer 1 1 msg $chan 5(o_O)7 $2 05has been temporarily 7banned 5from07 $chan 05for07 $duration($3) $iif(($4),05(Reason:07 $4- $+ 5)) $+ 5.
            .timer 1 2 notice $2 5You've been temporarily 7banned 5from7 $chan 5for7 $duration($3) $iif(($4),05(Reason:07 $4- $+ 5)) 7(>_<)5.
            .timer 1 $3 notice $2 5You've been 7unbanned 5from7 $chan (^_^)5.
          }
          else { echo -ac info TempBan: No/Invalid duration given. Syntax: !tb <nick> <duration in s> [reason] }
        }
        else { echo -ac info TempBan: No such user $qt($2) on chan $chan $+ . Syntax: !tb <nick> <duration in s> [reason]  }
      }
      else { echo -ac info TempBan: No parameters given. Syntax: !tb <nick> <duration ins s> [reason] }
    }
    else { echo -ac info TempBan: You're not opped in $chan $+ . }
    halt
  }
}


yeeh, this works great but is there a way to edit the script so that people in the channel would see me type "!tb <nick> <duration in s> [reason]", instead of temp banning them as soon as i enter the command.

would this be on text, rather than on input script? sorry for all the hassle lol

Jamezzz #201650 01/07/08 08:49 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
I don't think you can use an on text event to trigger your own command. As to your inquiry about showing people whom you ban, it is easy, just add /msg command behind the ban as such:

Code:
ban -ku $+ $int($3) $chan $2 $4- | msg $chan $me adds !tb $2 $3 $4 to the ban list.


Code:
on &*:INPUT:#: {
  if ($1 == !tb) {
    if ($me isop $chan) {
      if ($2) {
        if (($v1 ison $chan) && ($v1 != $me)) {
          if ($3 isnum 1-) {
            ban -ku $+ $int($3) $chan $2 $4- | msg $chan $me adds !tb $2 $3 $4 to the ban list.
            .timer 1 1 msg $chan 5(o_O)7 $2 05has been temporarily 7banned 5from07 $chan 05for07 $duration($3) $iif(($4),05(Reason:07 $4- $+ 5)) $+ 5.
            .timer 1 2 notice $2 5You've been temporarily 7banned 5from7 $chan 5for7 $duration($3) $iif(($4),05(Reason:07 $4- $+ 5)) 7(>_<)5.
            .timer 1 $3 notice $2 5You've been 7unbanned 5from7 $chan (^_^)5.
          }
          else { echo -ac info * TempBan: No/Invalid duration given. Syntax: !tb <nick> <duration in s> [reason] }
        }
        else { echo -ac info * TempBan: No such user $qt($2) on chan $chan $+ . Syntax: !tb <nick> <duration in s> [reason]  }
      }
      else { echo -ac info * TempBan: No parameters given. Syntax: !tb <nick> <duration ins s> [reason] }
    }
    else { echo -ac info * TempBan: You're not opped in $chan $+ . }
    halt
  }
}

Last edited by Tomao; 01/07/08 08:52 PM.
Tomao #201654 01/07/08 09:31 PM
Joined: Jun 2008
Posts: 9
J
Jamezzz Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Jun 2008
Posts: 9
Originally Posted By: Tomao
I don't think you can use an on text event to trigger your own command. As to your inquiry about showing people whom you ban, it is easy, just add /msg command behind the ban as such:

Code:
ban -ku $+ $int($3) $chan $2 $4- | msg $chan $me adds !tb $2 $3 $4 to the ban list.


Code:
on &*:INPUT:#: {
  if ($1 == !tb) {
    if ($me isop $chan) {
      if ($2) {
        if (($v1 ison $chan) && ($v1 != $me)) {
          if ($3 isnum 1-) {
            ban -ku $+ $int($3) $chan $2 $4- | msg $chan $me adds !tb $2 $3 $4 to the ban list.
            .timer 1 1 msg $chan 5(o_O)7 $2 05has been temporarily 7banned 5from07 $chan 05for07 $duration($3) $iif(($4),05(Reason:07 $4- $+ 5)) $+ 5.
            .timer 1 2 notice $2 5You've been temporarily 7banned 5from7 $chan 5for7 $duration($3) $iif(($4),05(Reason:07 $4- $+ 5)) 7(>_<)5.
            .timer 1 $3 notice $2 5You've been 7unbanned 5from7 $chan (^_^)5.
          }
          else { echo -ac info * TempBan: No/Invalid duration given. Syntax: !tb <nick> <duration in s> [reason] }
        }
        else { echo -ac info * TempBan: No such user $qt($2) on chan $chan $+ . Syntax: !tb <nick> <duration in s> [reason]  }
      }
      else { echo -ac info * TempBan: No parameters given. Syntax: !tb <nick> <duration ins s> [reason] }
    }
    else { echo -ac info * TempBan: You're not opped in $chan $+ . }
    halt
  }
}


Thanks to all that helped, all working now smile.

Jamezzz #201668 02/07/08 04:17 AM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Originally Posted By: Jamezzz
yeeh, this works great but is there a way to edit the script so that people in the channel would see me type "!tb <nick> <duration in s> [reason]", instead of temp banning them as soon as i enter the command.

...or you simply remove the line that runs: "halt" in my original post. This /halt command well.. halts processing of the input text (that is, in this case: halt sending the "message" to the server).
smile


Link Copied to Clipboard