mIRC Home    About    Download    Register    News    Help

Print Thread
INI list #147679 22/04/06 02:30 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
i have this:

Code:
 
on 1000:text:-ulist:#:{ .getuserlist users $scriptdir\remote.ini }

alias getuserlist {
  ; Syntax: /getuserlist <section> <path\file>
  if (!$isfile($2-)) .notice $nick File doesn't exist. $+($chr(40),$2-,$chr(41))
  elseif (!$ini($2-,$1)) .notice $nick Section $+(,$1,) does not exist. $+($chr(40),$2-,$chr(41))
  else {
    var %i = 1
    while ($ini($3-,$1,%i) != $null) {
      .notice $nick $v1
      inc %i
    }
  }
}

 


but it doesnt works :tongue:

ini file looks like this:

[users]
n0=10:*!*@antipiratbyran.info
n1=10:*!*@needs.more.b33r.net
n2=10:*!*@likes.drunkenprogramming.net

so on bot command -ulist i wouls wish bot to notice me
this list (from USERS section) if possible without n0=LEVEL:
lines.

anyone can help me with this?


IceCapped
Re: INI list #147680 22/04/06 02:34 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
alias getuserlist {
  var %ini = $ini($2-,$1)
  ; Syntax: /getuserlist <section> <path\file>
  if (!$isfile($2-)) .notice $nick File doesn't exist. $+($chr(40),$2-,$chr(41))
  elseif (!%ini) .notice $nick Section $+(,$1,) does not exist. $+($chr(40),$2-,$chr(41))
  else {
    var %i = 1
    while ($readini($2-,%ini,n $+ %i) != $null) {
      .notice $nick $gettok($v1,2,58)
      inc %i
    }
  }
}

Re: INI list #147681 22/04/06 02:37 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
hi hixxy
unfortunately it doesnt give me again nothing


IceCapped
Re: INI list #147682 22/04/06 02:45 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Sorry, made a couple of small mistakes. Tested this and it works:

Code:
alias getuserlist {
  var %ini = $ini($2-,$1)
  ; Syntax: /getuserlist <section> <path\file>
  if (!$isfile($2-)) .notice $nick File doesn't exist. $+($chr(40),$2-,$chr(41))
  elseif (!%ini) .notice $nick Section $+(,$1,) does not exist. $+($chr(40),$2-,$chr(41))
  else {
    var %i = 0
    while ($readini($2-,$1,n $+ %i) != $null) {
      .notice $nick $gettok($v1,2,58)
      inc %i
    }
  }
}

Re: INI list #147683 22/04/06 02:49 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
wow, it works perfect ! =D

thank you very much hixxy


IceCapped