mIRC Home    About    Download    Register    News    Help

Print Thread
#3642 27/12/02 06:19 AM
Joined: Dec 2002
Posts: 271
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 271
hey, i have this alias, that shows the users that won in the last round, along with the points they won, and how much they bet, but these users are shown in any order, i would like them to be shown in order of who won the highest amount of points....(if at all possible, maybe in order from the highest amount of points won, BASSED on the amount of points bet)

current alias:

Code:
  

alias -l showwon {
  if ($2 == points) {
    var %a = $ini(inplay.ini,won,0), %b Winners From Last Round --->
    if (%a == 0) {
      if ($3 == room) {
        domsg $iif($cset(main,allcolor),$ifmatch,$cset(main,gencolor)) %b NONE :|
      }
      else {
        tell $1 %b NONE :|
      }
      .halt
    }
    while (%a > 0) {
      %b = %b $+  $+ $ini(inplay.ini,won,%a) Bet ---> $bytes($dpoint($cplay(total,$ini(inplay.ini,won,%a))),b) Points, Won ---> $bytes($dpoint($cplay(won,$ini(inplay.ini,won,%a))),b) Points (Y)
      dec %a
    }
    if ($3 == room) {
      domsg $iif($cset(main,allcolor),$ifmatch,$cset(main,gencolor)) %b
    }
    else {
      tell $1 %b
    }
  }
  else {
    var %a = $ini(inplay.ini,won,0), %b Winners From Last Round --->
    if (%a == 0) {
      if ($2 == room) {
        domsg $iif($cset(main,allcolor),$ifmatch,$cset(main,gencolor)) %b NONE :|
      }
      else {
        tell $1 %b NONE :|
      }
      .halt
    }
    while (%a > 0) {
      %b = %b $+  $+ $ini(inplay.ini,won,%a)
      dec %a
    }
    if ($2 == room) {
      domsg $iif($cset(main,allcolor),$ifmatch,$cset(main,gencolor)) %b
    }
    else {
      tell $1 %b
    }
  }
}



and that would return something like:

Code:
  

NightChillz : !won points room
CASINO--BOT : 
Winners From Last Round --->
¤Constant_Virus¤ Bet ---> 4,000 Points, Won ---> 4,000 Points  
_sharky__ Bet ---> 9,999 Points, Won ---> 29,997 Points  
xX-DéMoN-Xx Bet ---> 4,000 Points, Won ---> 7,000 Points  
NightChillz Bet ---> 10,000 Points, Won ---> 20,000 Points  
\\Unknown Scr|pt/-\// Bet ---> 600 Points, Won ---> 1,200 Points   

#3643 27/12/02 06:38 AM
Joined: Dec 2002
Posts: 208
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 208
you have 3 basic options here

1. you could creat a window -h and send all of the data there then use window -s to sort the lines of the window and then loop though the lines in that window to display data.

2. tokenize the data into a string so that you could use $sorttok to sort the data as u wish.

3. creat a custom alias to read in and re order the data manualy (this option is far more compex than the above 2 options, but depending on how much data, and of what type, it might be the best alternitive)

that should give you some ideas. give it a try and see what you come up with. if you need more detail after trying feel free to ask smile

Cobra^

#3644 28/12/02 12:01 AM
Joined: Dec 2002
Posts: 271
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 271
Thanks, worked it out with aline'ing it all to a @ window, and...not sorting it with the -s property, cause that doesnt sort it the way i needed it sorter, but instear used the /filter commands once again, and worked it out with an alias....


Link Copied to Clipboard