mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2013
Posts: 49
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Nov 2013
Posts: 49
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-
  }
}

Joined: Dec 2002
Posts: 5,420
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,420
Since you want to return the result from $data(), you need to use the "return" command, eg. return $readini().

Joined: Nov 2013
Posts: 49
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Nov 2013
Posts: 49
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.


Link Copied to Clipboard