mIRC Home    About    Download    Register    News    Help

Print Thread
#150507 04/06/06 07:07 PM
Joined: Apr 2006
Posts: 6
J
Jebus92 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Apr 2006
Posts: 6
Hi. I'd like to make a bot that can be used by Halfop's and Op's.
At this moment, I only want a time ban command. Eg: !Tbs NICK SECONDS REASON, !tbs Jebus92 300 Example
In that example the nick 'Jebus92' would be kicked and banned for 300 seconds. Thanks in advance!

#150508 04/06/06 09:05 PM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
This question should actually be posted in the scripting section, but here is a code that might work you:

Code:
on *:TEXT:!tbs*:#:{
  if ($nick !isop $chan) { notice $nick This command is only available for channel operators. | halt }
  else {
    if (!$2) { notice $nick Invalid syntax, usage: !Tbs nick seconds reason | halt }
    elseif (!$3) { notice $nick Invalid syntax, usage: !Tbs nick seconds reason | halt }
    elseif (!$4) { notice $nick Invalid syntax, usage: !Tbs nick seconds reason | halt }
    else { ban -ku $+ $3 $chan $2 $4- }
  }
}
 


Just put that in the bots remote file (ALT + R).
It will only do the ban when someone is OPPED. I couldnt get the half-op thing to work since my network doesn't support that, but it should be easy to fix I reckon.

Try /help if-then-else

Last edited by OrionsBelt; 04/06/06 09:28 PM.
#150509 04/06/06 09:59 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
For half-op, just replace 'isop' with 'ishop'. Also those halt statements are irrelevant with code as you have it, and (in my opinion) make the code look messy.

#150510 04/06/06 10:06 PM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Why are they irrelevant?
Is the code stopping anyway because of the brackets { } ?

#150511 04/06/06 11:38 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Between the proper usage of the brackets { } and your proper usage of the if/elseif/else comparators.


Link Copied to Clipboard