scripting - mIRC: Check if INI-file has a key -


i'm trying see if there entry in ini-file user's nick key or not. if not; make entry. if exists; post error message.

var %previous = $readini(numbers.ini,number,$nick)  if(%previous != $null) {   msg $chan $nick , have written %previous . } else {   writeini numbers.ini number $nick $2   msg $chan $nick has written $2. } 

what's happening script above is never $null, , can't find anywhere returned $readini if key not found.

$ini(numbers.ini, numbers, $nick) return number n (indicating item nth item in section) if exists. if not exist, return $null.

in case, you'll want along lines of

if ($ini(numbers.ini, numbers, $nick) != $null) {   msg $chan $nick , have written $readini(numbers.ini, numbers, $nick) } else {   writeini numbers.ini numbers $nick $2   msg $chan $nick has written $2. } 

Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -