andeh Posted October 16, 2004 Share Posted October 16, 2004 *TLR*Andy said: alias mta.join { var %a = 1 while %a <= $lines(shiters.txt) { if $read(shiters.txt,%a) isin $mta.name($1,$2) { mta.say $1 $read(shiters.txt,%a) Is banned,Please go to www.tlr-clan.co.uk to apeal. mta.ban $1 $2 } !inc %a } if $read(shits.txt,w,$mta.name($1,$2)) { mta.say $1 $mta.name($1,$2) Is banned,Please go to www.tlr-clan.co.uk to apeal. mta.kick $1 $2 } } alias mta.text { if ($3 == brb) { mta.say $1 $mta.name($1,$2) $+ : will be right back! } elseif ($3 == lagger || $3 == lagga) { mta.slap $1 $2 mta.say $1 $mta.name($1,$2) stop complaining } alias mta.command { if !aban == $3 && *TLR*Andy isin $mta.name($1,$2) { if $4 !== $null { mta.say $1 $mta.name($1,$2) has advance banned $mta.name($1,$4) Good Bye! !write shits.txt $mta.name($1,$4) mta.ban $1 $4 } } elseif ($3 == !djon) && (*TLR*Andy isin $mta.name($1,$2)) { mta.say $1 TLR-RADIO Mode NOW ON! /timer 0 60 /mta.say $1 TLR-Radio IS NOW ON!!,Open URL With: http://213.230.209.159:8000/ } elseif ($3 == !djoff) && (*TLR*Andy isin $mta.name($1,$2)) { mta.say $1 TLR-Radio Mode Is Now OFF! /timer1 off } elseif ($3 == !reload && *TLR*Andy isin $mta.name($1,$2)) { mta.say $1 Script reloaded! !reload -rs $+(",$script,") } elseif ($3 == !lagging) && *TLR*Andy isin $mta.name($1,$2) { if ( $4 isnum ) { unset %lagging set %countlag 0 while (%countlag < 26 ) { if ( $mta.ping($1, %countlag ) > $4 ) { %lagging = %lagging $mta.name($1, %countlag ) $+ , } %countlag = %countlag + 1 } if ( %lagging == $null ) { mta.say $1 No people in the server have an average ping higher than $4 } else { mta.say $1 Average pings above $4 $+ : %lagging } unset %lagging unset %countlag } else { mta.say $1 $mta.name($1,$2) $+ : Error - Please specify a ping. Syntax: !lagging } } elseif !clanban == $3 && *TLR*Andy isin $mta.name($1,$2) { if $4 !== $null { mta.say $1 $mta.name($1,$2) has banned all members of $4 $+ . Good Bye! !write shiters.txt $4 clanban $1- } } elseif ($3 == !kill) && (*TLR*Andy isin $mta.name($1,$2)) { .timer1 1 1 mta.say $1 Killing $mta.name($1,$4) in 5 seconds! .timer6 1 6 !.timerkill 5 1 /mta.slap $1 $4 } elseif ($3 == !slap) && (*TLR*Andy isin $mta.name($1,$2)) { .timer1 1 1 mta.say $1 slapping $mta.name($1,$4) in 5 seconds! .timer6 1 6 !.timerkill 1 1 /mta.slap $1 $4 } elseif ($3 == !rules) && TLR isin $mta.name($1,$2) { if ($4 != $null) { mta.msg $1 $4 $mta.name($1,$4) Don't brake these rules!!! .timer 1 1 mta.msg $1 $4 No Cheating/Modding .timer 1 2 mta.msg $1 $4 No Bitching .timer 1 3 mta.msg $1 $4 No Chopper Kills .timer 1 4 mta.msg $1 $4 No Pausing .timer 1 5 mta.msg $1 $4 No Recruiting/Advertising .timer 1 6 mta.msg $1 $4 No Spawn Killing .timer 1 7 mta.msg $1 $4 Obey the rules or else be kicked/banned! } else { mta.msg $1 $2 TLR-Server Rules .timer 1 1 mta.msg $1 $2 No Cheating/Modding .timer 1 2 mta.msg $1 $2 No Bitching .timer 1 3 mta.msg $1 $2 No Chopper Kills .timer 1 4 mta.msg $1 $2 No Pausing .timer 1 5 mta.msg $1 $2 No Recruiting/Advertising .timer 1 6 mta.msg $1 $2 No Spawn Killing .timer 1 7 mta.msg $1 $2 Obey the rules or else be kicked/banned! } elseif (!admin == $3) { mta.say $1 The admin has been alerted. /run C:\admin.wav } } alias mta.part { if ($3 == kicked) { inc %kick .timer -m 1 1 mta.say $1 %kick $+ th idiot to get kicked } } alias mta.kill { if ($mta.kills($1,$3) == 9) mta.say $1 Woohoo $mta.name($1,$3) has 10 kills! if ($mta.kills($1,$3) == 19) mta.say $1 Woohoo $mta.name($1,$3) has 20 kills! if ($mta.kills($1,$3) == 29) mta.say $1 Woohoo $mta.name($1,$3) has 30 kills! if ($mta.kills($1,$3) == 39) mta.say $1 Woohoo $mta.name($1,$3) has 40 kills! if ($mta.kills($1,$3) == 49) mta.say $1 Woohoo $mta.name($1,$3) has 50 kills! if ($mta.kills($1,$3) == 59) mta.say $1 Woohoo $mta.name($1,$3) has 60 kills! if ($mta.kills($1,$3) == 69) mta.say $1 Woohoo $mta.name($1,$3) has 70 kills! if ($mta.kills($1,$3) == 79) mta.say $1 Woohoo $mta.name($1,$3) has 80 kills! if ($mta.kills($1,$3) == 89) mta.say $1 Woohoo $mta.name($1,$3) has 90 kills! if ($mta.kills($1,$3) == 99) mta.say $1 Woohoo $mta.name($1,$3) has 100 kills! } } } alias clanban { var %a = 0 while (%a < 32) { if ($4 isin $mta.name($1,%a)) mta.ban $1 %a !inc %a } } I killed another script,apart from most of it not working it kicks and bans people , any chance someone could fix it please? alias mta.text { if ($readini($scriptdir $+ $1.ini,ID $+ $2,op)) { if ($3 == !kick) mta.kick $1 $4 if ($3 == !ban) mta.ban $1 $4 ; } alias mta.pm { if ($3- == admin password) { mta.say $1 Admin rights given to $mta.name($1,2) writeini $+(",$scriptdir,$1.ini") ID $+ $2 op 1 } } And could this be added, all the commands with *TLR*Andy isin be put in the login script??. can someone fix this please, its randomly kicking people. And someone joined as me when my scripts where on and fucked wid the scripts . Link to comment
Shib Posted October 16, 2004 Share Posted October 16, 2004 You haven't closed alias mta.text { in the top one Link to comment
andeh Posted October 17, 2004 Share Posted October 17, 2004 alias mta.join { var %a = 1 while %a <= $lines(shiters.txt) { if $read(shiters.txt,%a) isin $mta.name($1,$2) { mta.say $1 $read(shiters.txt,%a) Is banned,Please go to www.tlr-clan.co.uk to apeal. mta.ban $1 $2 } !inc %a } if $read(shits.txt,w,$mta.name($1,$2)) { mta.say $1 $mta.name($1,$2) Is banned,Please go to www.tlr-clan.co.uk to apeal. mta.kick $1 $2 } } alias mta.text { if ($3 == brb) { mta.say $1 $mta.name($1,$2) $+ : will be right back! } elseif ($3 == lagger || $3 == lagga) { mta.slap $1 $2 mta.say $1 $mta.name($1,$2) stop complaining } } alias mta.command { if !aban == $3 && *TLR*Andy isin $mta.name($1,$2) { if $4 !== $null { mta.say $1 $mta.name($1,$2) has advance banned $mta.name($1,$4) Good Bye! !write shits.txt $mta.name($1,$4) mta.ban $1 $4 } } elseif ($3 == !djon) && (*TLR*Andy isin $mta.name($1,$2)) { mta.say $1 TLR-RADIO Mode NOW ON! /timer 0 60 /mta.say $1 TLR-Radio IS NOW ON!!,Open URL With: http://213.230.209.159:8000/ } elseif ($3 == !djoff) && (*TLR*Andy isin $mta.name($1,$2)) { mta.say $1 TLR-Radio Mode Is Now OFF! /timer1 off } elseif ($3 == !reload && *TLR*Andy isin $mta.name($1,$2)) { mta.say $1 Script reloaded! !reload -rs $+(",$script,") } elseif ($3 == !lagging) && *TLR*Andy isin $mta.name($1,$2) { if ( $4 isnum ) { unset %lagging set %countlag 0 while (%countlag < 26 ) { if ( $mta.ping($1, %countlag ) > $4 ) { %lagging = %lagging $mta.name($1, %countlag ) $+ , } %countlag = %countlag + 1 } if ( %lagging == $null ) { mta.say $1 No people in the server have an average ping higher than $4 } else { mta.say $1 Average pings above $4 $+ : %lagging } unset %lagging unset %countlag } else { mta.say $1 $mta.name($1,$2) $+ : Error - Please specify a ping. Syntax: !lagging } } elseif !clanban == $3 && *TLR*Andy isin $mta.name($1,$2) { if $4 !== $null { mta.say $1 $mta.name($1,$2) has banned all members of $4 $+ . Good Bye! !write shiters.txt $4 clanban $1- } } elseif ($3 == !kill) && (*TLR*Andy isin $mta.name($1,$2)) { .timer1 1 1 mta.say $1 Killing $mta.name($1,$4) in 5 seconds! .timer6 1 6 !.timerkill 5 1 /mta.slap $1 $4 } elseif ($3 == !slap) && (*TLR*Andy isin $mta.name($1,$2)) { .timer1 1 1 mta.say $1 slapping $mta.name($1,$4) in 5 seconds! .timer6 1 6 !.timerkill 1 1 /mta.slap $1 $4 } elseif ($3 == !rules) && TLR isin $mta.name($1,$2) { if ($4 != $null) { mta.msg $1 $4 $mta.name($1,$4) Don't brake these rules!!! .timer 1 1 mta.msg $1 $4 No Cheating/Modding .timer 1 2 mta.msg $1 $4 No Bitching .timer 1 3 mta.msg $1 $4 No Chopper Kills .timer 1 4 mta.msg $1 $4 No Pausing .timer 1 5 mta.msg $1 $4 No Recruiting/Advertising .timer 1 6 mta.msg $1 $4 No Spawn Killing .timer 1 7 mta.msg $1 $4 Obey the rules or else be kicked/banned! } else { mta.msg $1 $2 TLR-Server Rules .timer 1 1 mta.msg $1 $2 No Cheating/Modding .timer 1 2 mta.msg $1 $2 No Bitching .timer 1 3 mta.msg $1 $2 No Chopper Kills .timer 1 4 mta.msg $1 $2 No Pausing .timer 1 5 mta.msg $1 $2 No Recruiting/Advertising .timer 1 6 mta.msg $1 $2 No Spawn Killing .timer 1 7 mta.msg $1 $2 Obey the rules or else be kicked/banned! } elseif (!alert == $3) { mta.say $1 The admin has been alerted. /run C:\admin.wav } } alias mta.part { if ($3 == kicked) { inc %kick .timer -m 1 1 mta.say $1 %kick $+ th idiot to get kicked } } alias mta.kill { if ($mta.kills($1,$3) == 9) mta.say $1 Woohoo $mta.name($1,$3) has 10 kills! if ($mta.kills($1,$3) == 19) mta.say $1 Woohoo $mta.name($1,$3) has 20 kills! if ($mta.kills($1,$3) == 29) mta.say $1 Woohoo $mta.name($1,$3) has 30 kills! if ($mta.kills($1,$3) == 39) mta.say $1 Woohoo $mta.name($1,$3) has 40 kills! if ($mta.kills($1,$3) == 49) mta.say $1 Woohoo $mta.name($1,$3) has 50 kills! if ($mta.kills($1,$3) == 59) mta.say $1 Woohoo $mta.name($1,$3) has 60 kills! if ($mta.kills($1,$3) == 69) mta.say $1 Woohoo $mta.name($1,$3) has 70 kills! if ($mta.kills($1,$3) == 79) mta.say $1 Woohoo $mta.name($1,$3) has 80 kills! if ($mta.kills($1,$3) == 89) mta.say $1 Woohoo $mta.name($1,$3) has 90 kills! if ($mta.kills($1,$3) == 99) mta.say $1 Woohoo $mta.name($1,$3) has 100 kills! } } alias clanban { var %a = 0 while (%a < 32) { if ($4 isin $mta.name($1,%a)) mta.ban $1 %a !inc %a } } Seems to be dead from !alert, Also can anybody add a login system for it. Just for all the commands that have *TLR*Andy isin. Link to comment
Shib Posted October 17, 2004 Share Posted October 17, 2004 alias mta.kill - 2 { when only 1 needed !rules - you have only closed 1 { you need 2 Link to comment
andeh Posted October 17, 2004 Share Posted October 17, 2004 (edited) DJ_DaN said: alias mta.kill - 2 { when only 1 needed!rules - you have only closed 1 { you need 2 thx dan, i knew it was that dam rules script. alias mta.text { if ($readini($scriptdir $+ $1.ini,ID $+ $2,op)) { if ($3 == !kick) mta.kick $1 $4 if ($3 == !ban) mta.ban $1 $4 ; } alias mta.pm { if ($3- == admin password) { mta.say $1 Admin rights given to $mta.name($1,2) writeini $+(",$scriptdir,$1.ini") ID $+ $2 op 1 } } If i add the commands to admin system do i just change the "elseif" into "if" ?? EDIT: i tryed it and it fucked up, can someone help me please? Edited October 17, 2004 by Guest Link to comment
nivko Posted October 17, 2004 Share Posted October 17, 2004 Votekick system on page 2 dont work i have alias mta.text renamed to alias mta.command and is dont work ! Link to comment
Mike Posted October 17, 2004 Share Posted October 17, 2004 Here is the votekick script: alias mta.command { if ($3 == !votekick) { if (%vote.nick. [ $+ [ $1 ] ] == $null) { if ($ini($+(",$scriptdir,$1,.ini,"),ID $+ $4)) { set %vote.nick. [ $+ [ $1 ] ] $4 set %vote.voters. [ $+ [ $1 ] ] $null mta.say $1 Votekick "!vote" if u want that $mta.name($1,$4) shall be kicked. [ $calc($left($did(mta,$1 $+ 21),2) / 2) votes needed][30 sec] .timervote [ $+ [ $1 ] ] 1 30 mta.vote $1 } else mta.say $1 Give up an existing ID-number: "!votekick <#ID"> } else mta.say $1 Another votekick is running: $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) } if (($3 == !vote) && (%vote.nick. [ $+ [ $1 ] ] != $null)) { if ($2 !isin %vote.voters. [ $+ [ $1 ] ]) { %vote.voters. [ $+ [ $1 ] ] = %vote.voters. [ $+ [ $1 ] ] $2 mta.say $1 $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes for $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) if ($numtok(%vote.voters. [ $+ [ $1 ] ],32) >= $calc($left($did(mta,$1 $+ 21),2) / 2)) { mta.say $1 $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes ur out! mta.kick $1 %vote.nick. [ $+ [ $1 ] ] unset %vote.nick. [ $+ [ $1 ] ] unset %vote.voters. [ $+ [ $1 ] ] .timervote [ $+ [ $1 ] ] off } } else mta.say $1 $mta.name($1,$2) You have already voted } } alias mta.vote { mta.say $1 Vote kick cancelled: $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) unset %vote.nick. [ $+ [ $1 ] ] unset %vote.voters. [ $+ [ $1 ] ] } PS: I have tested this and it works Btw: this isn't mine, just Aeron's from earlier, slightly edited to work with the new alias Link to comment
nivko Posted October 17, 2004 Share Posted October 17, 2004 please post one with !cancel Link to comment
Mike Posted October 17, 2004 Share Posted October 17, 2004 Fine : alias mta.command { if ($3 == !votekick) { if (%vote.nick. [ $+ [ $1 ] ] == $null) { if ($ini($+(",$scriptdir,$1,.ini,"),ID $+ $4)) { set %vote.nick. [ $+ [ $1 ] ] $4 set %vote.voters. [ $+ [ $1 ] ] $null mta.say $1 Votekick "!vote" if u want that $mta.name($1,$4) shall be kicked. [ $calc($left($did(mta,$1 $+ 21),2) / 2) votes needed][30 sec] .timervote [ $+ [ $1 ] ] 1 30 mta.vote $1 } else mta.say $1 Give up an existing ID-number: "!votekick <#ID"> } else mta.say $1 Another votekick is running: $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) } if (($3 == !vote) && (%vote.nick. [ $+ [ $1 ] ] != $null)) { if ($2 !isin %vote.voters. [ $+ [ $1 ] ]) { %vote.voters. [ $+ [ $1 ] ] = %vote.voters. [ $+ [ $1 ] ] $2 mta.say $1 $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes for $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) if ($numtok(%vote.voters. [ $+ [ $1 ] ],32) >= $calc($left($did(mta,$1 $+ 21),2) / 2)) { mta.say $1 $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes ur out! mta.kick $1 %vote.nick. [ $+ [ $1 ] ] unset %vote.nick. [ $+ [ $1 ] ] unset %vote.voters. [ $+ [ $1 ] ] .timervote [ $+ [ $1 ] ] off } } else mta.say $1 $mta.name($1,$2) You have already voted } if ($3 == !cancel) && (nivko isin $mta.name($1,$2)) { mta.say $1 Votekick canceled unset %vote.nick. [ $+ [ $1 ] ] unset %vote.voters. [ $+ [ $1 ] ] .timervote [ $+ [ $1 ] ] off } } alias mta.vote { mta.say $1 Vote kick cancelled: $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) unset %vote.nick. [ $+ [ $1 ] ] unset %vote.voters. [ $+ [ $1 ] ] } Link to comment
nivko Posted October 17, 2004 Share Posted October 17, 2004 as i typ !wru niv he sayt this iam not ingame can you make this script that he sayt NiVKO is not ingame. This is my !wru script if ($3 == !wru) { if ($4 != $null) mta.say $1 $mta.name($1,$iif($4 isnum,$4,$mta.getid($1,$4))) is in @ $mta.area($1,$iif($4 isnum,$4,$mta.getid($1,$4))) else mta.say $1 $mta.name($1,$2) is in @ $mta.area($1,$2) } Link to comment
andeh Posted October 17, 2004 Share Posted October 17, 2004 nivko said: as i typ !wru nivhe sayt this iam not ingame can you make this script that he sayt NiVKO is not ingame. This is my !wru script if ($3 == !wru) { if ($4 != $null) mta.say $1 $mta.name($1,$iif($4 isnum,$4,$mta.getid($1,$4))) is in @ $mta.area($1,$iif($4 isnum,$4,$mta.getid($1,$4))) else mta.say $1 $mta.name($1,$2) is in @ $mta.area($1,$2) } alias mta.command { if (!wru == $3) { if ($4 !== $null) { mta.say $1 $mta.name($1,$4) is at $mta.area($1,$4)! else { mta.say $1 You are at $mta.area($1,$2)! } } } } This should work, !wru, !wru . (tested and it works) Link to comment
andeh Posted October 17, 2004 Share Posted October 17, 2004 (edited) /me waits for hes script Sorry for double post, my Internet Explorer fucked up. Edited October 17, 2004 by Guest Link to comment
Mike Posted October 17, 2004 Share Posted October 17, 2004 He wanted one that said if someone was out of game: alias mta.command { if (!wru == $3) { if ($4 !== $null) { if ($mta.area($1,$4) != Unknown) mta.say $1 $mta.name($1,$4) is at $mta.area($1,$4)! else mta.say $1 $mta.name($1,$4) is out of game! } else { if ($mta.area($1,$2) != Unknown) mta.say $1 You are at $mta.area($1,$2)! else mta.say $1 You are out of game. } } } Link to comment
Guest Posted October 17, 2004 Share Posted October 17, 2004 ok, i was wondering about the nicknames colorcodes generator thing on your website aeron. How do you use it and what does it change? thx, quadkidd02 Link to comment
Shib Posted October 18, 2004 Share Posted October 18, 2004 They are disabled in MTA 0.4.1 so you wouldn't see them anyway. Link to comment
MrJax Posted October 18, 2004 Share Posted October 18, 2004 u can use them on the MOTD Link to comment
andeh Posted October 18, 2004 Share Posted October 18, 2004 DJ_DaN said: They are disabled in MTA 0.4.1 so you wouldn't see them anyway. they wouldn't work atole, you would just see the codes. Link to comment
Oli Posted October 18, 2004 Share Posted October 18, 2004 um, that out game script is wrong mike: alias mta.command { if !wru == $3 { if $4 !== $null { if $mta.status($1,$4) == 2 mta.say $1 $mta.name($1,$4) is at $mta.area($1,$4) $+ . else mta.say $1 $mta.name($1,$4) is out of game. } else { if $mta.status($1,$2) == 2 mta.say $1 You are at $mta.area($1,$2) $+ . else mta.say $1 You are out of game. } } } This should work better Link to comment
nivko Posted October 18, 2004 Share Posted October 18, 2004 Hello, have somone a ping script with average ping ???? Link to comment
nivko Posted October 18, 2004 Share Posted October 18, 2004 alias mta.command { if ($3 == !votekick) { if (%vote.nick. [ $+ [ $1 ] ] == $null) { if ($ini($+(",$scriptdir,$1,.ini,"),ID $+ $4)) { set %vote.nick. [ $+ [ $1 ] ] $4 set %vote.voters. [ $+ [ $1 ] ] $null mta.say $1 Votekick "!vote" if u want that $mta.name($1,$4) shall be kicked. [ $calc($left($did(mta,$1 $+ 21),2) / 2) votes needed][30 sec] .timervote [ $+ [ $1 ] ] 1 30 mta.vote $1 } else mta.say $1 Give up an existing ID-number: "!votekick <#ID"> } else mta.say $1 Another votekick is running: $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) } if (($3 == !vote) && (%vote.nick. [ $+ [ $1 ] ] != $null)) { if ($2 !isin %vote.voters. [ $+ [ $1 ] ]) { %vote.voters. [ $+ [ $1 ] ] = %vote.voters. [ $+ [ $1 ] ] $2 mta.say $1 $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes for $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) if ($numtok(%vote.voters. [ $+ [ $1 ] ],32) >= $calc($left($did(mta,$1 $+ 21),2) / 2)) { mta.say $1 $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes ur out! mta.kick $1 %vote.nick. [ $+ [ $1 ] ] unset %vote.nick. [ $+ [ $1 ] ] unset %vote.voters. [ $+ [ $1 ] ] .timervote [ $+ [ $1 ] ] off } } else mta.say $1 $mta.name($1,$2) You have already voted } if ($3 == !cancel) && (nivko isin $mta.name($1,$2)) { mta.say $1 Votekick canceled unset %vote.nick. [ $+ [ $1 ] ] unset %vote.voters. [ $+ [ $1 ] ] .timervote [ $+ [ $1 ] ] off } } alias mta.vote { mta.say $1 Vote kick cancelled: $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) unset %vote.nick. [ $+ [ $1 ] ] unset %vote.voters. [ $+ [ $1 ] ] } I typ !votekick 0 he says: > Link to comment
Shib Posted October 18, 2004 Share Posted October 18, 2004 *TLR*Andy said: DJ_DaN said: They are disabled in MTA 0.4.1 so you wouldn't see them anyway. they wouldn't work atole, you would just see the codes. You don't even see the codes in 0.4.1, you can only use the colour codes in the MOTD as jax said. Link to comment
nivko Posted October 18, 2004 Share Posted October 18, 2004 Hello, have somone a ping script with average ping ???? Link to comment
Shib Posted October 18, 2004 Share Posted October 18, 2004 alias mta.start { .timerping 0 10 checkpings } alias checkpings { set %temp.i 0 while ( %temp.i < 26 ) { set %temp.ping $mta.ping(1, %temp.i) if ( ( %temp.ping > 1000 ) || ( %temp.ping < 0 ) ) { halt } if ( %temp.ping != $null ) { inc %loop. [ $+ [ %temp.i ] ] 1 if ( %loop. [ $+ [ %temp.i ] ] > 12 ) { set %loop. [ $+ [ %temp.i ] ] 1 } set %ping. [ $+ [ %temp.i ] $+ . $+ [ %loop. [ $+ [ %temp.i ] ] ] ] %temp.ping if ( %ping. [ $+ [ %temp.i ] $+ . $+ ] 12 != $null ) { set %temp.j 1 set %temp.average 0 while ( %temp.j <= 12 ) { inc %temp.average %ping. [ $+ [ %temp.i ] $+ . $+ [ %temp.j ] ] inc %temp.j 1 } set %temp.average $calc( %temp.average / 12 ) set %average. [ $+ [ %temp.i ] ] %temp.average if (( %temp.average >= %max ) && (nivko isin $mta.name(1, %temp.i))) { } elseif ( %temp.average >= %max ) { /mta.say 1 Kicking $mta.name(1, %temp.i) for having average ping over %max /mta.kick 1 %temp.i } } } inc %temp.i 1 } unset %temp.* } alias mta.command { if (!ping == $3) { if ($4 != $null) { mta.say $1 Name: $mta.name($1,$4) - Ping: $mta.ping($1,$4) } else { mta.say $1 Name: $mta.name($1,$2) - Ping: $mta.ping($1,$2) } } elseif ($3 == !setping) && (nivko isin $mta.name($1,$2)) { set %max $5 mta.say $1 $mta.name($1,$2) set the maximum ping to $5 } } There you go, this would kick everyone with high pings above %max. !ping - shows your ping !ping - shows 's ping !setping - sets max ping to what ever you want Works perfectly for me so any probs tell me Link to comment
Oli Posted October 18, 2004 Share Posted October 18, 2004 ouch thats a slow calc.. id use this one: alias pingkick { var %a = 1,%b while (%a < 90) { if ($sock(mta. $+ %a)) { %b = $readini(%dir $+ 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 ($ini(%a $+ .ini,ID $+ %b)) { !writeini " $+ $mta.dir $+ %a $+ .ini $+ " ID $+ %b avping $calc($1 /$2) } if ($2 > 5) { if $calc($1 /$2) > %max { mta.say %a Kicking $+(',$mta.name(%a,%b),') for high ping [ $+ $calc($1 /$2) $+ ]. Max allowed: %max mta.kick %a %b } !hadd -m Ping. $+ %a %b $mta.ping(%a,%b) 1 } !dec %b } } !inc %a if (%max == $null ) !echo Maximum ping not set. } } alias mta.start { .timerping 0 10 pingkick } alias mta.command { var %b = $iif($4 isnum,$4,$mta.getid($1,$4)) if ($3 == !ping) { if ($4 == $null) { mta.say $1 $mta.name($1,$2), your ping is $mta.ping($1,$2) $+ . Average $$round($readini($1.ini,ID $+ $2,avping)) $+ . $iif(%max,Max Ping Allowed %max $+ .) } else { if (%b == -1) mta.say $1 $mta.name($1,$2) $+ : Error - ID not present. else mta.say $1 The ping of $mta.name($1,%b) is $mta.ping($1,%b) $+ . Average $round($readini($1.ini,ID $+ %b,avping)) $+ . $iif(%max,Max Ping Allowed %max $+ .) } } elseif $3 == !setping && $mta.name($1,$2) == nivko { mta.say $1 Maximum ping changed from ' $+ %max $+ ' to ' $+ $4 $+ ' by ' $+ $mta.name($1,$2) $+ ' !set %max $4 } } Link to comment
Recommended Posts