mIRC Homepage
Posted By: lindenkron Posting alias result failure - 05/12/16 08:47 PM
Hey lads,
I've been looking and trying various things for over an hour to get this to spit out the result of the $readini and it keeps saying "Unknown Command" to the first word of the sentence (result). It's trying to fire it as a command instead of posting it as text. I'm sure it's basic flaw/mistake in the whole thing but I'm getting tired and want to move on. Anyone mind giving me a quick pointer? Thanks

Link to a picture where it's hightlight Syntaxed

Code:
alias msgbot {
  msg $1 /me || $2-
}

on *:TEXT:!input*:#: {
  if ($isSuperadmin) {
  var %msg = $data($2,$3,$4,$5,$6-)
  $msgbot($chan,%msg)
  }
}

alias data {
  ;;$data(write,filename,section,item,value)
  ;;$data(read,filename,section,item)
  if ($1 == read) {
  $readini(%BotNWLFolder. [ $+ [ $chan ] ] $+ [ $2 ] $+ .ini, n,$3,$4)
  }
  if ($1 == write) {
  writeini %BotNWLFolder. [ $+ [ $chan ] ] $+ [ $2 ] $+ .ini $3 $4 $5-
  }
}
Posted By: Khaled Re: Posting alias result failure - 06/12/16 09:31 AM
Since you want to return the result from $data(), you need to use the "return" command, eg. return $readini().
Posted By: lindenkron Re: Posting alias result failure - 06/12/16 03:08 PM
Originally Posted By: Khaled
Since you want to return the result from $data(), you need to use the "return" command, eg. return $readini().


The man himself, knew it was something simple. Didn't know return worked like that, have had this issue a few times.

Thanks! Works.
© mIRC Discussion Forums