mIRC Home    About    Download    Register    News    Help

Print Thread
dialog check box lists #196520 18/03/08 02:46 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I've got two lists, one uses the check option and contains the names of channels obtained from a /whois enquiry.
The 2nd list shows the idle time for the channel that is in the first list, with the two lists corresponding.
If I have the 2nd list without the check option, then the items don't line up, yet with the check option, I see the check boxes.

Does anyone have a suggestion as to how I can get the two lists to line up, and not have the check option showing in the 2nd list?

I hope this is clear enough to be understood.

Re: dialog check box lists [Re: RusselB] #196533 18/03/08 08:05 AM
Joined: Jan 2008
Posts: 3
R
R1cochet Offline
Self-satisified door
Offline
Self-satisified door
R
Joined: Jan 2008
Posts: 3
How are you storing the information being displayed?
ie: hash tables or txt?

You may want to remove sort if you have that set as a style.
I had problems getting items to line up when using sort with 2 diff list boxes

Re: dialog check box lists [Re: RusselB] #196558 18/03/08 09:15 PM
Joined: Dec 2002
Posts: 503
B
Bekar Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
.. Show us the code that's populating the lists, and the dialog table lines for them ..


Re: dialog check box lists [Re: R1cochet] #196601 19/03/08 11:13 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The information being displayed in the first list (which I want with check boxes) is the list of channels a specified nick is in, as returned by a /whois
The information in the 2nd list, is the idle time in each channel, if available, or N/A if not.

The lists are not sorted, and the information is not stored, as it is updated when called for.


