mIRC Homepage
Posted By: Jigsy $identifier problem. - 07/11/06 11:03 PM
If this is in the wrong section then I apologize.

I'm having some kind of crisis wif my $identifiers in one of my scripts.



And yet:

//echo -aet $_qt(Hello!)
//echo -aet $is_service(ChanServ)

Quote:

* No such identifier: $_qt
* No such identifier: $is_service


I've actually reloaded the script three times and restarted mIRC, and yet it's still not working. frown

Any help would be greatly appreciated.
Posted By: Riamus2 Re: $identifier problem. - 07/11/06 11:11 PM
Well, the aliases appear to be fine. Have you looked to make sure you don't have any {} mismatches? That would be the only thing I can think of.

The strange thing is that if I don't have those aliases entered and I try those echo commands you gave, I don't get the no such identifier errors. Instead, I get insufficient params for echo. (v6.2)

EDIT: You could also make your IF statement just see if $qt is valid rather than checking the version, if you wanted. if ($qt(a)) ... if it's valid, then you know $qt is available to use. Otheriwse, it would be $null and you'd know $qt wasn't available. Not really a big deal, but it does save a few characters. smile
Posted By: qwerty Re: $identifier problem. - 07/11/06 11:12 PM
I don't see anything wrong, so look for the usual suspect: a bracket mismatch. Hit the {} key to see if there is one.

Btw, your $_qt/$_noqt aren't correct wink
Check
//echo -a $qt("abc")
and
//echo -a $noqt(a"b""c"d)
to see why
Posted By: Jigsy Re: $identifier problem. - 07/11/06 11:15 PM
No bracket mismatch found.

Also, the $_noqt() isn't ment to be the same as $noqt(). However I'mma fix that $_qt() one. :P
Posted By: Riamus2 Re: $identifier problem. - 07/11/06 11:17 PM
Have you tried putting those aliases into a blank script to see if they work there?

Also, I edited my previous post in case you missed seeing that since it was edited when you were replying.
Posted By: Mpdreamz Re: $identifier problem. - 07/11/06 11:20 PM
Checking if ($qt(a)) is not a very failsave method with custum identifiers called qt.

Admittingly it's a very small odd that someone has a qt alias loaded.
Posted By: Jigsy Re: $identifier problem. - 07/11/06 11:21 PM
They'll work in any other remote scripts apart from this one. frown
Posted By: Riamus2 Re: $identifier problem. - 07/11/06 11:22 PM
Ah... good point. Well, then... if ($qt(a) == "a")

Granted that's not really much smaller and it's not really that helpful, either. That's what I get for not thinking it through all the way.
Posted By: Riamus2 Re: $identifier problem. - 07/11/06 11:23 PM
It would have to be a bracket issue, even if that button doesn't show you any. I don't know what else it could be. You could always put those aliases at the top of that script file.

EDIT: Does |_noqt work?
Posted By: Jigsy Re: $identifier problem. - 07/11/06 11:24 PM
Weirdly enough the same problem still applies even if I do that. O_o
Posted By: Riamus2 Re: $identifier problem. - 07/11/06 11:26 PM
Does the rest of that script work?

What happens if you copy/paste that entire script into a new script file (*and unload the original*)? Perhaps the file is corrupted in Windows.
Posted By: Mpdreamz Re: $identifier problem. - 07/11/06 11:30 PM
On that note ($qt() == "") would work just as well smile Still preffer version checking though.
Just a late night boring totally unimportant reply :P
Posted By: Jigsy Re: $identifier problem. - 07/11/06 11:30 PM
Still won't work. smirk
Posted By: Riamus2 Re: $identifier problem. - 07/11/06 11:34 PM
Lol. You aren't having much luck tonight. It doesn't make sense if it doesn't work at the top of the script, but works on a new script, and doesn't work if the whole thing is on a new script.

(did you remember to unload the original?)

At that point, I might suggest sending the full script file to someone else to test and see if it is the script or something with your mIRC. As I mentioned, I don't get an unknown identifier error if it's not loaded.
Posted By: Jigsy Re: $identifier problem. - 07/11/06 11:40 PM
Anyone willing to look at the code?
Posted By: Riamus2 Re: $identifier problem. - 07/11/06 11:43 PM
I'm not at home right now, so I can't. If you have no replies within about 2 hours, I'll be home and you can visit me in the #Invision channel (see my signature) and I'll look at it for you. I'm betting someone will be able to help before then, but I wanted to throw it out just in case.
Posted By: Jigsy Re: $identifier problem. - 07/11/06 11:47 PM
No worries, I'll try bug someone off IRC in the mean time. :P
Posted By: RusselB Re: $identifier problem. - 08/11/06 12:29 AM
I'm always willing to look at code. If it's small enough to post here, then please do so, otherwise contact me and we'll arrange a way for you to get the code to me. Please note that I'm unsure as to how much code can be placed in a single post, but I seem to remember having difficulties with very long codes previously (eg: 500 lines or more)
Posted By: Jigsy Re: $identifier problem. - 08/11/06 12:37 AM
I'll e-mail it you.
Posted By: RusselB Re: $identifier problem. - 08/11/06 01:08 AM
Thanks..I've reviewed the code and while I know why you're getting this problem, I'm unable to find a solution.

