mIRC Home    About    Download    Register    News    Help

Print Thread
#223969 03/08/10 08:30 PM
Joined: Aug 2010
Posts: 69
N
N3M3S1S Offline OP
Babel fish
OP Offline
Babel fish
N
Joined: Aug 2010
Posts: 69
Code:
dialog dxmsg1 {
  size -1 -1 230 295
  icon 01/DX007.ico
  title mIRC-DeluXe Messenger
  box "Online"1, 5 5 220 105
  list 2, 10 20 210 90,vsbar
  box "Offline"3, 5 110 220 105
  list 4, 10 125 210 90,vsbar
  button "Add user"5, 20 220 90 20
  button "Remove user"6, 115 220 90 20
  button "Send Message"7, 20 245 90 20
  button "Options"8, 115 245 90 20
  button "Close"9, 65 270 90 20,ok
}
on *:DIALOG:dxmsg1:init:*: {
  %dxmsg = 1
  while (%dxmsg1 <= $notify(0)) {
    if ($notify(%dxmsg1).ison == $true) { did -a dxmsg1 2 $notify(%dxmsg1) }
    elseif ($notify(%dxmsg1).ison == $false) { did -a dxmsg1 4 $notify(%dxmsg1) }
    inc %dxmsg1
  }
}

Whats wrong here? It wont even list the names in the dialog.


"There is no theory of evolution, only a list of creatures Chuck Norris allows to live."
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
%dxmsg = 1
while (%dxmsg1 <=

%dxmsg != %dxmsg1

Joined: Aug 2010
Posts: 69
N
N3M3S1S Offline OP
Babel fish
OP Offline
Babel fish
N
Joined: Aug 2010
Posts: 69
LMAO blush I usually catch those kinds of errors! *slaps self* Thanks a lot.


"There is no theory of evolution, only a list of creatures Chuck Norris allows to live."
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
you set the global var "%dxmsg" but check for (while %dxmsg1 <= $notify(0)).

Two notes if you don't mind...
- I'd use a local variable - they can neither conflict with other scripts / aliases nor will they obstruct the variables section.
- If $notify().ison is not true, it's either false or null. Since you loop "while <= $notify(0)", it cannot be null - a simple else would suffice.
Personally, I'd use:
Code:
on *:dialog:dxmsg1:init:*: {
  var %x = 1
  while ($notify(%x).ison != $null) {
    did -a $dname $iif($v1,2,4) $notify(%x)
    inc %x
  }
}
(2 calls of the $notify identifier per %x instead of 3 or 4) smile

...beat me to it...


Link Copied to Clipboard