mIRC Homepage
Posted By: learn3r dialog noob - 04/10/06 03:17 PM
Need someone who may help me making a dialog for this one..

Thank You guys...

-------------------------------------------------------------------------

Kick Protection

..$iif(%kick.status.on,[ %kick.status.on ],[ %kick.status.off ] ):{ if (%kick.status.on) { unset %kick.status.on | set %kick.status.off [Status:kick Mode] | .enable #kick | echo -a revengekick Mode | if ($server != $null) msg $active %script Prot. Enabled } | else { set %kick.status.on [Status:Peace Mode] | unset %kick.status.off | .disable #kick | echo -a Peace Mode | if ($server != $null) msg $active %script Prot. Disabled } }

..Clear enemy-list:{ if ($hget(kicklist)) { hdel -w kicklist * } | unset %kicklist %fastlist | echo -a Removing all users from the enemy list done... | else { echo -a No hastable kicklist available | haltdef } | if ($server != $null) { msg $active List cleared } }

..onJoin-ban $+ $chr(32) $+ $iif(%banlag.on,[ %banlag.on ],[ %banlag.off ] ):{ if (%banlag.on) { unset %banlag.on | set %banlag.off (off) | echo -a on-Join ban-Off } | else { set %banlag.on (on) | unset %banlag.off | echo -a on-Join ban-On) } }

..Ban-Locked ( $+ $group(#banlocker) $+ ) : { if ($group(#banlocker) == on) { .disable #banlocker | unset %ban | echo -a Banlocker is now Off | halt } | else { .enable #banlocker | set %ban ! | echo -a Banlocker is now On | halt } }

.-

.$iif($active ischan,&IAL state for #)

..$iif($chan(#).ial == $true,All addresses OK):echo No need to update IAL for chan #

..$iif($chan(#).ial == $false,IAL Incomplete. Update?):.who # ..-

.Protections

..Ban Prot ( $+ $group(#banprotect) $+ ) : { if ($group(#banprotect) == on) { .disable #banprotect | echo -a Ban Protection is now Off | halt } | else { .enable #banprotect | echo -a Ban Protection is now On | halt } }

..User Prot $+ $chr(32) $+ $iif(%user_prot.on,[ %user_prot.on ],[ %user_prot.off ] ):{ if (%user_prot.on) { unset %user_prot.on | set %user_prot.off (off) | echo -a User protection-Off } | else { set %user_prot.on (on) | unset %user_prot.off | echo -a $protect.list } }

..Chan. Mode Potect. $+ $chr(32) $+ $iif(%mode.on,[ %mode.on ],[ %mode.off ] ):{ if (%mode.on) { unset %mode.on | set %mode.off (off) | echo -a Channel Mode protection-Off } | else { set %mode.on (on) | unset %mode.off | echo -a Channel Mode protection-On } }

.-

.Set kick message { set %kickmsg $$?="Type kick message:" | echo -a Kick message is set to -=> %msg }
Posted By: Riamus2 Re: dialog noob - 04/10/06 07:13 PM
Just a note... you may not find anyone willing to write a dialog for you. Dialogs are a pain to do, so you may not have any luck with it. Usually, for dialogs, it's easier if you already have a start before asking for help with it. smile
Posted By: billythekid Re: dialog noob - 04/10/06 07:16 PM
I echo what riamus says although i'd add that you should grab a copy of dialog studio if you don't have one. It makes most dialogs sooooo much easier to create as it has a graphical interface so you can set out your dialog how you like, then it makes the code for you, all you need to do is put the coding behind the buttons(on dialog event)


btk
Posted By: MikeChat Re: dialog noob - 04/10/06 08:27 PM
ok, here is your dialog, good luck smile
Code:
alias protection dialog -m protection protection
dialog Protection {
  title "Protections"
  size -1 -1 200 100
  option dbu
  text "Kick Protection", 801, 0 0 100 8, center
  Text "Other Protection", 802, 100 0 100 8, center

  button "Kick Protection", 911, 10 20 60 10
  button "Clear Enemy List", 912, 10 30 60 10
  button "On Join Ban", 913, 10 40 60 10
  button "Banlocked", 914, 10 50 60 10
  button "Ban Protection", 915, 10 60 60 10

  button $IALcheck , 921, 110 20 60 10
  button $IALcheck2 , 922, 110 30 60 10
  button "User Protection", 923, 110 40 60 10
  button "Channel Mode Protection", 924, 110 50 60 10
  button "Set Kick Msg", 925, 110 60 60 10
}
alias IALcheck return $iif($active ischan, IAL state for $chr(35) ,Not A Chan)
alias IALcheck2 return $iif($chan(#).ial == $true,All addresses OK,Address Check Failure)
Posted By: learn3r Re: dialog noob - 05/10/06 01:48 AM
Tnk you mikechat
but seems the


alias IALcheck return $iif($active ischan, IAL state for $chr(35) ,Not A Chan)
alias IALcheck2 return $iif($chan(#).ial == $true,All addresses OK,Address Check Failure)



dont work...
isnt this suposed to check and update?
Posted By: MikeChat Re: dialog noob - 05/10/06 02:36 AM
you mean the button is blank?
Posted By: learn3r Re: dialog noob - 05/10/06 08:55 AM
Sorry my mistake it's working now
:tongue:

Isn't a dialog with check options much better for this type of
options?
Posted By: Lpfix5 Re: dialog noob - 05/10/06 07:05 PM
If you think it is, make one download a program called dialog studio

you can create the look then for the coding part in mIRC type

/help dialogs
Posted By: learn3r Re: dialog noob - 06/10/06 01:59 AM
Code:
 
dialog Kick Protections {
  title "Kick Protection"
  size -1 -1 150 150
  option dbu
  text "War Mode", 6, 9 24 39 12
  button "Clear Enemy Lists", 5, 42 1 71 12
  button "Set Kick Message", 19, 43 103 71 12
  radio "enable", 1, 62 23 31 10
  radio "disable", 2, 104 23 50 10
  text "On Join Ban", 8, 10 45 42 8
  check "Enable\Disable", 9, 90 44 50 10
  text "Ban Locker", 10, 10 55 42 8
  check "Enable\Disable", 11, 90 54 50 10
  text "Ban Protection", 12, 9 64 43 8
  check "Enable\Disable", 13, 90 63 50 10
  text "User Protection", 16, 9 74 44 8
  check "Enable\Disable", 14, 90 73 50 10
  text "Channel mode Protection", 17, 9 83 66 8
  check "Enable\Disable", 15, 90 82 50 10
  box "", 7, 3 14 145 24
  box "", 18, 3 39 145 58
}





on *:dialog:Kick Protections:sclick:*:{
  if ($did == 1) {  } }
  if ($did == 2) {  } }
  if ($did == 9) {  } }
  if ($did == 11) {  } }
  if ($did == 13) {  } }
  if ($did == 14) {  } }
  if ($did == 15) {  } }
  if ($did == 5) { if ($hget(warlist)) { hdel -w warlist * } | unset %warlist %fastlist | echo -a Removing all users from the enemy list done... | else { echo -a ***No hastable warlist available | haltdef } | if ($server != $null) { msg $active Lamers List Cleared } }
  if ($did == 19) {  set %kickmsg $$?="Type kick message:") | echo -a ***Kick message is set to0--> %msg }}  }
}
 



How can put these menus in that?




$str($chr(160),0) «» kick Protections «»
..$iif(%kick.status.on,[ %kick.status.on ],[ %kick.status.off ] ):{ if (%kick.status.on) { unset %kick.status.on | set %kick.status.off [Status:kick Mode] | .enable #kick | echo -a ***You are now in kick Mode | if ($server != $null) msg $active %script Prot. 14Enabled } | else { set %kick.status.on [Status:Peace Mode] | unset %kick.status.off | .disable #kick | echo -a ***You are now in Peace Mode or Channel Operator Mode | if ($server != $null) msg $active %script Prot. 14Disabled } }

..&onJoin-ban $+ $chr(32) $+ $iif(%banlag.on,[ %banlag.on ],[ %banlag.off ] ):{ if (%banlag.on) { unset %banlag.on | set %banlag.off (off) | echo -a *** on-Join ban-Off } | else { set %banlag.on (on) | unset %banlag.off | echo -a ***on-Join ban-On } }
..&Ban-Locked ( $+ $group(#banlocker) $+ ) : { if ($group(#banlocker) == on) { .disable #banlocker | unset %ban | echo -a ***Banlocker is now Off) | halt } | else { .enable #banlocker | set %ban ! | echo -a ***Banlocker is now On | halt } }
.-
.&Protections
..&Ban Protection ( $+ $group(#banprotect) $+ ) : { if ($group(#banprotect) == on) { .disable #banprotect | echo -a ***Ban Protection is now Off) | halt } | else { .enable #banprotect | echo -a ***Ban Protection is now On) | halt } }
..&User Protection $+ $chr(32) $+ $iif(%user_prot.on,[ %user_prot.on ],[ %user_prot.off ] ):{ if (%user_prot.on) { unset %user_prot.on | set %user_prot.off (off) | echo -a ***User protection-Off } | else { set %user_prot.on (on) | unset %user_prot.off | echo -a $protect.list } }
..&Chan. Mode Potect. $+ $chr(32) $+ $iif(%mode.on,[ %mode.on ],[ %mode.off ] ):{ if (%mode.on) { unset %mode.on | set %mode.off (off) | echo -a Channel Mode protection-Off } | else { set %mode.on (on) | unset %mode.off | echo -a Channel Mode protection-On } }
Posted By: learn3r Re: dialog noob - 06/10/06 04:51 AM
on *:dialog:Protection:init:0:{
if ($group(#banprotect) == on) { /did -c Protection 13 }
if (%mode.on == (on)) { /did -c Protection 15 }
if (%banlag.on == (on)) { /did -c Protection 9 }
if (%user_prot.on == (on)) { /did -c Protection 14 }
if ($group(#banlocker) == on) { /did -c Protection 11 }
}

thats for the check
what about the radio
i mean how?
Posted By: Lpfix5 Re: dialog noob - 06/10/06 04:58 AM
#1 your dialog wont work because of space between Kick Protections just use KickProtections and execute your dialog by typing //dialog -md KickProtections KickProtections

if you were able to create that code you should be easily able to figure it out. the dialog maker does not make the below code for u you knew what it did.

Here is a small little explanation the rest youll figure im sure.

now take in mind that STATE of radio button becomes 1 when pushed else its 0 if not in state same thing with checkbox if the check is in state is 1 else 0

now we go to your "Set Kick Message Button" i created ONLY EXample please on your own its real easy we will try to correct your code if you need help but atleast give it a try

Code:
On *:dialog:kickprotections:*:{
  if ($did == 19) {
    if ($did($dname,1).state == 1) { 
      ; perform whole script here
      ;example
      if ($did($dname,11).state == 1) { set On Join ban on | ; this is just an example this code is not functional }
      if ($did($dname,13).state == 1) { set Ban locker on | ; this is just an example again }
      ;ETC
      else { echo -a Why set anything up you have not selected any checkmarks }
    }
    elseif ($did($dname,2).state == 1) { 
      echo -a Sorry I cannot set any kick message parameters you have selected disable | unset %whatevervaryouhave or whichever way you disable it | return 
    }
    else { echo -a Um im stuck in la la land you have not selected either to disable or enable this script I cannot continue | return }
  }
}
Posted By: learn3r Re: dialog noob - 06/10/06 07:04 AM
on *:dialog:dialogL:sclick:*:{
if ($did == 15) { if (%tnx) unset %tnx
else %tnx = 1
}
if ($did == 16) { if (%netsplitQuit) unset %netsplitQuit
else %netsplitQuit = 1
}
if ($did == 17) { if (%pinger) unset %pinger
else %pinger = 1
}
if ($did == 18) { if ($group(#voice) == on) { .disable #voice | halt }
else { .enable #voice | halt }
}

if ($did == 43) { if ($group(#drone) == on) { .disable #drone | halt } | else { .enable #drone | halt } }
if ($did == 37) { if (%oz.aploresw == On) { .set %oz.aploresw Off | halt } | else { .set %oz.aploresw On | halt } }
if ($did == 38) { if (%badn) unset %badn | else %badn = 1 }
if ($did == 39) { if (%ident) unset %ident | else %ident = 1 }
if ($did == 40) { if (%guest) unset %guest | else %guest = 1 }
if ($did == 41) { if (%rdoor) unset %rdoor | else %rdoor = 1 }
if ($did == 42) { if (%slap) unset %slap | else %slap = 1 }
}




on *:dialog:dialogL:init:0:{
if ($group(#voice) == on) { /did -c Protection 18 }
if ($group(#drone) == on) { /did -c Protection 43 }
if (%tnx == 1) { /did -c Protection 15 }
if (%netsplitQuit == 1) { /did -c Protection 16 }
if ((%pinger == 1) { /did -c Protection 17 }
if (%oz.aploresw == On) { /did -c Protection 37 }
if (%badn == 1) { /did -c Protection 38 }
if (%ident == 1) { /did -c Protection 39 }
if (%guest == 1) { /did -c Protection 40 }
if (%rdoor == 1) { /did -c Protection 41 }
if (%slap == 1) { /did -c Protection 42 }
}

------------------------

Why do I always get an error is there something i did wrong here?
Posted By: RusselB Re: dialog noob - 06/10/06 07:32 AM
It would help if we knew what error you were getting.
Without that, the items that I see that might be causing problems, are:
1) Two dialog names are being used.
1a) dialogL in the on dialog events
1b) Protection in the initialization routine

Your coding structure is not the greatest

Here's your current code, restructured for easier reading, and a bit better coding.

Code:
 on *:dialog:dialogL:sclick:*:{
  if ($did == 15)     set %tnx $iif(%tnx,$false,1)  
  elseif ($did == 16)     set %netsplitQuit $iif(%netsplitQuit,$false,1)  
  elseif ($did == 17)     set %pinger $iif(%pinger,$false,1)  
  elseif ($did == 18)     $iif($group(#voice) == on,.disable,.enable) #voice  
  elseif ($did == 43)     $iif($group(#drone) == on,.disable,.enable) #drone  
  elseif ($did == 37)     set %oz.aploresw $iif(%oz.aploresw == On,Off,On)  
  elseif ($did == 38)  set %badn $iif(%badn,$false,1)
  elseif ($did == 39)  set %ident $iif(%ident,$false,1)
  elseif ($did == 40)  set %guest $iif(%guest,$false,1)
  elseif ($did == 41)  set %rdoor $iif(%rdoor,$false,1)
  elseif ($did == 42)  ser %slap $iif(%slap,$false,1)
}
on *:dialog:dialogL:init:0:{
  if ($group(#voice) == on) { /did -c Protection 18 }
  if ($group(#drone) == on) { /did -c Protection 43 }
  if (%tnx == 1) { /did -c Protection 15 }
  if (%netsplitQuit == 1) { /did -c Protection 16 }
  if ((%pinger == 1) { /did -c Protection 17 }
  if (%oz.aploresw == On) { /did -c Protection 37 }
  if (%badn == 1) { /did -c Protection 38 }
  if (%ident == 1) { /did -c Protection 39 }
  if (%guest == 1) { /did -c Protection 40 }
  if (%rdoor == 1) { /did -c Protection 41 }
  if (%slap == 1) { /did -c Protection 42 }
}
 
Posted By: learn3r Re: dialog noob - 06/10/06 09:09 AM
ok tnx didnt noticed that hehehe
again tnx guys
Posted By: Lpfix5 Re: dialog noob - 06/10/06 09:09 AM
Your still not checking state of your radio buttons like I told you... read your /help dialogs
© mIRC Discussion Forums