All pastes #521905 Raw Edit

Untitled

public text v1 · immutable
#521905 ·published 2007-05-30 09:18 UTC
rendered paste body
on *:TEXT:!banbot:%pc:{
  .notice $nick 4,1--- 5#SurrealHosting0 Banbot System 4---
  .notice $nick 4,1--- BanBot Still being made ---
  .halt
}

on *:TEXT:!creator:%pc:{
  .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,$me was made by coNNect) 
  .halt
}


on *:TEXT:!map *:%pc:{
  if ( %pugging = 1 ) {
    if ( $nick isin %pugstring ) || ( $nick isop $chan ) {
      if ( $2 isin %maps ) {
        .rcon changelevel $2 
        .describe %pc map changed to $2 by $nick
        .halt
      }
      if ( $2 !isin %maps ) {
        .describe %pc no such map.
        .halt
      }
    }
    else {
      .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,You lack access to use this command!)
      .halt
    }
  }
  else {
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,There is no pug currently on (!pug)) 
    .halt
  }
}
on *:TEXT:!pug:%pc:{
  if (%disable = 1) {
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,The Pug is currently disabled!) 
    .halt
  }
  if (%pugging = 1) {
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,The Pug has already started (!join)) 
    .halt
  }
  if ($nick isin %pugstring) {
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,You are already a admin of this pug!) 
    .halt 
  }
  if ($nick isin %warmestring) { 
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,You are already in the pug) 
    .halt 
  } 
  {
    .unset %pugstring
    .describe %pc map is de_dust2
    .set %pug.address $address($nick,2)  
    .set %pug.ban 15
    .inc -z %pug.ban 1
    .mod
    .set %admin.quit 1    
    .inc -c %admin.quit 1
    .unset %warmestring
    .unset %admin.pw
    .unset %team.CT
    .unset %team.T
    .set %rcon.says 0
    .set %teams.on 0 
    .unset %rcon.admin
    .set %admin.on 0
    .set %pugstring $nick
    .timer11 1 5400 .endpug
    .timer12 1 5400 .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,The Pug has been ended because of a 30 minute timeout (!pug)) 
    .timer12 1 120 .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,A pug has started !join to join it!) 
    .mode %pc +v $nick
    .set %pugging 1
    ;-- End 
    .set %pw $read(pw.txt)
    .set %admin.pw $read(adminpw.txt) 
    .set %map de_dust2
    .rcon map de_dust2
    .rcon sv_password %pw
    .topicstart
  }
  else {
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,You are already in the pug) 
  }
}

on *:TEXT:!pug *:%pc:{
  if (%disable = 1) {
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,The Pug is currently disabled!) 
    .halt
  }
  if (%pugging = 1) {
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,The Pug has already started (!join)) 
    .halt
  }
  if ($nick isin %pugstring) {
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,You are already a admin of this pug!) 
    .halt 
  }
  if ($2 isin %maps) {
    .set %map $2
    .rcon map $2
    .describe %pc map is $2
  }
  else { 
    .describe %pc invalid map
    .halt
  }
  if ($nick isin %warmestring) { 
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,You are already in this pug!) 
    .halt 
  } 
  {
    .unset %pugstring
    .mod
    .set %pug.address $address($nick,2)  
    .set %pug.ban 15
    .inc -z %pug.ban 1
    .set %admin.quit 1    
    .inc -c %admin.quit 1
    .unset %warmestring
    .unset %admin.pw
    .unset %team.CT
    .unset %team.T
    .set %rcon.says 0
    .set %teams.on 0 
    .unset %rcon.admin
    .set %admin.on 0
    .set %pugstring $nick
    .timer11 1 5400 .endpug
    .timer12 1 5400 .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,The Pug has been ended because of a 30 minute timeout (!pug)) 
    .timer12 1 120 .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,A pug has started !join to join it!) 
    .mode %pc +v $nick
    .set %pugging 1
    ;-- End 
    .set %pw $read(pw.txt)
    .set %admin.pw $read(adminpw.txt) 
    .rcon sv_password %pw
    .topicstart
  } 
  else {
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,You are already in this pug!) 
  }
}

on *:TEXT:!join:%pc:{
  if ($nick isin %pugstring) { 
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,You are already a admin of this pug!) 
    .halt
  }
  if ($numtok(%warmestring,59) = 9) { 
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,Sorry no more room in the pug for you!) 
    .halt
  } 
  if (%full == 1) { 
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,There is a pug in progress) 
    .halt
  } 
  if ($nick isin %warmestring) {
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,You are already in this pug!) 
    .halt
  } 
  if (%pugging == 0) { 
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,There is no pug in progress (!pug)) 
    .halt
  } 
  if ($nick !isin %warmestring) {
    %warmestring = $addtok(%warmestring, $nick, $asc(;))
    .mode %pc +v $nick
    .settopic
    .msg $chan %playernum
    .set %teams.on 0
    .ignore -u3 $nick
  }
  else {
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,You are already in this pug!) 
  }
  if ($gettok(%warmestring,0,59) == %modeplayer) {
    .mod
    .timer11 off
    .timer12 off
    .timer13 off
    .topicingame
    .rcon sv_restartround 1
    .set %rcon.says 0
    .set %teams.on 1 
    .set %full 1    
    .set %half.1 1
    .sorttok
    if (%mode = 5) {
      .set %team.CT 10 $gettok(%pugstring,1,59) 2 $gettok(%warmestring,5,59) 10 $gettok(%warmestring,3,59) 2 $gettok(%warmestring,8,59) 10 $gettok(%warmestring,9,59) 
      .set %team.T 5 $gettok(%warmestring,1,59) 4 $gettok(%warmestring,2,59) 5 $gettok(%warmestring,4,59) 4 $gettok(%warmestring,6,59) 5 $gettok(%warmestring,7,59) 
      .set %team.CT.rcon $gettok(%pugstring,1,59) $gettok(%warmestring,5,59) $gettok(%warmestring,3,59) $gettok(%warmestring,8,59) $gettok(%warmestring,9,59) 
      .set %team.T.rcon $gettok(%warmestring,1,59) $gettok(%warmestring,2,59) $gettok(%warmestring,4,59) $gettok(%warmestring,6,59) $gettok(%warmestring,7,59) 
    }
    if (%mode = 3) {
      .set %team.CT 10 $gettok(%pugstring,1,59) 2 $gettok(%warmestring,5,59) 10 $gettok(%warmestring,3,59) 
      .set %team.T 5 $gettok(%warmestring,1,59) 4 $gettok(%warmestring,2,59) 5 $gettok(%warmestring,4,59) 
      .set %team.CT.rcon $gettok(%pugstring,1,59) $gettok(%warmestring,5,59) $gettok(%warmestring,3,59) 
      .set %team.T.rcon $gettok(%warmestring,1,59) $gettok(%warmestring,2,59) $gettok(%warmestring,4,59)  
    }
    .msg $chan 2CT: %team.CT
    .msg $chan 4T: %team.T
    .adminnotice
    .playernotice
  }
}

