mIRC Home    About    Download    Register    News    Help

Print Thread
#127201 10/08/05 09:27 AM
F
fobiC
fobiC
F
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 }

#127202 10/08/05 09:31 AM
Joined: May 2005
Posts: 106
S
Vogon poet
Offline
Vogon poet
S
Joined: May 2005
Posts: 106
Code:
 
on *:TEXT:!k*:*: {
  /kick # $2 Bye
  /write kicked.txt $2 was kicked from #
}
 


THIS CODE IS UNTESTED

#127203 10/08/05 09:47 AM
A
Abuser__
Abuser__
A
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.

#127204 10/08/05 09:58 AM
Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
$nick refers to the nickname typing !k.

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


-Andy

#127205 10/08/05 11:20 AM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
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)
}

#127206 11/08/05 09:58 AM
A
Abuser__
Abuser__
A
Quote:
$nick refers to the nickname typing !k.


I know..my little mistake grin

#127207 15/08/05 07:50 AM
_
_DuDe_
_DuDe_
_
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.


Link Copied to Clipboard