LG-Gaming Marathon Server hosted by LGrobert |
| | TS query addon and ts config file | |
| | Author | Message |
---|
LGrobert Elite Newbie
Number of posts : 40 Age : 37 Status : Founder Points : 9 Registration date : 2008-09-30
| Subject: TS query addon and ts config file Mon Nov 24, 2008 3:26 pm | |
| Here is a new TS script Part1 - Code:
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; teamspeak_interaction addon coded by LGrobert ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ts2.d will write to the socket, and ts.connect ends any current connection to ts, and opens it alias ts.connect { sockclose ts2 | if $hget(ts2) { .hfree ts2 } | sockopen ts2 $ts.ip $ts.qport | .timertsconfail 1 15 ts.sockclose cc } alias ts2.d { if $sock(ts2) { sockwrite -n ts2 $1- } } ; ts.name gets the item in quotes, ts.rest gets the items after the quotes alias ts.name { return $gettok($iif($gettok($1-,2,34),$ifmatch,$gettok($1-,1,34)),1,34) } alias ts.rest { return $iif($gettok($1-,3-,34),$ifmatch,$gettok($1-,2-,34)) } ; The other aliases here are for quick referance to the configuration file alias ts.chan { return $readini($scriptdirtsconfig.ini,general,channel) } alias ts.slogin { return $readini($scriptdirtsconfig.ini,general,Super_Admin_Login) } alias ts.spass { return $readini($scriptdirtsconfig.ini,general,Super_Admin_Pass) } alias ts.qport { return $readini($scriptdirtsconfig.ini,general,TCPQuery_Port) } alias ts.sport { return $readini($scriptdirtsconfig.ini,general,TS_Server_Port) } alias ts.ip { return $readini($scriptdirtsconfig.ini,general,TS_IP) } alias ts.ip.public { return $readini($scriptdirtsconfig.ini,general,TS_Public_IP) } alias ts.timeout { return $readini($scriptdirtsconfig.ini,general,Timeout_Seconds) } alias ts.afdsecs { return $readini($scriptdirtsconfig.ini,general,AntiFloodDaemonSeconds) } alias ts.afdcounts { return $readini($scriptdirtsconfig.ini,general,AntiFloodDaemoncounts) } alias ts.afdcheck { return $readini($scriptdirtsconfig.ini,general,AntiFloodDaemoncheck) } alias ts.spamfiltercheck { return $readini($scriptdirtsconfig.ini,general,Spamfiltercheck) } ; runs the config file and asks for the first operator's name, if they are not set on *:LOAD: { if (!$hget(tscommands)) { hmake tscommands 1 } if (!$hget(tsspam)) { if $exists(tsspam.hsh) { hmake tsspam 1 | //hload tsspam tsspam.hsh } else { hmake tsspam 1 } } if (!$hget(tsafd)) { hmake tsafd 1 } if (!$hget(tsspamfilter)) { hmake tsspamfilter 1 } if (!$hget(tsid)) { hmake tsid 1 } if (!$hget(tscid)) { hmake tscid 1 } run notepad.exe $scriptdirtsconfig.ini } ; connects to TS on join on *:join:#:if $nick == $me && # == $ts.chan { ts.connect } on *:sockopen:ts2: { .timertsconfail off } on *:TEXT:*:#:{ ; ignores text typed anywhere except the ts channel if # != $ts.chan { halt } else { if ($nick isop $chan) { ; command help if $1- == !tshelp { msg # TeamSpeak Commands !TS [Command] Users, Kick, Msg, Privmsg, Operators, Ban, Banlist, Unban, Info, Findp, Movep, Rehash, Remove, Getpid, Getcid, Addfilter, Removefilter, Listfilter, filtercheck, afdcheck, banclear, dbuserlist - "!TS [command] ?" for more information. } if $1 == !ts && $3 == ? { if $2 == users { msg # Usage: !TS Users : Displays information about the currently connected users. } elseif $2 == kick { msg # Usage: !TS kick "[name]" [reason] : Quotes Required : Kicks name from the server. : Limited to Channel Ops } elseif $2 == msg { msg # Usage: !TS MSG [message] : Messages everyone on the TeamSpeak server. : Limited to Half-Ops and higher. } elseif $2 == privmsg { msg # Usage: !TS PrivMSG "[name]" [message] : Quote Required : Messages name only. } elseif $2 == operators { msg # Usage: !TS Operators [list/add/del] [operator if add or del] : Requires operator permissions : Lists, Adds, Or Deletes (an) operator(s). } elseif $2 == ban { msg # Usage: !TS Ban "[name]" [reason] : Quotes Required : Bans and Kicks name from the server. : Limited to TS Operators } elseif $2 == banlist { msg # Usage: !TS BanList : Lists information about all the banned users on the server. : Limited to Voiced Users } elseif $2 == unban { msg # Usage: !TS Unban [banid] : Unbans the user matching the ban ID. : "!TS Banlist" for ban IDs. } elseif $2 == info { msg # Usage: !TS Info : Lists basic information about the TeamSpeak Server } elseif $2 == findp { msg # Usage: !Ts findp name/string : Returns matching connected players of name/string } elseif $2 == movep { msg # Usage: !Ts movep channelid playerid : Forces Playername/ID Into Channelname/ID - if the names dont work use !ts channellist then wait 1 min then try again. } elseif $2 == rehash { msg # Usage: !Ts rehash : Forces server to reload all settings, usful when you change something and want to avoid restarting } elseif $2 == remove { msg # Usage: !Ts remove player/ID : Forces Player/ID to disconnect without sending out a "kick" } elseif $2 == getpid { msg # Usage: !Ts getpid playername : Returns the present ID of playername } elseif $2 == getcid { msg # Usage: !Ts getcid Channelname : Returns the present ID Of channelname } elseif $2 == addfilter { msg # Usage: addfilter regex : Adds regex to the spamfilter } elseif $2 == removefilter { msg # Usage: removefilter ID : Removes Filter ID } elseif $2 == listfilter { msg # Usage: Lists all filters with ID and regex } elseif $2 == filtercheck { msg # Usage: Returns the state of the spamfilter.. active or unactive } elseif $2 == afdcheck { msg # Usage: Returns the state of the AntiFloodDaemon.. active or unactive } elseif $2 == dbuserlist { msg # Usage: Lists all users in the servers database } elseif $2 == banclear { msg # Usage: Clears all bans on the server } } ; commands if $chr(33) isin $1 { if (!$hget(tscommands)) { hmake tscommands 1 } hinc -u10 tscommands $nick if ($hget(tscommands,$nick) >= 1000) { msg $ts.chan $nick You Are On Ignore For Flooding Me | .ignore -u600 $nick | halt } else { if $1-2 == !ts addfilter && ($3 != * || ($3 != ?)) && ($nick isop $chan) { if (!$hget(tsspamfilter)) { hmake tsspamfilter 1 } hinc -u5 tsspamfilter addfiltercheck while ($hget(tsspamfilter,addfiltercheck) <= $hget(tsspam,0).item) { if (!$hget(tsspam,$hget(tsspamfilter,addfiltercheck))) { //hadd tsspam $hget(tsspamfilter,addfiltercheck) $3- | msg $ts.chan 12[7Spamfilter Added12]: To remove this filter use !ts removefilter ID - this filters ID is: $hget(tsspamfilter,addfiltercheck) | break } hinc -u5 tsspamfilter addfiltercheck if ($hget(tsspamfilter,addfiltercheck) > $hget(tsspam,0).item)) { //hadd tsspam $hget(tsspamfilter,addfiltercheck) $3- | msg $ts.chan 12[7Spamfilter Added12]: To remove this filter use !ts removefilter ID - this filters ID is: $hget(tsspamfilter,addfiltercheck) } } } if $1-2 == !ts removefilter && ($3) && ($nick isop $chan) { if (!$hget(tsspam,$3)) { msg $ts.chan 12[6Spamfilter Error12]: No Such Filter ID } else { //hdel tsspam $3 | msg $ts.chan 12[7Spamfilter Removed12]: } } if $1-2 == !ts listfilter && (!$3) && ($nick isop $chan) { if (!$hget(tsspamfilter)) { hmake tsspamfilter 1 } hadd -u5 tsspamfilter listfilter 1 while ($hget(tsspamfilter,listfilter) <= $hget(tsspam,0).item) { msg $ts.chan 12[3Spamfilter List12]: ID: [07 $+ $hget(tsspamfilter,listfilter) $+ ] Regex: $hget(tsspam,$hget(tsspamfilter,listfilter)) hinc -u5 tsspamfilter listfilter } } if $1-2 == !ts connect && $nick isop # && $istok(%ts.ops,$nick,32) { ts.connect } if $1 == !ts && !$sock(ts2) { msg $ts.chan 12[4Teamspeak error12]: Not connected to the TeamSpeak server—have an operator type !TS Connect } if $1-2 == !ts banclear && $nick isop $chan { ts2.d banclear | msg $ts.chan 12[10TS Ban12]: All Bans Removed } if $1-2 == !ts getpid && ($3 != ?) { if ($hget(tsid,$3)) { msg $ts.chan 12[8TS PID12]: Player ID for 10 $3 is 4 $hget(tsid,$3) } else { msg $ts.chan 12[4Teamspeak error12]: Player ID for10 $3 is not found. } } if $1-2 == !ts getcid && ($3 != ?) { if ($hget(tscid,$3-)) { msg $ts.chan 12[8TS CID12]: Channel ID for 10 $3 is 4 $hget(tscid,$3-) } else { msg $ts.chan 12[4Teamspeak error12]: Channel ID for10 $3- is not found. } } if $1-2 == !ts filtercheck { msg # 12[13TS Spamfilter12]: is presently: $ts.spamfiltercheck } if $1-2 == !ts channellist { ts2.d cl } if $1-2 == !ts afdcheck { msg # 12[6TS AntiFlood12]: is presently: $ts.afdcheck } if $1-2 == !ts findp && ($3 != ?) && ($nick isop $chan) { ts2.d fp $3 } if $1-2 == !ts sel && ($nick isop $chan) { ts2.d sel $ts.sport } if $1-2 == !ts dbserverlist && ($nick isop $chan) { ts2.d dbserverlist } if $1-2 == !ts dbuserlist && ($nick isop $chan) { ts2.d dbuserlist } if $1-2 == !ts movep && ($3 != ?) && ($3 isnum) && ($4 isnum) && ($nick isop $chan) { ts2.d mptc $3 $4 | msg $ts.chan 12[5TS Admin12]: Attempting to move PlayerID $4 To Channel $3 } if $1-2 == !ts movep && ($3 != ?) && ($3 !isnum) && ($4 !isnum) && ($nick isop $chan) { ts2.d mptc $hget(tscid,$3) $hget(tsid,$4) | msg $ts.chan 12[5TS Admin12]: Attempting to move Player $4 To Channel $3 | msg # $hget(tscid,$3) $hget(tsid,$4) } if $1-2 == !ts movep && ($3 != ?) && ($3 isnum) && ($4 !isnum) && ($nick isop $chan) { ts2.d mptc $3 $hget(tsid,$4) | msg $ts.chan 12[5TS Admin12]: Attempting to move Player $4 To Channel $3 } if $1-2 == !ts movep && ($3 != ?) && ($3 !isnum) && ($4 isnum) && ($nick isop $chan) { ts2.d mptc $hget(tscid,$3) $4 | msg $ts.chan 12[5TS Admin12]: Attempting to move PlayerID $4 To Channel $3 } if $1-2 == !ts rehash && (!$3) && ($nick isop $chan) { ts2.d rehash | msg $ts.chan 12[4Teamspeak12]: Rehashing Server } if $1-2 == !ts remove && ($3 != ?) && ($3 isnum) && ($nick isop $chan) { ts2.d removeclient $3 } if $1-2 == !ts remove && ($3 != ?) && ($3 !isnum) && ($nick isop $chan) { set -u2 %ts.lastact remove | ts2.d removeclient $hget(tsid,$3) } if $1-2 == !ts users { ts.pl public } if $1-2 == !ts kick && $4 && $nick isop # { var %user = $hfind(ts2,$+(*;,$ts.name($1-),;*;*),1,w).data if !%user { msg $ts.chan 12[4Teamspeak error12]: User not found... type !ts users for a list of online users. } else { ts2.d kick $gettok($hget(ts2,%user),1,59) (IRC Kick By $nick $+ ) $ts.rest($1-) msg $ts.chan 12[4Teamspeak kick12]:10 $ts.name($1-) was kicked by $nick with reason: $ts.rest($1-) } } if $1-2 == !ts info { ts.si public } if $1-2 == !ts unban && $istok(%ts.ops,$nick,32) && $3 isnum { var %user = $hfind(ts2,$+($3,;*),1,w).data if !%user { msg $ts.chan 12[4Teamspeak error12]: Ban ID not found... type !ts banlist for a list of bans. } else { ts2.d bandel $gettok($hget(ts2,%user),1,59) | msg $ts.chan 12[10TS Ban12]: Ban removed on ip $gettok($gettok($hget(ts2,%user),2,59),1-2,46) $+ .x.x | ts.bl } } if $1-2 == !ts ban && $istok(%ts.ops,$nick,32) && $4 { var %user = $hfind(ts2,$+(*;,$ts.name($1-),;*;*),1,w).data if !%user { msg $ts.chan 12[4Teamspeak error12]: User not found... type !ts users for a list of online users. } else { ts2.d banplayer $gettok($hget(ts2,%user),1,59) ts2.d kick $gettok($hget(ts2,%user),1,59) @(IRC banned By $nick $+ ) $ts.rest($1-) msg $ts.chan 12[4Teamspeak kick12]:10 $ts.name($1-) was kicked by $nick with reason: $ts.rest($1-) msg $ts.chan msg $ts.chan 12[4Teamspeak Ban12]: User10 $ts.name($1-) banned by $nick with reason: $ts.rest($1-) } }
Last edited by LGrobert on Mon Nov 24, 2008 3:45 pm; edited 1 time in total | |
| | | LGrobert Elite Newbie
Number of posts : 40 Age : 37 Status : Founder Points : 9 Registration date : 2008-09-30
| Subject: Re: TS query addon and ts config file Mon Nov 24, 2008 3:41 pm | |
| And here TS script part2 - Code:
-
if $1-2 == !ts banlist && $nick !isreg # { ts.bl public } if $1-2 == !ts operators && !$3 { msg # Sub Commands (!TS operators [sub]): list add del } if $1-3 == !ts operators list { msg # TS Operators: %ts.ops } if $1-3 == !ts operators add && $istok(%ts.ops,$nick,32) && $nick isop # && $4 && !$istok(%ts.ops,$4,32) { msg $ts.chan 12[4Teamspeak Control12]: Operator " $+ $4 $+ " Has Been Added. set %ts.ops $addtok(%ts.ops,$4,32) } if $1-3 == !ts operators del && $istok(%ts.ops,$nick,32) && $nick isop # && $4 && $istok(%ts.ops,$4,32) { msg $ts.chan 12[4Teamspeak Control12]: Operator " $+ $4 $+ " Has Been Deleted set %ts.ops $remtok(%ts.ops,$4,1,32) } if $1-2 == !ts msg && $3- && $nick !isreg # && $nick !isvoice # && $3 != ? { ts2.d msg @[IRC MSG from $nick $+ ] $3- msg $ts.chan 12[4Teamspeak Massage12]: Sent to all connected users. } if $1-2 == !ts privmsg && $3 != ? && $4 { var %user = $hfind(ts2,$+(*;,$ts.name($1-),;*;*),1,w).data if !%user { msg $ts.chan 12[4Teamspeak error12]: User not found... type !ts users for a list of online users. } else { ts2.d msgu $gettok($hget(ts2,%user),1,59) @[IRC PRIVMSG from $nick $+ ] $ts.rest($1-) msg $ts.chan 12[4Teamspeak PRIVmassage12]: Sent to $ts.name($1-) $+ . } } } } } } }
on *:sockread:ts2: { ; puts the information recieved from the ts sever into %tsl, and then throws it into $* var %tsl | sockread -n %tsl | tokenize 32 %tsl if %tsl == [TS] { msg $ts.chan 12[4Teamspeak12]: Connection Establised...Selecting server on port $ts.sport $+ . set %ts.act select ts2.d sel $ts.sport } ; Stores user info in the hash table, and if it was called to by !ts users, displays it in $ts.chan elseif $gettok($1,1,9) isnum && $numtok($1-,9) == 16 { if (%ts.r == first) { set %ts.s 1 | hdel -w ts2 user* | unset %ts.r } ; 1 = pid, 14 = ip, 15 = nick, 16 = login ; Format: pid;nick;login;ip var %login = $iif($remove($gettok(%tsl,16,9),"),$ifmatch,Guest) hadd ts2 $+(user,%ts.s) $gettok(%tsl,1,9) $+ ; $+ $remove($gettok(%tsl,15,9),") $+ ; $+ %login $+ ; $+ $remove($gettok(%tsl,14,9),") if $gettok(%ts.act,2,32) == public { msg $ts.chan TS User %ts.s $+ : ID[07 $+ $gettok(%tsl,1,9) $+ ] Nick[10 $+ $remove($gettok(%tsl,15,9),") $+ ] Login[ $+ $iif(%login == Guest,4,03) $+ %login $+ ] } inc %ts.s } ; stores server info in the hash, and if it was called to by !ts info, displays it in $ts.chan elseif server_*=* iswm $1 { tokenize 61 $1- if $1 == server_name { hadd ts2 servername $2 | if %ts.act == si public { msg $ts.chan TS Server Name: $2 | msg $ts.chan TS Address: 62.212.66.163 or 62.212.66.171 } } elseif $1 == server_platorm { hadd ts2 serverplatform $2 | if %ts.act == si public { msg $ts.chan TS Server Platform: $2 } } elseif $1 == server_udpport { hadd ts2 serverudpport $2 | if %ts.act == si public { msg $ts.chan TS Server Port: $2 } } elseif $1 == server_currentusers && %ts.act == si public { msg $ts.chan TS User Count: $2 } elseif $1 == server_bwoutlastmin { unset %ts.act } } ; Get's the server ID and stores it in a hash (for reference with the logs) elseif $numtok($1-,9) == 4 && $gettok($1,2,9) == $ts.sport { if (!$hget(ts2)) { hmake ts2 4 } hadd ts2 sid $gettok($1,1,9) unset %ts.act } ; stores the ban list in the hash, and displays it in $ts.chan if it was called to by !ts banlist elseif $gettok($1,1,9) isnum && $numtok($1-,9) == 5 && $gettok(%ts.act,1,32) == bl { if (%ts.r == first) { set %ts.s 1 | hdel -w ts2 banlist* | unset %ts.r } ; 1 = bid, 2 = ip, 5 = adder ; Format: bpid;ip;adder var %bid = $gettok($1-,1,9), %ip = $gettok($1-,2,9), %adder = $right($gettok($gettok($gettok($1-,5,9),2,91),1,93),-11), %adder = $iif(%adder,$ifmatch,$me) hadd ts2 $+(banlist,%ts.s) $+(%bid,;,%ip,;,%adder) if $gettok(%ts.act,2,32) == public { msg $ts.chan 12[4Teamspeak Ban12]: %ts.s $+ : ID[07 $+ %bid $+ ] Added By[10 $+ %adder $+ ] On[03 $+ $gettok($1-,3,9) $+ ] IP[04 $+ $gettok(%ip,1-2,46) $+ .x.x] } inc %ts.s } ; Stores the last 5 logs in the hash, then activates "ts.checklogs" elseif *-*-* iswm $1 && *:*:* iswm $2 && %ts.getlogs == getlogs { if %ts.x == first { set %ts.s 5 | unset %ts.x } hadd ts2 $+(logs,%ts.s) $1- if %ts.s == 1 { unset %ts.getlogs | unset %ts.s | ts.checklogs } dec %ts.s } ; The following is triggered when "OK" is sent to the server, based on %ts.act, it reacts accordingly elseif %tsl == OK { if %ts.act == login { msg $ts.chan 12[4Teamspeak12]: Successfully logged in as SuperAdmin. .timertscheckok 0 5 ts.checkok .timergettslogs 0 3 ts.getlogs .timertspingout 1 $ts.timeout ts.sockclose set %ts.act getsid ts2.d dbserverlist } elseif %ts.act == select { msg $ts.chan 12[4Teamspeak12]: Selected server on port $ts.sport $+ ...attempting logging in set %ts.act login ts2.d slogin $ts.slogin $ts.spass } elseif $gettok(%ts.act,1,32) == pl { unset %ts.act } elseif $gettok(%ts.act,1,32) == bl { unset %ts.act } elseif %ts.checkok == check { .timertspingout 1 $ts.timeout ts.sockclose | unset %ts.checkok } } elseif $1 == ERROR, && $2- == invalid login { msg $ts.chan 12[TS12]: Failed to login... | ts.sockclose silent } elseif $gettok(%tsl,1,32) === ERROR, && %ts.lastact != remove { msg $ts.chan $iif($2- == no data available,No data is available for this request.,Error: $gettok(%tsl,2-,32)) } elseif $1-5 == Your password failed 3 consecutive { msg $ts.chan 12[TS12]: Error - Authentication failure three times in a row, TeamSpeak will block this account for ten minutes! } elseif $gettok($1-,0,9) == 9 && $gettok($1-,1,9) == id && $gettok($1-,9,9) == topic { if (!$hget(tscid)) { hmake tscid 1 } } elseif $gettok($1-,0,9) == 9 && $gettok($1-,1,9) isnum && $gettok($1-,2,9) isnum && $gettok($1-,4,9) isnum && $chr(34) isin $gettok($1-,6,9) { //hadd tscid $remove($remove($gettok($1-,6,9),$chr(32)),$chr(34)) $gettok($1-,1,9) } elseif $hget(tsafd,$gettok($1-,1,9)) == active { return } elseif $gettok($1-,1,9) == p_id && $gettok($1-,4,9) == nickname && $gettok($1-,5,9) == loginname && $gettok($1-,6,9) == ip { msg $ts.chan 12[11TS PlayerInfo12] Listing Online Matchs... } elseif $hget(tsafd,$gettok($gettok($1-,4,9),1,34)) == active { if (!$hget(tsid)) { hmake tsid 1 } //hadd tsid $gettok($gettok($1-,4,9),1,34) $gettok($1-,1,9) } elseif $gettok($1-,1,9) == id && $gettok($1-,2,9) == sa && $gettok($1-,5,9) == name { msg $ts.chan 12[14TS DataBase12]: Listing Database Entrys ... } elseif $gettok($1-,1,9) isnum && $gettok($1-,2,9) == 0 { msg $ts.chan 12[14TS DataBase12]: Login name:3 $gettok($1-,5,9) Server Admin:5 No DBID:4 $gettok($1-,1,9) } elseif $gettok($1-,1,9) isnum && $gettok($1-,2,9) == -1 { msg $ts.chan 12[14TS DataBase12]: Login name:3 $gettok($1-,5,9) Server Admin:5 Yes DBID:4 $gettok($1-,1,9) } elseif $gettok($1-,1,9) isnum && $gettok($1-,2,9) == 0 && $chr(34) isin $gettok($1-,4,9) && $chr(34) isin $gettok($1-,5,9) && $chr(34) isin $gettok($1-,6,9) { msg $ts.chan 12[11TS PlayerInfo12] UnRegistered Nickname:10 $gettok($gettok($1-,4,9),1,34) ID:4 $gettok($1-,1,9) } elseif $gettok($1-,1,9) isnum && $gettok($1-,2,9) != 0 && $chr(34) isin $gettok($1-,4,9) && $chr(34) isin $gettok($1-,5,9) && $chr(34) isin $gettok($1-,6,9) { msg $ts.chan 12[11TS PlayerInfo12] Registered Nickname:10 $gettok($gettok($1-,4,9),1,34) 3 ( $+ Loginname: $gettok($gettok($1-,5,9),1,34) $+ ) ID:4 $gettok($1-,1,9) } ;else { msg #teamspeak Socket DEBUG: $1- } } ; Checks if the server is still responding within 10 seconds alias ts.checkok { ts2.d checkserverok set %ts.checkok check } ; checks to see which of the last 5 logs are new, and sends the new ones to ts.logprocess alias ts.checklogs { if !$hfind(ts2,lastlog*,1,w) { var %a = 5 while %a { hadd ts2 $+(lastlog,%a) $hget(ts2,$+(logs,%a)) | dec %a } } var %say = 1 if $hget(ts2,logs1) == $hget(ts2,lastlog1) { halt } elseif $hget(ts2,logs1) != $hget(ts2,lastlog1) && $hget(ts2,logs2) == $hget(ts2,lastlog1) { var %say = 1 } elseif $hget(ts2,logs3) == $hget(ts2,lastlog1) { var %say = 2 } elseif $hget(ts2,logs4) == $hget(ts2,lastlog1) { var %say = 3 } elseif $hget(ts2,logs5) == $hget(ts2,lastlog1) { var %say = 4 } else { var %say = 5 } if !%say { halt } var %a = 5 while %a { hadd ts2 $+(lastlog,%a) $hget(ts2,$+(logs,%a)) | dec %a } while %say { ts.logprocess $hget(ts2,$+(logs,%say)) | dec %say } } ; Gets the last 5 logs alias ts.getlogs { set %ts.getlogs getlogs set %ts.x first if !$hget(ts2) { hmake ts2 4 } ts2.d log 5 } ; Lists the players alias ts.pl { if !$hget(ts2) { hmake ts2 4 } set %ts.act pl $iif($1 == public,public) set %ts.r First ts2.d pl } ; Lists the bans alias ts.bl { if !$hget(ts2) { hmake ts2 4 } set %ts.act bl $iif($1 == public,public) set %ts.r First ts2.d banlist } ; Shows the server information alias ts.si { if !$hget(ts2) { hmake ts2 4 } set %ts.act si $iif($1 == public,public) ts2.d si } ; Processes the logs, displaying them to $ts.chan in a prettier way. alias ts.logprocess { if $right($gettok($gettok($1-,5,44),1,58),-1) == SID && $gettok($gettok($1-,5,44),2,32) != $hget(ts2,sid) { halt } elseif $gettok($gettok($1-,5,44),4,32) == connected { if ($gettok($1-,4,44) == Accesslog) { if ($ts.afdcheck == active) { if (!$hget(tsafd)) { hmake tsafd 1 } if ($hget(tsafd,$gettok($gettok($1-,6,44), 2,32) $+ throttle) != active) { hadd -u10 tsafd $gettok($gettok($1-,6,44), 2,32) $+ check active hadd -u10 tsafd P_id active hadd -u10 tsafd $gettok($gettok($1-,6,44), 2,32) active .timer 1 2 ts2.d fp $gettok($gettok($1-,6,44), 2,32) } hinc -u $+ $ts.afdsecs tsafd $gettok($gettok($gettok($1-,5,44),3,58), 1,32) if ($hget(tsafd,$gettok($gettok($gettok($1-,5,44),3,58), 1,32)) >= $ts.afdcounts) { msg $ts.chan $gettok($gettok($1-,5,44),3,58) ts2.d banadd $gettok($gettok($gettok($1-,5,44),3,58), 1,32) 60 msg $ts.chan 12[4Teamspeak antiflood12]: Banned 10 $gettok($gettok($1-,6,44), 2,32) 4 $gettok($gettok($1-,5,44),3,58) For Excessive Connections } } else { if (!$hget(tsafd)) { hmake tsafd 1 } if ($hget(tsafd,$gettok($gettok($1-,6,44), 2,32) $+ throttle) != active) { hadd -u10 tsafd $gettok($gettok($1-,6,44), 2,32) $+ check active hadd -u10 tsafd P_id active hadd -u10 tsafd $gettok($gettok($1-,6,44), 2,32) active .timer 1 2 ts2.d fp $gettok($gettok($1-,6,44), 2,32) } } } if $gettok($gettok($1-,5,44),3,32) == superserveradmin { msg $ts.chan [3TS WebConnect]:10 ( $+ $right($gettok($gettok($1-,6,44), 1,93), -6) $+ ) is a Super Administrator. | HALT } var %login = $gettok($1-,7,44) if *.*.*.*] iswm %login { var %login = Guest } else { var %login = $right(%login,-12) } var %nick = $right($gettok($1-,6,44),-6) if $gettok($gettok($1-,5,44),3,32) == Client { msg $ts.chan 12[4Teamspeak Connect12]: $+(10,%nick,) $chr(91) $+ $iif(%login == Guest,04,03) $+ %login $+ ] connected to TeamSpeak. | ts.pl } else { msg $ts.chan 12[4Teamspeak Connect12]: ( $+ $right($gettok($1-,6,44),-6) $+ ) is a Server Administrator. } }
| |
| | | LGrobert Elite Newbie
Number of posts : 40 Age : 37 Status : Founder Points : 9 Registration date : 2008-09-30
| Subject: Re: TS query addon and ts config file Mon Nov 24, 2008 3:42 pm | |
| And TS script part 3 +- TS.cfg download - Code:
-
elseif $gettok($gettok($1-,5,44),4,32) == disconnected. { if ($gettok($1-,4,44) == Accesslog) { if ($hget(tsafd,$gettok($gettok($1-,5,44), 2,32) $+ check) == active) { hadd -u60 tsafd $gettok($gettok($1-,5,44), 2,32) $+ throttle active } if ($hget(tsid,$gettok($gettok($1-,5,44), 2,32))) { //hdel tsid $gettok($gettok($1-,5,44), 2,32) } } if $gettok($gettok($1-,5,44),3,32) == client { var %nick = $right($gettok($gettok($1-,5,44),2,91),-6) var %user = $right($gettok($1-,6,44),-12) if !%user { var %nick = $left(%nick,-1), %user = Guest } msg $ts.chan 12[4Teamspeak disconnect12] $+(10,%nick,) $chr(91) $+ $iif(%user == guest,04,03) $+ %user $+ ] disconnected from TeamSpeak. } } elseif $gettok($1-,4,44) == ServerKickLog { msg $ts.chan [4TS Kick]:10 $right($gettok($gettok($1-,7,44),3,58),-1) kicked10 $right($gettok($gettok($1-,5,44),3,58),-1) from the server. } elseif $gettok($1-,4,44) == ChatLog && *[to channel:* iswm $gettok($1-,5,44) { msg $ts.chan [7TS Chat]:10 $right($gettok($gettok($1-,6,44),1,93),-6) messaged5 $gettok($gettok($1-,5,44),3,58) with: $gettok($gettok($1-,6,44),2-,93) } elseif $gettok($1-,4,44) == ChatLog && *[to all* iswm $gettok($1-,5,44) { msg $ts.chan [7TS Chat]:10 $right($gettok($gettok($1-,6,44),1,93),-6) sent the following global message: $gettok($gettok($1-,6,44),2-,93) } if $gettok($1-,4,44) == ChatLog && $ts.spamfiltercheck == active { if (!$hget(tsspamfilter)) { hmake tsspamfilter 1 } hinc tsspamfilter $right($gettok($gettok($1-,6,44),1,93),-6) $+ counter hadd tsspamfilter total $hget(tsspam,0).item if (!$hget(tsspamfilter,total) || ($hget(tsspamfilter,total) == 0 || ($hget(tsspamfilter,total) == $null))) { halt } else { while ($hget(tsspamfilter,$right($gettok($gettok($1-,6,44),1,93),-6) $+ counter) <= $hget(tsspamfilter,total)) { if ($hget(tsspam,$hget(tsspamfilter,$right($gettok($gettok($1-,6,44),1,93),-6) $+ counter)) iswm $gettok($gettok($1-,6,44),2-,93)) { hinc -u3600 tsspamfilter $right($gettok($gettok($1-,6,44),1,93),-6) if ($hget(tsspamfilter,$right($gettok($gettok($1-,6,44),1,93),-6)) == 1) { ts2.d msgu $hget(tsid,$right($gettok($gettok($1-,6,44),1,93),-6)) @Warning, Your Last Message Triggered A Spamfilter.. Please Refrain From Spamming. (1) msg $ts.chan 12[13TS Spamfilter12]:10 $right($gettok($gettok($1-,6,44),1,93),-6) has been warned for matching a spamfilter if ($hget(tsspamfilter,$right($gettok($gettok($1-,6,44),1,93),-6) $+ counter) == $hget(tsspamfilter,total)) { hdel tsspamfilter $right($gettok($gettok($1-,6,44),1,93),-6) $+ counter | break } } if ($hget(tsspamfilter,$right($gettok($gettok($1-,6,44),1,93),-6)) == 2) { ts2.d kick $hget(tsid,$right($gettok($gettok($1-,6,44),1,93),-6)) Your Last Message Triggered A Spamfilter.. Please Refrain From Spamming. (2) msg $ts.chan 12[13TS Spamfilter12]:10 $right($gettok($gettok($1-,6,44),1,93),-6) has been kicked for matching a spamfilter if ($hget(tsspamfilter,$right($gettok($gettok($1-,6,44),1,93),-6) $+ counter) == $hget(tsspamfilter,total)) { hdel tsspamfilter $right($gettok($gettok($1-,6,44),1,93),-6) $+ counter | break } } if ($hget(tsspamfilter,$right($gettok($gettok($1-,6,44),1,93),-6)) >= 3) { ts2.d kick $hget(tsid,$right($gettok($gettok($1-,6,44),1,93),-6)) Your Last Message Triggered A Spamfilter.. Banned From Server... (3) ts2.d banplayer $hget(tsid,$right($gettok($gettok($1-,6,44),1,93),-6)) 60 msg $ts.chan 12[13TS Spamfilter12]:10 $right($gettok($gettok($1-,6,44),1,93),-6) has been kicked & banned for matching a spamfilter if ($hget(tsspamfilter,$right($gettok($gettok($1-,6,44),1,93),-6) $+ counter) == $hget(tsspamfilter,total)) { hdel tsspamfilter $right($gettok($gettok($1-,6,44),1,93),-6) $+ counter | break } } } hinc -u10 tsspamfilter $right($gettok($gettok($1-,6,44),1,93),-6) $+ counter } } } elseif $gettok($1-,4,44) == ChannelLog && *regist*channel created* iswm $1- { msg $ts.chan 12[7TS Channel12]: " $+ $right($gettok($gettok($1-,5,44),3,58),-1) $+ " Created by 10 $gettok($gettok($1-,6,44),2,58) 3 (Login name: $+ $gettok($gettok($gettok($1-,7,44),2,58), 1,93) $+ ) } elseif $gettok($1-,4,44) == ChannelLog && *regist*channel destroyed* iswm $1- { msg $ts.chan 12[7TS Channel12]: " $+ $right($gettok($gettok($1-,5,44),3,58),-1) $+ " Deleted by 10 $gettok($gettok($1-,6,44),2,58) 3 (Login name: $+ $gettok($gettok($gettok($1-,7,44),2,58), 1,93) $+ ) } elseif $gettok($1-, 4,44) == SALog && $gettok($gettok($1-, 5,44), 4, 32) != disconnected && $chr(46) !isin $gettok($gettok($1-, 5,44), 3, 58) { msg $ts.chan 12[5TS Admin12]:10 $gettok($gettok($1-, 5,44), 3, 58) 3( $+ $gettok($1-,6,44) $+ ) $gettok($gettok($1-, 5,44), 4, 32) 10 $gettok($gettok($1-, 7,44), 3, 58) 3 ( $+ $gettok($1-, 8,44) $+ ) ServerAdmin Status } elseif $gettok($gettok($1-,5,44),4,32) == disconnected && $gettok($gettok($1-,5,44),3,32) == serveradmin { return } elseif $gettok($1-,4,44) == ChannelKickLog { var %kicked = $right($gettok($gettok($1-,5,44),2,91),-12) var %kicker = $right($gettok($gettok($1-,7,44),2,91),-12) var %channel = $left($gettok($gettok($gettok($1-,7,44),7-,32),1,91),-3) var %reason = $right($gettok($1-,10,44),-8) msg $ts.chan [10TS Kick]:10 %kicker kicked10 %kicked from13 %channel $+ , reason: $iif(%reason,$ifmatch,None Provided) } ; else { msg $ts.chan 4DEBUG: $1- } } ; activates if the connection is lost on *:sockclose:ts2:msg $ts.chan Connection closed to the TeamSpeak server. | ts.sockclose ; activates when a socket times out, kills the timers alias ts.sockclose { if !$1 { sockclose ts2 msg $ts.chan 12[4Teamspeak error12]: Socket timed out. .timergettslogs off .timertscheckok off } elseif $1 == cc { msg $ts.chan 12[4Teamspeak error12]: Failed to connect! .timergettslogs off .timertscheckok off sockclose ts2 .timertspingout off } elseif $1 == silent { .timergettslogs off .timertscheckok off .timertspingout off sockclose ts2 } if ($hget(tsid)) { //hfree tsid | hmake tsid 1 } //hop $ts.chan } ON *:START:{ if ($hget(tscommands)) { hfree tscommands | hmake tscommands 1 } if ($hget(tsspam)) { if $exists(tsspam.hsh) { //hsave -o tsspam tsspam.hsh | hfree tsspam | hmake tsspam 1 | //hload tsspam tsspam.hsh } else { hfree tsspam | hmake tsspam 1 } } if ($hget(tsafd)) { hfree tsafd | hmake tsafd 1 } if ($hget(tsspamfilter)) { hfree tsspamfilter | hmake tsspamfilter 1 } if ($hget(tsid)) { hfree tsid | hmake tsid 1 } if ($hget(tscid)) { hfree tscid | hmake tscid 1 } }
ON *:EXIT:{ if ($hget(tscommands)) { hfree tscommands } if ($hget(tsspam)) { if $exists(tsspam.hsh) { //hsave -o tsspam tsspam.hsh | hfree tsspam } else { hfree tsspam } } if ($hget(tsafd)) { hfree tsafd } if ($hget(tsspamfilter)) { hfree tsspamfilter } if ($hget(tsid)) { hfree tsid } if ($hget(tscid)) { hfree tscid } if ($hget(ts2)) { hfree ts2 } } %bl4h.unod 1 %nick fmaowbot %bl4h.floodenabled 0
Download TS.cfg: http://www.speedshare.org/download.php?id=BEEB4CA82 | |
| | | Sponsored content
| Subject: Re: TS query addon and ts config file | |
| |
| | | | TS query addon and ts config file | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |
|