on *:QUIT: {
  if ($nick == %pugstring) && (%teams.on != 1) {
    .devoice
    .endpug
  } 
  if ($nick isin %warmestring) {
    if (%full == 1) { halt }
    %warmestring = $remtok(%warmestring,$nick, $asc(;)) 
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>, $+ $nick $+  has left the pug %sepright $+ $calc($numtok(%warmestring,59) + $numtok(%pugstring,59)) $+ %col.1 $+ / $+ %col.2 $calc(%mode + %mode) $+ %sepleft)
    .unset %team.CT
    .unset %team.T
    .set %teams.on 0 
  }
} 


on *:NICK: {
  if ($nick isin %pugstring) {
    %pugstring = $remtok(%pugstring, $nick, $asc(;))
    %pugstring = $addtok(%pugstring, $newnick, $asc(;))
  }
  if ($nick isin %warmestring) {
    %warmestring = $remtok(%warmestring, $nick, $asc(;))
    %warmestring = $addtok(%warmestring, $newnick, $asc(;))
  }
}



on *:PART:%pc:{
  if (%full == 1) { 
    .halt
  } 
  if ($nick isin %pugstring) && (%pug.ban >= 1) {
    .endpug     
    .set %pug.ban.mask $mask(%pug.address,3)
    .ban -u3600 %pc %pug.ban.mask 
    .unset %pugstring
  } 
  if ($nick isin %pugstring) {
    .endpug
  }
  if ($nick isin %warmestring) && (%teams.on != 1) {
    %warmestring = $remtok(%warmestring,$nick, $asc(;)) 
    .settopic
    .msg $chan $nick has left the pug %playernum
    .unset %team.CT
    .unset %team.T
    .set %teams.on 0 
  }
} 

on *:KICK:%pc: {
  if ($knick isin %pugstring) {
    .endpug
  } 
  if ($knick isin %warmestring) {
    %warmestring = $remtok(%warmestring,$knick, $asc(;)) 
    settopic
    msg %pc 15,1[4 $knick 15has left the pug - Type 4!join0 to play15] %playernum
  } 
}


on *:TEXT:!extra:%pc: {
  if (%extra != 1) { halt }
  if (%extra == 1) {
    .set %nick $nick
    .passnotice
    .set %extra 0
    .unset %nick
    .rcon say ***!Get accepted. Player joining. ***
  }
}

on *:TEXT:!endpug:%pc: { 
  if (%pugging = 0) {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,There is no pug running!) 
    .halt
  }
  if ($nick !isin %pugstring) && ($nick !isop $chan ) {
    .notice $nick $skin $replace(%skin,<cmd>,PUG,<info>,You are not a admin of this pug!) 
    .halt
  }
  if ($nick isin %pugstring) && (%pug.ban >= 1) {
    .set %pug.ban.mask $mask(%pug.address,2)
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,Banning $nick $+ ; Starting a pug/ending a pug within 15 seconds!) 
    .ban -u3600 %pc %pug.ban.mask 
    .kick $chan $nick Read the %pc AUP!
    .endpug
    .halt
  } 
  if ($nick isin %pugstring) || ($nick isop $chan) {
    .rcon say Pug ended. Idle %pc !
    .endpug
    .halt
  }
}


on *:TEXT:!override *:%pc:{
  if ($nick isop $chan) {
    if ($2 isin %warmestring) {
      .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>, $+ $2 $+  is now admin (!status))
      %warmestring = $addtok(%warmestring,%pugstring,59)
      %warmestring = $remtok(%warmestring,$2,59)
      .set %pugstring $2
      .topic
    }
    else { 
      .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,$2 is not in the pug)
      .halt
    }
  }
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}


on *:TEXT:!teams:%pc: { 
  if (%pugging = 1) {
    .if (%teams.on == 0) { 
      .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,There is no pug in progress! (!pug))
      .halt 
    }
    .msg $chan 2CT: %team.CT
    .msg $chan 4T: %team.T
    .ignore -u4 $nick
  }
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,There is no pug in progress!)
    .halt
  }
}

on *:TEXT:!details:%pc:{ 
  if (%teams.on == 1) {
    if ($nick isin %warmestring) {
      .set %nick $nick
      .passnotice
      .unset %nick
    }
    if ($nick isin %pugstring) || ($nick isop $chan) {
      .adminnotice
    }
  }
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,A pug has not yet been filled (!join))
    .halt
  }
}

on 1:CONNECT: {
  .as auth SurrealHosting sopeter123
  .set %rcon.ip $ip(%rcon.ip.port)
  .set %rcon.port $port(%rcon.ip.port)
  .set %rcon.scorebotchan %pc
  .set %pugbot.channel %pc
  .set %scorebot 0
  .timer 1 3 /join %pc
  .rconoff
  .rconon  
  .settopic
  .window -ae @rcon
}

