mIRC Home    About    Download    Register    News    Help

Print Thread
#169048 18/01/07 04:52 PM
Joined: Apr 2005
Posts: 1,008
R
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Apr 2005
Posts: 1,008
ok i already went insane with this thing....
this is my cripled Ignore dialog and as said its cripled
just for this post to go on main issue:

problem is that mirc wont accept any changes to variable
%ignorecombo.type2 which SHOULD be result of combo
dropdown list with ban masks (ignore masks)

so in short story
variable %ignorecombo.type reads value from drop down list (1-10)
and variable %ignore.combo.type2 decreases value by 1 (coz of ignore mask values 0-9)

problem is that whenever i/user clicks on OK button this change never happens... dunno why.

i painted in green (down bottom) echoes that i use for checkup

heres code so if anyone sane can explain me why this happens
i buy him icecream :P

(btw when dialog is called, you must select user in nicklist coz it works "on the fly")

menu nicklist {
Ignore: ignored
}


Code:
alias ignored {
  if (!$dialog(ignored)) { dialog -mo ignored ignored }
}

dialog ignored {
  title "Ignore"
  size -1 -1 181 230
  option dbu
  tab "Ignore", 1, 8 7 163 194
  box "User", 3, 18 30 108 30, tab 1
  text "", 4, 26 43 94 8, tab 1
  box "Ignore options", 5, 18 96 144 80, tab 1
  check "Private messages", 6, 27 114 51 8, tab 1
  check "Channel messages", 7, 27 129 55 8, tab 1
  check "Notice messages", 8, 27 144 51 8, tab 1
  check "Invites", 9, 104 114 28 8, tab 1
  check "Control codes", 10, 27 159 44 8, tab 1
  check "CTCP requests", 11, 104 129 46 8, tab 1
  check "DCC requests", 12, 104 144 43 8, tab 1
  check "Everything", 13, 104 159 38 8, tab 1
  box "Ignore Mask type", 14, 18 62 108 30, tab 1
  combo 15, 27 74 90 12, tab 1 drop
  button "OK", 18, 130 183 32 12, tab 1
  button "Close", 19, 139 212 32 12, cancel
}

on *:dialog:ignored:init:0:{
  did -a $dname 15 [0] *!user@host.domain
  did -a $dname 15 [1] *!*user@host.domain
  did -a $dname 15 [2] *!*@host.domain
  did -a $dname 15 [3] *!*user@*.domain
  did -a $dname 15 [4] *!*@*.domain
  did -a $dname 15 [5] nick!user@host.domain
  did -a $dname 15 [6] nick!*user@host.domain
  did -a $dname 15 [7] nick!*@host.domain
  did -a $dname 15 [8] nick!*user@*.domain
  did -a $dname 15 [9] nick!*@*.domain
  if (%ignorecombo.type == $null) { %ignorecombo.type = 4 | %ignorecombo.sel = $gettok($did(15,%ignorecombo.type),2,32) }
  did -c $dname 15 %ignorecombo.type 
  set %ignore.types -
  ;----
  did -a $dname 4 $snick($active)
  ignorechk
}

on *:dialog:ignored:close:0:{ unset %ignore.types }

alias -l ignorechk { .timerignorechk 0 1 did -ra ignored 4 $!snick($active) $(|) did $!iif($snick($active),-e,-b) ignored 18 }

