SHARE
TWEET

Rcon Tracker

intersys Feb 16th, 2018 163 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;;;Counter Strike 1.6 Server Rcon Tracker;;;
  2. ;;;By interSys;;;
  3.  
  4. ;;;;Dialog;;;;
  5.  
  6. alias RTrack $iif(!$dialog(RTrack),dialog -m RTrack RTrack,echo -a 04Error! 14The dialog already open ...)
  7. dialog RTrack {
  8.   title "Rcon Tracker"
  9.   size -1 -1 253 330
  10.   option dbu
  11.   text "Rcon Tracker By interSys", 1, 87 3 80 8, disable center
  12.   text "SteamID:", 2, 10 22 26 8, center
  13.   edit "", 3, 38 21 75 10
  14.   button "Search", 4, 114 21 50 10
  15.   text "Previous Nicknames", 5, 16 62 55 8, center
  16.   list 6, 8 73 76 72, size vsbar
  17.   edit "SteamID Status", 7, 10 43 156 10, disable read center
  18.   text "Previous ips", 8, 102 62 44 8, center
  19.   list 9, 86 73 76 72, size vsbar
  20.   button "Remove all the tracks", 10, 8 148 236 10
  21.   text "Date And Time", 12, 180 62 39 8, center
  22.   list 13, 165 73 76 72, size vsbar
  23.   box "", 14, 4 14 166 42
  24.   box "", 15, 4 55 245 109
  25.   box "Blacklist Panel Control", 16, 4 167 245 119
  26.   list 17, 8 195 188 70, size
  27.   text "SteamID:", 11, 9 180 26 8, center
  28.   edit "", 18, 38 178 75 10
  29.   button "Search", 19, 118 178 39 10
  30.   button "Add Blacklist", 20, 198 196 46 12
  31.   button "Remove Blacklist", 21, 198 215 47 12
  32.   button "Clear Blacklist", 23, 198 234 47 12
  33.   button "Show all Blacklist", 24, 9 269 76 12
  34.   button "Clear Blacklist Window", 25, 88 269 76 12
  35.   button "Clear windows", 26, 88 33 76 9
  36.   button "Open tracks file", 27, 10 33 76 9
  37.   box "Search steamid by nick/ip", 28, 171 14 78 42
  38.   edit "", 29, 174 23 73 10
  39.   button "Search", 30, 174 34 73 9
  40.   edit "status win", 31, 174 44 73 10, read autohs center
  41.   box "Rcon Command", 32, 4 286 245 40
  42.   text "Send rcon command to the server:", 33, 8 299 84 8
  43.   edit "", 34, 95 298 150 10
  44.   button "Send ", 35, 10 312 234 10
  45.   button "Open blacklist file", 22, 198 252 47 12
  46. }
  47.  
  48. on *:dialog:RTrack:*:*:{
  49.   if ($devent == init) {
  50.     showblist
  51.   }
  52.   if ($devent == sclick) {
  53.     if ($did = 4) {
  54.       did -r $dname 6,9,13,7
  55.       if ($ini(Tracks.ini,$did($dname,3).text) == 0) { did -a $dname 6,7,9,13 The SteamID not found! }
  56.       else {
  57.         did -a $dname 7 Last connection from the user was in $readini(Tracks.ini,$did($dname,3).text,$+(Date,$var($+(%,$did($dname,3).text),1).value))) $&
  58.           - $readini(Tracks.ini,$did($dname,3).text,$+(time,$var($+(%,$did($dname,3).text),1).value)))
  59.         var %x = 1
  60.         while (%x <= $var($+(%,$did($dname,3).text),1).value) {
  61.           did -a $dname 6 $+(Nick,%x,:) $readini(Tracks.ini,$did($dname,3).text,$+(nick,%x))
  62.           did -a $dname 9 $+(IP,%x,:) $readini(Tracks.ini,$did($dname,3).text,$+(IP,%x))
  63.           did -a $dname 13 $+(%x,:) $readini(Tracks.ini,$did($dname,3).text,$+(Date,%x)) - $readini(Tracks.ini,$did($dname,3).text,$+(time,%x))
  64.           inc %x
  65.         }
  66.       }
  67.     }
  68.     elseif ($did = 26) { did -r $dname 6,9,13,7 | did -a $dname 7 SteamID Status }
  69.     elseif ($did = 10) { did -r $dname 6,9,13,7 | did -a $dname 7 All the tracks removed, You can find them in recycle bin for restore. | remove -b Tracks.ini }
  70.     elseif ($did = 27) { run Tracks.ini }
  71.     elseif ($did = 22) { run Blacklist.ini }    
  72.     elseif ($did = 19) {
  73.       if ($ini(Blacklist.ini,$did($dname,18).text) == 1) {
  74.         did -ra $dname 17 Nick: $readini(blacklist.ini,$did($dname,18).text,Nick) $chr(124) SteamID: $did($dname,18).text $chr(124) Reason: $readini(blacklist.ini,$did($dname,18).text,Reason)
  75.       }
  76.       else { did -ra $dname 17 SteamID Not Found! }
  77.     }
  78.     elseif ($did = 30) { did -ra $dname 31 $iif($srcsid($did($dname,29).text) != $false,$srcsid($did($dname,29).text),SteamID Not Found!) }
  79.     elseif ($did = 20) {
  80.       var %stmid = $$?="Enter a SteamID:" | if (%stmid) { var %nck = $$?="Enter a Nickname:" |  if (%nck) { var %rsn = $$?="Enter a Reason:"
  81.           writeini -n Blacklist.ini %stmid Nick %nck
  82.           writeini -n Blacklist.ini %stmid Reason %rsn
  83.           echo -ag $+(04,%nck,01) added to the blacklist with the steamid: $+(04,%stmid,01,$chr(44)) and the reason: $+(04,%rsn,01,.)
  84.         }
  85.       }
  86.     }
  87.     elseif ($did = 21) {
  88.       if ($did($dname,17).sel) {
  89.         noop $regex($did($dname,17).seltext,/SteamID:(.+)\|/i)
  90.         .remini -n blacklist.ini $regml(1)
  91.         echo -ag $+(04,$regml(1),01) has Removed Succsesfuly!
  92.         showblist
  93.       }
  94.       elseif (!$did($dname,17)) {
  95.         var %x = $$?="Enter the SteamID of the user:"
  96.         if ($ini(blacklist.ini,%x)) { remini -n blacklist.ini %x | echo -ag $+(04,%x,01) has Removed Succsesfuly! | showblist }
  97.         else { echo -ag $+(04,%x,01) has Not Found! }
  98.       }
  99.     }
  100.     elseif ($did = 25) { did -ra $dname 17 }
  101.     elseif ($did = 24) { showblist }
  102.     elseif ($did = 35) { rcon $did(34) }
  103.   }
  104.   if ($devent == dclick) {
  105.     if ($did = 6) { noop $regex($did($dname,6).seltext,/Nick([\d]):(.+)/i) | clipboard $regml(2) | echo -s $+(04,$cb,01) copied to you clipboard. }
  106.     elseif ($did = 9) { noop $regex($did($dname,9).seltext,/IP([\d]):(.+)/i) | clipboard $regml(2) | echo -s $+(04,$cb,01) copied to you clipboard. }
  107.     elseif ($did = 13) { noop $regex($did($dname,13).seltext,/([\d]):(.+)/i) | clipboard $regml(2) | echo -s $+(04,$cb,01) copied to you clipboard. }
  108.   }
  109. }
  110. alias showblist {
  111.   did -r RTrack 17
  112.   var %i = 1
  113.   while ($ini(blacklist.ini,%i)) {
  114.     did -a RTrack 17 Nick: $readini(blacklist.ini,$ifmatch,Nick) $chr(124) SteamID: $ini(blacklist.ini,%i) $chr(124) Reason: $readini(blacklist.ini,$ifmatch,Reason)
  115.     inc %i
  116.   }
  117. }
  118. alias srcsid {
  119.   if ($regex($read(tracks.ini,w,$+(*,$1,*)),/(.+?)=(.+)/g)) {
  120.     var %x = 1
  121.     while ($ini(tracks.ini,%x)) {
  122.       if ($readini(tracks.ini,$ifmatch,$regml(1)) == $regml(2)) {
  123.         return $ini(tracks.ini,%x)
  124.       }
  125.       inc %x
  126.     }
  127.   }
  128.   else return $false
  129. }
  130. ;;;;Get Rcon Logs;;;;
  131.  
  132. alias challengercon {
  133.   sockudp -k rcon $gettok(%iport,1,58) $gettok(%iport,2,58) ÿÿÿÿChallenge Rcon
  134.   window @kills
  135.   window @joined
  136.   window @Console
  137.   window @say
  138. }
  139. alias getchall {
  140.   var %i = 1
  141.   while ($mid($mid($1-,%i,1),1) != $null) {
  142.     if ($v1 isnum) { var %c = %c $+ $v1 }
  143.     inc %i
  144.   }
  145.   return %c
  146. }
  147. on *:udpread:rcon:{
  148.   sockread &t | breplace &t 0 254 32 160
  149.   tokenize 160 $bvar(&t,1-).text
  150.   if ($getchall($1-) isnum) {  
  151.     set %challnum $getchall($1-)
  152.     echo -a %challnum
  153.   }
  154.   rcon logaddress $ip 1337
  155.   sockclose rcon
  156. }
  157.  
  158. alias rcon {
  159.   sockudp rcon.cmd $gettok(%iport,1,58) $gettok(%iport,2,58) ÿÿÿÿrcon %challnum $+(",%SRcon,") $1-
  160. }
  161.  
  162. ;/startrcon <port>
  163. alias startrcon {
  164.   sockudp -k rcon.cmd 1337
  165.   challengercon
  166. }
  167. on *:UDPREAD:rcon.cmd:{
  168.   sockread &x | breplace &x 0 254 32 160
  169.   tokenize 160 $bvar(&x,1-).text
  170.   var %action = $gettok($gettok($1-,3,34),1,32), %steamid = $gettok($gettok($1-,3,$asc(<)),1,$asc(>)), %userid = $gettok($gettok($1-,2,$asc(<)),1,$asc(>))
  171.   var %nick = $gettok($gettok($1-,2,$asc(")),1,$asc(<)), %team = $iif($gettok($gettok($1-,4,$asc(<)),1,$asc(>)) == CT,12CT,4T)
  172.  
  173.   if (%action == say) {
  174.     aline @say Nick: %nick (USERID: %userid STEAMID: %steamid TEAM: %team $+ ) said: $gettok($1-,4,$asc("))
  175.   }
  176.   elseif (%action == killed) {
  177.     aline @kills Nick: %nick (USERID: %userid STEAMID: %steamid TEAM: %team $+ ) killed $gettok($gettok($1-,4,$asc(")),1,$asc(<)) $&
  178.       (USERID: $gettok($gettok($1-,5,$asc(<)),1,$asc(>)) STEAMID: $gettok($gettok($1-,6,$asc(<)),1,$asc(>)) $&
  179.       TEAM: $iif($gettok($gettok($1-,7,$asc(<)),1,$asc(>)) == CT,12CT,4T) $+ ) Gun: $gettok($1-,6,$asc("))
  180.   }
  181.   elseif (%action == connected,) {
  182.     noop $regex($1-,/address "(.+?):/i)
  183.     aline @joined Nick: %nick (USERID: %userid STEAMID: %steamid TEAM: None) Connected with address $regml(1)
  184.     set $+(%,%steamid) $iif($+(%,%steamid), $calc($+(%,%steamid) +1), 1)
  185.     writeini -n Tracks.ini %steamid IP $+ $var($+(%,%steamid),1).value $regml(1)
  186.     writeini -n Tracks.ini %steamid Date $+ $var($+(%,%steamid),1).value $date
  187.     writeini -n Tracks.ini %steamid Time $+ $var($+(%,%steamid),1).value $time
  188.     writeini -n Tracks.ini %steamid Nick $+ $var($+(%,%steamid),1).value %nick
  189.   }
  190.   elseif (%action == entered) {
  191.     if ($ini(blacklist.ini,%steamid)) {
  192.       rcon kick %nick
  193.       rcon admin_command admin_kick %steamid
  194.       rcon admin_command admin_ssay [AUTOKICK] %nick ( $+ %steamid $+ ) blacklist user.
  195.     }
  196.     aline @joined Nick: %nick (USERID: %userid STEAMID: %steamid TEAM: None $+ ) Entered the game
  197.   }
  198.   elseif (%action == joined) {
  199.     aline @joined nick: %nick (USERID: %userid STEAMID: %steamid TEAM: %team $+ ) Joined team %team
  200.   }
  201.   elseif ($gettok($1-,6,32) == World) {
  202.     $iif($gettok($1-,2,34) == Round_Start,aline @Console New Round started!,$iif($gettok($1-,2,34) == Round_End,aline @Console End of New ROUND))
  203.   }
  204.   else {
  205.     aline @Console $1-
  206.   }
  207. }
  208.  
  209. ;;;;Menu;;;;
  210. menu * {
  211.   Rcon Tracks: RTrack
  212.   Set Server IPort: Set %IPort $$?="Type The Server ip and the port"
  213.   Set Server Rcon Password: Set %SRcon $$?="Type The Server Rcon Password"
  214. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top