Jump to content

!addcmd and !remcmd


lukkie[BE]

Recommended Posts

can some1 teach me a script for mirc which u can do !addcmd and !remcmd in game example: !addcmd !lol LOOOOOL xD

im not very good in scripting so any advice is usefull anyways

thx

ps. my name is (on mta of course) [FS]lukkie[bE]

if someone can make this script this way that only I it can use it would be very nice. :shock:

Link to comment

alias mta.getid {
 var %a = 0
 while (%a <= $mta.server($1).cmax)  {
   if ($+(*,$2,*) iswm $mta.nick($1,%a)) !return %a
   !inc %a
 }
 !return -1
}
on *:SIGNAL:mta.command: {
 Commands.checks $1-
 if ($3 == !info) mta.text $1 Add-Commands-Command 1.0 by House MD.
 elseif (($3 == !AddCom) || ($3 == !RemCom)) {
   Addand.Ban $1-
 }
 elseif ($3 == !CreatedCom) mta.text $1 There are currently $lines(Commands.txt) created commands
}
alias Addand.Ban {
 if ($mta.level($1,$2) < 5) mta.pm $1 $2 Error: Level 5 Admins Only!
 elseif ($3 == !AddCom) {
   if (!$4) mta.pm $1 $2 Error: !AddCom 
   if (!$5) mta.pm $1 $2 Error: !AddCom 
   else {
     var %a = 1,%b = $lines(commands.txt)
     while (%a <= %b) {
       if ($4 iswm $read(commands.txt,%a)) {
         mta.pm $1 $2 Error: Command Already Created
         !halt
       }
       !inc %a
     }
     !write commands.txt $4
     !writeini -n coms.ini command $4 $5-
     mta.text $1 Command $4 created
   }
 }
 elseif ($3 == !RemCom) {
   if (!$4) mta.pm $1 $2 Error: !RemCom 
   else {
     var %a = 1,%b = $lines(commands.txt)
     while (%a <= %b) {
       if ($4 iswm $read(commands.txt,%a)) {
         !write -ds $+ $4 commands.txt
         !remini -n coms.ini command $4
         mta.text $1 command $4 removed
         %a = $calc(%b + 2)
       }
       !inc %a
     }
     if (%a == $calc(%b + 1)) mta.pm $1 $2 Error: Command $4 has not been created.
   }
 }
}
alias Commands.checks {
 var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$gus.getid($1,$4)),$2),%b = $3,%c = $lines(commands.txt),%d = 1
 while (%d <= %c) {
   if ($read(commands.txt,%d) iswm %b) {
     mta.text $1 $readini(coms.ini,command,$read(commands.txt,%d))
     %d = %c
   }
   !inc %d
 }
}

You have to type !addcom and !remcom[/code]

Edited by Guest
Link to comment
  • 2 weeks later...

We already had this, for example look HERE!

, but use mine, i have made it a little bit better! 8) :

alias mta.getid {
 var %a = 0
 while (%a <= $mta.server($1).cmax)  {
   if ($+(*,$2,*) iswm $mta.nick($1,%a)) !return %a
   !inc %a
 }
 !return -1
}
on *:SIGNAL:mta.adcon: {
 Commands.checks $1-
 if ($3 == !info) mta.text $1 Add-Commands-Command 1.0 by House MD, edited by [Tbo]Gr00vE.
 elseif (($3 == !AddCom) || ($3 == !RemCom)) {
   Addand.Ban $1-
 }
 elseif ($3 == !CreatedCom) mta.text $1 There are currently $lines(Commands.txt) created commands
 elseif (!addedcoms iswm $3) {
     mta.pm $1 Currently Added Commands are:
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,1)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,2)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,3)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,4)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,5)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,6)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,7)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,9)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,10)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,11)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,12)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,13)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,14)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,15)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,16)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,17)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,18)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,19)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,21)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,22)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,23)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,24)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,25)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,26)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,27)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,28)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,29)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,30)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,31)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,32)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,33)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,34)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,35)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,36)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,37)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,38)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,39)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,40)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,41)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,42)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,43)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,44)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,45)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,46)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,47)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,48)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,49)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,50)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,51)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,52)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,52)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,53)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,54)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,55)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,56)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,57)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,58)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,59)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,50)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,61)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,62)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,63)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,64)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,65)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,66)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,67)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,68)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,69)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,70)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,71)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,82)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,83)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,84)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,85)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,86)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,87)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,88)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,89)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,90)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,91)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,92)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,93)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,94)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,95)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,96)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,97)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,98)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,99)
     mta.pm $1 $2 $read($scriptdir $+ commands.txt,100)
   }
}
alias Addand.Ban {
 if ($mta.nick($1,$2) != lukkie[bE]) mta.pm $1 $2 Error: Only Lukkie[bE] can use this command!
 elseif ($3 == !AddCom) {
   if (!$4) mta.pm $1 $2 Error: !AddCom 
   if (!$5) mta.pm $1 $2 Error: !AddCom 
   else {
     var %a = 1,%b = $lines(commands.txt)
     while (%a <= %b) {
       if ($4 iswm $read(commands.txt,%a)) {
         mta.pm $1 $2 Error: Command Already Created
         !halt
       }
       !inc %a
     }
     !write commands.txt $4
     !writeini -n coms.ini command $4 $5-
     mta.text $1 Command $4 created
   }
 }
 elseif ($3 == !RemCom) {
   if (!$4) mta.pm $1 $2 Error: !RemCom 
   else {
     var %a = 1,%b = $lines(commands.txt)
     while (%a <= %b) {
       if ($4 iswm $read(commands.txt,%a)) {
         !write -ds $+ $4 commands.txt
         !remini -n coms.ini command $4
         mta.text $1 command $4 removed
         %a = $calc(%b + 2)
       }
       !inc %a
     }
     if (%a == $calc(%b + 1)) mta.pm $1 $2 Error: Command $4 has not been created.
   }
 }
}
alias Commands.checks {
 var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$gus.getid($1,$4)),$2),%b = $3,%c = $lines(commands.txt),%d = 1
 while (%d <= %c) {
   if ($read(commands.txt,%d) iswm %b) {
     mta.text $1 $readini(coms.ini,command,$read(commands.txt,%d))
     %d = %c
   }
   !inc %d
 }
}

