mIRC Home    About    Download    Register    News    Help

Print Thread
#162342 17/10/06 04:22 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
3 checkboxes, ID 41, 42, & 43
Each checkbox is 3 state
If 41 is clicked and state does not equal 0 then 42 & 43 are unchecked
if 42 or 43 are clicked and state does not equal 0, then 41 is unchecked

I tried this
Code:
on *:dialog:dialog_name:sclick:41-43:{
  if $did(41).state {
    did -u $dname 42,43
  }
  if $did(42).state {
    did -u $dname 41,43
  }
  if $did(43).state {
    did -u $dname 41
  }
} 


but when tested, if a lower ID had a state, then the higher ID's wouldn't change

In case the above is confusing
Checking the first box unchecks the other two
Checking the 2nd box unchecks the first & 3rd
Checking the 3rd box unchecks the first

Hopefully one of the two explanations (if not both) is clear enough for someone to show how I should do this.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Its just a conflict dude to the 41-43 sclick event and if checking everything just do a seperate event for all

on *:dialog:dname:slick:41:{
if $did(41).state == 1 did -u $dname 42,43
else { did -c $dname 42,43 }
}

etc.... this won't conflict.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
thanks, seems a shame to have to have those 3 events coded separately when the ID parameter can handle the range.

Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
You could try this, I think it does the way you want.
Code:
on *:dialog:dialog_name:sclick:41-43:{
  if $did == 43 {
    if $did(43).state { did -u $dname 41 }
  }
  elseif $did($did).state { var %a = 41,42,43 | did -u $dname $remtok(%a,$did,44) }
}

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Have you tried changing the second and third 'if' to 'elseif'?

Also, you could try putting echo's within each if-statement to see which ones are firing and which ones aren't.

echo -a 40( $+ $did(40).state $+ ) 41( $+ $did(41).state $+ ) etc..

-genius_at_work

Last edited by genius_at_work; 17/10/06 02:18 PM.
Joined: Aug 2004
Posts: 423
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
how about something like this?

Code:
on *:dialog:dialog_name:sclick:41-43:{
  if $did == 41 && $did(41).state { did -u $dname 42,43 }
  elseif $did == 42 && $did(42).state { did -u $dname 41,43 }
  elseif $did == 43 && $did(43).state { did -u $dname 41,42 }
 }
  

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Quote:
how about something like this?

Code:
on *:dialog:dialog_name:sclick:41-43:{
  if $did == 41 && $did(41).state { did -u $dname 42,43 }
  elseif $did == 42 && $did(42).state { did -u $dname 41,43 }
  elseif $did == 43 && $did(43).state { did -u $dname 41,42 }
 }
  


it wont work, because of the conflict occuring still of the Unselect feature


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }

Link Copied to Clipboard