Re: dialog check box lists [Re: Bekar] #196602 19/03/08 11:28 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
dialog Whois {
  size -1 -1 805 382
  option pixels
  icon $scriptdirCanada.ico, 0
  button "Nick:", 1, 5 10 30 20
  combo 2, 55 10 335 20, edit drop
  text "Address:", 3, 5 35 42 16
  text "", 4, 55 35 335 20
  text "Name:", 5, 5 122 32 16
  text "", 6, 55 120 335 20, right
  text "Modes:", 7, 5 147 38 16
  text "", 8, 55 145 335 20
  text "IP:", 9, 5 172 16 16
  text "", 10, 55 170 335 20
  text "Away:", 15, 5 272 30 16
  text "", 16, 55 270 335 40
  text "", 17, 705 175 95 16
  text "Registered", 11, 5 60 60 16, center
  text "Server:", 12, 5 247 38 16
  text "", 18, 55 245 335 20
  text "", 19, 5 80 190 16
  text "Help", 20, 70 60 60 16, center
  text "Secure", 21, 135 60 60 16, center
  text "", 22, 5 222 46 16
  text "", 23, 55 220 335 20
  button "E&xit", 25, 715 275 75 24, ok
  list 30, 395 195 200 170, size check
  text "0 Common out of 0 Channels:", 31, 395 175 196 16, center
  text "0 Clones detected:", 32, 395 10 200 16, center
  list 33, 395 30 200 140, size
  text "DNS:", 34, 5 197 26 16
  text "", 35, 55 195 335 20
  radio "Kill", 13, 205 60 44 16, group
  radio "K-Line", 14, 205 80 50 16
  radio "Z-Line", 27, 255 80 50 16
  radio "G-Line", 36, 305 60 50 16
  radio "Shun", 37, 255 60 44 16
  radio "GZ-Line", 38, 305 80 56 16
  icon 39, 730 195 48 48,  $scriptdirFace.jpg, 0
  link "Russel Bairstow", 40, 715 250 75 16
  text "Idle Time", 41, 600 175 100 16, center
  button "Send Results to Channel(s)", 42, 600 8 200 20, multi
  text "", 43, 5 315 386 50
  text "", 44, 5 100 385 16
  list 28, 600 195 100 170, size check
  list 46, 600 30 200 140, size check
}
on *:dialog:whois:init:*:{
  dialog -t Whois Who Is/Who Was
  var %a = 1
  while %a <= $chan(0) {
    did -a Whois 46 $chan(%a)
    inc %a
  }
  did $iif($countcs($usermode,o,O,C,A,a,N),-ev,-bh) Whois 13,14,27,36,37,38
}
on *:dialog:Whois:sclick:46:{
  set %chan.msg $iif($did(46,$did(46).sel).cstate,$addtok(%chan.msg,$did(46).seltext,44),$remtok(%chan.msg,$did(46).seltext,1,44))
}
#whois off
raw *:*:{
  var %raw = $numeric
  if $istok(402 311 401 379 378 307 319 312 301 313 310 671 317 320,$event,32) {    haltdef  }
  if %raw == 402 {
    ctcp $name time
    .whois $name
  }
  elseif %raw == 320 {    did -ra Whois 44 $2-  }
  elseif %raw == 311 {
    did -v Whois 3,5
    did -rva Whois 4 $+($3,@,$4)
    did -rva Whois 6 $6-
  }
  elseif %raw == 401 {
    .enable #whowas
    .whowas $iif($did(Whois,2).seltext,$v1,$did(Whois,2))
  }
  elseif %raw == 379 {
    did -v Whois 7
    did -rva Whois 8 $6-
  }
  elseif %raw == 378 {
    if $gettok($iif(!$7,$6,$7),1,46) isnum && $gettok($iif(!$7,$6,$7),2,46) isnum && $gettok($iif(!$7,$6,$7),3,46) isnum && $gettok($iif(!$7,$6,$7),4,46) isnum {
      did -v Whois 9
      did -rva Whois 10 $iif(!$7,$6,$7)
      dns $iif(!$7,$6,$7)
    }
  }
  elseif %raw == 307 {    did -v Whois 11   }
  elseif %raw == 319 {
    did -rv Whois 30,28
    didtok Whois 30 32 $3-
    var %a = 1, %b = $numtok($3-,32)
    while %a <= %b {
      did $iif($me ison $right($gettok($3-,%a,32),-1),-s,-l) Whois 30 %a
      did $iif($me ison $right($gettok($3-,%a,32),-1),-sa,-la) Whois 28 $iif($me ison %chan,$idle($nick(%chan,$name).idle),N/A)
      inc %a
    }
    did -rva Whois 31 $did(whois,30,0).csel Common out of $did(whois,30).lines Channels
  }
  elseif %raw == 312 {
    did -v Whois 12
    did -rva Whois 18 $3
  }
  elseif %raw == 301 {
    did -v Whois 15
    did -rva Whois 16 $3-
  }
  elseif %raw == 313 {    did -rva Whois 19 $strip($5-)   }
  elseif %raw == 310 {    did -v whois 20   }
  elseif %raw == 671 {    did -v whois 21   }
  elseif %raw == 317 {
    did -ra Whois 22 Sign In:
    did -rva whois 23 $asctime($4,ddd mmm d yyyy @ HH:nn:ss)
    if $3 > 0 {
      did -rva whois 17 $idle($3)
    }
  }
  elseif %raw == 318 {
    did -e Whois 25
    .disable #whois
    haltdef
  }
}
#whois end
on *:dns:{
  if $dialog(whois) {
    did -ra Whois 35 $iif($dns(0).addr,$v1,Unable to Resolve)
  }
}
#whowas off
raw *:*:{
  dialog -t Whois Who Was
  var %raw = $numeric
  if $istok(301 312 314 406,$event,32) {    haltdef  }
  if %raw == 314 {
    did -v Whois 3,5
    did -rva Whois 4 $+($3,@,$4)
    did -rva Whois 6 $6-
  }
  elseif %raw == 312 {
    did -ra Whois 22 Sign Out:
    did -v Whois 12
    did -rva Whois 18 $3
    did -rva whois 23 $asctime($ctime($4-),ddd mmm d yyyy @ HH:nn:ss)
  }
  elseif %raw == 406 {    did -ra Whois 4 Not found in /whois or /whowas listings  }
  elseif %raw == 369 {
    did -e Whois 25
    .disable #whowas
    haltdef
  }
}
#whowas end
on *:dialog:whois:sclick:2:{
  did -b whois 25
  did -r whois 4,6,8,10,35,23,18,16,17,33,30,28,46
  did -h whois 3-23,27,28,44,30-38,41,42,46
  var %comchan = 1
  while %comchan <= $comchan($name,0) {
    clones $comchan($name,%a) 
    inc %comchan
  }
  .enable #whois
  .whois $name $name
  if $name == $me {
    did -v Whois 7
    did -rva Whois 8 $usermode
  }
}
alias -l clones {
  var %mask = 0
  while %mask <= 9 {
    var %a = 1, %b = $nick($1,0)
    while %a <= %b {
      if ($address($name,%mask) iswm $address($nick($1,%a),5)) && ($nick($1,%a) != $name)  && !$didwm(Whois,33,$nick($1,%a)) {
        did -a Whois 33 $nick($1,%a)
      }
      inc %a
    }
    inc %mask
  }
  did -ra Whois 32 $did(Whois,33).lines Clone $+ $iif($did(Whois,33).lines > 1,s) detected
}
on *:dialog:whois:*:30:{
  var %chan = $+($chr(35),$gettok($did(Whois,$did).seltext,-1,35))
  if $devent == dclick {    .join %chan  }
}
menu * {
  Who2 : {
    set %chan $iif($chan,$v1,$null)
    .who2 $iif($snick(%chan,0),$snicks,$iif($nick,$nick))
  }
}
;ALIASES SECTION
alias -l idle {
  var %idle = $duration($1)
  return $iif($numtok(%idle,32) < 4,$duration($1,3),$+($gettok(%idle,1--3,32),$chr(32),$duration($duration($gettok(%idle,-3-,32)),3)))
}
alias -l name {
  return $iif($did(Whois,2).seltext,$v1,$did(Whois,2))
}
alias who2 {
  var %nicks = $iif($1,$1-,$$?="Enter nick(s) comma or space separated")
  %nicks = $replace(%nicks,$chr(44),$chr(32))
  dialog $iif(!$dialog(Whois),-md,-eno) Whois Whois
  did -b whois 25
  did -r whois 2,4,6,8,10,30,16,17,18,28
  did -h whois 3,4,5,6,7,8,9,10,11,12,30,15,16,17,18,19,20,21,22,23,28
  didtok Whois 2 32 %nicks
  did -kc Whois 2 1
  if %chan {    clones %chan  }
  .enable #whois
  .whois $name $name
  if $name == $me {
    did -v whois 7
    did -rva whois 8 $usermode
  }
  if $numtok(%nicks,32) > 1 {
    didtok Whois 2 32 $gettok(%nicks,2-,32)
  }
} 