on 1:EXIT: {
  .rconoff
  .save -rv vars.ini
}

on 1:DISCONNECT: {
  .set %rcon.scorebot 0
  .set %scorebot 0
  .set %rcon.says 0
  .set %pugging 0 
  .endpug
  .unset %warmestring
  .unset %pugstring
  .unset %rcon.admin
  .unset %admin.on
  .unset %admin.pw
  .unset %team.CT
  .unset %team.T
  .set %teams.on 0 
  .rcon off
}

on *:START: {
  .load -rv vars.ini
  .window -ae @rcon
  .rconoff
  .rconon
  .set %maps de_dust2 de_inferno de_nuke de_train de_aztec de_cbble de_cpl_mill
  .set %mode 5
  .set %modeplayer 9
}

alias startit {
  /load -rv vars.ini
  /window -ae @rcon
  rconoff
  rconon
  set %maps de_dust2 de_inferno de_nuke de_train de_aztec de_cbble de_cpl_mill
  set %mode 5
  set %modeplayer 9
}


on *:TEXT:!leave:%pc: { 
  if ($nick !isin %warmestring) { .notice $nick You are not in the list! | halt } {
    %warmestring = $remtok(%warmestring,$nick,1,59) 
    .settopic
    mode $chan -v $nick 
  } 
  else { 
    .notice $nick Sorry, you are not in the pug! 
  } 
}

