Jump to content

MTAMA Scripting


Si|ent

Recommended Posts

  • Replies 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

If i load this:

alias mta.text {
 if (!stat == $3) { 
     mta.say $1 Name: $mta.name($1,$2) - ID: $2 - Ping: $mta.ping($1,$2) - Kills: $mta.kills($1,$2) - Deaths: $mta.deaths($1,$2) - Online: $duration($mta.online($1,$2)) - Status: $iif($mta.game($1,$2) == 1,Out Game,In Game) 
   }
 }

alias mta.text { 
 if ($3 == !countdown) { 
mta.say $1 Count down! 
.timer 1 1 mta.say $1 5 
.timer 1 2 mta.say $1 4 
.timer 1 3 mta.say $1 3 
.timer 1 4 mta.say $1 2 
.timer 1 5 mta.say $1 1 
.timer 1 6 mta.say $1 GO! Go! Go! Go! 
 }
}

to my mtama only the stat worx. why?

thnx

Link to comment
If i load this:
alias mta.text {
 if (!stat == $3) { 
     mta.say $1 Name: $mta.name($1,$2) - ID: $2 - Ping: $mta.ping($1,$2) - Kills: $mta.kills($1,$2) - Deaths: $mta.deaths($1,$2) - Online: $duration($mta.online($1,$2)) - Status: $iif($mta.game($1,$2) == 1,Out Game,In Game) 
   }
 }

alias mta.text { 
 if ($3 == !countdown) { 
mta.say $1 Count down! 
.timer 1 1 mta.say $1 5 
.timer 1 2 mta.say $1 4 
.timer 1 3 mta.say $1 3 
.timer 1 4 mta.say $1 2 
.timer 1 5 mta.say $1 1 
.timer 1 6 mta.say $1 GO! Go! Go! Go! 
 }
}

to my mtama only the stat worx. why?

thnx

You can haven only 1 (ONE!) instance of every alias. This means only one mta.text

Combine them together to

alias mta.text {
 if (!stat == $3) { 
     mta.say $1 Name: $mta.name($1,$2) - ID: $2 - Ping: $mta.ping($1,$2) - Kills: $mta.kills($1,$2) - Deaths: $mta.deaths($1,$2) - Online: $duration($mta.online($1,$2)) - Status: $iif($mta.game($1,$2) == 1,Out Game,In Game) 
   }
 }
 elseif ($3 == !countdown) { 
   mta.say $1 Count down! 
   .timer 1 1 mta.say $1 5 
   .timer 1 2 mta.say $1 4 
   .timer 1 3 mta.say $1 3 
   .timer 1 4 mta.say $1 2 
   .timer 1 5 mta.say $1 1 
   .timer 1 6 mta.say $1 GO! Go! Go! Go! 
 }
}

Scorpion, please use the search on this topic. I could post it for the 100,000st time., but the topic is long enough, sorry

Andys, i didn't test it, I only noticed that } was missing. Plz contact me so i can ask what the problem is exactly

Link to comment

!timeban Script - Edited!

