mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2004
Posts: 23
X
x3RiouS Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: May 2004
Posts: 23
Well, my knowledge at mIRC scripting sux.
Yet, I tried to write a script. I'm sure there are lots and lots of simple mistakes in it:
Code:
ON +100:text:start gather:?: { 
  .msg $nick The gather has started
  .set %i 1
  .set %teamA 0
  .set %teamB 0
  .enable #gather   
}
ON +100:text:cancel gather:?: {
  .disable #gather
  .msg $nick The gather has been cancelled
  .msg #chan 2>>> 5[7,15$nick has cancelled the gather5] 2<<<
}
#gather off
.msg #chan 2>>> 5[7,15A Gather Has Started. Say !add to play in the gather.5] 2<<<
while(%i<=10){
ON *:text:!addme:#chan:{
  %i++;
  .set %player%i $nick
  if(%teamA >= %teamB) { 
  .set %playert%i A }
  else .set %playert%i B
  .set %j 1
  .set %k %playert1
  .msg $chan 14>>> 5[7,15Players: %i / 10 || Team Alpha: while(%k) { if(%k == A){ echo %player%j
%j++ } } %j=1 || Team Bravo: while(%k) { if(%k == B){ echo %player%j
%j++ } } %j=1 5] 14<<<
}
}
#gather end

Plz, I would be greatful if you'll correct me and explaine me more about the mIRC scripting syntax.
10q very much!

Last edited by x3RiouS; 10/05/04 06:14 PM.
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Untested, but try
Code:
ON +100:text:start gather:?: { 
  msg $nick The gather has started
  set %alpha. 0
  set %beta. 0
  .enable #gather 
  msg #chan 2>>>5[7,15 A Gather Has Started. Say !add to play in the gather.5] 2<<<
  .timergather 1 30 stopgather
}
ON +100:text:cancel gather:?: {
  .disable #gather
  msg $nick The gather has been cancelled
  msg #chan 2>>>5[7,15 $nick has cancelled the gather5] 2<<<
}
alias stopgather {
  msg #chan Gather has stopped.
  .disable #gather
  msg $chan 14>>>5[7,15 Players:
  var %i = 1,%alpha
  while $var(%alpha.*,%i) { %alpha = %alpha $var($ifmatch).value | inc %i }
  var %i = 1,%beta
  while $var(%beta.*,%i) { %beta = %beta $var($ifmatch).value | inc %i }
  msg #chan Players Team Alpha: %alpha
  msg #chan Players Team Alpha: %beta
  unset %alpha.* %beta.*
}
#gather off
ON *:text:!addme:#chan:{
  if (%alpha.1 >= %beta.1) {
    set %alpha. $+ $nick $nick
    inc %alpha.i
  }
  else {
    set %beta. $+ $nick $nick
    inc %beta.i
  }
}
#gather end

Joined: May 2004
Posts: 23
X
x3RiouS Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: May 2004
Posts: 23
10q.
The result is better than mine, yet not perfect.
that's whas the above script shows:
Quote:
A Gather Has Started. Say !addme to play in the gather
!addme
!addme
!addme
!addme
!addme
Gather has stopped.
Players Team Alpha: 1 1 1 1
Players Team Bravo: 1


How can I make the players show and why doesn't it balance the teams?
Can I make it show the teams and number of players after everytime someone writes !addme?
How can I prevent people from beeing twice at a gather?
And can I make it stop when there are 10 people and not after 30 minutes?

Last edited by x3RiouS; 11/05/04 12:08 PM.

Link Copied to Clipboard