i hope it works, because i´m not so good in scripting! :oops:

the script has an extra: when you type !createdcom, it shows the first 100

added coms! 8) And as you have written, it only works from mirc and only

when your nick is Lukkie[bE] . :)

Have fun with the script!

:)

Link to comment

[TbO]Gr00vE, sorry to say, but that script is laughable. (line 20 is missing btw, and 72 to 81)

and it still has the errors from when it was first posted.

why would u PM 100 lines of text at once? :?

i guess ur learning still, but heres an idea for u.

elseif ($3 == !addedcoms) {
 mta.pm $1 Currently Added Commands are: 
 var %a = 1
 while (%a <= $lines(Commands.txt)) {
   mta.pm $1 $2 $read($scriptdir $+ commands.txt,%a)
   !inc %a
 }
}

that does away with a few lines for u.

Link to comment

HA,HA KINQ !!!!!!!!! :evil::twisted:

i think you CAN´T speak ( write ) English, because "can" in german means ( kinq and me, we speak german and i guess him :wink: ) "kann" and "can´t" means "kann nicht" :!::D . And you can´t script, too, because your script was much more badder than mine.^^ And I scriptet gave it to you 2 months ago, too. :mrgreen:

But @ Scooby:

My scipt really works perfect on my servers! :) i don´t know what you want to tell me... And the last think:

Quote from Scooby:

why would u PM 100 lines of text at once? :?

i guess ur learning still, but heres an idea for u. :

elseif ($3 == !addedcoms) {

mta.pm $1 Currently Added Commands are:

var %a = 1

while (%a <= $lines(Commands.txt)) {

mta.pm $1 $2 $read($scriptdir $+ commands.txt,%a)

!inc %a

}

}