alias mta.start {
 .timerunban 0 10 mta.timeunban
}
alias mta.text {
 if ($readini($scriptdir $+ $1.ini,ID $+ $2,op)) { 
   if ($3 == !timeban) { 
     if ($4 != $null) { 
       if ($5 != $null) {
         if ($6 != $null) {
           if ($mta.name($1,$4) == unknown) { 
             mta.say $1 Error! ID $4 don't exist!
           }
           else {
             if ($6 == sec || $6 == min || $6 == hour || $6 == day || $6 == week) {
               mta.timeban $1- 
             }
             else {
               mta.say $1 Error of synthesis, use: !timeban  value (sec,min,hour,day or week).
             }
           }
         }
         else {
           mta.say $1 Error of synthesis, use: !timeban  value (sec,min,hour,day or week).
         }
       }
       else {
         mta.say $1 Error of synthesis, use: !timeban  value (sec,min,hour,day or week).
       }
     }
     else {
       mta.say $1 Error of synthesis, use: !timeban  value (sec,min,hour,day or week).
     }
   }
 }
}
alias mta.timeban { 
 %id = $4
 %ip = $mta.ip($1, %id) 
 %currenttime = $ctime 

 if (%id == -1) { 
   !return 
 } 
 %factor_text = $6 
 if (%factor_text == sec) { 
   %factor = 1 
 } 
 elseif (%factor_text == min) { 
   %factor = 60 
 } 
 elseif (%factor_text == hour) { 
   %factor = 3600 
 } 
 elseif (%factor_text == day) { 
   %factor = 86400 
 } 
 elseif (%factor_text == week) { 
   %factor = 604800 
 } 

 %ban_until = $calc(%currenttime + $5 * %factor) 
 mta.say $1 $mta.name($1,$4) has been BANned by $mta.name($1,$2) until $asctime(%ban_until)
 %bans = $readini( "MTAbans.ini", bans, ips) 
 %bans = $addtok(%bans, $longip(%ip), 32) 

 %servers = $readini( "MTAbans.ini", servers, $longip(%ip)) 
 %servers = $addtok(%servers, $1, 32) 

 writeini "MTAbans.ini" bans ips %bans 
 writeini "MTAbans.ini" banduration $longip(%ip) %ban_until 
 writeini "MTAbans.ini" server $longip(%ip) %servers 
 writeini "MTAbans.ini" name $longip(%ip) $mta.name($1,%id) 
 writeini "MTAbans.ini" ip $longip(%ip) $mta.ip($1,%id)
 mta.ban $1 %id 
} 
alias mta.timeunban { 
 %bans = $readini( "MTAbans.ini", bans, ips) 
 %num_bans = $numtok(%bans, 32) 
 %currenttime = $ctime 
 %counter = 0 

 while (%counter < %num_bans) { 
   if (%num_bans > 1) { 
     %banned = $gettok( %bans , %counter + 1 , 32) 
   } 
   else { 
     %banned = %bans 
   } 
   if (%banned != $null) { 
     %ban_until = $readini( "MTAbans.ini", banduration, %banned ) 
     if (%ban_until <= %currenttime) { 
       %servers = $readini( "MTAbans.ini", server, %banned) 
       %name = $readini( "MTAbans.ini", name, %banned) 
       %num_servers = $numtok(%servers,32) 
       %counter2 = 0 
       while (%counter2 <= %num_servers) { 
         %server = $gettok( %servers , %counter2 + 1 , 32) 
         mta.say %server  %name has been unBANned ...
         mta.unban %server $longip(%banned) 
         %counter2 = %counter2 + 1 
       } 
       %bans = $remtok(%bans, %banned, 32) 
       %num_bans = $calc(%num_bans - 1) 
       %counter = %counter - 1         
       remini "MTAbans.ini" banduration %banned 
       remini "MTAbans.ini" server %banned 
       remini "MTAbans.ini" name %banned 
       remini "MTAbans.ini" ip %banned 
     } 
   } 
   %counter = %counter + 1 
 } 
 if (%bans != $null) { 
   writeini "MTAbans.ini" bans ips %bans 
 } 
 else { 
   remini "MTAbans.ini" bans ips 
 } 
}
alias mta.pm {
 if ($3- == server secret) { 
   mta.say $1 Admin rights given to $mta.name($1,$2) 
   writeini $+(",$scriptdir,$1.ini") ID $+ $2 op 1 
 }
}

Tested with success...

Link to comment
!timeban Script - Edited!


Ah no.. You only changed some of the messages, and post it again.. wow.. now i know why this thread is allmost 50 pages... How could anybody find something here, if everything is ajusted for just 2 characters, and no real big improvments, and posted over and over and over again?

Edited by Guest
Link to comment
!timeban Script - Edited!


Ah no.. You only changed some of the messages, and post it again.. wow.. now i know why this thread is allmost 50 pages... How could anybody find something here, if everything it justered for just 2 charecters, and no real big improvments, and posted over and over again?

indeed...

Link to comment

Hey all

I use mirc for my server

Now i want that someone else gonna use my mirc to

That person must go introu my server and typ !start 2

then mirc starts the mirc server 2

I have tryed to do

elseif ($3 == Start ) {

if ($4 == 2 ) {

mta.say $1 Server 2 is starting

mta.con 2

}

if ($4 == 3 ) {

mta.say $1 Server 3 is starting

mta.con 3

}

}