on *:dialog:ignored:sclick:*:{
  if ($did = 13) { .did -u $dname 6-12 }
  if ($did = 19) { .timerignorechk off | unset %ignore.types }
  if ($did = 18) {
    if ($did(6).state == 1) { set %ignore.types %ignore.types $+ p }
    if ($did(7).state == 1) { set %ignore.types %ignore.types $+ c }
    if ($did(8).state == 1) { set %ignore.types %ignore.types $+ n }
    if ($did(9).state == 1) { set %ignore.types %ignore.types $+ i }
    if ($did(10).state == 1) { set %ignore.types %ignore.types $+ k }
    if ($did(11).state == 1) { set %ignore.types %ignore.types $+ t }
    if ($did(12).state == 1) { set %ignore.types %ignore.types $+ d }
    if ($did(13).state == 1) { set %ignore.types -pcnitd }
[color:#33FF33] .echo -a before = %ignorecombo.type2 [/color]
    %ignorecombo.type2 = %ignorecombo.type - 1
    .ignore %ignore.types $snick($active) %ignorecombo.type2
[color:#33FF33] .echo -a after = %ignorecombo.type2 [/color]
  }
}




Last edited by raZOR; 18/01/07 04:55 PM.
S
Scripto
Scripto
S
Hmm..

First of all, your combo is set up so that "on init" sets %ignorecombo.type = 4, and there is no other code to change that value. You've left out a "if ($did = 15)" in your sclick commands, which is where you would want to reset the value of %ignorecombo.type to whatever line number the user selects.

Right now, you have it set at 4, and it won't change when you select a choice from your combo. So it will always /ignore $nick 4 (or 4 minus 1 as you have your variable coded in your current ignore command)

So here is the fix...

add this line to your sclick statement... if ($did = 15) { set %ignorecombo.type $gettok($remove($did(15),[,]),1,32) }

and change your ignore statment to... .ignore $snick($active) %ignorecombo.type.

The "if ($did = 15)" statement above will eliminate any reason to subtract 1, as it sets %ignorecombo.type to the value that you need it at.

Code:
 
on *:dialog:ignored:sclick:*:{
  if ($did = 13) { .did -u $dname 6-12 }
  ;next: will set %ignorecombo.type to whatever is selected in the combo-box 
  if ($did = 15) { set %ignorecombo.type $gettok($remove($did(15),[,]),1,32) }
  if ($did = 19) { .timerignorechk off | unset %ignore.types }
  if ($did = 18) {
    if ($did(6).state == 1) { set %ignore.types %ignore.types $+ p }
    if ($did(7).state == 1) { set %ignore.types %ignore.types $+ c }
    if ($did(8).state == 1) { set %ignore.types %ignore.types $+ n }
    if ($did(9).state == 1) { set %ignore.types %ignore.types $+ i }
    if ($did(10).state == 1) { set %ignore.types %ignore.types $+ k }
    if ($did(11).state == 1) { set %ignore.types %ignore.types $+ t }
    if ($did(12).state == 1) { set %ignore.types %ignore.types $+ d }
    if ($did(13).state == 1) { set %ignore.types -pcnitd }
    ;then here... it ignores, without subtraction.
    .ignore %ignore.types $snick($active) %ignorecombo.type
  }
}


Another thing you will have to do with this fix, is to eliminate the "if (%ignorecombo.type == $null)", or your default combo could be different each time you open it, because if the variable is set by previously opening and using the dialog, the variable wont be $null when you open it the next time, and it will ignore the 'set' command behind it.

Just set %ignorecombo.type 4 for your default, or add an unset %ignorecombo.type to your "on close" statement. Either way will do it.

Code:
on *:dialog:ignored:init:0:{
  did -a $dname 15 [0] *!user@host.domain
  did -a $dname 15 [1] *!*user@host.domain
  did -a $dname 15 [2] *!*@host.domain
  did -a $dname 15 [3] *!*user@*.domain
  did -a $dname 15 [4] *!*@*.domain
  did -a $dname 15 [5] nick!user@host.domain
  did -a $dname 15 [6] nick!*user@host.domain
  did -a $dname 15 [7] nick!*@host.domain
  did -a $dname 15 [8] nick!*user@*.domain
  did -a $dname 15 [9] nick!*@*.domain
  set %ignorecombo.type 4 
  did -c $dname 15 %ignorecombo.type 
  set %ignore.types -
  ;----
  did -a $dname 4 $snick($active)
  ignorechk
}
 


That should do it. cool

Joined: Apr 2005
Posts: 1,008
R
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Apr 2005
Posts: 1,008
ohh this is nicer =)
thank you very much ^^

and this i owe you laugh


Last edited by raZOR; 18/01/07 10:13 PM.

Link Copied to Clipboard