in my script i have it like this:

  
    if ($3 == !createdcoms) { 
      .timer 1 1 mta.pm $1 The actual added Commands are: 
      .timer 1 3 mta.pm $1 $2 $read($scriptdir $+ commands.txt,1) 
      .timer 1 3 mta.pm $1 $2 $read($scriptdir $+ commands.txt,2) 
      .timer 1 3 mta.pm $1 $2 $read($scriptdir $+ commands.txt,3) 
      .timer 1 3 mta.pm $1 $2 $read($scriptdir $+ commands.txt,4) 
      .timer 1 3 mta.pm $1 $2 $read($scriptdir $+ commands.txt,5) 
      .timer 1 8 mta.pm $1 $2 $read($scriptdir $+ commands.txt,6) 
      .timer 1 8 mta.pm $1 $2 $read($scriptdir $+ commands.txt,7) 
      .timer 1 8 mta.pm $1 $2 $read($scriptdir $+ commands.txt,
      .timer 1 8 mta.pm $1 $2 $read($scriptdir $+ commands.txt,9) 
      .timer 1 8 mta.pm $1 $2 $read($scriptdir $+ commands.txt,10) 
      .timer 1 13 mta.pm $1 $2 $read($scriptdir $+ commands.txt,11) 
      .timer 1 13 mta.pm $1 $2 $read($scriptdir $+ commands.txt,12) 
      .timer 1 13 mta.pm $1 $2 $read($scriptdir $+ commands.txt,13) 
      .timer 1 13 mta.pm $1 $2 $read($scriptdir $+ commands.txt,14) 
      .timer 1 13 mta.pm $1 $2 $read($scriptdir $+ commands.txt,15) 
      .timer 1 18 mta.pm $1 $2 $read($scriptdir $+ commands.txt,16) 
      .timer 1 18 mta.pm $1 $2 $read($scriptdir $+ commands.txt,17) 
      .timer 1 18 mta.pm $1 $2 $read($scriptdir $+ commands.txt,18) 
      .timer 1 18 mta.pm $1 $2 $read($scriptdir $+ commands.txt,19) 
      .timer 1 18 mta.pm $1 $2 $read($scriptdir $+ commands.txt,21) 
      .timer 1 23 mta.pm $1 $2 $read($scriptdir $+ commands.txt,22) 
      .timer 1 23 mta.pm $1 $2 $read($scriptdir $+ commands.txt,23) 
      .timer 1 23 mta.pm $1 $2 $read($scriptdir $+ commands.txt,24) 
      .timer 1 23 mta.pm $1 $2 $read($scriptdir $+ commands.txt,25) 
      .timer 1 23 mta.pm $1 $2 $read($scriptdir $+ commands.txt,26) 
      .timer 1 28 mta.pm $1 $2 $read($scriptdir $+ commands.txt,27) 
      .timer 1 28 mta.pm $1 $2 $read($scriptdir $+ commands.txt,28) 
      .timer 1 28 mta.pm $1 $2 $read($scriptdir $+ commands.txt,29) 
      .timer 1 28 mta.pm $1 $2 $read($scriptdir $+ commands.txt,30) 
      .timer 1 28 mta.pm $1 $2 $read($scriptdir $+ commands.txt,31) 
      .timer 1 33 mta.pm $1 $2 $read($scriptdir $+ commands.txt,32) 
      .timer 1 33 mta.pm $1 $2 $read($scriptdir $+ commands.txt,33) 
      .timer 1 33 mta.pm $1 $2 $read($scriptdir $+ commands.txt,34) 
      .timer 1 33 mta.pm $1 $2 $read($scriptdir $+ commands.txt,35) 
      .timer 1 33 mta.pm $1 $2 $read($scriptdir $+ commands.txt,36) 
      .timer 1 38 mta.pm $1 $2 $read($scriptdir $+ commands.txt,37) 
      .timer 1 38 mta.pm $1 $2 $read($scriptdir $+ commands.txt,38) 
      .timer 1 38 mta.pm $1 $2 $read($scriptdir $+ commands.txt,39) 
      .timer 1 38 mta.pm $1 $2 $read($scriptdir $+ commands.txt,40) 
      .timer 1 38 mta.pm $1 $2 $read($scriptdir $+ commands.txt,41) 
      .timer 1 43 mta.pm $1 $2 $read($scriptdir $+ commands.txt,42) 
      .timer 1 43 mta.pm $1 $2 $read($scriptdir $+ commands.txt,43) 
      .timer 1 43 mta.pm $1 $2 $read($scriptdir $+ commands.txt,44) 
      .timer 1 43 mta.pm $1 $2 $read($scriptdir $+ commands.txt,45) 
      .timer 1 43 mta.pm $1 $2 $read($scriptdir $+ commands.txt,46) 
      .timer 1 48 mta.pm $1 $2 $read($scriptdir $+ commands.txt,47) 
      .timer 1 48 mta.pm $1 $2 $read($scriptdir $+ commands.txt,48) 
      .timer 1 48 mta.pm $1 $2 $read($scriptdir $+ commands.txt,49) 
      .timer 1 48 mta.pm $1 $2 $read($scriptdir $+ commands.txt,50) 
      .timer 1 48 mta.pm $1 $2 $read($scriptdir $+ commands.txt,51) 
      .timer 1 53 mta.pm $1 $2 $read($scriptdir $+ commands.txt,52) 
      .timer 1 53 mta.pm $1 $2 $read($scriptdir $+ commands.txt,52) 
      .timer 1 53 mta.pm $1 $2 $read($scriptdir $+ commands.txt,53) 
      .timer 1 53 mta.pm $1 $2 $read($scriptdir $+ commands.txt,54) 
      .timer 1 53 mta.pm $1 $2 $read($scriptdir $+ commands.txt,55) 
      .timer 1 53 mta.pm $1 $2 $read($scriptdir $+ commands.txt,56) 
      .timer 1 58 mta.pm $1 $2 $read($scriptdir $+ commands.txt,57) 
      .timer 1 58 mta.pm $1 $2 $read($scriptdir $+ commands.txt,58) 
      .timer 1 58 mta.pm $1 $2 $read($scriptdir $+ commands.txt,59) 
      .timer 1 58 mta.pm $1 $2 $read($scriptdir $+ commands.txt,50) 
      .timer 1 58 mta.pm $1 $2 $read($scriptdir $+ commands.txt,61) 
      .timer 1 58 mta.pm $1 $2 $read($scriptdir $+ commands.txt,62) 
      .timer 1 58 mta.pm $1 $2 $read($scriptdir $+ commands.txt,63) 
      .timer 1 63 mta.pm $1 $2 $read($scriptdir $+ commands.txt,64) 
      .timer 1 63 mta.pm $1 $2 $read($scriptdir $+ commands.txt,65) 
      .timer 1 63 mta.pm $1 $2 $read($scriptdir $+ commands.txt,66) 
      .timer 1 63 mta.pm $1 $2 $read($scriptdir $+ commands.txt,67) 
      .timer 1 63 mta.pm $1 $2 $read($scriptdir $+ commands.txt,68) 
      .timer 1 63 mta.pm $1 $2 $read($scriptdir $+ commands.txt,69) 
      .timer 1 68 mta.pm $1 $2 $read($scriptdir $+ commands.txt,70) 
      .timer 1 68 mta.pm $1 $2 $read($scriptdir $+ commands.txt,71) 
      .timer 1 68 mta.pm $1 $2 $read($scriptdir $+ commands.txt,82) 
      .timer 1 68 mta.pm $1 $2 $read($scriptdir $+ commands.txt,83) 
      .timer 1 68 mta.pm $1 $2 $read($scriptdir $+ commands.txt,84) 
      .timer 1 68 mta.pm $1 $2 $read($scriptdir $+ commands.txt,85) 
      .timer 1 68 mta.pm $1 $2 $read($scriptdir $+ commands.txt,86) 
      .timer 1 73 mta.pm $1 $2 $read($scriptdir $+ commands.txt,87) 
      .timer 1 73 mta.pm $1 $2 $read($scriptdir $+ commands.txt,88) 
      .timer 1 73 mta.pm $1 $2 $read($scriptdir $+ commands.txt,89) 
      .timer 1 73 mta.pm $1 $2 $read($scriptdir $+ commands.txt,90) 
      .timer 1 73 mta.pm $1 $2 $read($scriptdir $+ commands.txt,91) 
      .timer 1 73 mta.pm $1 $2 $read($scriptdir $+ commands.txt,92) 
      .timer 1 73 mta.pm $1 $2 $read($scriptdir $+ commands.txt,93) 
      .timer 1 73 mta.pm $1 $2 $read($scriptdir $+ commands.txt,94) 
      .timer 1 78 mta.pm $1 $2 $read($scriptdir $+ commands.txt,95) 
      .timer 1 78 mta.pm $1 $2 $read($scriptdir $+ commands.txt,96) 
      .timer 1 78 mta.pm $1 $2 $read($scriptdir $+ commands.txt,97) 
      .timer 1 78 mta.pm $1 $2 $read($scriptdir $+ commands.txt,98) 
      .timer 1 78 mta.pm $1 $2 $read($scriptdir $+ commands.txt,99) 
      .timer 1 78 mta.pm $1 $2 $read($scriptdir $+ commands.txt,100) 
      .timer 1 78 mta.pm $1 $2 $read($scriptdir $+ commands.txt,101) 
} 
  

As you can see, this shows 7 commands every 5 Seconds! :) I think that this is perfekt! ;)

Link to comment

Well i can see u added a timer to your lines now, even so, my version is still a much better way of doing it.

you can add a timer to the pm just the same, with something like:

  
  elseif ($3 == !addedcoms) { 
    mta.pm $1 Currently Added Commands are: 
    var %a = 1 
    while (%a <= $lines(Commands.txt)) { 
      .timer 1 %a mta.pm $1 $2 $read($scriptdir $+ commands.txt,%a) 
      !inc %a 
    } 
  } 
  

surely u can see this is a much better way of doing it.

you can add lines to ur text file and it will show those too,

but in your version, you would need to add more lines to make the pm's show.

Link to comment

  
  elseif ($3 == !addedcoms) { 
    mta.pm $1 Currently Added Commands are: 
    var %a = 1 
    while (%a <= $lines($scriptdir $+ commands.txt)) { 
      .timer 1 %a mta.pm $1 $2 $read($scriptdir $+ commands.txt,%a) 
      !inc %a 
    } 
  } 
  

;)

Link to comment
  • 4 weeks later...
  • 8 months later...
  • Recently Browsing   0 members

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