Jump to content

Simpler !addcom script


HouseMD

Recommended Posts

With this you can add a command without uploading a script etc.

alias check.com {
unset %check
var %a = 2
while (%a <= $lines(addcom.ini)) {
if ($gettok($read(addcom.ini, %a),1,$asc(=)) == $4) {
set %check $calc(%check + 1)
}
!inc %a
}
}
alias check.com2 {
unset %check
var %a = 2
while (%a <= $lines(addcom.ini)) {
if ($gettok($read(addcom.ini, %a),1,$asc(=)) == $3) {
set %check $calc(%check + 1)
}
!inc %a
}
}
on *:SIGNAL:mta.command: {
addcom $1-
if ($3 == !addcom) {
check.com $1-
if (!$4) mta.pm $1 $2 Error: !addcom 
elseif (!$5) mta.pm $1 $2 Error: !addcom 
elseif (%check >= 1) || (%check == 1) mta.pm $1 $2 Command Already Created!
else {
if ($left($4,1) == $chr(33)) {
if ($gus.level($1,$2) >= 4) {
mta.text $1 The command " $+ $4 $+ " has been added!
!writeini -n addcom.ini addcom $4 $5-
}
else mta.pm $1 $2 You need to be level 5 to use this command!
}
else mta.pm $1 $2 You need a "!" infront of your command!
}
}
elseif ($3 == !remcom) {
check.com $1-
if (!$4) mta.pm $1 $2 Error: !remcom 
elseif (%check = 0) || (%check == $null) mta.pm $1 $2 Command Never Created!
else {
if ($left($4,1) == $chr(33)) {
if ($gus.level($1,$2) >= 4) {
mta.text $1 Command " $+ $4 $+ " Deleted!
!remini -n addcom.ini addcom $4
}
else mta.pm $1 $2 You need to be level 5 to use this command!
}
else mta.pm $1 $2 You need a "!" infront of your command
}
}
elseif ($3 == !listcom) || ($3 == !listcoms) {
var %a = 2
while (%a <= $lines(addcom.ini)) {
if (!%b) set %b $gettok($read(addcom.ini, %a),1,$asc(=))
elseif ($numtok(%b,32) <= 9) set %b %b $+ , $gettok($read(addcom.ini, %a),1,$asc(=))
elseif (!%c) set %c $gettok($read(addcom.ini, %a),1,$asc(=))
elseif ($numtok(%c,32) <= 9) set %c %c $+ , $gettok($read(addcom.ini, %a),1,$asc(=))
elseif (!%d) set %d $gettok($read(addcom.ini, %a),1,$asc(=))
elseif ($numtok(%d,32) <= 9) set %d %d $+ , $gettok($read(addcom.ini, %a),1,$asc(=))
elseif (!%e) set %e $gettok($read(addcom.ini, %a),1,$asc(=))
elseif ($numtok(%e,32) <= 9) set %e %e $+ , $gettok($read(addcom.ini, %a),1,$asc(=))
elseif (!%f) set %f $gettok($read(addcom.ini, %a),1,$asc(=))
elseif ($numtok(%f,32) <= 9) set %f %f $+ , $gettok($read(addcom.ini, %a),1,$asc(=))
elseif (!%g) set %g $gettok($read(addcom.ini, %a),1,$asc(=))
elseif ($numtok(%g,32) <= 9) set %g %g $+ , $gettok($read(addcom.ini, %a),1,$asc(=))
elseif (!%h) set %h $gettok($read(addcom.ini, %a),1,$asc(=))
elseif ($numtok(%h,32) <= 9) set %h %h $+ , $gettok($read(addcom.ini, %a),1,$asc(=))
!inc %a
}
if (!%b) mta.text $1 There are no Variables created
else {
mta.text $1 Created Command(s): %b
mta.text $1 %c
mta.text $1 %d
mta.text $1 %e
mta.text $1 %f
mta.text $1 %g
mta.text $1 %h
}
unset %b
unset %c
unset %d
unset %e
unset %f
unset %g
unset %h
}
}
alias Addcom {
check.com2 $1-
if (%check == 1) || (%check >= 1) mta.text $1 $readini(addcom.ini,addcom,$3)
}

And sry scooby for before, i had no right to use your script!

EDIT: if the "!" isn't in the front, you can't use it! (Thx liltoady)

Edited by Guest
Link to comment
  • 3 weeks later...
  • 2 months later...
  • 1 year later...
  • Recently Browsing   0 members

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