mIRC Home    About    Download    Register    News    Help

Print Thread
#199497 15/05/08 04:06 PM
Joined: Apr 2008
Posts: 51
K
kkoser Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Apr 2008
Posts: 51
Am i missing something?

Code:

 if ($did(203).state == 1) {
      did -e AutoList 207 | did -e AutoList 206 | did -e AutoList 205 | did -e AutoList 204 |
      did -r $dname 206 
      var %x = 1
      while $nick(%uno.channel,%x) {
        did -a $dname 206 $v1 
        inc %x
      }
    } 
    if ($did(203).state == 0) {
      did -r AutoList 206 | did -b AutoList 207 | did -b AutoList 206 | did -b AutoList 205 | did -b AutoList 204 
    }



when i click on the list (206) it checks the state of the checkbox again and refreshes the listbox. all the list does is display the nicks in the channel. gaaa. frustrating.

kkoser #199498 15/05/08 05:07 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
What are you trying to accomplish?

Are you trying to load the nicks from channel X into the dialog or???


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Lpfix5 #199502 15/05/08 06:18 PM
Joined: Apr 2008
Posts: 51
K
kkoser Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Apr 2008
Posts: 51
i want to enable the controls on tab(202), and populate a listbox with nicks from the channel


i also have another tab with an checkbox on it as well. i wonder if they are conflicting with each other. don't think so though. i think i am just missing something or not using the right terminology. frown
here isare the lines for the two checkboxes:
Code:

    elseif ($did(80).state == 1) {
      did -e AutoList 81 | did -e AutoList 100 | did -e AutoList 94 | did -e AutoList 95 | did -e Autolist 96 | did -e AutoList 97 | did -e AutoList 98 | did -e AutoList 99 
      did -e AutoList 142 | did -e AutoList 143 | did -e Autolist 144 | did -e AutoList 145 | did -e AutoList 146 | did -e AutoList 147 | did -e AutoList 101
    }
    elseif ($did(80).state == 0) { 
      did -b AutoList 81 | did -b AutoList 100 | did -b AutoList 94 | did -b AutoList 95 | did -b Autolist 96 | did -b AutoList 97 | did -b AutoList 98 | did -b AutoList 99
      did -b AutoList 142 | did -b AutoList 143 | did -b Autolist 144 | did -b AutoList 145 | did -b AutoList 146 | did -b AutoList 147 | did -b AutoList 101
    }


    if ($did(203).state == 1) {
      did -e AutoList 207 | did -e AutoList 206 | did -e AutoList 205 | did -e AutoList 204 | did -r $dname 206 
      var %x = 1
      while $nick(%uno.channel,%x) {
        did -a $dname 206 $v1 
        inc %x
      }
    } 
    if ($did(203).state == 0) {
      did -r AutoList 206 | did -b AutoList 207 | did -b AutoList 206 | did -b AutoList 205 | did -b AutoList 204 
    }








they both function as an enable/disable controls.

But yes essentially all i want to do is list the nicks in the channel in the listbox upon enabling the controls on the tab. i need to be able to use the dclick function on the listbox but every click refreshes the list.

Last edited by kkoser; 15/05/08 06:26 PM.
kkoser #199535 16/05/08 12:40 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Slightly off topic, but you might be able to replace the first two elseif's (regarding the state of $did(80)) with
Code:
did $iif($did(80).state,-e,-b) AutoList 81,94-101,142-147


As to your $did(203) code, you might be smarter to pick a different item to click in order to refresh the dialog list, as it's quite easy to not click the list box fast enough to match the requirements of a double click, so a single click is matched, therefore updating the list.

Being able to see a more complete code might help, in the meantime, you might try something like
Code:
on *:dialog:Autolist:sclick:206:{
  if $did(203).state {
    did -e AutoList 204-207
    did -r $dname 206 
    var %x = 1
    while $nick(%uno.channel,%x) {
      did -a $dname 206 $v1 
      inc %x
    }
  } 
  elseif !$did(203).state {
    did -r AutoList 206
    did -b AutoList 204-207
  }
}

This is based mostly on the code that you posted, and condensed using my knowledge of dialogs.

RusselB #199541 16/05/08 01:22 AM
Joined: Apr 2008
Posts: 51
K
kkoser Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Apr 2008
Posts: 51
again thank you RusselB. You have my little addon. You know its about making a "gui" for the text based uno game from bl4h's code.
I sure appreciate all of everybody's help in not just making this idea a reality, but actually pulling it off. i thank especially you for taking the interest in it. The part of it that i am working on right now is to be able to play match games and not just single games like it is at present. When i started this, i had very little knowledge of mIRC scripting language. but now because of you and others i can hold my own(well, a little). so, thanks again. i will try your code soon and play around with the $iif's.

but back to this idea i have a tab and an enable/disable checkbox. upon true state(or other) i wanted to populate the listbox also on the tab with nicks, then on dclick on the list i want to add it to another list off of the tab and be able to add controls to that listbox to ad scores

i.e.
John 100
Jane 145
Bob 355

above is not a question but i just wanted to give you an idea of what the goal is.

RussellB, you have the whole code, except for the listboxes i put in and the checkbox on the tab.

kkoser #199542 16/05/08 01:52 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
ok.. as this is a long weekend for me, I'll have more time to work on this, and now that I know why you're doing what you're doing, I'll see about incorporating it into the replacement code that I'm currently working on.

RusselB #199543 16/05/08 02:13 AM
Joined: Apr 2008
Posts: 51
K
kkoser Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Apr 2008
Posts: 51
i used this to get it working.

Code:

    elseif ($did == 209) { 
      did -r $dname 206
      var %x = 1
      while $nick(%uno.channel,%x) {
        did -a $dname 206 $v1 
        inc %x
      }
    }

    did $iif($did(80).state,-e,-b) AutoList 81,94-101,142-147
    did $iif($did(203).state,-e,-b) AutoList 209,204-207




smile i added the "Refresh" button (209)

here is what i added for controls.

Code:

  box "Points per Match", 204, 220 25 50 20, tab 202
  check "Enable Match", 203, 215 15 45 10, right tab 202
  edit "", 205, 235 34 20 9, autohs left  tab 202
  list 206, 220 52 50 52, size vsbar tab 202
  box "Select Players", 207, 220 45 52 60, tab 202
  list 208, 231 121 60 65, size vsbar 
  button "Refresh", 209, 260 15 25 9, default tab 202




maybe i should send you the whole thing again. with my resized images and all. ?


Link Copied to Clipboard