But this not work

Does ennyone how i can do that :)

Gr Michael

Link to comment

This is in my mta.mrc

alias mta.con {

if ($1 == $null) !echo 2 -es * /mta.con: insufficient parameters

elseif ($sock(mta. $+ $1)) !echo 2 -es * /mta.con: already connected

else {

if (!$dialog(mta)) mta

if ($did(mta,$1 $+ 12) == $null) mta.log $1 * Nick missing.

elseif (!$mta.checkip($did(mta,$1 $+ 09))) mta.log $1 * Invalid IP.

elseif (($did(mta,$1 $+ 10) < 1) || ($did(mta,$1 $+ 10) > 65536)) mta.log $1 * Invalid port.

else {

!remini " $+ $scriptdirmta.ini" $1 motd

!.remove $+(",$scriptdir,$1.ini")

!did -a mta $1 $+(Server,$1,*)

!did -a mta $1 $+ 08 Cancel

!did -b mta $+($1,09,$chr(44),$1,10,$chr(44),$1,11,$chr(44),$1,12)

if ($readini($scriptdirmta.ini,0,clear) != 0) !did -r mta $1 $+ 02

mta.log $1 * $iif($readini($scriptdirmta.ini,$1,to),Connect retry $chr(35) $+ $ifmatch,Connecting to) $+($did(mta,$1 $+ 09),:,$did(mta,$1 $+ 10),...)

!.timerto $+ $1 1 10 mta.dis $1 Timed out.

mta.dll join $1

}

}

}

alias mta.dis {

if ($1 == $null) !echo 2 -es * /mta.dis: insufficient parameters

else {

var %a = mta. $+ $1,%b

mta.dll part $1

!.timerto $+ $1 off

!.remove $+(",$scriptdir,$1.ini")

!did -r mta $+($1,01,$chr(44),$1,21,$chr(44),$1,22,$chr(44),$1,27)

mta.log $1 * Disconnected: $2-

if (($readini($scriptdirmta.ini,0,to)) && ($2- == Timed out.)) {

%b = $calc($readini($scriptdirmta.ini,$1,to)+1)

!writeini -n " $+ $scriptdirmta.ini" $1 to %b

if (%b < 6) {

!sockclose %a

mta.con $1

!halt

}

}

Link to comment

DON'T change ANYTHING in mta.mrc! You do not need to modify anything in there ever!

What i asked is, are the tabs filled in completely? MTAMA wil connect the server on tab x with mta.con x, but it can't if it doesn't know the connection details...

Link to comment
!timeban Script - Edited!


Ah no.. You only changed some of the messages, and post it again.. wow.. now i know why this thread is allmost 50 pages... How could anybody find something here, if everything is ajusted for just 2 characters, and no real big improvments, and posted over and over and over again?

If you don't know, the original script doesn't work.

This that I modified, yes!

Where is it to total repetition in him? It is totally edited!

Link to comment
!timeban Script - Edited!


Ah no.. You only changed some of the messages, and post it again.. wow.. now i know why this thread is allmost 50 pages... How could anybody find something here, if everything is ajusted for just 2 characters, and no real big improvments, and posted over and over and over again?

yep, x32 developers in in the middle of making a custom site for posting scripts and archive for tested and working scripts that sort of thing... please be patient not long to wait now!

Link to comment

Improved Ping kicker which is faster.

Please leave the comment inside ;)

You may edit the mta.* aliases a bit.

alias mta.start {
 %ping.max = 200
 !.timerpingkick 0 10 pingkick
}
alias mta.quit {
 !.timerpingkick off
}
alias mta.part {
 !hdel Ping. $+ $1 $2
}
alias pingkick {
 ;Made by Aeron
 ;Contact at [email protected]
 var %a = 1,%b
 if (%ping.max !isnum) {
   !echo Maximum ping not set.
   !halt
 }
 while %a < 9 {
   if ($sock(mta. $+ %a)) {
     %b = $readini($nofile($script(mta.mrc)) $+ mta.ini,%a,max)
     while %b >= 0 {
       !tokenize 32 $hget(Ping. $+ %a,%b)
       !hadd -m Ping. $+ %a %b $calc($mta.ping(%a,%b) +$1) $calc(1+$2)
       if $2 > 5 {
         if $calc($1 /$2) > %ping.max {
           mta.say %a $mta.name(%a,%b) Reason: High ping. (Max: %ping.max $+ )
           mta.kick %a %b
         }
         !hadd -m Ping. $+ %a %b $mta.ping(%a,%b) 1
       }
       !dec %b
     }
   }
   !inc %a
 }
}

Link to comment

Hi!

I am new to this mIRC scripting buisness, i never done this before. In a few days we will have a "LAN-party", and MTA is on the game list. I'm the one who suggested it, so i am the one who should make it work:)

To cut the story a bit shorter: I didn't find any scripts for Stunt servers so I am making one. I've got some ideas from here, so thanks for everyone, who posted these kickass scripts:)