There's more code there than is actually required for the problem I'm having, and I admit it's simply an esthetic problem, not an operational one. The reason I have supplied more code, is due to the way the code works.. removing more of the code than I have causes the code to fail/return errors.

Re: dialog check box lists [Re: RusselB] #196605 20/03/08 03:17 AM
Joined: Dec 2002
Posts: 503
B
Bekar Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
Well, I'm getting check-boxes in both lists, and the idle-times (all the same) lining up correctly.

(code: direct copy-paste, comment out the Face.jpg icon line)

Re: dialog check box lists [Re: Bekar] #196641 20/03/08 11:49 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Yes, but what I'd like, if possible, is to have the two line up but without the check boxes in the second list. Sorry if I failed to make that clear earlier.

Re: dialog check box lists [Re: RusselB] #196644 21/03/08 01:15 AM
Joined: Dec 2002
Posts: 503
B
Bekar Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
Ah. Right. No. It sucks, but no.

The spacing forced on the list-box by the inclusion of the check-boxes is not possible (with native mIRC) to reproduce ... without more check-boxes ..

The only other option I can see is to not use multiple list boxes, but then you'd have a spacing issue ..

Ok, here's a dumb question. Does the network you're using this on return different idle times for the different channels the user is on? Otherwise I'm failing to see the point of having a channel->idletime match-up.

Re: dialog check box lists [Re: Bekar] #196645 21/03/08 01:58 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The idle time for the channel will only be displayed if the person using the dialog is also on the channel, so that the channel idle time is (for the most part) correct. This information is gathered using $nick($chan,<nick>).idle, not the idle time returned via the /whois command, which is the idle time on the server.

Re: dialog check box lists [Re: RusselB] #196648 21/03/08 03:08 AM
Joined: Dec 2002
Posts: 503
B
Bekar Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
Right.. ok.. wonder why I was only getting the same values or the /whois value for all of them..

*pokes it once* ah well.

Sorry I couldn't be a real help.

Re: dialog check box lists [Re: Bekar] #196649 21/03/08 03:26 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
np.. and thanks anyways.. I seem to have messed up the code a bit doing the re-write and dialog adjustment.. my original code, which works, is on Hawkee