mIRC Home    About    Download    Register    News    Help

Print Thread
#17218 28/03/03 04:15 PM
Joined: Mar 2003
Posts: 49
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2003
Posts: 49
I want that when i write
!rank $nick
The bot answer to me
The nick $nick is in the place with lines
e.g
I write
!rank SnakeRulez
The bot write
The nick SnakeRulez is in the 1 place with 1923 lines!

and i want that be to all the users like
!rank Snake
!rank Angel

Please help me do this wink crazy wink crazy
and all this in variables

#17219 28/03/03 05:20 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Assuming you have already made the variables (%lines.nick & %place.nick), you can just use...

Code:
on 1:TEXT:!rank*:#: {
  /msg $chan The nick $$2 is in the %place. [ $+ [ $$2 ] ] place with %lines. [ $+ [ $$2 ] ] $+ !
}


-KingTomato
#17220 28/03/03 06:45 PM
Joined: Mar 2003
Posts: 49
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2003
Posts: 49
but i want that
%place. [ $+ [ $$2 ] ]
the bot automatic calc
and i want that when someone type
!rank 1
the bot write
The nick in the 1st place is [nick] with [lines] lines!
please how i can do this
help me crazy crazy crazy
And all this in variables

#17221 28/03/03 07:10 PM
Joined: Mar 2003
Posts: 272
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
Code:
On *:TEXT:*:#YourChannel:{
  inc %lines. [ $+ [ $nick ] ] 1
  if (!Rank == $1) { 
  msg $chan $2 wrote $iif(%lines. [ $+ [ $2 ] ],%lines. [ $+ [ $2 ] ],0) lines and is currently ranked $rank($2) $+ .
}
alias rank {
var %highest = $var(%lines.*,1).value, %i = 2
 while (%highest > $var(%lines.*,%i) {
  var %highest = $var(%lines.*,%i).value
  inc %i 1
}
}


Not too sure, but that should work. Have a good time flooding off.


- cF
Dedicated helper for rent.
#17222 29/03/03 07:19 AM
Joined: Mar 2003
Posts: 49
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2003
Posts: 49
the mirc write this
* /while: invalid format (line 8, rank.mrc)
frown

#17223 29/03/03 12:19 PM
Joined: Dec 2002
Posts: 395
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2002
Posts: 395
Code:
...
while (%highest > $var(%lines.*,%i)[color:red])[/color] {
...

#17224 29/03/03 01:02 PM
Joined: Mar 2003
Posts: 49
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2003
Posts: 49
Its not work :
when i write !rank snakerulez
the bot write
SnakeRulez wrote 3122 lines and is currently ranked .

#17225 30/03/03 01:36 AM
Joined: Mar 2003
Posts: 54
J
Babel fish
Offline
Babel fish
J
Joined: Mar 2003
Posts: 54
Because the code you were given doesn't /return anything, so the identifier is pointless and won't return a value for the script to relay to the channel.

#17226 30/03/03 04:05 PM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Code:
on *:text:*:#chan:{
  if $1 == !rank {
    var %a = $iif($2,$2,$nick),%b = $iif(%lines. [ $+ [ %a ] ],$ifmatch,0)
    msg $chan %a wrote %b lines $iif(%b,and is currently ranked $ord($rank(%a)))
  }
  else inc %lines. $+ $nick
}
alias rank {
  window -lh @@
  var %i = 1
  while $var(%lines.*,%i) { aline @@ $var(%lines.*,%i).value $ifmatch | inc %i }
  filter -wwcute 1 32 @@ @@ *
  %i = $fline(@@,$+(*,$1))
  window -c @@
  return %i
}

#17227 01/04/03 08:58 PM
Joined: Feb 2003
Posts: 33
G
Ameglian cow
Offline
Ameglian cow
G
Joined: Feb 2003
Posts: 33
maybe (just an id) it's easyer to work with $readini
and /writeini?

so you don't need to work with all those difficult vars %lines . $+ [ $$2] ]



Link Copied to Clipboard