As soon as i tested every function of my script i can post it here, if anyone is interested. I've got some really nice features already

I remember i saw a post about a killer-kicker thingy, well here's my solution to the killer-free stunt server with the feature of forgiving:

alias mta.join {
/set %warn [ $+ [ $2 ] ] 0
}
alias mta.kill { 
 if  ( $3 != $2 ) {
     /set %killed [ $+ [ $2 ] ] $3
     mta.say $1 $mta.name($1,$2) $+ , you can forgive $mta.name($1,$3) by typing !forgive $3 in 10 seconds
     timer.k 1 10 mta.killer $1 $2 $3
 }
}
alias mta.text {
 if ( ( $3 == !forgive ) && ( $4 != $null ) ) {
   if ( $4 == %killed [ $+ [ $2 ] ]) {
     unset %killed [ $+ [ $2 ] ]
     timer.k off
     mta.say $1 $mta.name($1,$2) forgives the killer
     }
   }
 if  ( $3 == !warning ) {
   if ( ( $4 == $null ) || ( $4 isalpha ) ) {
     mta.say $1 $mta.name($1,$2) $+ , you have %warn [ $+ [ $2 ] ] warning(s)
     mta.say $1 If you get $calc( 3 - %warn [ $+ [ $2 ] ] ) more, you'll be kicked
     }
   else mta.say $1 $mta.name($1,$4) has %warn [ $+ [ $4 ] ] warning(s)
 }
}
alias mta.killer {
 if ( %killed [ $+ [ $2 ] ] != $null ) {
   inc %warn [ $+ [ $3 ] ]
   if ( %warn [ $+ [ $3 ] ] == 3 ) {
     mta.say $1 $mta.name($1,$3) $+ , you have now 3 warnings, it's time to say goobye!
     mta.kick $1 $3
     unset %killed [ $+ [ $2 ] ]
     }
 else {
   mta.say $1 $mta.name($1,%killed [ $+ [ $2 ] ]) $+ , you get a warning for kiling!
   unset %killed [ $+ [ $2 ] ]
   }
 }
}

I tested it and it works. The only bug it has, that it can't handle two diiferent kills if they are so close together that the timer still runs.

But i don't think that's a problem since on stunt servers there aren't kills every 10 seconds:)

Link to comment

Has anyone got a script to kick all clan members at same time, so i would write summit like !kick all members have benn kicked by VCES>Puddy. then it kiks em all. I have seen alot of clans that cheat

:shock:

Insert into mta.text (use elseif if not the first statement):


elseif ($3 == !clankick && %isadmin. [ $+ [ $1 ] $+ . $+ [ $2 ] ] == true) {
if ($4 != $null) {
%a = 0
while (%a < $mta.maxplayers($1)) {
if ($4 isin $mta.name($1,%a)) {
mta.kick $1 %a
}
inc %a 1
}
unset %a
}
else {
mta.say $1 Usage: !clankick
}
}

This should work, hope i didn't make any typo's. If so, please PM me so i can change it and there are no unneccesary postings in this thread

EDIT: First typo

Edited by Guest
Link to comment

Damn, the bigger your script, the bigger your ego? Try to add 10M of \n, \t, \b , ^h in it.... Maybe you're happy then...

Seriously:

I forgot to pot the $1 in the mta.maxplayers in my last code, i changed it, but for those who allready used it: my apologies, hope this will work

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...