Jump to content

Kicking script and parameters, how to do?


Convirion

Recommended Posts

hi, i get it a little those mirc scripts,

I wanted to make a script that you can kick yourself (for example: !kickme, and it will kick yourself)

I want it doing via the kick script and if im right that needs to work.

I have the follow script but I dont know its secured and save and I dont know which parameters I need to use, I have the followed:

Maybe you guys can explain what all those $1 - $2 means?

elseif($3 == !kickme){ 
mta.kick $2 %a
}

I think the %a is what you typed after !kick nickname, and the question is how to fix it so you kan only kick yourself no matter what you enter after the !kickme command.

Thanks to everone who wants to look at it

=)

Link to comment

on *:SIGNAL:mta.command:{
if ($3 == !kickme) {
mta.say $1 $mta.name($1,$2) wants to be kicked...
mta.kick $1 $2
      }
}

i just think of it this way:

$1 is server

$2 is the user typing the command

$3 is the command they type

$4 is the word after the command they type

etc :P

%a would be a var that you set to do something but it's not needed in your script.

(the above helps if you use mtama) :)

Link to comment

Yeah that's right,

on *:SIGNAL:mta.command:command

This event is triggerd when a player does a !-command.

Parameters: $1 = Server, $2 = PlayerID, $3 = Command, $4- = Parameters

and if you want to kick another you need to have this code:

alias mta.getnick {
 var %a = 0
 while (%a <= $mta.server($1).cmax) {
   if ($2 isin $mta.nick($1,%a)) !return %a
   !inc %a
 }
 !return -1
}
on *:SIGNAL:mta.command: {
 var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$mta.getnick($1,$4)),$2)
 if ($3 == !kickme) mta.kick $1 $2
 if ($3 == !kick) {
   if (%a == -1) mta.pm $1 $2 Error - Absent ID
   elseif (%a == $2) mta.pm $1 $2 Error - Can't $3 yourself
   else mta.kick %1 %a
 }
}

Link to comment
alias mta.getnick {
 var %a = 0
 while (%a <= $mta.server($1).cmax) {
   if ($2 isin $mta.nick($1,%a)) !return %a
   !inc %a
 }
 !return -1
}
on *:SIGNAL:mta.command: {
 var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$mta.getnick($1,$4)),$2)
 if ($3 == !kickme) mta.kick $1 $2
 if ($3 == !kick) {
   if (%a == -1) mta.pm $1 $2 Error - Absent ID
   elseif (%a == $2) mta.pm $1 $2 Error - Can't $3 yourself
   else mta.kick %1 %a
 }
}

There is an alias to get id in mtama already, you dont need to write one yourself ;)

on *:SIGNAL:mta.command: {
 var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$mta.getid($1,$4)),$2)
 if ($3 == !kickme) mta.kick $1 $2
 if ($3 == !kick) {
   if (%a == -1) mta.pm $1 $2 Error - Absent ID
   elseif (%a == $2) mta.pm $1 $2 Error - Can't kick yourself
   else mta.kick $1 %a
 }
}

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...