For some reason (and I haven't a clue as to why) your aliases aren't being recognized. You can test/check this yourself by using //echo -a $isalias(<alias name>)

If the alias exists (doesn't work with local aliases, since they can only be called from within the script), then it returns $true..otherwise $false

When I checked the aliases listed in your code, they returned $false, inspite of the fact that I can see the alias definition.

Sorry I can't be of more help.
Posted By: Jigsy Re: $identifier problem. - 08/11/06 01:11 AM
It's alright, at least I know now that my script doesn't effect just me. frown
Posted By: Riamus2 Re: $identifier problem. - 08/11/06 01:33 AM
I'm around now, if you need.
Posted By: deegee Re: $identifier problem. - 08/11/06 02:30 AM
Out of curiosity, what is the name of the file? I notice it's blanked out, maybe it's to do with the name?
Posted By: DaveC Re: $identifier problem. - 08/11/06 04:45 AM
Dump that pointless version check stuff and just add these alas's (i not you said your _noqt is ment to be different, so you obviously need to keep that, but this gets you $qt and $noqt)

alias qt { if ($isid) { return $+($iif($left($1,1) != ","),$1,$iif($right($1,1) != ",")) } }
alias noqt { if ($isid) { return $+($iif($left($1,1) != ",$v1),$left($right($1,-1),-1),$iif($right($1,1) != ",$v1)) } }


Now if you happen to be running a version or mirc with out these well here hey are!
And if your running a version of mirc with these identifiers well who cares, internal identifiers override custom ones so these never get called.

* These do have one small drawback, in that multiple consecutive and leading/trailing spaces passed in a string well be lost, but this is a generic drawback with all custom identifiers.

As to why there not working in your code, i notic the scroll bar on the code is a long way dwn the page, it might be a bracket miss match, which under some conditions can seem to slip through the [{}] button, but I would hazzard a guess it might also be a #group command and the group is switched off.

There is an interesting odity in that if you have a group off in the script editor and the script is running and switches the group on (in a remote event say), and then you save the mrc file its off again, becuase in the script editor it doesnt update when the script turned it on, now if you are using some variable to tell your scrpt if script parts that are in groups are enabled or not and thus can or cant be called, rather than checking if the groups enabled then that var can be set to group enabled, while the group isnt, causing just such errors, i myself have fallen to this problem several times, i now use a custom identifier to return group states as true or false by testing them (im sure it puts heaps more tasking on but well to bad!)
Posted By: Riamus2 Re: $identifier problem. - 08/11/06 02:24 PM
The group idea is a good one that I didn't think of... but that shouldn't prevent the aliases from working when they are put at the top of the script file. Same for bracket mismatches, which had been suggested before.
Posted By: qwerty Re: $identifier problem. - 08/11/06 02:58 PM
Quote:
* These do have one small drawback, in that multiple consecutive and leading/trailing spaces passed in a string well be lost, but this is a generic drawback with all custom identifiers.

Not as of v6.2, where you can use /returnex instead of /return. It's undocumented, so all standard disclaimers apply.
Posted By: DaveC Re: $identifier problem. - 09/11/06 09:47 AM
heheheh

alias qt { if ($isid) { returnex $+($iif($left($1,1) != ","),$1,$iif($right($1,1) != ",")) } }
alias noqt { if ($isid) { returnex $+($iif($left($1,1) != ",$v1),$left($right($1,-1),-1),$iif($right($1,1) != ",$v1)) } }

Would seem a little pointless in 6.2! since $qt and $noqt are also in 6.2

However thanks I didnt know about a /returnex at all. Where did you find that jem?
Posted By: qwerty Re: $identifier problem. - 09/11/06 10:40 AM
Not just pointless but impossible, since you can't override built-in identifiers smile I just thought you'd want to know about /returnex in general. Certain $regsubex bugs (that have been reported here) caused errors like "RETURNEX<something> unknown command", which gives a strong hint that mirc tried to call such command. "/!returnex" is also a string in mirc.exe.
Posted By: Jigsy Re: $identifier problem. - 09/11/06 02:28 PM
I'm just thinking ... is there a certain limit to the number of aliases you can define in a script?
Posted By: RusselB Re: $identifier problem. - 09/11/06 11:28 PM
If there is, it's a high number, since I have a script that contains nothing but small workarounds in alias format, and there's about 200 of them in the script, and they all work fine.
Posted By: DaveC Re: $identifier problem. - 10/11/06 06:14 AM
Quote:
"/!returnex" is also a string in mirc.exe.

oh dear, you woudnt be disassembling / backward enginering the exe would you, call a moderator quick! ....... oh wait well errrr nm then eh! :-)
Posted By: Jigsy Re: $identifier problem. - 12/11/06 08:14 AM
Semi-doubtful, but what about a limit on /* comments */ ?
Posted By: Jigsy Re: $identifier problem. - 14/11/06 09:42 PM
I've managed to fix the problem.

I copied over about 50+ aliases into notepad and then deleted them from the script. Now everything seems to be working fine.

So either the aliases were causing the problem or the comment lines were. However when I grouped or /* commented */ the aliases it still refused to work.

So there might be some kind of limit. *shrugs*

Thanks for all the help though.
© mIRC Discussion Forums