mIRC Homepage
Posted By: fobiC kick counter.. - 10/08/05 09:27 AM
i want to do so that if i type !k (nick) the bot kicks and writes i a txt.. then reads what it have written so, every time i kick some one with that command it adds one in the txt.. i tink it should look something like this but i suppose that i'm compleatly wrong... on 1001:text:!k &:#:{ write kick.txt | kick $chan read (kick.txt)$2 }
Posted By: Sleepyfreak Re: kick counter.. - 10/08/05 09:31 AM
Code:
 
on *:TEXT:!k*:*: {
  /kick # $2 Bye
  /write kicked.txt $2 was kicked from #
}
 


THIS CODE IS UNTESTED
Posted By: Abuser__ Re: kick counter.. - 10/08/05 09:47 AM
Code:
on 1001:TEXT:!k*:#: {  
  kick $chan $2 Bye $lines(kicked.txt)
  write kicked.txt $2 was kicked from #
}

$lines(kicked.txt) will make the bot read all lines in kicked.txt. That means it will display all lines of kicked nicks. But you don't have to write a file (except if you want to have all kicked nicks loged) Now here is more simple script:
Code:
on 1001:TEXT:!k*:#:{
  inc %kicked
  kick $chan $nick %kicked
}

That "inc" will increase %kicked every time when the command !k is gived.
Posted By: SladeKraven Re: kick counter.. - 10/08/05 09:58 AM
$nick refers to the nickname typing !k.

Code:
On @1001:Text:!k &:#: {
  inc %kick
  kick $chan $2 Kick number %kick
}


-Andy
Posted By: tidy_trax Re: kick counter.. - 10/08/05 11:20 AM
All of the scripts you've been given so far will increase the kick count even if you don't end up kicking the person for some reason, I'd use something like this instead:

Code:
on me:*:kick:#:{ 
  write kick.txt $knick kicked by $iif(%nick,$v1,$me)
  unset %nick
}
on @1001:text:!k &:#:{
  set -u3 %nick $nick
  kick $chan $2 $calc($lines(kick.txt) + 1)
}
Posted By: Abuser__ Re: kick counter.. - 11/08/05 09:58 AM
Quote:
$nick refers to the nickname typing !k.


I know..my little mistake grin
Posted By: _DuDe_ Re: kick counter.. - 15/08/05 07:50 AM
Quote:
All of the scripts you've been given so far will increase the kick count even if you don't end up kicking the person for some reason, I'd use something like this instead:

Code:
on me:*:kick:#:{ 
  write kick.txt $knick kicked by $iif(%nick,$v1,$me)
  unset %nick
}
on @1001:text:!k &:#:{
  set -u3 %nick $nick
  kick $chan $2 $calc($lines(kick.txt) + 1)
}


When would you ever not kick the person.

I reccomend a) using an .ini file, and b) using these scripts
Code:

on *:join:#: { 
if ( $readini(kicks.ini, Users, $nick) == $null ) {
writeini kicks.ini Users $nick 0
}
if ( $readini(kicks.ini, Users, $nick) != $null ) {
var %kick = $readini(kicks.ini, Users, $nick)
notice $nick You have been kicked from this channel %kick times.
}
}

Code:
on @1001:text:!k *:#: {
var %quack = $readini(kicks.ini, Users, $knick)
var %moo = $readini(kicks.ini, Totals, moo)
writeini kicks.ini Totals moo $calc( %moo + 1 )
writeini kicks.ini Users $knick $calc( %quack + 1 )
var %kick = $readini(kicks.ini, Users, $knick)
var %kicks = $readini(kicks.ini, Totals, moo)
kick $chan $2 You have now been kicked out of here %kick times. Chan Kick Total : %kicks
}


** Note: This has not been tested, but I did triple check the code to make sure it looks right.
© mIRC Discussion Forums