Control

By asakura on Jul 18, 2008

this works but there may be may things wrong with it like brackets :P it was my second dialog and biggest yet :) 2nd post here please comment mistakes =D

on *:CONNECT: { if (%jjj = on) join %chans
}
menu channel,menubar,nicklist,status {
  control
  .Open:dialog -m mastercontrol mastercontrol
}
dialog mastercontrol {
  title "Master Control"
  size -1 -1 420 250
  option pixels
  tab "op contols", 24, 10 10 360 200
  box "", 26, 15 30 348 165, tab 24
  edit "#", 1, 25 65 80 20, tab 24
  edit "", 2, 25 115 80 20, tab 24
  button "kick", 3, 130 45 50 20, tab 24
  button "ban", 4, 130 70 50 20, tab 24
  button "unban", 9, 130 95 50 20, tab 24
  text "chan" 6, 25 45 80 20, tab 24
  text "nick" 7, 25 95 80 20, tab 24
  button "akick", 8, 130 120 50 20, tab 24
  button "delakick", 5, 130 145 50 20, tab 24
  button "op", 10, 190 45 50 20, tab 24
  button "deop", 11, 190 70 50 20, tab 24
  button "halfop", 12, 190 95 50 20, tab 24
  button "dehalfop", 13, 190 120 50 20, tab 24
  button "voice", 14, 190 145 50 20, tab 24
  button "devoice", 15, 250 45 50 20, tab 24
  button "sop", 16, 250 70 50 20, tab 24
  button "aop", 17, 250 95 50 20, tab 24
  button "hop", 18, 250 120 50 20, tab 24
  button "vop", 19, 250 145 50 20, tab 24
  button "delsop", 20, 310 45 50 20, tab 24
  button "delaop", 23, 310 70 50 20, tab 24
  button "delhop", 21, 310 95 50 20, tab 24
  button "delvop", 22, 310 120 50 20, tab 24
  button "kb", 30, 310 145 50 20, tab 24
  menu "File", 48
  menu "Help", 46
  item "Run web", 49, 48
  item "Close", 47, 48, cancel
  menu "script sites", 51
  item "hawkee", 50, 51
  item "info", 56, 46
  menu "Tools", 59
  item "Say", 60, 59
  item "Act", 61, 59
  item "Disconnect", 62, 48
  item "Connect", 63, 48
  item "Find userhost", 64, 59
  tab "Time ban", 86
  tab "Auto join", 116
  tab "Modes", 124
  tab "Ignore", 175
  list 174, 25 45 120 143, size vsbar, tab 175
  button "Add ignore", 176, 155 45 120 20, tab 175
  button "Del ignore", 177, 155 70 120 20, tab 175
  edit "#", 125, 25 65 80 20, tab 124
  text "chan" 126, 25 45 80 20, tab 124
  button "Enable autojoin", 121, 155 45 120 20, tab 116
  button "Disable autojoin", 118, 155 70 120 20, tab 116
  button "Add autojoin", 119, 155 100 120 20, tab 116
  button "Del autojoin", 120, 155 125 120 20, tab 116
  tab "Other commands", 104
  box "", 105, 15 30 348 165, tab 104
  box "", 87, 15 30 348 165, tab 86
  box "", 117, 15 30 348 165, tab 116
  text "", 44, 15 217 70 20
  list 122, 25 45 120 143, size vsbar, tab 116
  button "Done", 45, 310 215 90 20, ok cancel
  edit "#", 89, 25 65 80 20, tab 86
  text "chan" 90, 25 45 80 20, tab 86
  text "nick" 91, 25 95 80 20, tab 86
  edit "", 88, 25 115 80 20, tab 86
  button "1 minute", 92, 130 45 100 20, tab 86
  button "5 minute", 93, 130 70 100 20, tab 86
  button "10 minute", 94, 130 95 100 20, tab 86
  button "15 minute", 95, 130 120 100 20, tab 86
  button "30 minute", 96, 130 145 100 20, tab 86
  button "1 hours", 97, 235 45 100 20, tab 86
  button "3 hours", 98, 235 70 100 20, tab 86
  button "6 hours", 99, 235 95 100 20, tab 86
  button "12 hours", 100, 235 120 100 20, tab 86
  button "18 hours", 101, 235 145 100 20, tab 86
  button "1 whole day", 102, 130 170 205 20, tab 86
  button "kick", 103, 25 145 80 45, tab 86
  button "disconnect", 106, 25 45 100 20, tab 104
  button "connect", 107, 25 70 100 20, tab 104
  button "leaveall", 108, 25 95 100 20, tab 104
  button "join", 109, 25 120 100 20, tab 104
  button "hop", 110, 135 120 100 20, tab 104
  button "nick", 111, 135 45 100 20, tab 104
  button "leave", 112, 135 70 100 20, tab 104
  button "pass change", 113, 135 95 100 20, tab 104
  button "global kick", 163, 245 120 100 20, tab 104
  button "global msg", 164, 245 70 100 20, tab 104
  button "global act", 165, 245 45 100 20, tab 104
  button "global ban", 166, 245 95 100 20, tab 104
  menu "Mode help", 161
  tab "Status", 28
  tab "Help", 114
  item "Modes help", 162, 161
  button "s", 130, 130 45 50 20, tab 124
  button "i", 131, 130 70 50 20, tab 124
  button "M", 132, 190 45 50 20, tab 124
  button "m", 133, 190 70 50 20, tab 124
  button "N", 134, 190 95 50 20, tab 124
  button "O", 135, 70 95 50 20, tab 124
  button "e", 136, 250 45 50 20, tab 124
  button "r", 137, 250 70 50 20, tab 124
  button "R", 138, 250 95 50 20, tab 124
  button "S", 139, 130 95 50 20, tab 124
  button "T", 140, 70 120 50 20, tab 124
  button "t", 141, 310 45 50 20, tab 124
  button "V", 142, 310 70 50 20, tab 124
  button "v", 143, 310 95 50 20, tab 124
  button "-s", 144, 70 145 50 20, tab 124
  button "-i", 158, 70 170 50 20, tab 124
  button "-M", 146, 130 120 50 20, tab 124
  button "-m", 147, 130 145 50 20, tab 124
  button "-N", 148, 130 170 50 20, tab 124
  button "-O", 149, 190 120 50 20, tab 124
  button "-e", 150, 190 145 50 20, tab 124
  button "-r", 151, 190 170 50 20, tab 124
  button "-R", 152, 250 120 50 20, tab 124
  button "-S", 153, 250 145 50 20, tab 124
  button "-T", 154, 250 170 50 20, tab 124
  button "-t", 155, 310 120 50 20, tab 124
  button "-V", 156, 310 145 50 20, tab 124
  button "-v", 157, 310 170 50 20, tab 124
  box "", 145, 15 30 348 165, tab 124
  box "", 179, 15 30 348 165, tab 175
  box "", 171, 15 30 348 165, tab 114
  text "", 52, 25 45 120 20, tab 28
  text "", 53, 25 70 150 20, tab 28
  text "", 54, 25 95 250 20, tab 28
  text "", 55, 25 120 100 20, tab 28
  box "", 81, 15 30 348 165, tab 28
  button "Search", 170, 210 215 90 20
  button "Refresh", 178, 110 215 90 20, ok close
  text "This is a script made by asacura to do multi commands for the left part of the script type in a #chan and a nick and press one of the 20 options for the middle part if u have the pm blocker it will show your expceptions to it ones you allow and to enable and disable it and the last is some random commands the list is the channels you will join on autojoin please enjoy the script, autojoin adds and del chans will be shown when next opened the script" 115, 25 45 280 155, tab 114
}
dialog userahost {
  title "Userhost"
  size -1 -1 300 50
  option pixels
  text "", 1, 10 10 280 30
}
dialog search {
  title "Search"
  size -1 -1 350 70
  option pixels
  tab "Search", 4, 5 5 330 60
  tab "Image", 5
  tab "Video", 6
  edit "", 2, 20 32 200 20, tab 4
  button "Go!", 3, 230 32 50 20, tab 4
  edit "", 7, 20 32 200 20, tab 5
  button "Go!", 8, 230 32 50 20, tab 5
  edit "", 9, 20 32 200 20, tab 6
  button "Go!", 10, 230 32 50 20, tab 6
}
alias timez { did -ra mastercontrol 44 $time(h:nn:ss tt) }
alias userahost { dialog $iif($dialog(userahost),-v,-md) userahost userahost }
alias mastercontrol { dialog $iif($dialog(mastercontrol),-v,-md) mastercontrol mastercontrol }
alias search { dialog $iif($dialog(search),-v,-md) search search
}
on *:DIALOG:mastercontrol:init:0:{
  var %bo = $numtok(%chans,44), %or = 1
  while ( %or <= %bo ) {
    did -a mastercontrol 122 $gettok(%chans,%or,44)
  inc %or }
  var %bo = $numtok(%igynrea,44), %or = 1
  while ( %or <= %bo ) {
    did -a mastercontrol 174 $gettok(%igynrea,%or,44)
  inc %or }
  did -a mastercontrol 44 $time(h:nn:ss tt) | .timerclockk 0 1 timez
  did -a mastercontrol 52 ip : $ip
  did -a mastercontrol 53 server : $server
  did -a mastercontrol 54 userhost : $address($me,0)
  did -a mastercontrol 55 nick : $me 
}
on *:DIALOG:userahost:init:0:{
  did -a userahost 1 %nicae userhost: $address(%nicae,0)
}
on *:dialog:mastercontrol:close:*:{ 
  .timerclockk off
}
on *:DIALOG:mastercontrol:menu:*:{
  if ($did = 49) { set %site $?="what website would you like to visit?" | run %site }
  if ($did = 50) { run www.hawkee.com }
  if ($did = 56) { helpa }
  if ($did = 60) { set %text $?="what would you like to say?" | set %chaneb $?="in which channel?" | msg %chaneb %text }
  if ($did = 61) { set %texter $?="what would you like to act?" | set %chaneb $?="in which channel?" | describe %chaneb %texter }
  if ($did = 62) { disconnect }
  if ($did = 63) { server }
  if ($did = 64) { set %nicae $?="what nick would you like to find the userhost of?" | userahost }
  if ($did = 162) { run http://www.wyldryde.org/commands/chanserv.php#mode }
}
on *:DIALOG:search:sclick:*:{
  if ($did = 3) { run http://www.google.com/search?q= $+ $($did(2)) }
  if ($did = 8) { run http://images.google.com/images?um=1&hl=en&q= $+ $($did(7)) }
  if ($did = 10) { run http://www.youtube.com/results?search_query= $+ $($did(9)) $+ $(&search_type=&aq=f) }
}
on *:DIALOG:mastercontrol:sclick:*:{
  if ($did = 4) { set %nicke $did(2) | mode $did(1) +b $address(%nicke,0) }
  if ($did = 3) { kick $did(1) $did(2) }
  if ($did = 8) { cs akick $did(1) add $did(2) }
  if ($did = 5) { cs akick $did(1) del $did(2) $+ $(!*@*) }
  if ($did = 9) { set %nicke $did(2) | mode $did(1) -b $address(%nicke,0) }
  if ($did = 10) { cs op $did(1) $did(2) }
  if ($did = 11) { cs deop $did(1) $did(2) }
  if ($did = 12) { cs halfop $did(1) $did(2) }
  if ($did = 13) { cs dehalfop $did(1) $did(2) }
  if ($did = 14) { cs voice $did(1) $did(2) }
  if ($did = 15) { cs devoice $did(1) $did(2) }
  if ($did = 16) { cs sop $did(1) add $did(2) }
  if ($did = 17) { cs aop $did(1) add $did(2) }
  if ($did = 18) { cs hop $did(1) add $did(2) }
  if ($did = 19) { cs vop $did(1) add $did(2) }
  if ($did = 20) { cs sop $did(1) del $did(2) }
  if ($did = 21) { cs hop $did(1) del $did(2) }
  if ($did = 22) { cs vop $did(1) del $did(2) }
  if ($did = 23) { cs aop $did(1) del $did(2) }
  if ($did = 30) { kick $did(1) $did(2) | set %nicke $did(2) | mode $did(1) +b $address(%nicke,0) } 
  if ($did = 82) { set %pmb 1 }
  if ($did = 83) { unset %pmb }
  if ($did = 84) { set %adders $?="what nick do you wish to add to Pmexception list?" | set %spnick $addtok(%spnick,%adders,44) }
  if ($did = 85) { set %delers $?="what nick do you wish to remove to Pmexception list?" | set %spnick $remtok(%spnick,%delers,44) }
  if ($did = 92) { set %nickez $did(88) | ban -u60 $did(89) $address(%nickez,0) }
  if ($did = 93) { set %nickez $did(88) | ban -u300 $did(89) $address(%nickez,0) }
  if ($did = 94) { set %nickez $did(88) | ban -u600 $did(89) $address(%nickez,0) }
  if ($did = 95) { set %nickez $did(88) | ban -u900 $did(89) $address(%nickez,0) }
  if ($did = 96) { set %nickez $did(88) | ban -u1200 $did(89) $address(%nickez,0) }
  if ($did = 97) { set %nickez $did(88) | ban -u3600 $did(89) $address(%nickez,0) }
  if ($did = 98) { set %nickez $did(88) | ban -u10800 $did(89) $address(%nickez,0) }
  if ($did = 99) { set %nickez $did(88) | ban -u21600 $did(89) $address(%nickez,0) }
  if ($did = 100) { set %nickez $did(88) | ban -u43200 $did(89) $address(%nickez,0) }
  if ($did = 101) { set %nickez $did(88) | ban -u64800 $did(89) $address(%nickez,0) }
  if ($did = 102) { set %nickez $did(88) | ban -u86400 $did(89) $address(%nickez,0) }
  if ($did = 103) { kick $did(89) $did(88) }
  if ($did = 106) { quit }
  if ($did = 107) { server }
  if ($did = 108) { var %x = $chan(0) | while (%x) { | part $chan(%x) | dec %x }
  }
  if ($did = 109) { set %joie $?="what channel would you like to join?" | join %joie }
  if ($did = 110) { set %hope $?="what channel would you like to hop in?" | hop %hope }
  if ($did = 111) { set %nickew $?="what nick would you like to use?" | set %passew $?="if registered what is pass?" | nick %nickew | ns identify %passew }
  if ($did = 112) { set %leave $?="what channel would you like to leave?" | part %leave }
  if ($did = 113) { set %passen $?="what do you want your new password to be?" | ns set password %passen }
  if ($did = 119) { set %chans $addtok(%chans,$?="what channel do you want to add to autojoin?",44) }
  if ($did = 120) { set %chans $remtok(%chans,$?="what channel do you want to delete from autojoin?",44) }
  if ($did = 121) { set %jjj on }
  if ($did = 118) { set %jjj off }
  if ($did = 130) { mode $did(125) +s }
  if ($did = 131) { mode $did(125) +i }
  if ($did = 132) { mode $did(125) +M }
  if ($did = 133) { mode $did(125) +m }
  if ($did = 134) { mode $did(125) +N }
  if ($did = 135) { mode $did(125) +O }
  if ($did = 136) { set %nicbe $?="what nick would you like to put mode e on?" | mode $did(125) +e %nicbe } 
  if ($did = 137) { mode $did(125) +r }
  if ($did = 138) { mode $did(125) +R }
  if ($did = 139) { mode $did(125) +S }
  if ($did = 140) { mode $did(125) +T }
  if ($did = 141) { mode $did(125) +t }
  if ($did = 142) { mode $did(125) +V }
  if ($did = 143) { mode $did(125) +v }
  if ($did = 144) { mode $did(125) -s }
  if ($did = 145) { mode $did(125) -i }
  if ($did = 146) { mode $did(125) -M }
  if ($did = 147) { mode $did(125) -m }
  if ($did = 148) { mode $did(125) -N }
  if ($did = 149) { mode $did(125) -O }
  if ($did = 150) { set %nicbes $?="what nick would you like to take mode e off?" | mode $did(125) -e %nicbes } 
  if ($did = 151) { mode $did(125) -r }
  if ($did = 152) { mode $did(125) -R }
  if ($did = 153) { mode $did(125) -S }
  if ($did = 154) { mode $did(125) -T }
  if ($did = 155) { mode $did(125) -t }
  if ($did = 156) { mode $did(125) -V }
  if ($did = 157) { mode $did(125) -v }
  if ($did = 166) { set %nickre $?="who would you like to globally ban?" | var %x = $chan(0) | while (%x) { | mode $chan(%x) +b $address(%nickre,0) | dec %x }
  }
  if ($did = 163) { set %nikca $?="who would you like to globally kick?" | var %x = $chan(0) | while (%x) { | kick $chan(%x) %nikca | dec %x }
  }
  if ($did = 164) { set %msge $?="what would you like to Amsg?" | amsg %msge }
  if ($did = 165) { set %msge $?="what would you like to Aact?" | var %x = $chan(0) | while (%x) { | describe $chan(%x) %msge | dec %x }
  }
  if ($did = 170) { search }
  if ($did = 176) { set %igynrea $addtok(%igynrea,$?="who do you want to add to your ignore list?",44) | ignore %igynrea }
  if ($did = 177) { set %igynrea $remtok(%igynrea,$?="who do you want to delete from your ignore list?",44) | unignore %igynrea }
  if ($did = 178) { timer 1 1 mastercontrol }

Comments

Sign in to comment.
asakura   -  Jul 19, 2008

we all make mistakes :P and then we learn from them.

 Respond  
Typo   -  Jul 19, 2008

This script was not ready for release.

First off, you really need to close your brackets. It\'s one of the most basic parts of scripting and there really is no reason to be lazy about it. Just remember. EVERY single last { gets a } , no exceptions!

You should update a list when an item is added or removed. The user shouldn\'t have to close and open the dialog to see the list updated.

You have included a disconnect and connect to server option but the disconnect one doesnt specify which conection it closes if you have multiple networks opened and the connect one doesnt ask for a server or even open a new server window, it just disconects you by issuing /server with nothing else or connects you to whatever server u were on before if you arent already conected.

I dont understand why you used a dialog to enter the userhost for the userhost lookup when you made it look exactly like a standard $input box. If you hit the cancel button in the userhost dialog it still pops the userhost window up without any userhost in it.

Also, you didnt include a way to just open the broser in the homepage and if you hit the cancel button in the website entry box your confronted with \"* /run: insufficient parameters (line 316, script2.mrc)\" in the status window.

You dont check to see if the dialog is already open before trying to open it from the menu and why did you use a submenu in the rightclick menu instead of making the title open the control panel?

I\'m not even looking any further into this script because Im tired of typing about it so there may be plenty more wrong.

You need to take more time with your code before you release it.

Good luck.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.