Jump to content

[MIRC SCRIPTING]Gatherbot script No2


Recommended Posts

Posted

[script]



on *:TEXT:!add:%channel:{
  if (%add == 1) {
    set $2
  }
}
on *:TEXT:!add*a:%channel:{
  if (%add == 1) {
    checkteamsa
  }
}
on *:TEXT:!add*b:%channel:{
  if (%add == 1) {
    checkteamsb
  }
}

on *:TEXT:!next:%channel:{
  if (%add == 1) { next }
  else { msg %channel %Color1 There is no game.. %Color2 }
}
on *:TEXT:!teams:%channel:{
  if (%add == 1) { teams }
  else {  }
}
alias teams {
  .msg %channel 2Currently3:( $+ %slots $+ /10):5Team A(CTs):2 $pavla(%teama) 5Team B(TERRORISTs):2 $pavla(%teamb) | unset %pavla
  checkslots
}
on *:TEXT:!remove*:%channel:{ 
  if ($2 == $null) { .msgremove }
  if ($2 != $null) && ($2 isincs %teama) && ($nick == %admin) { .set %teama $instok($remtok(%teama,$2,1,32),?,5,32) | .dec %slots | .dec %slots1 | teams }
  if ($2 != $null) && ($2 isincs %teamb) && ($nick == %admin)  { .set %teamb $instok($remtok(%teamb,$2,1,32),?,5,32) | .dec %slots | .dec %slots2 | teams }
  else { .halt }
}
on *:TEXT:!teams:%channel:{
  if (%add == 1) { teams }
  else { .msg %channel %Color1 There is no game %Color2 }
}

alias teams {
  .msg %channel 2Currently3:( $+ %slots $+ /10):5Team A(CTs):2 $pavla(%teama) 5Team B(TERRORISTs):2 $pavla(%teamb) | unset %pavla
  checkslots
}

alias add {
  if (($nick !isincs %teama) && ($nick !isincs %teamb)) { testslots }
  else { .notice $nick %left You are already added. %right }
}

alias testslots {
  if (%slots1 > %slots2) { add-b }
  else { add-a }
}
alias add-a {
  if (%slots1 != 5) {
    .set %teama $reptok(%teama,?,$nick,1,32)
    .inc %slots
    .inc %slots1
    .teams
  }
}

alias add-b {
  if (%slots2 != 5) {
    .set %teamb $reptok(%teamb,?,$nick,1,32)
    .inc %slots
    .inc %slots2
    .teams
  }
}

alias checkteamsa {
  if (($nick !isincs %teama) && ($nick !isincs %teamb)) { add-a }
  else { .nickremove | add-a }
}
alias checkteamsb {
  if (($nick !isincs %teama) && ($nick !isincs %teamb)) { add-b }
  else { .nickremove | add-b }
}

alias nickremove {
  if ($nick isincs %teama) { .set %teama $instok($remtok(%teama,$nick,1,32),?,5,32) | .dec %slots | .dec %slots1 }
  elseif ($nick isincs %teamb) { .set %teamb $instok($remtok(%teamb,$nick,1,32),?,5,32) | .dec %slots | .dec %slots2 }
}

