mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 292
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 292
This is just test code for now, until i can put it into my real script
The problem i have is using Checkbox to enable and disable #groups

Code:
dialog gtest {
  title ""
  size -1 -1 107 60
  option dbu
  text "Group Checkbox Test", 1, 5 5 100 8, center
  check "Click here to turn on or off groups", 2, 5 18 100 10
  edit "", 3, 5 30 50 10, read center
  button "OK!", 4, 5 45 37 12, ok
}

on 1:dialog:gtest:sclick:2: {
  $iif($did(2).state == 0,set %check Off,set %check On) | did -r $dname 3
  did -a $dname 3 %check
  $iif(%check == On, .enable [color:red]#gtest[/color])
}
[color:red]#gtest on
ON *:DIALOG:gtest:sclick:2 {
  echo -a Test
}
[color:green];What goes here ?, this is where  my problem lies i think[/color]
#gtest end
[/color] 


The above code works, in that it will say On or Off in the edit box, but wont enable the group
maybe i got something wrong.

I did take the checkbox code from an old script of mine to be used for timers and that works
but this is the first time for #groups.

Also is it possible to pull the #groups enable/disable from an external .mrc file ?
For example, i use the above code but the groups are in another mirc script file

Or will i have to put my groups into the script i have the checkbox's in ?
which i dont wanna do if i dont have to.

Can somebody help me in nice easy to understand code please ?, bear in mind i have re-read the help file,
seacrhed the forums, i have other groups in scripts that do work, but only if i type /enable or /disable
this is a first for me with checkboxes and groups.

Thanks in advance

ShadowDemon
mIRC V6.15

Joined: Mar 2004
Posts: 130
T
Vogon poet
Offline
Vogon poet
T
Joined: Mar 2004
Posts: 130
Code:
 
on 1:dialog:gtest:sclick:2: {
 $iif($did(2).state == 0,disable #gtest,enable #gtest) 
}
 


me personal would do

Code:
 

on 1:dialog:gtest:sclick:2: {
if ($did(2).state == 0) { disable #gtest }
elseif ($did(2).state == 1) { enable #gtest }
}
but the first sould work good too
 

Last edited by tsoglanos; 01/07/04 08:08 PM.
Joined: Dec 2002
Posts: 292
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 292
Thanks tsoglanos,

i`ll edit the rest of my script to follow any other groups i have, and hope i dont run into anymore problems. laugh

ShadowDemon

Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
$iif($did(2).state,en,dis) $+ able #gtest

Joined: Dec 2002
Posts: 292
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 292
Sorry tidy,

I really dont follow that code confused

ShadowDemon

Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
Basically a shorter version of tsoglanos's

Joined: Dec 2002
Posts: 292
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 292
Haha, thanks tidy grin
will look into it

ShadowDemon

C
Cyclone
Cyclone
C
$iif($did(2).state,en,dis) $+ able #gtest

Now that's what I call clever... grin
nice bit of code you have there tidy_trax.


Link Copied to Clipboard