FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


mIRC scripting





ranzon
Hi..
I would like to request a counter-strike gather script for mIRC clients.
It should have these commands:
!start server_ip:port || when this command beeing used the mIRC client connects the server, and check that it's up. if it's up the client echos that the server is up, and working, else it echos: server is down or the ip is wrong
then it's sends a pm to the one who used !start in the main channel, and requests a password for the counter-strike server.
and then it allow 10 people to use the command: !add to add their own nick to the gather.. and it have to got an !remove to remove yourself from the gather. or if the gather starter uses the command, the gather beeing stopped, and the bot says: Gather stopped.

if someone could help me with this i would be very thankfull..
Comrade
im finishing this snippet. but im stuck in one place. can u script in irc? if
yes i could give u my code and u could finish it.

Im not finished cuz im pissed off and tomorrow maybe will finish it lol
ranzon
Comrade wrote:
im finishing this snippet. but im stuck in one place. can u script in irc? if
yes i could give u my code and u could finish it.

Im not finished cuz im pissed off and tomorrow maybe will finish it lol


AHh thank you..
Comrade
Ok m8 here it is.

How to use? First you have to set server pass, ip and irc channel in menu
bar popup. I hope you know where it is.

After this, someone have to type !start <ip> <port> ATTENSION not ip:port
Next bot will notice nick if its online. Then that nick have to open bot query
and type the password ex. Paper. but if the query was open before he type it, it wont work.

After all this it will start work.

You can add by typing !add yourself or something else. But u have to be oped if u wanna
add someone.

You can remove yourself typing !rem or something else with !rem <nick>
U have to be oped if u wanna remove something else. If nick leave the
channel and he is in gather, bot will scan and remove him from the gather.

Code:
on *:text:!start *:#:{
  .set %nick $nick
  .set %chan $chan
  .set %ip $2
  .set %port $3
  /sockopen cs %ip %port
}

on *:SOCKOPEN:cs: {
  if (!$sockerr) { notice %nick Server is ONLINE | .set %online 1 }
  else { notice %nick Server is OFFLINE | .set %online 0 }
  /sockclose cs
  if (%online = 1) {
    notice %nick Please type the password.
  }
}

on *:OPEN:?:{
  if ($nick = %nick) && (%online = 1) {
    .set %pass.typed $1-
    if (%pass.typed = %pass) start
    .close -m $nick
  }
}

alias start {
  .set %gather.on 1
  .set %last.player 0
  .set %p1 x | .set %p2 x | .set %p3 x | .set %p4 x | .set %p5 x | .set %p6 x | .set %p7 x | .set %p8 x | .set %p9 x | .set %p10 x
  .msg %chan Gather is turned on
  .msg %chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10
}

on *:text:!add*:#:{
  if (%gather.on = 1) {
    if ($2) {
      if ($2 ison $chan) && ($nick isop $chan) {
        if (%p1 != $2) && (%p2 != $2) && (%p3 != $2) && (%p4 != $2) && (%p5 != $2) && (%p6 != $2) && (%p7 != $2) && (%p8 != $2) && (%p9 != $2) && (%p10 != $2) { 
          if (%p10 = x) && (%last.player != 10) {
            .set %p $+ $calc(%last.player + 1) $2-
            .set %last.player $calc(%last.player + 1)
            .write gather.txt $2-
            .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10
            if (%last.player = 10) { .msg $chan Gather is full. Please wait till we generate the teams. | /make.teams }
          }
        }
        else { .msg %chan Sorry you are already in gather. }
      }
      elseif ($2 !ison $chan) { .msg %chan $2 is not in the channel }
    }
    else {
      if (%p1 != $nick) && (%p2 != $nick) && (%p3 != $nick) && (%p4 != $nick) && (%p5 != $nick) && (%p6 != $nick) && (%p7 != $nick) && (%p8 != $nick) && (%p9 != $nick) && (%p10 != $nick) { 
        if (%p10 = x) && (%last.player != 10) {
          .set %p $+ $calc(%last.player + 1) $nick
          .set %last.player $calc(%last.player + 1)
          .write gather.txt $nick
          .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10
          if (%last.player = 10) { make.teams }
        }
      }
      else { .msg %chan Sorry you are already in gather. }
    }
  }
}