alias msgremove {
  if ($nick isincs %teama) { .set %teama $instok($remtok(%teama,$nick,1,32),?,5,32) | .dec %slots | .dec %slots1 | teams }
  elseif ($nick isincs %teamb) { .set %teamb $instok($remtok(%teamb,$nick,1,32),?,5,32) | .dec %slots | .dec %slots2 | teams }
  else { .notice $nick %left You are not added on any team. %right }
}
alias pavla {
  var %a = 2
  set %pavla $1
  while (%a <= 8) {
    set %pavla $instok(%pavla,-,%a,32)
    inc %a 2
  }
  return %pavla
}
alias checkslots {
  if (%slots == 10) {
    set %add 0
    set %getpass 1
    mode %channel +m
    .inc %totalgames
    .topic %channel %topic
    .msg %channel %left Match starting , check your private messages ( this will be take about 1 minute ) , if you didn`t receive ip & password type: !getpass after -m channel mode. %right
    .msg %channel %left Team A(Counter Terrorists): %teama %right
    .msg %channel %left Team B(Terrorists): %teamb %right
    msg $gettok(%teama,1,32) %left You are in Team A (Counter Terrorists) %mid Copy/Paste in your concole:4 name $gettok(%teama,1,32) ;password %password ;connect %ip  %right
    msg $gettok(%teama,2,32) %left You are in Team A (Counter Terrorists) %mid Copy/Paste in your concole:4 name $gettok(%teama,2,32) ;password %password ;connect %ip  %right
    msg $gettok(%teama,3,32) %left You are in Team A (Counter Terrorists) %mid Copy/Paste in your concole:4 name $gettok(%teama,3,32) ;password %password ;connect %ip  %right
    msg $gettok(%teama,4,32) %left You are in Team A (Counter Terrorists) %mid Copy/Paste in your concole:4 name $gettok(%teama,4,32) ;password %password ;connect %ip  %right
    msg $gettok(%teama,5,32) %left You are in Team A (Counter Terrorists) %mid Copy/Paste in your concole:4 name $gettok(%teama,5,32) ;password %password ;connect %ip  %right
    msg $gettok(%teamb,1,32) %left You are in Team B (Terrorists) %mid Copy/Paste in your concole:4 name $gettok(%teamb,1,32) ;password %password ;connect %ip  %right
    msg $gettok(%teamb,2,32) %left You are in Team B (Terrorists) %mid Copy/Paste in your concole:4 name $gettok(%teamb,2,32) ;password %password ;connect %ip  %right
    msg $gettok(%teamb,3,32) %left You are in Team B (Terrorists) %mid Copy/Paste in your concole:4 name $gettok(%teamb,3,32) ;password %password ;connect %ip  %right
    msg $gettok(%teamb,4,32) %left You are in Team B (Terrorists) %mid Copy/Paste in your concole:4 name $gettok(%teamb,4,32) ;password %password ;connect %ip  %right
    msg $gettok(%teamb,5,32) %left You are in Team B (Terrorists) %mid Copy/Paste in your concole:4 name $gettok(%teamb,5,32) ;password %password ;connect %ip  %right
    .inc %mystats. [ $+ [ $gettok(%teama,1,32) ] ]
    .inc %mystats. [ $+ [ $gettok(%teama,2,32) ] ]
    .inc %mystats. [ $+ [ $gettok(%teama,3,32) ] ]
    .inc %mystats. [ $+ [ $gettok(%teama,4,32) ] ]
    .inc %mystats. [ $+ [ $gettok(%teama,5,32) ] ]
    .inc %mystats. [ $+ [ $gettok(%teamb,1,32) ] ]
    .inc %mystats. [ $+ [ $gettok(%teamb,2,32) ] ]
    .inc %mystats. [ $+ [ $gettok(%teamb,3,32) ] ]
    .inc %mystats. [ $+ [ $gettok(%teamb,4,32) ] ]
    .inc %mystats. [ $+ [ $gettok(%teamb,5,32) ] ]
    .inc %gstats. [ $+ [ %admin ] ]
    mode %channel -m
  }
}


on *:TEXT:!last:%channel:{ if (%add == 0) msg %channel %Color1 Last game started at %last by %lastadmin %Color2 }

on *:TEXT:addgame*:?:{
  if (%add == 0) ($nick == %admin){
  set %add 1
  set %ip $2
  set %password $2
  set %game 1
  notice %channel %Color1 Game started by %admin %Color2
  topic %channel 14,1[4,1«0,1 Game started! 0,14,1»14,1]14,1[4,1«0,1 Admin: %admin 0,14,1»14,1]14,1[4,1«0,1 Map: %map 0,14,1»14,1]14,1[4,1«0,1 Type: %type 0,1 4,1»14,1]
  teams
}
}}

on *:TEXT:!settype*:%channel:{ if (%add == 1)set %type $2 }

on *:TEXT:cancelgame:?:{
  if (%add == 1) ($nick == %admin){
  set %add 0
  set %game 0
  set %teama ? ? ? ? ?
  set %teamb ? ? ? ? ?
  set %lastadmin $nick
  set %slots 0
  set %slots1 0
  set %slots2 0
  set %type Mixbot v.2 by spongegr
  set %map Not Given Yet
  notice %channel %Color1 ATTENTION! - %admin decided not to do his game - Everything works good for now.. %Color2
  notice %channel %Color1 %admin decided not to do its game! %Color2
  topic %channel  14,1[4,1«0,1 Gatherbot 2011 - 2012 0,14,1»14,1]14,1[4,1«0,1 spongegr@md.gr 0,14,1»14,1]14,1[4,1«0,1 Version 1 0,14,1»14,1]14,1[4,1«0,1 Last game by %lastadmin 0,1 4,1»14,1]
}
}}
on 1:QUIT:%channel:{
  if (%add == 1) {
    set %add 0
    set %getpass 0
    topic %channel %topic
    mode %channel -m
    notice %channel %left 4GAME HAS BEEN CANCELED. %right
    unset %admin
  }
}
on 1:PART:%channel:{
  if ($nick isincs %teama) {
    nickremove
  }
  else {
    if ($nick isincs %teamb) {
      nickremove
    }
  }
}

on 1:QUIT:%channel:{
  if ($nick isincs %teama) {
    msgremove
  }
  else {
    if ($nick isincs %teamb) {
      msgremove
    }
  }
}
on 1:nickchange:%channel:{
  if ($nick isincs %teama) {
    msgremove
  }
  else {
    if ($nick isincs %teamb) {
      msgremove
    }
  }
}

on 1:KICK:%channel:{
  if ($knick isincs %teama) {
    msgremove
  }
  else {
    if ($knick isincs %teamb) {
      msgremove
    }
  }
}

on 1:BAN:%channel:{
  if ($bnick isincs %teama) {
    msgremove
  }
  else {
    if ($bnick isincs %teamb) {
      msgremove
    }
  }
}
on 5:text:restart:?: { quit Restarting...Gatherbot by spongegr   | timer -o 1 3 server nana.irc.gr
  set %add 0
  set %slots 0
  set %slots1 0
  set %slots2 0
  set %teama ? ? ? ? ?
  set %teamb ? ? ? ? ?
}
on *:text:!help:%channel: { 
  notice $nick %ms User commands are : !addme <team> - !remove - !teams - !next - !last - !totalgames - !sub - !ip %me
}
on 5:text:!help:%prive: { 
  notice $nick %ms Admin commands are : !setmap - !settype - !kick - !ban - !unban 
  notice $nick %ms Senior commands are : addakick - delakick - addaccess - delaccess - addadmin - deladmin
  notice %prive %ms To Start a game type /msg $me help 
}
on 5:text:help:?: { 
  msg $nick To Start a game msg $me ''addgame IP:PORT'' (without "")
  msg $nick To change map type !setmap on %channel
  msg $nick To change type type !settype on %channel
  msg $nick %Color1 Gatherbot by spongegr 2011 %Color2
}

/set %channel #Channelpickup

/set %prive #Channelprive

/set %support #Support

Source will be updated soon

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock