mIRC Home    About    Download    Register    News    Help

Print Thread
dialog question #163740 04/11/06 03:55 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
i made some dialog for nick list
and what i wanted is that in text control is
displayed nickname of which i selected in nicklist

id 2 is text control

thing is i want to on every nick change (click)
it shows every nick change in ID

so imade alias for it

alias svictim {
.timersvictim 0 1 did -ra dialog_name 2 $snick($active)
}

but it doesnt work...
why?

Last edited by raZOR; 04/11/06 04:27 AM.

IceCapped
Re: dialog question #163741 04/11/06 06:11 AM
Joined: Mar 2003
Posts: 612
B
billythekid Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
the timer is evaluating your parameters

try .timersvictim 0 1 did -ra dialog_name 2 $($snick($active),0)

to evaluate it 0 times on setting so that the timer re-evaluates it.

there is somethign with a ! too, but i cant remember it, $!snick($active) perhaps....

btk


billythekid
Re: dialog question #163742 04/11/06 05:53 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
sweet, it works !
thanks.


IceCapped
Re: dialog question #163743 04/11/06 07:28 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
heh, ill need some help with same...

Code:
 
alias kickban {
  if ($dialog(kickban) == $null) { dialog -mo kickban kickban }
}

dialog kickban {
  title "Kick/Ban"
  size -1 -1 172 146
  option dbu
  box "Victim", 1, 8 7 157 33
  text "", 2, 15 22 142 9
  radio "Kick victim", 3, 10 51 35 9, group
  radio "Kick and Ban victim", 4, 10 66 55 9
  box "Ban Mask type", 5, 70 45 95 30
  combo 6, 76 58 84 12, drop
  box "Kick Message", 7, 8 82 157 33
  edit "", 8, 15 96 142 11, autohs
  button "Cancel", 9, 132 127 32 12, cancel
  button "OK", 10, 93 127 32 12, ok
}

on *:dialog:kickban:init:0:{
  did -a $dname 6 [0] *!user@host.domain
  did -a $dname 6 [1] *!*user@host.domain
  did -a $dname 6 [2] *!*@host.domain
  did -a $dname 6 [3] *!*user@*.domain
  did -a $dname 6 [4] *!*@*.domain
  did -a $dname 6 [5] nick!user@host.domain
  did -a $dname 6 [6] nick!*user@host.domain
  did -a $dname 6 [7] nick!*@host.domain
  did -a $dname 6 [8] nick!*user@*.domain
  did -a $dname 6 [9] nick!*@*.domain
  if (%bancombo.type == $null) { %bancombo.type = 3 | %bancombo.sel = $gettok($did(1,%bancombo.type),2,32) }
  did -c $dname 6 %bancombo.type 
  ;----
  did -a $dname 2 $snick($active)
  if (%kick-penality == on) { did -c $dname 3 }
  if (%kickban-penality == on) { did -c $dname 4 }
  svictim
}

alias svictim { .timersvictim 0 1 did -ra kickban 2 $($snick($active),0) }


on *:dialog:kickban:sclick:*:{
  if ($did = 9) { .timersvictim off }
  if ($did = 10) {
    %bancombo.type = $did(6).sel 
    %bancombo.sel = $gettok($did(6,%bancombo.type),2,32) 
    %bancombo.type2 = %bancombo.type - 1
    if ($did(3).state == 1) { %kick-penality = on } | else { %kick-penality = off }
    if ($did(4).state == 1) { %kickban-penality = on } | else { %kickban-penality = off }
    ;---
    if (%kick-penality == on) { .kick $active $snick($active) $did(8).text }
    if (%kickban-penality == on) { .ban -k $active $snick($active) %bancombo.type2 $did(8).text }
    .timersvictim off
  }
}
 


problem is that i dont know a way to make dialog disables
OK button (ID 10) if no nick is selected.

in alias it doesnt work (acts like init event)
and in dialog... you just cant do it...

any ideas?


IceCapped
Re: dialog question #163744 04/11/06 07:33 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
use if (!$snick(#chan,0))


-KingTomato
Re: dialog question #163745 04/11/06 07:42 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
yea but where?

i tried with

alias svictim {
.timersvictim 0 1 did -ra kickban 2 $($snick($active),0)
if ($snick($acitve) == $null) { did -b kickban 10 } | else { did -e kickban 10 }
}


tried this [censored] too :P

alias svictim {
.timersvictim 0 1 did -ra kickban 2 $($snick($active),0)
.timersnickdisable 0 1 if ($($snick($active),0) == $null) { did -b kickban 10 }
.timersnickenable 0 1 if ($($snick($active),0) != $null) { did -e kickban 10 }
}

Last edited by raZOR; 04/11/06 07:48 PM.

IceCapped
Re: dialog question #163746 04/11/06 08:01 PM
Joined: Mar 2003
Posts: 612
B
billythekid Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
$active not $acitve and change the...

.timersvictim 0 1 did -ra kickban 2 $($snick($active),0))


billythekid
Re: dialog question #163747 04/11/06 09:03 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
well problem remains.


IceCapped
Re: dialog question #163748 05/11/06 01:19 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Put this as the first line in the init event
Code:
if !$snick($active,0)  {    did -b $dname 10  }

Re: dialog question #163749 05/11/06 03:09 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
now it always stays disabled... even if nick is clicked on


IceCapped
Re: dialog question #163750 05/11/06 05:12 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
did $iif(!$snick($active,0),-b,-e) $dname 10  }  


Sorry..that should fix it up

Re: dialog question #163751 05/11/06 05:23 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
it does not :P
just to note, that this dialog (if anyone even loaded it up would know...) changes nick target on every new click, co it IS refreshed on every click.

therefore i dont think that init event is good way for what i need help with, correct me if i'm wrong tho.

Last edited by raZOR; 05/11/06 05:23 AM.

IceCapped
Re: dialog question #163752 05/11/06 06:46 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The edit box, where the target is placed, only holds a single nick.
When you click the OK (to kick/ban someone) or Cancel, the dialog closes, so the next time the dialog opens, the init event runs again. The init event runs every time the dialog is opened.

I just realized that there's an un-needed brace in the line I gave you last time right at the very end.

I have tested the following, which is a slightly modified version of yours, and it works. The modifications I made (with the exception of that line for the init event) refer to the radio buttons, but aren't required and simply make the code a little easier to read (in my opinion)

Code:
 alias kickban {
  if ($dialog(kickban) == $null) { dialog -mo kickban kickban }
}
dialog kickban {
  title "Kick/Ban"
  size -1 -1 172 146
  option dbu
  box "Victim", 1, 8 7 157 33
  text "", 2, 15 22 142 9
  radio "Kick victim", 3, 10 51 35 9, group
  radio "Kick and Ban victim", 4, 10 66 55 9
  box "Ban Mask type", 5, 70 45 95 30
  combo 6, 76 58 84 12, drop
  box "Kick Message", 7, 8 82 157 33
  edit "", 8, 15 96 142 11, autohs
  button "Cancel", 9, 132 127 32 12, cancel
  button "OK", 10, 93 127 32 12, ok
}
on *:dialog:kickban:init:0:{
  did $iif(!$snick($active,0),-b,-e) $dname 10
  did -a $dname 6 [0] *!user@host.domain
  did -a $dname 6 [1] *!*user@host.domain
  did -a $dname 6 [2] *!*@host.domain
  did -a $dname 6 [3] *!*user@*.domain
  did -a $dname 6 [4] *!*@*.domain
  did -a $dname 6 [5] nick!user@host.domain
  did -a $dname 6 [6] nick!*user@host.domain
  did -a $dname 6 [7] nick!*@host.domain
  did -a $dname 6 [8] nick!*user@*.domain
  did -a $dname 6 [9] nick!*@*.domain
  if (%bancombo.type == $null) { %bancombo.type = 3 | %bancombo.sel = $gettok($did(1,%bancombo.type),2,32) }
  did -c $dname 6 %bancombo.type 
  ;----
  did -a $dname 2 $snick($active)
  if (%kick-penality == on) { did -c $dname 3 }
  if (%kickban-penality == on) { did -c $dname 4 }
  svictim
}
alias svictim { .timersvictim 0 1 did -ra kickban 2 $($snick($active),0) }
on *:dialog:kickban:sclick:*:{
  if ($did = 9) { .timersvictim off }
  if ($did = 10) {
    %bancombo.type = $did(6).sel 
    %bancombo.sel = $gettok($did(6,%bancombo.type),2,32) 
    %bancombo.type2 = %bancombo.type - 1
    %kick-penality = $iif($did(3).state,on,off)
    ;---
    if (%kick-penality == on) { .kick $active $snick($active) $did(8).text }
    if (%kickban-penality == on) { .ban -k $active $snick($active) %bancombo.type2 $did(8).text }
    .timersvictim off
  }
}
 

Re: dialog question #163753 05/11/06 06:52 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
this "modification" STILL disables OK button even if nick IS selected


IceCapped
Re: dialog question #163754 05/11/06 07:35 AM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Try this
Code:
alias kickban {
[color:green]  if !$dialog(kickban) { dialog -mo kickban kickban }[/color]
}
dialog kickban {
  title "Kick/Ban"
  size -1 -1 172 146
  option dbu
  box "Victim", 1, 8 7 157 33
  text "", 2, 15 22 142 9
  radio "Kick victim", 3, 10 51 35 9, group
  radio "Kick and Ban victim", 4, 10 66 55 9
  box "Ban Mask type", 5, 70 45 95 30
  combo 6, 76 58 84 12, drop
  box "Kick Message", 7, 8 82 157 33
  edit "", 8, 15 96 142 11, autohs
  button "Cancel", 9, 132 127 32 12, cancel
[color:green]  button "OK", 10, 93 127 32 12, ok,disable[/color]
}
on *:dialog:kickban:init:0:{
[color:gray]  ; line removed[/color]
  var %i = 0
[color:green]  while %i < 10 { did -a $dname 6 $+([,%i,]) $mask(nick!user@host.domain,%i) | inc %i }[/color]
  if (%bancombo.type == $null) { %bancombo.type = 3 | %bancombo.sel = $gettok($did(1,%bancombo.type),2,32) }
  did -c $dname 6 %bancombo.type 
  ;----
  did -a $dname 2 $snick($active)
  if (%kick-penality == on) { did -c $dname 3 }
  if (%kickban-penality == on) { did -c $dname 4 }
  svictim
}
[color:green]alias svictim { .timersvictim 0 1 did -ra kickban 2 $!snick($active) $(|) did $!iif($snick($active),-e,-b) kickban 10 }[/color]


Note: This doesnt have your sclick event , so keep that wink

Re: dialog question #163755 05/11/06 07:54 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I can't understand that. Here's a couple of screen shots using the code I posted. First one is with a nick selected, 2nd is without



As you should be able to see, the OK button is available in the first picture, however, it's greyed in the second.

Re: dialog question #163756 05/11/06 07:55 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
hehe you done it !!!!
thanks so much !


IceCapped
Re: dialog question #163757 05/11/06 07:57 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
Quote:
I can't understand that. Here's a couple of screen shots using the code I posted. First one is with a nick selected, 2nd is without
As you should be able to see, the OK button is available in the first picture, however, it's greyed in the second.


i have no clue why, i realy don't.
but it didnt worked at me and i do use mirc 6.2.
and it is NOT possible other scripts or timers or aliases
interfered with this one bcos i always make unique ones (names).
and ofc i check if there is such intereferance.

Last edited by raZOR; 05/11/06 07:58 AM.

IceCapped
Re: dialog question #163758 05/11/06 08:04 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
It would be interesting to see what other people get when trying my code. Do they get the same as me (which shows that it works) or the same as you (which shows it doesn't work)?

Re: dialog question #163759 05/11/06 08:32 AM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Your code doesn't change the state of the OK button if you select/unselect a nick after the dialog is open.