I was missing the parens in an if statement, use this:
Code:
alias awardpoints {
  var %chan = $$1, %table = coins. $+ %chan, %file = coins.ini

  if (!$hget(%table)) {
    hmake %table
    if ($ini(%file,%chan)) hload -i %table %file %chan
  }

  var %i = 1, %n = $nick(%chan,0)
  while (%i <= %n) {
    hinc %table $nick(%chan,%i)
    inc %i
  }

  hdel %table nightbot
  hdel %table tylerb0t
  hdel %table tylersgaming

  hsave -i %table %file %chan
}


It's a replacement for your existing alias. It takes the channel name as input, and as output you get an ini file with the channel as the section name. It does not use plain text files. Those were the problem. Maybe you can loop over the hash table at the end and write to plain text instead of ini, but altering the c++ would probably make more sense.

To convert your existing point structure to ini you'll need to loop over both files and use writeini, or add them to the hash table and save it when you're done.

/help hash tables
/help writeini

Last edited by Loki12583; 21/08/14 11:49 AM.