on *:text:!rem*:#:{
  if (%gather.on = 1) {
    if ($2) && ($nick isop $chan) {
      if (%p1 = $2) { .set %p1 %p2 | .set %p2 %p3 | .set %p3 %p4 | .set %p4 %p5 | .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $2- gather.txt }
      elseif (%p2 = $2) { .set %p2 %p3 | .set %p3 %p4 | .set %p4 %p5 | .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $2- gather.txt }
      elseif (%p3 = $2) { .set %p3 %p4 | .set %p4 %p5 | .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $2- gather.txt }
      elseif (%p4 = $2) { .set %p4 %p5 | .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $2- gather.txt }
      elseif (%p5 = $2) { .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $2- gather.txt }
      elseif (%p6 = $2) { .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $2- gather.txt }
      elseif (%p7 = $2) { .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1 | /.write -ds $+ $2- gather.txt) }
      elseif (%p8 = $2) { .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) }
      elseif (%p9 = $2) { .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) }
    }
    else {
      if (%p1 = $nick) { .set %p1 %p2 | .set %p2 %p3 | .set %p3 %p4 | .set %p4 %p5 | .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
      elseif (%p2 = $nick) { .set %p2 %p3 | .set %p3 %p4 | .set %p4 %p5 | .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
      elseif (%p3 = $nick) { .set %p3 %p4 | .set %p4 %p5 | .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
      elseif (%p4 = $nick) { .set %p4 %p5 | .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
      elseif (%p5 = $nick) { .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
      elseif (%p6 = $nick) { .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
      elseif (%p7 = $nick) { .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
      elseif (%p8 = $nick) { .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
      elseif (%p9 = $nick) { .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
    }
  }
}

on *:part:#:{
  if (%gather.on = 1) {
    if (%p1 = $nick) { .set %p1 %p2 | .set %p2 %p3 | .set %p3 %p4 | .set %p4 %p5 | .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
    elseif (%p2 = $nick) { .set %p2 %p3 | .set %p3 %p4 | .set %p4 %p5 | .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
    elseif (%p3 = $nick) { .set %p3 %p4 | .set %p4 %p5 | .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
    elseif (%p4 = $nick) { .set %p4 %p5 | .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
    elseif (%p5 = $nick) { .set %p5 %p6 | .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
    elseif (%p6 = $nick) { .set %p6 %p7 | .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
    elseif (%p7 = $nick) { .set %p7 %p8 | .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
    elseif (%p8 = $nick) { .set %p8 %p9 | .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
    elseif (%p9 = $nick) { .set %p9 %p10 | .set %p10 x | .msg $chan Players: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 $chr(124) %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10 | .set %last.player $calc(%last.player - 1) | /.write -ds $+ $nick gather.txt }
  }
}

alias make.teams {
  if ($len(gather.txt) = 10) {
    .set %i 1
    .set %last.num 1

    while (%i <= 10) {
      .set %tmp $read(gather.txt)
      .set %p $+ %last.num %tmp
      inc %i
      .set %last.num $calc(%last.num + 1)
      /.write -ds $+ %tmp gather.txt
      .unset %tmp
    }
    msg $chan Team A: %p1 $chr(124) %p2 $chr(124) %p3 $chr(124) %p4 $chr(124) %p5 Team B: %p6 $chr(124) %p7 $chr(124) %p8 $chr(124) %p9 $chr(124) %p10
    msg $chan Match Begins. Please wait till you get the password.
    /send.pass
  }
}

on *:text:!off:#:{
  if ($nick isop $chan) {
    if (%gather.on = 1) {
      .set %gather.on 0
      .msg $chan Gather is now turned off
      .set %p1 x | .set %p2 x | .set %p3 x | .set %p4 x | .set %p5 x | .set %p6 x | .set %p7 x | .set %p8 x | .set %p9 x | .set %p10 x
      .unset %ip | .unset %port | .unset %chan | .unset %nick
      .unset %pass.typed | .unset %last.player | .unset %last.num
      /.remove gather.txt
      .set %online 0
    }
    elseif (%gather.on = 0) { msg $chan Gather is already off }
  }
}
alias send.pass {
  .write gather.txt %p1 | .write gather.txt %p2 | .write gather.txt %p3 | .write gather.txt %p4 | .write gather.txt %p5 | .write gather.txt %p6 | .write gather.txt %p7 | .write gather.txt %p8 | .write gather.txt %p9 | .write gather.txt %p10
  .set %i 1
  while (%i <= 10) {
    .set %tmp $read(gather.txt,%i)
    inc %i
    if (%tmp != $null) {
      .msg %tmp Hello, server ip is  $+ %server.ip $+  and the password is  $+ %pass $+ 
      .msg %tmp Good luck & have fun
    }
    .unset %tmp
  }
  .msg %chan Game information has been sent. If u didnt get it plz ask administration.
  /.remove gather.txt
  if (%gather.on = 1) {
    .set %gather.on 0
    .set %p1 x | .set %p2 x | .set %p3 x | .set %p4 x | .set %p5 x | .set %p6 x | .set %p7 x | .set %p8 x | .set %p9 x | .set %p10 x
    .unset %ip | .unset %port | .unset %chan | .unset %nick
    .unset %pass.typed | .unset %last.player | .unset %last.num
    /.remove gather.txt
    .set %online 0
  }
}

menu menubar {
  Gather
  .Set pass:/.set %pass $?="What's the pasword?"
  .Set IP:/.set %server.ip $?="What's the server ip?"
  .Set map:/.set %map $?="What's the map?"
}


If you need something else, tell me ill make it for ya. gl & hf
Related topics
Make a mIRC channel
What do most of you do when you are online?
mIRC for begginers.
Creating an RPG bot in IRC (yes I wrote this)
The Official FriHost IRC Channel!
[JAVA TUTORIALS & FILES] - Java Scripting world
To Moderators: Should C++ questions be in "scripting&am
programming
bash scripting help
PHP Scripting for Dummies... like me?
web hosting
Search Engine Listings
Mirc Scripting
Mirc Scripting Forums
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.