mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
hi i wanted to make a script where when you type
!checkkicks in the channel the script would message the channel how many times the person has been kicked, ive got this, but i need help with the "rank" bit, i dunno how to do it, i wanted it so when it messaged the channel it would say you are rank X (1 being the most kicks)

i got the followin code

Code:
on *:KICK:#:{
  if (!$hget(kick.counter.list) && $isfile(kick.counter.list.bin)) { hmake kick.counter.list | hload -b kick.counter.list kick.counter.list.bin } | hinc -m kick.counter.list $+($address($knick,2),@,$chan) | hsave -bo kick.counter.list kick.counter.list.bin
  if (!$hget(nick.address.list) && $isfile(nick.address.list.bin)) { hmake nick.address.list | hload -b nick.address.list nick.address.list.bin } | hadd -m nick.address.list $knick $address($knick,2) | hsave -bo nick.address.list nick.address.list.bin
}
on *:TEXT:!checkkicks &:#:{ checkkicks $2 }
alias checkkicks {
  if (!$chan) { echo -s Checkkicks must be run on a channel | return }
  if (!$hget(kick.counter.list) && $isfile(kick.counter.list.bin)) { hmake kick.counter.list | hload -b kick.counter.list kick.counter.list.bin }
  if (!$hget(nick.address.list) && $isfile(nick.address.list.bin)) { hmake nick.address.list | hload -b nick.address.list nick.address.list.bin }
  var %address = $hget(nick.address.list,$1)
  var %total = $hget(kick.counter.list,$+(%address,@,$chan))
  if ((%address) && (%total)) {
    msg $chan $1 has had a total of %total kicks.
  }
}

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
on *:KICK:#:{
  if (!$hget(kick.counter.list) && $isfile(kick.counter.list.bin)) { hmake kick.counter.list | hload -b kick.counter.list kick.counter.list.bin } | hinc -m kick.counter.list $+($address($knick,2),@,$chan) | hsave -bo kick.counter.list kick.counter.list.bin
  if (!$hget(nick.address.list) && $isfile(nick.address.list.bin)) { hmake nick.address.list | hload -b nick.address.list nick.address.list.bin } | hadd -m nick.address.list $knick $address($knick,2) | hsave -bo nick.address.list nick.address.list.bin
}
on *:TEXT:!checkkicks &:#:{ checkkicks $2 }
alias checkkicks {
  if (!$chan) { echo -s Checkkicks must be run on a channel | return }
  if (!$hget(kick.counter.list) && $isfile(kick.counter.list.bin)) { hmake kick.counter.list | hload -b kick.counter.list kick.counter.list.bin }
  if (!$hget(nick.address.list) && $isfile(nick.address.list.bin)) { hmake nick.address.list | hload -b nick.address.list nick.address.list.bin }
  var %address = $hget(nick.address.list,$1)
  var %total = $hget(kick.counter.list,$+(%address,@,$chan))
  if ((%address) && (%total)) {
    [color:blue];
    set %checkkicks.rank  1
    set %checkkicks.total %total
    hsave -o kick.counter.list kick.counter.list.temp.txt
    filter -fk kick.counter.list.temp.txt checkkicks.filter.alias $+(*,@,$chan)
    msg $chan $1 has had a total of %total kicks, ranking as number %checkkicks.rank
    ;[/color]
  }
}
alias -l checkkicks.filter.alias { if ($hget(kick.counter.list,$1) > %checkkicks.total) { inc -s %checkkicks.rank } }

* code untested, looks sound tho.

1st set the rank to 1and store the total kicks for this person
2nd save the hashtable
3rd filter through the hastable save file for ONLY [email]addresss@chan[/email] that match the channel, this should ignore other channels and kick counts, sending each match line to the alias 3*
4th display the result

3* the alias compares the value from that [email]address@chan[/email] hashtable entry to the current persons one, and increases there ranking position if its higher one than theres.

Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
ok theres 2 probs im having with this script

the 1st is that say a person and an op hadd in common #channel1 and #channel2, when the op kicks the person in #channel1, the amount of kicks the script says he has jumps by 2 not 1

also, the rank isnt working as an individual thing:

Code:
[05:34:06] <Gypo> The-Matrix has had a total of 6 kicks, ranking as number 1
[05:34:14] <Gypo> Critic has had a total of 4 kicks, ranking as number 1

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
the 1st is that say a person and an op hadd in common #channel1 and #channel2, when the op kicks the person in #channel1, the amount of kicks the script says he has jumps by 2 not 1


Thats not in my code, and by the looks isnt in the original code either, I would question if you might have the script loaded twice.

Quote:
also, the rank isnt working as an individual thing:
Code:
[05:34:06] <Gypo> The-Matrix has had a total of 6 kicks, ranking as number 1
[05:34:14] <Gypo> Critic has had a total of 4 kicks, ranking as number 1


The Filter -k option requieres mirc 6.16 is that the version in use?

Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
sorry bout the delay - u were right about the first problem, but the second problem is still there

im using version 6.16 on a fresh mirc - still says rank is the same

Code:
[20:38:20pm] <matrix> onesikgypo has had a total of 3 kicks, ranking as number 1
[20:38:23pm] <matrix> bla has had a total of 1 kicks, ranking as number 1


Link Copied to Clipboard