mIRC Home    About    Download    Register    News    Help

Print Thread
Page 3 of 3 1 2 3
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
I guess I could always change the format later on, if needed


I registered; you should too.
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
How can I prevent the following from showing an 'insufficant parameters' for /hadd after the last text file line read:

Code:
alias iptracker.init {
  var %a = 1, %b = $read(iptracker.txt,%a)
  while (%a <= %b) {
    var %b = $read(iptracker.txt,%a)
    var %nick = $gettok(%b,1,91)
    echo -s a: %a  nick: %nick  b: %b
    /hadd -s iptracker %nick %b
    inc %a
  }
}


I registered; you should too.
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
Quote:
var %a = 1, %b = $read(iptracker.txt,%a)
sould be
Quote:
var %a = 1, %b = $read(iptracker.txt,0)


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
Then the while look won't execute as %a will be 1 and %b will be $null.

What I ended up doing was preventing the /hadd if %b = $null

if (%b != $null) /hadd ...

Code:
alias iptracker.init {
  var %a = 1, %b = 1
  while (%a = %b) {
    var %c = $read(iptracker.txt,%a)
    var %nick = $gettok(%c,1,91)
    echo -s a: %a  nick: %nick  c: %c
    if (%c != $null) {
      /hadd -s iptracker %nick %b
      inc %a
    }
    var %b = $calc($readn + 1)
  }
}


I registered; you should too.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
alias iptracker.init {
  var %a = 1, %b = $lines(iptracker.txt)
  while (%a <= %b) {
    var %b = $read(iptracker.txt,%a)
    var %nick = $gettok(%b,1,91)
    echo -s a: %a  nick: %nick  b: %b
    /hadd -s iptracker %nick %b
    inc %a
  }
}


Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
Yes, i was tired, use RusselB's code

Last edited by Wims; 11/05/08 12:52 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Page 3 of 3 1 2 3

Link Copied to Clipboard