on *:TEXT:!delip:?: {
  if ($nick isop %pc) {
    /rcon logaddress_del $ip 7130
  }
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!nick *:%pc:{
  if ($nick isop $chan) {
    nick $2
  }
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!status:%pc:{
  if (%pugging == 1) { 
    {
      var %user = 1 | var %users = $gettok(%warmestring,0,59) 
      var %msgstring | while (%user <= %users) { 
        %msgstring = %msgstring $chr(32) $+ $gettok(%warmestring,%user,59) 
        inc %user 
      } 
      settopic
      msg %pc 0,1 $+ %sepright %admin %pugstring %sepleft $+ %sepright %col.2 $+ 0Players4:0 %msgstring %sepleft $+ 14[0 %playernum - Need $calc(10 - $gettok(%playernum,1,47)) 0more to 4!join0 up 14]
      ;-- End 
      unset %admin.txt
      unset %players.txt
      unset %playernum
      .halt
    } 
  } 
  else { 
    msg $chan 0,14[ 0A pug has been started, type 4!join0 to play! 4]
  }
}

on *:TEXT:!players:%pc:{ 
  if (%pugging == 1) { 
    {
      var %user = 1 | var %users = $gettok(%warmestring,0,59) 
      var %msgstring | while (%user <= %users) { 
        %msgstring = %msgstring $chr(32) $+ $gettok(%warmestring,%user,59) 
        inc %user 
      } 
      settopic
      msg %pc 0,1 $+ %sepright %admin %pugstring %sepleft $+ %sepright %col.2 0Players4:0 %msgstring %sepleft $+ 14[0 %playernum 14]
      ;-- End 
      unset %admin.txt
      unset %players.txt
      unset %playernum
    } 

  } 
  else { msg $chan 0,14[ 0A pug hasnt been started, type 4!pug0 to start a pug! 4]
  }
}


on *:TEXT:!rcon *:?:{ 
  if ($nick isop %pc) {
    /rcon $2-
    msg $nick Command successfully entered:  $2-
  }    
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!restart:%pc:{ 
  if ($nick isop %pc) {
    if (%pugging = !) { endpug }
    /quit Restarting...
    /server irc.gamesurge.net:6667 -j %pc
  }    
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}


on *:TEXT:!scorebot on:%pc:{ 
  if (%scorebot == 1) { .notice $nick Scorebot already enabled. | halt } 
  if ($nick isop %pc) {
    set %scorebot 1
    set %rcon.says 0
    msg %pc 0,1 Scorebot enabled by $nick
  }    
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!scorebot off:%pc:{ 
  if (%scorebot != 1) { .notice $nick Scorebot already disabled. | halt }  
  if ($nick isop %pc) {
    unset %scorebot 
    unset %rcon.says
    msg %pc 0,1 Scorebot disabled by $nick
  }    
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!serverpw *:?:{ 
  if ($nick isop %pc) {
    set %pw $2-
    /rcon sv_password $2-
    /rcon say Server password changed to: $2-
    msg $nick Server password set to: $2-
  }    
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!adminpw *:?:{ 
  if ($nick isop %pc) {
    msg $nick Admin password set to: $2-
    set %admin.pw $2-
    unset %rcon.admin
    set %admin.on 0
    /rcon say Admin reset.
  }    
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!chat *:%pc:{ 
  if ($nick isop %pc) {
    /rcon say $nick - $2-
  }    
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}


on *:TEXT:!ip *:?:{ 
  if ($nick isop %pc) {
    msg $nick IP set to: $2
    set %rcon.ip $2-
    /rcon.challenge %rcon.ip %rcon.port
  }    
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!port *:?:{ 
  if ($nick isop %pc) {
    msg $nick PORT set to: $2
    set %rcon.port $2-
    /rcon.challenge %rcon.ip %rcon.port
  }    
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!logs:?:{ 
  if ($nick isop %pc) {
    rconoff
    rconon
    msg $nick Logs restarting in 5 seconds.
  }    
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!lo3:?:{
  if ($nick isop %pc) {
    lo3
  }
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!info:%pc:{
  if (%pugging = 1) && ($nick isop %pc) {
    notice $nick Admin Password: %admin.pw // User Password: %pw
  }
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!rconpw *:?:{ 
  if ($nick isop %pc) {
    msg $nick This does not change RCON password. It updates the RCON password that is set in the bot.
    msg $nick RCON password updated to: $2
    set %rcon.password $2-
    /rcon.password %rcon.password
  }    
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!disable:%pc:{
  if ($nick isop $chan) {
    if ( !%disable ) {
      set %disable 1
      endfordisable
      msg $chan %sepright Pug Temporarily Disabled %sepleft
      topicdis
    }
    if ( %disable = 1 ) { 
      notice $nick Already disabled.
    }
  }
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

on *:TEXT:!enable:%pc:{
  if ($nick isop $chan) {
    unset %disable 
    topicend
  }
  else {
    .msg $chan $skin $replace(%skin,<cmd>,PUG,<info>,You are not a bot operator!)
    .halt
  }
}

menu status,channel,@rcon,query {
  #YGC
  .Settings:/settings
  .Help:/run readme.txt
}

dialog pug {
  title "LSPug"
  size -1 -1 229 123
  option dbu
  tab "General", 1, 1 -2 228 126
  box "Channel", 2, 3 13 97 29, tab 1
  text "#Chan:", 3, 7 24 17 8, tab 1
  edit "", 4, 26 23 70 10, tab 1 autohs %pc
  box "Server:", 5, 3 42 97 61, tab 1
  text "IP:", 6, 7 60 17 8, tab 1
  edit "", 7, 25 59 70 10, tab 1 autohs %rcon.ip.port
  text "RCON:", 8, 7 80 18 8, tab 1
  edit "", 9, 25 78 70 10, tab 1 pass autohs %rcon.password
  box "IMPORTANT", 10, 110 13 117 90, tab 1
  text "SET ALL OPTIONS EACH TIME ", 14, 125 44 84 8, tab 1 center
  text "YOU OPEN THIS WINDOW", 15, 125 53 84 8, tab 1 center
  text "OPTIONS ARE RESET", 16, 125 71 84 8, tab 1 center
  text "IF EMPTY", 17, 125 80 84 8, tab 1 center
  text "READ THIS", 13, 124 25 84 8, tab 1 center
  text "(Including next tab)", 41, 125 62 84 8, tab 1 center
  text "eg. 123.132.123.12:27015", 51, 25 70 70 8, tab 1 center
  text "eg. omgrconpasslol", 52, 25 91 70 10, tab 1 center
  text "eg. #YGC", 54, 26 33 70 8, tab 1 center
  tab "Colours", 12
  text "Available colours:", 23, 3 13 45 8, tab 12
  text "Brown", 24, 64 24 25 8, tab 12
  text "Navy Blue", 37, 32 24 25 8, tab 12
  text "Dark Green", 27, 32 34 29 8, tab 12
  text "Black", 26, 3 34 25 8, tab 12
  text "White", 25, 3 24 25 8, tab 12
  text "Red", 28, 64 34 25 8, tab 12
  text "Orange", 29, 89 34 25 8, tab 12
  text "L Green", 31, 117 34 25 8, tab 12
  text "Yellow", 34, 117 24 25 8, tab 12
  text "Turquoise", 35, 145 24 25 8, tab 12
  text "Sky Blue", 32, 145 34 25 8, tab 12
  text "Blue", 36, 173 24 25 8, tab 12
  text "Grey", 33, 201 24 25 8, tab 12
  text "Pink", 38, 173 34 25 8, tab 12
  text "Purple", 30, 89 24 25 8, tab 12
  text "Light Grey", 39, 201 34 25 8, tab 12
  edit "", 59, 30 86 50 10, tab 12 %leftsep
  box "Seperators", 49, 5 78 221 23, tab 12
  text "eg. [, (, {", 72, 83 86 25 8, tab 12
  edit "", 71, 135 85 50 10, tab 12 %rightsep
  text "eg. ], ), }", 73, 188 86 25 8, tab 12
  edit "", 20, 162 62 50 10, tab 12 %colour2
  text "Secondary Colour", 21, 115 63 43 8, tab 12
  edit "", 18, 47 63 50 10, tab 12 %colour1
  text "Primary Colour", 19, 7 64 37 8, tab 12
  box "Custom", 22, 5 55 221 21, tab 12
  text "Please select 2 colours and fill in boxes below (eg. Red)", 40, 37 45 153 10, tab 12 center
  text "Right", 70, 115 86 16 8, tab 12
  text "Left", 50, 10 87 16 8, tab 12
  tab "Other", 42
  box "VHOST", 43, 5 21 97 61, tab 42
  text "Login:", 44, 9 39 17 8, tab 42
  text "Pass:", 46, 9 59 18 8, tab 42
  edit "", 47, 27 58 70 10, tab 42 pass autohs %vh.pass
  edit "", 45, 27 38 70 10, tab 42 autohs %vh.login
  edit "", 57, 143 32 70 10, tab 42 autohs %site
  text "URL:", 56, 123 33 17 8, tab 42
  box "Site", 58, 118 23 97 38, tab 42
  text "eg. http://liquid.bloopgaming.com", 48, 123 45 89 8, tab 42
  tab "About", 55
  text "Created by Sky for ", 61, 10 25 69 8, tab 55 center
  box "Author", 60, 6 17 77 27, tab 55
  box "Contact", 63, 6 49 77 37, tab 55
  text "#YGC, #Vi2, #ClanThugz on ETG", 64, 10 57 69 14, tab 55 center
  text "wizard@realservs.com", 65, 10 73 69 8, tab 55 center
  text "#YGC", 62, 10 34 69 8, tab 55 center
  box "Site", 66, 96 17 125 69, tab 55
  text "http://aes.com", 67, 100 34 117 8, tab 55 center
  text "AES Pugserv", 68, 100 24 117 8, tab 55 center
  text "For all your EnterTheGame scripting needs. Fully customised bots available.", 69, 116 45 85 22, tab 55 center
  button "OK/Save", 11, 40 109 30 12, default flat ok
  button "Cancel", 53, 158 109 30 12, default flat cancel
}


on 1:dialog:pug:close:*: {
  if (%colour1 == White) {
    set %col.1 0
  }
  if (%colour1 == Black) {
    set %col.1 1
  }
  if (%colour1 == Navy Blue) {
    set %col.1 2
  }
  if (%colour1 == Dark Green) {
    set %col.1 3
  }
  if (%colour1 == Red) {
    set %col.1 4
  }
  if (%colour1 == Brown) {
    set %col.1 5
  }
  if (%colour1 == Purple) {
    set %col.1 6
  }
  if (%colour1 == Orange) {
    set %col.1 7
  }
  if (%colour1 == Yellow) {
    set %col.1 8
  }
  if (%colour1 == Light Green) {
    set %col.1 9
  }
  if (%colour1 == Turquoise) {
    set %col.1 10
  }
  if (%colour1 == Sky Blue) {
    set %col.1 11
  }
  if (%colour1 == Blue) {
    set %col.1 10
  } 
  if (%colour1 == Pink) {
    set %col.1 13
  } 
  if (%colour1 == Grey) {
    set %col.1 14
  } 
  if (%colour1 == Light Grey) {
    set %col.1 15
  } 
  if (%colour2 == White) {
    set %col.2 0
  }
  if (%colour2 == Black) {
    set %col.2 1
  }
  if (%colour2 == Navy Blue) {
    set %col.2 2
  }
  if (%colour2 == Dark Green) {
    set %col.2 3
  }
  if (%colour2 == Red) {
    set %col.2 4
  }
  if (%colour2 == Brown) {
    set %col.2 5
  }
  if (%colour2 == Purple) {
    set %col.2 6
  }
  if (%colour2 == Orange) {
    set %col.2 7
  }
  if (%colour2 == Yellow) {
    set %col.2 8
  }
  if (%colour2 == Light Green) {
    set %col.2 9
  }
  if (%colour2 == Turquoise) {
    set %col.2 10
  }
  if (%colour2 == Sky Blue) {
    set %col.2 11
  }
  if (%colour2 == Blue) {
    set %col.2 10
  } 
  if (%colour2 == Pink) {
    set %col.2 13
  } 
  if (%colour2 == Grey) {
    set %col.2 14
  } 
  if (%colour2 == Light Grey) {
    set %col.2 15
  } 
  .set %rcon.ip $ip(%rcon.ip.port)
  .set %rcon.port $port(%rcon.ip.port)
  .set %rcon.scorebotchan %pc
  .set %pugbot.channel %pc
  .set %scorebot 0
  .rcon log off
  .rcon logaddress_del %rcon.myip 7130
  .rcon.password %rcon.password
  .rcon.challenge %rcon.ip %rcon.port
  .timer 1 5 /rcon.logs
  .settopic
}

on *:DIALOG:pug:init:*:{ 
  .did -a $dname 7 %rcon.ip.port
  .did -a $dname 9 %rcon.password
  .did -a $dname 4 %pc
  .did -a $dname 18 %colour1
  .did -a $dname 20 %colour2
  .did -a $dname 45 %vh.login
  .did -a $dname 47 %vh.pass
  .did -a $dname 57 %site
  .did -a $dname 59 %leftsep
  .did -a $dname 71 %rightsep
  .rcon log off
  .rcon logaddress_del %rcon.myip 7130
}

on *:load:{
  .echo -s CS Scorebot
  .echo -s Usage:
  .echo -s -
  .echo -s 1: select rcon console from the popups menu
  .echo -s 2: type /rcon.password RCONPASSWORDHERE
  .echo -s 3: type /rcon.challenge IPHERE PORTHERE
  .echo -s 4: If you want to see the logs, type /rcon.logs
  .echo -s 5: type /rcon COMMANDHERE
  .echo -s If you try to access a server with the wrong information too many times you could be IP banned.
  .echo -s type /rcon.help for more information
  .set %rcon.says 0
  .set %scorebot 0
  .set %rcon.myip $ip
}

on *:udpread:rcon.cmd:{
  if ($window(@rcon)) {
    if ($sockerr > 0) {
      return
    }
    :nextread
    sockread -f %rcon.cmd
    if ($sockbr == 0) {
      return
    }
    if (%rcon.cmd == $null) {
      goto nextread
    }
    else {
      if ($gettok(%rcon.cmd,1,32) == ÿÿÿÿchallenge) {
        set %rcon.challengenumber $gettok(%rcon.cmd,3,32)
      }
      if ($left(%rcon.cmd,5) == ÿÿÿÿl) {
        %rcon.cmd = $remove(%rcon.cmd,$left(%rcon.cmd,5))
        if (%rcon.cmd == $null) {
        }
      }
    }  
    if (%rcon.cmd == $null) {
      goto nextread
    }
    aline -p @rcon %rcon.cmd
    goto nextread
  }
}

on *:udpread:rcon:{
  if ($sockerr > 0) {
    return
  }
  :nextread
  sockread -f %rcon.data
  if ($sockbr == 0) {
    return
  }
  if (%rcon.data == $null) {
    goto nextread
  }
  else {
    if (*"*from*"*"* iswm %rcon.data) {
      %rcon.data = $null
    }
    if (*server cvar* iswm %rcon.data) {
      %rcon.data = $null
    }
    if (*"* iswm %rcon.data) {
      %rcon.data = $replace(%rcon.data,",$null)
    }
    if (*started map* iswm %rcon.data) {
      %rcon.data = $null
    }
    if (*loading* iswm %rcon.data) {
      %rcon.data = $null
    }
    if (*[META]* iswm %rcon.data) {
      %rcon.data = $null
    }
    if (*disconnect* iswm %rcon.data) {
      %rcon.data = $null
    }
    if (*shutdown* iswm %rcon.data) {
      %rcon.data = $null
    }
    if (*changed name to* iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
      echo -a %rcon.data
      %rcon.data = $remove($gettok(%rcon.data,3-,62),changed name to,<CT>,<TERRORIST>,<SPECTATOR>)
      set %rcon.admin $mid(%rcon.data,3)
      rcon say The Admin now known as %rcon.data
      goto nextread
    }
    if (*changed name* iswm %rcon.data) {
      %rcon.data = $null
    }
    if (*joined team* iswm %rcon.data) {
      %rcon.data = $null
    }
    if (*Team TERRORIST triggered VIP_Not_Escaped* iswm %rcon.data) {
      %rcon.data = $replace(%rcon.data,Team TERRORIST triggered VIP_Not_Escaped,4*** Terrorists Win! ***)
    }
    if (*Hostages_Not_Rescued* iswm %rcon.data) {
      %rcon.data = $replace(%rcon.data,Team TERRORIST triggered Hostages_Not_Rescued,4*** Terrorists Win! ***)
    }
    if (*Team TERRORIST triggered Hostages_Not_Rescued* iswm %rcon.data) {
      %rcon.data = $replace(%rcon.data,Team TERRORIST triggered Hostages_Not_Rescued,4*** Terrorists Win! ***)
    }
    if (*killed* iswm %rcon.data) {
      %rcon.data = $null
    }
    if (*attacked* iswm %rcon.data) {
      %rcon.data = $null
    }
    if ($gettok(%rcon.data,1,32) == ÿÿÿÿchallenge) {
      set %rcon.challengenumber $gettok(%rcon.data,3,32)
    }
    if ($left(%rcon.data,5) == ÿÿÿÿl) {
      %rcon.data = $remove(%rcon.data,$left(%rcon.data,5))
      if ((*sv_* !iswm %rcon.data) || (*mp_* !iswm %rcon.data)) {
        %rcon.data = $gettok(%rcon.data,6- $+ $numtok(%rcon.data,32),32)
        if (*"* iswm %rcon.data) {
          %rcon.data = $remove(%rcon.data,")
        }
        if (*<* iswm %rcon.data) {
          %rcon.data = $remove(%rcon.data,$gettok(%rcon.data,3,60))
          %rcon.data = $remove(%rcon.data,$gettok(%rcon.data,2,60))
          %rcon.data = $replace(%rcon.data,<<,)
        }
        if (World triggered Restart_Round_* iswm %rcon.data) {
          %rcon.data = $replace(%rcon.data,World triggered Restart_Round_,$null)
          %rcon.data = $replace(%rcon.data,second,$null)
          %rcon.data = $replace(%rcon.data,(*),$null)
          %rcon.data = $null
        }
        if (*<TERRORIST>* iswm %rcon.data) {
          %rcon.data = $replace(%rcon.data,<TERRORIST>,$null)
        }
        if (*> with * iswm %rcon.data) {
          %rcon.data = $replace(%rcon.data,> with,> with)
        }
        if (*> killed* iswm %rcon.data) {
          %rcon.data = $remove(%rcon.data,$gettok(%rcon.data,-2,60))
          %rcon.data = $remove(%rcon.data,$gettok(%rcon.data,-2,60))
          %rcon.data = $remove(%rcon.data,<<)
          %rcon.data = $replace(%rcon.data,killed,killed)
          %rcon.data = $null
          if (*<CT* iswm $gettok(%rcon.data,-2,62)) {
            %rcon.death = $gettok(%rcon.data,-2,62)
            %rcon.death2 = $gettok(%rcon.death,2-,32)
            %rcon.data = $replace(%rcon.data,$gettok(%rcon.data,-2,62),$chr(32) $+ killed $+ $chr(32) $+ %rcon.death2)
            %rcon.data = $null
          }
          if (*<T* iswm $gettok(%rcon.data,-2,62)) {
            %rcon.death = $gettok(%rcon.data,-2,62)
            %rcon.death2 = $gettok(%rcon.death,2-,32)
            %rcon.data = $replace(%rcon.data,$gettok(%rcon.data,-2,62),$chr(32) $+ killed $+ $chr(32) $+ %rcon.death2)
            %rcon.data = $null
          }
          if (*<CT* iswm $gettok(%rcon.data,1,62)) {
            %rcon.data = $replace(%rcon.data,$gettok(%rcon.data,1,60),$gettok(%rcon.data,1,60))
            %rcon.data = $null
          }
          if (*<T* iswm $gettok(%rcon.data,1,62)) {
            %rcon.data = $replace(%rcon.data,$gettok(%rcon.data,1,60),$gettok(%rcon.data,1,60))
            %rcon.data = $null
          }
        }
        if (*connected, address* iswm %rcon.data) {
          %rcon.data = $remove(%rcon.data,connected $+ $chr(44) address $gettok(%rcon.data,-1,32),<STEAM_ID_PENDING>)
          %rcon.data = $left(%rcon.data,$calc($len(%rcon.data) - 2))
          if ( $chr(60) isin %rcon.data) || ( $chr(62) isin %rcon.data ) {
            .timersay $+ %rcon.data 1 20 rcon say Illegal name contains either > or <
            .timersayx $+ %rcon.data 1 20 rcon say Please change your name %rcon.data and reconnect.
            .timerkick $+ %rcon.data 1 23 rcon kick %rcon.data
          }
          if (%full = 1) msg %pc 0,14[0 %rcon.data has connected 4]
        }
        if (*<> disconnected iswm %rcon.data) {
          %rcon.data = $null
        }
        if (*<T> disconnected iswm %rcon.data) {
          %rcon.data = $null
        }
        if (*<CT> disconnected iswm %rcon.data) {
          %rcon.data = $null
        }
        if (*STEAM USERID validated iswm %rcon.data) {
          %rcon.data = $null
        }
        if (*entered the game iswm %rcon.data) {
          %rcon.data = $null
        }
        if (*Spawned_With_The_Bomb* iswm %rcon.data) {
          %rcon.data = $null
        }
        if (*triggered Dropped_The_Bomb iswm %rcon.data) {
          %rcon.data = $null
        }
        if (*triggered Got_The_Bomb iswm %rcon.data) {
          %rcon.data = $null
        }
        if (*triggered Planted_The_Bomb iswm %rcon.data) {
          %rcon.data = $null
        }
        if (Team TERRORIST triggered Target_Bombed* iswm %rcon.data) {
          sortscores
          Twin
        }
        if (Team CT triggered Bomb_Defused* iswm %rcon.data) {
          sortscores
          CTwin
        }
        if (Team TERRORIST triggered Terrorists_Win* iswm %rcon.data) {
          sortscores
          Twin
        }
        if (Team CT triggered CTs_Win* iswm %rcon.data) {
          sortscores
          CTwin
        }
        if (Team CT triggered Target_Saved* iswm %rcon.data) {
          sortscores
          CTwin
        }    
        if (*!login* iswm %rcon.data) && (%admin.pw isin %rcon.data) {
          if (%admin.on == 0) {
            if ($count(%rcon.data,say) != 1) { halt }
            %rcon.admin = $gettok(%rcon.data,1,62)
            set %rcon.admin $remove(%rcon.data, say !login %admin.pw ) 
            set %rcon.admin $remove(%rcon.admin, say_team ) 
            set %rcon.admin $remove(%rcon.admin, say )
            set %rcon.admin $remove(%rcon.admin, _team )
            set %rcon.admin $remove(%rcon.admin, !login ) 
            set %rcon.admin $remove(%rcon.admin, %admin.pw ) 
            set %rcon.admin $remove(%rcon.admin, <T> ) 
            set %rcon.admin $remove(%rcon.admin, <CT> ) 
            set %rcon.admin $remove(%rcon.admin, <SPECTATOR> ) 
            set %rcon.admin $remove(%rcon.admin, (dead) ) 
            /rcon say Login Accepted.
            .timersay 1 2 rcon say The admin for the pug is %rcon.admin GLHF.  
            msg %pc 0,14[ 0Admin is now Logged in 4] [ 10User:0 %rcon.admin 4] 
            set %admin.on 1
            goto nextread
          }
          else { 
            /rcon say Admin already established.
          }
        }
        if (*!logout* iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if (%admin.on == 1) {
            if ($count(%rcon.data,say) != 1) { halt }
            unset %rcon.admin 
            /rcon say You are logged out.  
            set %admin.on 0
            set %rcon.admin $replace(%rcon.admin, say !logout,$null) 
            set %rcon.admin $replace(%rcon.admin, <T>,$null) 
            set %rcon.admin $replace(%rcon.admin, <CT>,$null) 
            goto nextread
          }
          else { 
            /rcon say Admin already established.
          }
        }
        if (*!endpug* iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          endpug
          goto nextread
        }
        if (*!restart* iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          set %scorebot 0
          /rcon say Round Restart in 1 second(s).
          /rcon sv_restartround 1 
          goto nextread
        }
        if (*!ff on* iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          /rcon say Friendly fire on.
          /rcon mp_friendlyfire 1 
          goto nextread
        }
        if (*!ff off* iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          /rcon say Friendly fire off.
          /rcon mp_friendlyfire 0
          goto nextread
        }
        if (*!password* iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          set %pw $read(pw.txt)
          /rcon sv_password %pw
          /rcon say Server password changed to: %pw
          goto nextread
        }
        if (*!teams* iswm %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          /rcon say CTs: %team.CT.rcon
          /rcon say Ts: %team.T.rcon
          goto nextread
        }
        if (*!score* iswm %rcon.data) {
          if (%half.1 = 1) {
            /rcon say Game scores - CT: %CTscore T: %Tscore // $calc( 15 - $calc(%CTscore + %Tscore)) rounds till change over
            goto nextread
          }
          (%half.2 = 1) {
            /rcon say Game scores - CT: $calc(%CTscore + %Tsh1) T: $calc(%Tscore + %CTsh1)
            goto nextread
          }
        }
        if (*!map de_dust2 iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          /rcon say Changing map to de_dust2
          /rcon mp_friendlyfire 0
          set %rcon.scorebot 0
          msg %pc 0,14[ 5Map Change:0 de_dust2 4]
          .timer 1 2 /rcon changelevel de_dust2
          goto nextread
        }
        if (**!map de_dust iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          /rcon say Changing map to de_dust
          /rcon mp_friendlyfire 0
          set %rcon.scorebot 0
          msg %pc 0,14[ 5Map Change:0 de_dust 4]
          .timer 1 2 /rcon changelevel de_dust
          goto nextread
        }
        if (*!map de_cpl_strike iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          /rcon say Changing map to de_cpl_strike
          /rcon mp_friendlyfire 0
          set %rcon.scorebot 0
          msg %pc 0,14[ 5Map Change:0 de_cpl_strike 4]
          .timer 1 2 /rcon changelevel de_cpl_strike
          goto nextread
        }
        if (*!map de_cpl_fire iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          /rcon say Changing map to de_cpl_fire
          /rcon mp_friendlyfire 0
          set %rcon.scorebot 0
          msg %pc 0,14[ 5Map Change:0 de_cpl_fire 4]
          .timer 1 2 /rcon changelevel de_cpl_fire
          goto nextread
        }
        if (*!map de_cpl_mill iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          /rcon say Changing map to de_cpl_mill
          /rcon mp_friendlyfire 0
          set %rcon.scorebot 0
          msg %pc 0,14[ 5Map Change:0 de_cpl_mill 4]
          .timer 1 2 /rcon changelevel de_cpl_mill
          goto nextread
        }
        if (*!map de_aztec iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          /rcon say Changing map to de_aztec
          /rcon mp_friendlyfire 0
          set %rcon.scorebot 0
          msg %pc 0,14[ 5Map Change:0 de_aztec 4]
          .timer 1 2 /rcon changelevel de_aztec
          goto nextread
        }
        if (*!map de_nuke iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          /rcon say Changing map to de_nuke
          /rcon mp_friendlyfire 0
          set %rcon.scorebot 0
          msg %pc 0,14[ 5Map Change:0 de_nuke 4]
          .timer 1 2 /rcon changelevel de_nuke
          goto nextread
        }
        if (*!map de_inferno iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          /rcon say Changing map to de_inferno
          /rcon mp_friendlyfire 0
          set %rcon.scorebot 0
          msg %pc 0,14[ 5Map Change:0 de_inferno 4]
          .timer 1 2 /rcon changelevel de_inferno
          goto nextread
        }
        if (*!map de_train iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          /rcon say Changing map to de_train
          /rcon mp_friendlyfire 0
          set %rcon.scorebot 0
          msg %pc 0,14[ 5Map Change:0 de_train 4]
          .timer 1 2 /rcon changelevel de_train
          goto nextread
        }
        if (*!map de_cbble* iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          /rcon say Changing map to de_cbble
          /rcon mp_friendlyfire 0
          set %rcon.scorebot 0
          msg %pc 0,14[ 5Map Change:0 de_cbble 4]
          .timer 1 2 /rcon changelevel de_cbble
          goto nextread
        }
        if (*!get* iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          msg %pc 0,14[ 0 Player Needed! 4] [ 0Type 7!extra0 for details 4]
          set %extra 1
          .timer 1 120 set %extra 0
          goto nextread
        }
        if (*!irc* iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          if (*.com* !isin %rcon.data) && (*.net* !isin %rcon.data) && (*.org* !isin %rcon.data) && (*http://* !isin %rcon.data) {
            set %ircmsg %rcon.data
            set %ircmsg $replace(%ircmsg, (dead),$null) 
            set %ircmsg $replace(%ircmsg,say ,$null)
            set %ircmsg $replace(%ircmsg, !irc ,$null)
            set %ircmsg $replace(%ircmsg,<CT>,$null)
            set %ircmsg $replace(%ircmsg,say_team !irc,$null)
            set %ircmsg $replace(%ircmsg,<T>,$null)
            set %ircmsg $replace(%ircmsg,%rcon.admin,$null)
            msg %pc 0,14[ 0IN-GAME from ADMIN 4] [0 Msg: %ircmsg 4]
            goto nextread
          }
        }
        if (*!kick* iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          if (*.com* !isin %rcon.data) && (*.net* !isin %rcon.data) && (*.org* !isin %rcon.data) && (*http://* !isin %rcon.data) {
            set %rcon.data $replace(%rcon.data,<T>,$null)
            set %rcon.data $replace(%rcon.data,<CT> ,$null)
            set %rcon.data $replace(%rcon.data,<>,$null)
            set %rcon.data $replace(%rcon.data, (dead),$null)
            set %rcon.kick %rcon.data
            set %rcon.kick $replace(%rcon.kick,say ,$null)
            set %rcon.kick $replace(%rcon.kick,!kick ,$null)
            set %rcon.kick $replace(%rcon.kick, %rcon.admin ,$null)
            /rcon say Attempting to kick player: %rcon.kick
            /rcon kick %rcon.kick
            goto nextread
          }
        }
        if (*!stophalf* iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if ($count(%rcon.data,say) != 1) { halt }
          if (%half.1 = 1) {
            /rcon say 1st half stopped. !lo3 to restart.
            set %scorebot 0
            msg %pc 0,14[ 0First half stopped 4]
          }
          if (%half.2 = 1) {
            /rcon say 2nd half stopped. !lo3 to restart.
            set %scorebot 0
            msg %pc 0,14[ 0Second half stopped 4]
          }
        }
        if (*!lo3* iswm %rcon.data) && (%rcon.admin isin %rcon.data) {
          if (%half.1 = 1) {
            lo3
            /rcon say First half commencing. To cancel this half type !stophalf
            msg %pc 0,14[ 0First half commencing 4]
          }
          if (%half.2 = 1) {
            lo3
            /rcon say Second half commencing. To cancel this half type !stophalf
            msg %pc 0,14[ 0Second half commencing 4]
          } 
        }
        else {
          %rcon.data = $null
        }
      }
      if (*<T>* iswm %rcon.data) {
        %rcon.data = $replace(%rcon.data,<T>,$null)
      }
      if (*<CT>* iswm %rcon.data) {
        %rcon.data = $replace(%rcon.data,<CT>,$null)
      }
      if (* $chr(40) $+ CT* iswm %rcon.data) {
        %rcon.data = $replace(%rcon.data,$chr(40) $+ CT,2 $+ $chr(40) $+ CT)
      }
      if (* $chr(40) $+ T* iswm %rcon.data) {
        %rcon.data = $replace(%rcon.data,$chr(40) $+ T,4 $+ $chr(40) $+ T)
      }
      if (Team CT triggered Target_Saved* iswm %rcon.data) {
        sortscores
        CTwin
      }        
    }
    if (%rcon.data == $null) {
      goto nextread
    }
  }
  if (%rcon.scorebot == 1) {
    if (%rcon.data != $null) && (*.com* !isin %rcon.data) && (*.net* !isin %rcon.data) && (*.org* !isin %rcon.data) && (*http://* !isin %rcon.data) {
      aline -p @rcon %rcon.data
    }
  }
  if (%rcon.data != $null) {
    aline -p @rcon %rcon.data
  }
  goto nextread
}

on *:sockwrite:rcon:{
  if ($sockerr) {
    aline @rcon $sock().wserr
  }
}

on *:close:@rcon:{
  if (%rcon.scorebot == 1) {
    set %rcon.scorebot 0
  }
  set %rcon.myip $ip
  sockclose rcon.cmd
  sockudp -n rcon.cmd %rcon.ip %rcon.port ÿÿÿÿrcon %rcon.challengenumber " $+ %rcon.password $+ " log off
  sockudp -n rcon 7130 %rcon.ip %rcon.port ÿÿÿÿrcon %rcon.challengenumber " $+ %rcon.password $+ " logaddress_del %rcon.myip 7130
  sockclose rcon
  sockclose rcon.cmd
}