mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2006
Posts: 25
L
Lymril Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Feb 2006
Posts: 25
Here's a strange quirk that about drove me nuts before I found what was causing it. I stumbled across it as I was reworking a script so the script was doing some things I normally wouldn't have it do.

If you add a user to the userlist that has a non-numeric level and an address that is the same as your main nickname it will prevent dialog controls from functioning. Here's a short script that will cause the problem:

ALIAS Test {
nick test
set %testdata test
REM auser me %testdata
$dialog(Test, TestTable, -2)
}
DIALOG -l TestTable {
title This is a test:
size -1 -1 -1 -1
option dbu
button "Click Me!", 1, 5 25 118 12, default
}
on 1:DIALOG:Test:sclick:1: {
echo -s Click Detected!
}

Type "/test" in your status window test box and click Enter. The script will change your main nick to "test" and then bring up a dialog with a single button. If you click the button you should see the words "Click Detected!" in your status window.

Bring up the script and remove the REM before the auser command. This will cause "me:test" to be added to your user list before bringing up the dialog. Click the button and the "Click Detected!" will no no longer appear in your status window.

Delete the "me:test" entry from your users list and REM out the auser line. Run the test and the button will work properly.

I'm using mIRC version 6.2. I had a blank userlist before running the script so I haven't tested it with other users of the same level, etc.

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
This is not a bug. on 1:EVENT: will trigger for all users, except when the associated user (in case of dialog events, you) is on a named level. This is why scripters generally avoid 1 and use * instead:
[code]...
on *:dialog:sclick:1:{
...
}
...


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Feb 2006
Posts: 25
L
Lymril Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Feb 2006
Posts: 25
Okay, I didn't realize that a username would affect dialog scripts since dialogs aren't accessed from the outside. I'll change the 1 to * in my scripts where appropriate. Thanks!


Link Copied to Clipboard