mIRC Home    About    Download    Register    News    Help

Print Thread
#11331 15/02/03 10:00 PM
Joined: Feb 2003
Posts: 10
T
Pikka bird
OP Offline
Pikka bird
T
Joined: Feb 2003
Posts: 10
After changing the title of a /dialog with /did -t you cannot properly get the $dialog().title for that dialog. Sample

I load a dialog called edituser, after it loads I change the title to Edit User - <nick>

The Original Title was Edit User, if I use $gettok($dialog(edituser).title,4,32) with /echo at the status window, it returns the nick fine, but if I use that in the on dialog sclick event it returns insufficient parameters, however to make things even more complicated, If I use /echo $dialog(edituser).title in the on dialog sclick event it echos the full title just fine :P

#11332 16/02/03 05:15 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
I'm sure you meant /dialog -t edituser New dialog title goes here.

Perhaps you might want to show us the offending code. Here's a quickie example of doing what you said, using the nicks in the channel #mIRC to cycle through (just for content).
Code:

alias edituser dialog -m edituser tdefEditUser
dialog tdefEditUser {
  title "User List Editor:"
  size -1 -1 102 42
  option dbu
  text "User name:", 1001, 3 6 28 6, right
  edit "", 1002, 33 4 65 10, autohs disable
  text "Level:", 1003, 3 16 28 6, right
  edit "", 1004, 33 14 65 10, autohs disable
  button "&amp;Previous", 1005, 3 26 30 12, disable
  button "&amp;Next", 1006, 36 26 30 12
  button "Done", 1007, 68 26 30 12, ok
}
on *:DIALOG:edituser:init:{
  did -f $dname 1002
}
on *:DIALOG:edituser:sclick:1006:{
  if ($did(1002).text ison #mIRC) var %x = $nick(#mIRC, $ifmatch)
  else var %x = 0
  inc %x
  if %x &lt;= $nick(#mIRC, 0) {
    did -ra $dname 1002 $nick(#mIRC, %x)
    dialog -t $dname Edit User - $nick(#mIRC, %x)
    did -e $dname 1002,1004
    echo $color(info) -esbflirt * Now editing user: $gettok($dialog($dname).title, 4, 32)
    if %x &gt; 1 did -e $dname 1005
    if %x == $nick(#mIRC, 0) did -b $dname 1006
    did -f $dname 1004
  }
}
on *:DIALOG:edituser:sclick:1005:{
  if ($did(1002).text ison #mIRC) var %x = $nick(#mIRC, $ifmatch)
  else var %x
  dec %x
  if %x &gt; 0 {
    did -ra $dname 1002 $nick(#mIRC, %x)
    dialog -t $dname Edit User - $nick(#mIRC, %x)
    echo $color(info) -esbflirt * Now editing user: $gettok($dialog($dname).title, 4, 32)
    if %x == 1 did -b $dname 1005
    if %x == $calc($nick(#mIRC, 0) - 1) did -e $dname 1006
    did -f $dname 1003
  }
}

/edituser works fine for me.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#11333 16/02/03 01:05 PM
Joined: Feb 2003
Posts: 10
T
Pikka bird
OP Offline
Pikka bird
T
Joined: Feb 2003
Posts: 10
I found the problem, I was using echo %enick, which mIRC does not like you tring to //echo %vars or $identifiers, it always wants something in from of them, IE I have to do /echo blah %enick, i cannot do /echo %enick, thats what was causing the error,

thanks for the help smile

#11334 16/02/03 02:59 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Nope, mirc has no problem echoing a variable by itself. I'm guessing you have the usual problem, which is that you tried to /echo a number without using any switches after that. In this case, mirc thinks the number is the color parameter, so it has the color but no text to echo.

Examples:
//var %a = 3 | echo %a -> doesn't work: insufficient parameters
//var %a = blah | echo %a -> works: "blah" is not a number, so mirc can't be confused
//var %a = 3 | echo -a %a -> works: since the number comes after the switch, it can't be a color number but actual text.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard