mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 54
B
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2005
Posts: 54
confused mmkay so far the script i have for my alias problem is:
Code:
alias -l say { if (%sayon == False) { halt } | $iif($ulevel >= %saylevel, msg # $1-, $notlevel(%saylevel,$nick,$ulevel)) | /msgcheck %sayresponse ) }

And the function I have to calculate and call it is:
Code:
on *:TEXT:*:*: { if ($mid($1-,1,1) == %commandtag) { $iif($me == $nick,halt,$remove($1,%commandtag)) } }


Whenever someone with the right Ulevel says !say blah
it comes up with "* /msg: insufficient parameters (line 94, commands v4.mrc)"
if someone could help me thank you! ^_^

ini files:
would anyone know how to load ini files without them overwriting the original variables?


Chat NSN
My Server: sleepystickman.ircxpro.com
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
For the alias problem, try changing the # to the actual channel name. If the channel name is going to vary, then you'll have to pass the channel name to the alias, then reference it using $1, $2, $3, ... (or whatever happens to be the appropriate identifier)

Regarding the INI file question, I'm sorry, but I think the only way to do that would be to write the values that you want to stay the same to the ini file, then read the ini file.

Joined: Oct 2005
Posts: 54
B
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2005
Posts: 54
I actually tried switching it to $chan aswell but the same affect happened =\


Chat NSN
My Server: sleepystickman.ircxpro.com
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
First of all, $nick will NEVER equal $me for an on text event.... change 'SOMENICK' to the specific nickname. (note: also according to your script you want the script to work only if $nick is NOT 'somenick', if this is not what is wanted alter the $iif). Secondly the error is caused by the event not the alias, since you fail to send any information 'say' can not be used without parimaters.

As for the say alias, you had mismatched brackets and should probably use return rather than halt. Also changed # to $target since your event is not restricted to just channels. Should work, but untested on my side.
Code:
on *:TEXT:*:*: {
  if ($mid($1-,1,1) == %commandtag) {
    $iif(SOMENICK == $nick,return,$remove($1,%commandtag) $2-)
  }
}
alias -l say {
  if (%sayon == False) { return }
  $iif($ulevel >= %saylevel, msg $target $1-, $notlevel(%saylevel,$nick,$ulevel))
  msgcheck %sayresponse
}


Looking closer, i see no place where %sayresponse is set. So i can only assume that the $notlevel alias call sets this global variable.

If this is the case, you could change the notlevel to 'return blablabla' instead of 'set %sayresponse blablabla', then alter the $iif to something like '$iif($ulevel >= %saylevel, msg $target $1-, msgcheck $notlevel(%saylevel,$nick,$ulevel))' and remove the 'msgcheck %sayresponse' line.

Last edited by Om3n; 27/10/05 02:52 AM.

"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Joined: Oct 2005
Posts: 54
B
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2005
Posts: 54
aye, say response is set in my dialog
Code:
on *:dialog:options:sclick:9: { if ($did(options,4).sel == 1) { set %sayresponse $did(options,9).sel }

it works fine wink


Chat NSN
My Server: sleepystickman.ircxpro.com

Link Copied to Clipboard