mIRC Home    About    Download    Register    News    Help

Print Thread
O
onesikgypo
onesikgypo
O
hey, not entirely sure how to do this so would love some direction, basically i want to write all voiced nicks with ADMIN- in their nick to a number of different text files

i.e

VoicedNicks[1].txt
VoicedNicks[2].txt etc.

and about 15 - 20 names in each

D
DaveC
DaveC
D
Code:
;$1 = chan
;$2 = filename
;$3 = number per file
;$4 = wildmatch for nick (aka ADMIN-*)
alias voiced.nicks.to.text.files {
  var %f = 1, %n = 1, %i = 1
  while ($nick($1,%i,v) != $null) {
    if ($4 iswm $v1) {
      write $iif(!%n,-c) $+($2,[,%f,].txt) $v2
      inc %n
      if (%n > $3) {
        var %n = 1
        inc %f
      }
    }
    inc %i
  }
}

* code untested *

so usage would be ...
/voiced.nicks.to.text.files #yourchan VoicedNicks 15 ADMIN-*
or
$voiced.nicks.to.text.files(#yourchan,VoicedNicks,15,ADMIN-*)

O
onesikgypo
onesikgypo
O
got a little problem with this script, maybe because i didnt explain it properly, however i need the nick's written to the text file, not just the different text files being created

D
DaveC
DaveC
D
Code had a stuttle fault in it.

Code:
;$1 = chan
;$2 = filename
;$3 = number per file
;$4 = wildmatch for nick (aka ADMIN-*)
alias voiced.nicks.to.text.files {
  var %f = 1, %n = 1, %i = 1
  while ($nick($1,%i,v) != $null) {
    if ($4 iswm $v1) {
      write $iif(%n == 1,-c) $+($2,[,%f,].txt) [ $v2 ]
      inc %n
      if (%n > $3) {
        var %n = 1
        inc %f
      }
    }
    inc %i
  }
}

* tested, working *

The fault was $v2 was wanted from the IF above, but was lost due to the $iif earlier on the line, i used [ & ] as there ment to be for, to control the order of evaluation, namely evaluate $v2 before the $iif.

--edit--
just saw a second fault frown, was using !%n when it should have been %n == 1

Last edited by DaveC; 12/04/06 10:14 PM.

Link Copied to Clipboard