;;;;Buzz-Zyrus SoulFly Multi-Gamer by d33j4y™  ©2010 EvolutionScriptz d0t c0m;;;;
;;;;;;;;;;;;Evolution Scriptz Website http://www.evolutionscriptz.com;;;;;;;;;;;;
;;;;Room Settingz Dialog Created by d33j4y™ - Credits given where code is used;;;

alias rsettingz { dialog -m room_settingz room_settingz }
alias mdx { return dlls\mdx.dll }
alias deurl return $null($regex($1-,/(((http(s)?\72(\57{2}))|(www\56{1}))+(\w*)+(\56{1})+(\w{2,3})\S*)/Sig)) $regml(1)

dialog room_settingz {
  title "Buzz-Zyrus SoulFly Room Settingz"
  size -1 -1 294 210
  option dbu
  icon imgs\icons\zyrus.ico, 0
  text User and Room Settings for $active, 1, 2 28 290 8, center
  check "Check Box", 2, 3 39 7 7
  check "Check Box", 3, 3 49 7 7
  check "Check Box", 4, 3 59 7 7
  check "Check Box", 5, 3 69 7 7
  check "Check Box", 6, 3 79 7 7
  check "Check Box", 7, 3 89 7 7
  check "Check Box", 8, 3 99 7 7
  check "Check Box", 9, 3 109 7 7
  check "Check Box", 10, 3 119 7 7
  check "Check Box", 11, 3 129 7 7
  check "Check Box", 12, 3 139 7 7
  check "Check Box", 13, 3 149 7 7
  check "Check Box", 14, 3 159 7 7
  check "Check Box", 15, 3 169 7 7
  text "Auto Owner On Entry", 16, 12 39 60 7, center
  text "Auto Host On Entry", 17, 12 49 55 7, center
  text "Auto Participant On Entry", 18, 12 59 70 7, center
  text "Auto Helpop On Entry", 19, 12 69 61 7, center
  text "No Owner On Away", 20, 12 79 56 7, center
  text "No Host on Away", 21, 12 89 50 7, center
  text "Only Golds Can Host", 22, 12 99 57 7, center
  text "Away Flood Kicker", 23, 12 109 52 7, center
  text "Spam Link Kicker", 24, 12 119 47 7, center
  text "Guest Nick Kicker", 25, 12 129 49 7, center
  text "History Checker", 26, 12 139 47 7, center
  text "Lock Room Modes", 27, 12 149 52 7, center
  text "Rejoin Speed Calculator", 28, 12 159 66 7, center
  text "Noone Can Get Hammer", 29, 12 169 67 7, center
  text $bdc($mnick) Status, 30, 92 38 95 8, center
  icon 31, 237 37 23 10,  imgs\away.bmp, 0, noborder
  icon 32, 265 37 24 10,  imgs\back.bmp, 0, noborder
  edit "", 33, 92 48 198 10, read autovs center
  text "Nick Join Message", 34, 92 68 54 8, center
  text " $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickwelcome) ", 35, 153 68 11 8, center
  icon 36, 168 67 23 10,  imgs\on.bmp, 0, noborder
  icon 37, 195 67 23 10,  imgs\off.bmp, 0, noborder
  icon 38, 230 67 32 10,  imgs\set.bmp, 0, noborder
  icon 39, 267 67 22 10,  imgs\clear.bmp, 0, noborder
  edit "", 40, 92 78 127 10, read autovs center
  combo 41, 222 78 68 10, drop
  text "Nick Away Message", 42, 92 97 54 8, center
  text " $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickaway) ", 43, 153 97 11 8, center
  icon 44, 168 96 23 10,  imgs\on.bmp, 0, noborder
  icon 45, 195 96 23 10,  imgs\off.bmp, 0, noborder
  icon 46, 230 96 32 10,  imgs\set.bmp, 0, noborder
  icon 47, 267 96 22 10,  imgs\clear.bmp, 0, noborder
  edit "", 48, 92 107 127 10, read autovs center
  combo 49, 222 107 68 10, drop
  text "Nick Part Message", 50, 93 127 54 8, center
  text " $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickpart) ", 51, 153 127 11 8, center
  icon 52, 168 126 23 10,  imgs\on.bmp, 0, noborder
  icon 53, 195 126 23 10,  imgs\off.bmp, 0, noborder
  icon 54, 230 126 32 10,  imgs\set.bmp, 0, noborder
  icon 55, 267 126 22 10,  imgs\clear.bmp, 0, noborder
  edit "", 56, 92 137 127 10, read autovs center
  combo 57, 222 137 68 10, drop
  text "Chatroom Modes", 58, 93 158 57 8, center
  combo 59, 151 157 68 10, drop
  combo 60, 222 157 68 10, drop
  text "Set Room Limit", 61, 93 170 45 8, center
  edit "", 62, 139 168 23 10, limit 3 center
  icon 63, 163 168 24 10,  imgs\set2.bmp, 0, noborder
  edit "", 64, 189 168 68 10, read center
  icon 65, 257 168 32 10,  imgs\refresh.bmp, 0, noborder
  combo 66, 34 183 90 10, drop
  combo 67, 173 183 90 10, drop
  text "Room Settingz Dialog for Buzz-Zyrus SoulFly 2009 by d33j4y", 68, 61 201 171 8, center
  icon 69, 234 196 54 10,  imgs\close.bmp, 0, noborder
  icon 70, -2 -1 299 28,  imgs\settingzlogo.bmp, 0, noborder
}

on *:dialog:room_settingz:init:0: {
  dll $mdx SetMircVersion $version
  dll $mdx MarkDialog $dname
  dll $mdx SetDialog $dname bgcolor $rgb(0,0,0)
  dll $mdx SetColor $dname 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70 textbg $rgb(0,0,0)
  dll $mdx SetColor $dname 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70 background $rgb(0,0,0)
  dll $mdx SetColor $dname 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70 text $rgb(77,109,243)
  dll $mdx SetFont $dname 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70 400 tahoma
  dll $mdx SetBorderStyle $dname staticedge
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),autogold) == on,did -c $dname 2)
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),autohost) == on,did -c $dname 3)
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),autovoice) == on,did -c $dname 4)
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),autohelpop) == on,did -c $dname 5)
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),noowneraway) == on,did -c $dname 6)
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),nohostaway) == on,did -c $dname 7)
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),onlygold) == on,did -c $dname 8)
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),awayflood) == on,did -c $dname 9)
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),nolinks) == on,did -c $dname 10)
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),guestkick) == on,did -c $dname 11)
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),history) == on,did -c $dname 12)
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),modelock) == on,did -c $dname 13)
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),speedcalc) == on,did -c $dname 14)
  $iif($readini(iniset\localsettings.ini,bzchannel $+ $right($active,-2),nohammers) == on,did -c $dname 15)
  did -a $dname 33 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),awaymessage)
  did -a $dname 35 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickwelcome)
  did -a $dname 40 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickwmessage)
  did -a $dname 41 Room Message
  did -a $dname 41 Action Message
  did -a $dname 41 Time Reply
  did -a $dname 41 Whisper Reply
  did -a $dname 41 Notice Message
  did -a $dname 41 Room Broadcast
  did -u $dname 41 $didwm($dname,41,$readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickwmsgtype))
  did -a $dname 43 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickaway)
  did -a $dname 48 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickawaymsg)
  did -a $dname 49 Room Message
  did -a $dname 49 Action Message
  did -a $dname 49 Time Reply
  did -a $dname 49 Whisper Reply
  did -a $dname 49 Notice Message
  did -a $dname 49 Room Broadcast
  did -u $dname 49 $didwm($dname,49,$readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickawaymsgtype))
  did -a $dname 51 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickpart)
  did -a $dname 56 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickpartmsg)
  did -a $dname 57 Room Message
  did -a $dname 57 Action Message
  did -a $dname 57 Room Broadcast
  did -u $dname 57 $didwm($dname,57,$readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickpartmsgtype))
  did -ca $dname 59 *Enable Room Modez*
  did -a $dname 59 Unassigned Mode +a
  did -a $dname 59 Profanity Filter +f
  did -a $dname 59 Room Invite Only +i
  did -a $dname 59 Moderated Channel +m
  did -a $dname 59 Private Channel +p
  did -a $dname 59 Flood Protection +P
  did -a $dname 59 Secret Channel +s
  did -a $dname 59 Unassigned Mode +t
  did -a $dname 59 Room Knock Mode +u
  did -a $dname 59 No Room Whispers +w
  did -a $dname 59 No Guest Whispers +W
  did -ca $dname 60 *Disable Room Modez*
  did -a $dname 60 Unassigned Mode -a
  did -a $dname 60 Profanity Filter -f
  did -a $dname 60 Room Invite Only -i
  did -a $dname 60 Moderated Channel -m
  did -a $dname 60 Private Channel -p
  did -a $dname 60 Flood Protection -P
  did -a $dname 60 Secret Channel -s
  did -a $dname 60 Unassigned Mode -t
  did -a $dname 60 Room Knock Mode -u
  did -a $dname 60 No Room Whispers -w
  did -a $dname 60 No Guest Whispers -W
  did -a $dname 64 $chan($active).mode
  did -ca $dname 66 *Last 10 Joined Roomz*
  did -a $dname 66 $Gettok(%vrr.1, 2, 32)
  did -a $dname 66 $Gettok(%vrr.2, 2, 32)
  did -a $dname 66 $Gettok(%vrr.3, 2, 32)
  did -a $dname 66 $Gettok(%vrr.4, 2, 32)
  did -a $dname 66 $Gettok(%vrr.5, 2, 32)
  did -a $dname 66 $Gettok(%vrr.6, 2, 32)
  did -a $dname 66 $Gettok(%vrr.7, 2, 32)
  did -a $dname 66 $Gettok(%vrr.8, 2, 32)
  did -a $dname 66 $Gettok(%vrr.9, 2, 32)
  did -a $dname 66 $Gettok(%vrr.10, 2, 32)
  did -ca $dname 67 *Clear Access Optionz*
  did -a $dname 67 Clear ALL Access
  did -a $dname 67 Clear Owner Access
  did -a $dname 67 Clear Host Access
  did -a $dname 67 Clear Voice Access
  did -a $dname 67 Clear Deny Access
  did -a $dname 67 Clear Grant Access
}

on *:dialog:room_settingz:sclick:2: {
  if ($did(2).state == 0) {
    writeini -n iniset\localsettings.ini bzchannel $+ $right($active,-2) autogold off
    echo -a 10* Auto Owner On Entry for $replace($mid($active,3),\b,$chr(32)) Has Been Disabled! 
  }
  elseif ($did(2).state == 1) {
    writeini -n iniset\localsettings.ini bzchannel $+ $right($active,-2) autogold on
    echo -a 10* Auto Owner On Entry For $replace($mid($active,3),\b,$chr(32)) Has Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:3: {
  if ($did(3).state == 0) {
    writeini -n iniset\localsettings.ini bzchannel $+ $right($active,-2) autohost off
    echo -a 10* Auto Host On Entry for $replace($mid($active,3),\b,$chr(32)) Has Been Disabled! 
  }
  elseif ($did(3).state == 1) {
    writeini -n iniset\localsettings.ini bzchannel $+ $right($active,-2) autohost on
    echo -a 10* Auto Host On Entry For $replace($mid($active,3),\b,$chr(32)) Has Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:4: {
  if ($did(4).state == 0) {
    writeini -n iniset\localsettings.ini bzchannel $+ $right($active,-2) autovoice off
    echo -a 10* Auto Voice On Entry for $replace($mid($active,3),\b,$chr(32)) Has Been Disabled! 
  }
  elseif ($did(4).state == 1) {
    writeini -n iniset\localsettings.ini bzchannel $+ $right($active,-2) autovoice on
    echo -a 10* Auto Voice On Entry For $replace($mid($active,3),\b,$chr(32)) Has Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:5: {
  if ($did(5).state == 0) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) autohelpop off
    echo -a 10* Auto Helpop For $replace($mid($active,3),\b,$chr(32)) Have Been Disabled! 
  }
  elseif ($did(5).state == 1) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) autohelpop on
    echo -a 10* Auto Helpop For $replace($mid($active,3),\b,$chr(32)) Have Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:6: {
  if ($did(6).state == 0) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) noowneraway off
    echo -a 10* No Owners While Away For $replace($mid($active,3),\b,$chr(32)) Has Been Disabled! 
  }
  elseif ($did(6).state == 1) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) noowneraway on
    echo -a 10* No Owners While Away For $replace($mid($active,3),\b,$chr(32)) Has Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:7: {
  if ($did(7).state == 0) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) nohostaway off
    echo -a 10* No Hosts While Away For $replace($mid($active,3),\b,$chr(32)) Has Been Disabled! 
  }
  elseif ($did(7).state == 1) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) nohostaway on
    echo -a 10* No Hosts While Away For $replace($mid($active,3),\b,$chr(32)) Has Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:8: {
  if ($did(8).state == 0) {
    writeini -n iniset\localsettings.ini bzchannel $+ $right($active,-2) onlygold off
    echo -a 10* Only Golds Can Host For $replace($mid($active,3),\b,$chr(32)) Has Been Disabled! 
  }
  elseif ($did(8).state == 1) {
    writeini -n iniset\localsettings.ini bzchannel $+ $right($active,-2) onlygold on
    echo -a 10* Only Golds Can Host For $replace($mid($active,3),\b,$chr(32)) Has Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:9: {
  if ($did(9).state == 0) {
    writeini -n iniset\localsettings.ini bzchannel $+ $right($active,-2) awayflood off
    echo -a 10* Away Flood Kicks For $replace($mid($active,3),\b,$chr(32)) Have Been Disabled! 
  }
  elseif ($did(9).state == 1) {
    writeini -n iniset\localsettings.ini bzchannel $+ $right($active,-2) awayflood on
    echo -a 10* Away Flood Kicks For $replace($mid($active,3),\b,$chr(32)) Have Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:10: {
  if ($did(10).state == 0) {
    writeini -n iniset\localsettings.ini bzchannel $+ $right($active,-2) nolinks off
    echo -a 10* No Spamming Links For $replace($mid($active,3),\b,$chr(32)) Have Been Disabled! 
  }
  elseif ($did(10).state == 1) {
    writeini -n iniset\localsettings.ini bzchannel $+ $right($active,-2) nolinks on
    echo -a 10* No Spamming Links For $replace($mid($active,3),\b,$chr(32)) Have Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:11: {
  if ($did(11).state == 0) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) guestkick off
    echo -a 10* Guest Kicks For $replace($mid($active,3),\b,$chr(32)) Have Been Disabled! 
  }
  elseif ($did(11).state == 1) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) guestkick on
    echo -a 10* Guest Kicks For $replace($mid($active,3),\b,$chr(32)) Have Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:12: {
  if ($did(12).state == 0) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) history off
    echo -a 10* History Checker For $replace($mid($active,3),\b,$chr(32)) Has Been Disabled! 
  }
  elseif ($did(12).state == 1) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) history on
    echo -a 10* History Checker For $replace($mid($active,3),\b,$chr(32)) Has Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:13: {
  if ($did(13).state == 0) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) modelock off
    echo -a 10* Room Mode Changes For $replace($mid($active,3),\b,$chr(32)) Have Been Disabled! 
  }
  elseif ($did(13).state == 1) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) modelock on
    echo -a 10* Room Mode Changes For $replace($mid($active,3),\b,$chr(32)) Have Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:14: {
  if ($did(14).state == 0) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) speedcalc off
    echo -a 10* The Speed Calculator For $replace($mid($active,3),\b,$chr(32)) Has Been Disabled! 
  }
  elseif ($did(14).state == 1) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) speedcalc on
    echo -a 10* The Speed Calculator For $replace($mid($active,3),\b,$chr(32)) Has Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:15: {
  if ($did(15).state == 0) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) nohammers off
    echo -a 10* No Hammers Allowed For $replace($mid($active,3),\b,$chr(32)) Has Been Disabled! 
  }
  elseif ($did(15).state == 1) {
    writeini iniset\localsettings.ini bzchannel $+ $right($active,-2) nohammers on
    echo -a 10* No Hammers Allowed For $replace($mid($active,3),\b,$chr(32)) Has Been Enabled! 
  }
}

on *:dialog:room_settingz:sclick:31:{ 
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) awaymessage $$input(Enter Away Reason:,129,Away Reason)
  away $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),awaymessage)
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) awaytime $ctime
  msg $active Away Reason: $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),awaymessage) at $asctime(h:nntt) on $adate
  did -ra room_settingz 33 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),awaymessage)
}

on *:dialog:room_settingz:sclick:32:{
  away
  msg $active Returns from $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),awaymessage) at $asctime(h:nntt) on $adate
  msg $active I Was Away For Approximately $duration($calc($ctime - $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),awaytime)))
  remini iniset\messages.ini bzchannel $+ $right($active,-2) awaymessage
  did -ra room_settingz 33 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),awaymessage)
}

on *:dialog:room_settingz:sclick:36:{
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) nickwelcome on
  did -ra room_settingz 35 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickwelcome)
  echo -a 10* Nick Onjoin Welcomes for $replace($mid($active,3),\b,$chr(32)) Have Been Turned ON! 
}

on *:dialog:room_settingz:sclick:37:{
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) nickwelcome off
  did -ra room_settingz 35 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickwelcome)
  echo -a 10* Nick Onjoin Welcomes for $replace($mid($active,3),\b,$chr(32)) Have Been Turned OFF! 
}

on *:dialog:room_settingz:sclick:38:{
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) nickwmessage $$input(Set Nick Onjoin Welcome Message:,129,Nick Onjoin Welcome Message)
  did -ra room_settingz 40 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickwmessage)
}

on *:dialog:room_settingz:sclick:39:{
  remini iniset\messages.ini bzchannel $+ $right($active,-2) nickwmessage
  remini iniset\messages.ini bzchannel $+ $right($active,-2) nickwmsgtype
  did -ra room_settingz 40 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickwmessage)
  did -ra room_settingz 41 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickwmsgtype)  
}

on *:dialog:room_settingz:sclick:41:{
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) nickwmsgtype $did($dname,41)
  set %njoin $($readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickwmsgtype))
}

on *:dialog:room_settingz:sclick:44:{
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) nickaway on
  did -ra room_settingz 43 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickaway)
  echo -a 10* Nick Away Messages for $replace($mid($active,3),\b,$chr(32)) Have Been Turned ON! 
}

on *:dialog:room_settingz:sclick:45:{
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) nickaway off
  did -ra room_settingz 43 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickaway)
  echo -a 10* Nick Away Messages for $replace($mid($active,3),\b,$chr(32)) Have Been Turned OFF! 
}

on *:dialog:room_settingz:sclick:46:{
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) nickawaymsg $$input(Set Nick Away Message:,129,Nick Away Message)
  did -ra room_settingz 48 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickawaymsg)
}

on *:dialog:room_settingz:sclick:47:{
  remini iniset\messages.ini bzchannel $+ $right($active,-2) nickawaymsg
  remini iniset\messages.ini bzchannel $+ $right($active,-2) nickawaymsgtype
  did -ra room_settingz 48 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickawaymsg)
  did -ra room_settingz 49 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickawaymsgtype)
}

on *:dialog:room_settingz:sclick:49:{
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) nickawaymsgtype $did($dname,49)
  set %naway $($readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickawaymsgtype))
}

on *:dialog:room_settingz:sclick:52:{
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) nickpart on
  did -ra room_settingz 51 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickpart)
  echo -a 10* Nick Part Messages for $replace($mid($active,3),\b,$chr(32)) Have Been Turned ON! 
}

on *:dialog:room_settingz:sclick:53:{
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) nickpart off
  did -ra room_settingz 51 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickpart)
  echo -a 10* Nick Part Messages for $replace($mid($active,3),\b,$chr(32)) Have Been Turned OFF! 
}

on *:dialog:room_settingz:sclick:54:{
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) nickpartmsg $$input(Set Nick Part Message:,129,Nick Onjoin Part Message)
  did -ra room_settingz 56 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickpartmsg)
}

on *:dialog:room_settingz:sclick:55:{
  remini iniset\messages.ini bzchannel $+ $right($active,-2) nickpartmsg
  remini iniset\messages.ini bzchannel $+ $right($active,-2) nickpartmsgtype
  did -ra room_settingz 56 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickpartmsg)
  did -ra room_settingz 57 $readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickpartmsgtype)  
}

on *:dialog:room_settingz:sclick:57:{
  writeini iniset\messages.ini bzchannel $+ $right($active,-2) nickpartmsgtype $did($dname,57)
  set %npart $($readini(iniset\messages.ini,bzchannel $+ $right($active,-2),nickpartmsgtype))
}

on *:dialog:room_settingz:sclick:59:{
  if ($did($dname,$did).sel == 2) {
    mode $active +a
    echo -a 10* Auditorium Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set ON! 
  }
  elseif ($did($dname,$did).sel == 3) {
    mode $active +f
    echo -a 10* Profanity Filter Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set ON! 
  }
  elseif ($did($dname,$did).sel == 4) {
    mode $active +i
    echo -a 10* Room Invite Only Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set ON! 
  }
  elseif ($did($dname,$did).sel == 5) {
    mode $active +m
    echo -a 10* Channel Moderation Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set ON! 
  }
  elseif ($did($dname,$did).sel == 6) {
    mode $active +p
    echo -a 10* Private Channel Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set ON! 
  }
  elseif ($did($dname,$did).sel == 7) {
    mode $active +P
    echo -a 10* Flood Protection Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set ON! 
  }
  elseif ($did($dname,$did).sel == 8) {
    mode $active +s
    echo -a 10* Secret Channel Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set ON! 
  }
  elseif ($did($dname,$did).sel == 9) {
    mode $active +t
    echo -a 10* Room Topic Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set ON! 
  }
  elseif ($did($dname,$did).sel == 10) {
    mode $active +u
    echo -a 10* Room Knock Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set ON! 
  }
  elseif ($did($dname,$did).sel == 11) {
    mode $active +w
    echo -a 10* No Room Whispers Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set ON! 
  }
  elseif ($did($dname,$did).sel == 12) {
    mode $active +W
    echo -a 10* No Guest Whispers Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set ON! 
  }
}

on *:dialog:room_settingz:sclick:60:{
  if ($did($dname,$did).sel == 2) {
    mode $active -a
    echo -a 10* Auditorium Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set OFF! 
  }
  elseif ($did($dname,$did).sel == 3) {
    mode $active -f
    echo -a 10* Profanity Filter Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set OFF! 
  }
  elseif ($did($dname,$did).sel == 4) {
    mode $active -i
    echo -a 10* Room Invite Only Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set OFF! 
  }
  elseif ($did($dname,$did).sel == 5) {
    mode $active -m
    echo -a 10* Channel Moderation Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set OFF! 
  }
  elseif ($did($dname,$did).sel == 6) {
    mode $active -p
    echo -a 10* Private Channel Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set OFF! 
  }
  elseif ($did($dname,$did).sel == 7) {
    mode $active -P
    echo -a 10* Flood Protection Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set OFF! 
  }
  elseif ($did($dname,$did).sel == 8) {
    mode $active -s
    echo -a 10* Secret Channel Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set OFF! 
  }
  elseif ($did($dname,$did).sel == 9) {
    mode $active -t
    echo -a 10* Room Topic Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set OFF! 
  }
  elseif ($did($dname,$did).sel == 10) {
    mode $active -u
    echo -a 10* Room Knock Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set OFF! 
  }
  elseif ($did($dname,$did).sel == 11) {
    mode $active -w
    echo -a 10* No Room Whispers Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set OFF! 
  }
  elseif ($did($dname,$did).sel == 12) {
    mode $active -W
    echo -a 10* No Guest Whispers Mode for $replace($mid($active,3),\b,$chr(32)) Has Been Set OFF! 
  }
}

on *:dialog:room_settingz:sclick:63: {
  mode $active +l $did(62)
  set %limit $did(62)
  did -ra $dname 64 $chan($active).mode
  echo -a 10* Room Limit for $replace($mid($active,3),\b,$chr(32)) Has Been Set To $did(62) ! 
}

on *:dialog:room_settingz:sclick:65:{ did -ra $dname 64 $chan($active).mode }

on *:dialog:room_settingz:sclick:66:{ join $did(66) }

on *:dialog:room_settingz:sclick:67: {
  if ($did($dname,$did).sel == 2) {
    ax_clear $active
    echo -a 10* Cleared ALL Access Entries! 
  }
  elseif ($did($dname,$did).sel == 3) {
    ax_clear $active q
    echo -a 10* Cleared Owner Access Entries! 
  }
  elseif ($did($dname,$did).sel == 4) {
    ax_clear $active o
    echo -a 10* Cleared Host Access Entries! 
  }
  elseif ($did($dname,$did).sel == 5) {
    ax_clear $active v
    echo -a 10* Cleared Voice Access Entries! 
  }
  elseif ($did($dname,$did).sel == 6) {
    ax_clear $active d
    echo -a 10* Cleared Deny Access Entries! 
  }
  elseif ($did($dname,$did).sel == 7) {
    ax_clear $active g
    echo -a 10* Cleared Grant Access Entries! 
  }
}

on *:dialog:room_settingz:sclick:69:{ dialog -x room_settingz room_settingz }

;;;;Credit to Rumbaar for the History Checker modded by d33j4y™;;;;
;;;Credit to av0ider for the Speed Calculator modded by d33j4y™;;;;
on *:join:#: {
  if ($readini(iniset\greetings.ini,customgreet,status) == On) {
    if ($readini(iniset\greetings.ini,publicmsg $+ $chan,$ial($nick).addr)) {
      msg $chan $gettok($readini(iniset\greetings.ini,publicmsg $+ $chan,$ial($nick).addr),1,61)
    }
    if ($readini(iniset\greetings.ini,privatemsg $+ $chan,$ial($nick).addr)) {
      whisper $chan $nick $gettok($readini(iniset\greetings.ini,privatemsg $+ $chan,$ial($nick).addr),1,61)
    }
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),speedcalc) == on) {
    if (%partticks. [ $+ [ $ial($nick,1).addr ] $+ [ $chan ] ]) {
      msg # S eTahoma;0 Rejoin Speed Calculator: $replace($nick,>,Guest_) rejoined the $replace($mid($active,3),\b,$chr(32)) chatroom in $calc($calc($ticks - $eval(%partticks. [ $+ [ $ial($nick,1).addr ] $+ [ $chan ] ],2)) / 1000) seconds. 
    }
    elseif (%partticks. [ $+ [ $ial($knick,1).addr ] $+ [ $chan ] ]) {
      msg # S eTahoma;0 Rejoin Speed Calculator: $replace($nick,>,Guest_) rejoined the $replace($mid($active,3),\b,$chr(32)) chatroom in $calc($calc($ticks - $eval(%partticks. [ $+ [ $ial($knick,1).addr ] $+ [ $chan ] ],2)) / 1000) seconds. 
    }
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),autogold) == on) {
    raw mode # +q $nick
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),autohost) == on) {
    raw mode # +o $nick
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),autovoice) == on) {
    raw mode # +v $nick
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),autohelpop) == on) {
    raw mode # +h $nick
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),guestkick) == on) {
    if (> isin $nick) {
      sockwrite -n $+(sf.,#) kick # $nick Sorry $replace($nick,>,Guest_) $replace($mid($active,3),\b,$chr(32)) Chatroom Has Disabled Guest Nick Joins, Go Register An Account For FREE At http://www.buzzen.com/passport/reg.php $Lf ACCESS # ADD DENY $nick
    }
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),history) == on) {
    if ($nick == $me) return
    if (> isin $nick) goto guest
    if ($$ial($nick $+ *,1).addr == $gettok($read(text\history.txt, w,* $+ $$ial($nick $+ *,1).addr $+ *),1,32)) { set %line $readn | goto old }
    else { goto new }
    :new {
      timerhistory1 1 2 { ctcpreply $nick TIME Welcome $replace($nick,>,Guest_) This is the first time for you to visit $replace($mid($active,3),\b,$chr(32)) }
      write text\history.txt $$ial($nick $+ *,1).addr $nick $time $adate $chan
      return
    }
    :old {
      if ($nick == $gettok($read(text\history.txt,%line),2,32)) {
        timerhistory2 1 2 { ctcpreply $nick TIME Welcome back $replace($nick,>,Guest_) great to have you back in $replace($mid($active,3),\b,$chr(32)) }
        timerhistory3 1 3 { ctcpreply $nick TIME You were here last time on $gettok($read(text\history.txt,%line),4,32) on $gettok($read(text\history.txt,%line),3,32) }
        write -l %line text\history.txt $$ial($nick $+ *,1).addr $nick $time $date $chan 
        return
      }
      else {
        timerhistory4 1 2 { ctcpreply $nick TIME Welcome back $replace($nick,>,Guest_) great to have you back in $replace($mid($active,3),\b,$chr(32)) }
        timerhistory5 1 3 { ctcpreply $nick TIME You were here last time on $gettok($read(text\history.txt,%line),4,32) on $gettok($read(text\history.txt,%line),3,32) and were known as $gettok($read(text\history.txt,%line),2,32)) }
        write -l %line text\history.txt $$ial($nick $+ *,1).addr $nick $time $date $chan
        return
      }
      :guest {
        if (%autobril = aan) {
          timerhistory6 1 2 { ctcpreply $nick TIME Welcome $replace($nick,>,Guest_) in $replace($mid($active,3),\b,$chr(32)) . If you login or register via http://www.buzzen.com/passport/reg.php you can join the conversation (8) }
          return
        }
        else {
          timerhistory7 1 2 { ctcpreply $nick TIME Welcome $replace($nick,>,Guest_) in $replace($mid($active,3),\b,$chr(32)) , It seems you need to login or register via http://www.buzzen.com/passport/reg.php }
          return
        }
      }
    }
  }
  if ($readini(iniset\messages.ini,bzchannel $+ $right(#,-2),nickwelcome) == on) {
    $iif(%njoin = Room Message, msg #,$iif(%njoin = Action Message,describe #,$iif(%njoin = Time Reply,ctcpreply $nick TIME,$iif(%njoin = Whisper Reply,whisper # $nick,$iif(%njoin = Notice Message,notice # $nick,$iif(%njoin = Room Broadcast,notice # #)))))) $readini(iniset\messages.ini,bzchannel $+ $right(#,-2),nickwmessage)
  }
}

on *:text:*:#: {
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),nolinks) == on) {
    if ($nick($active,$nick,.@%)) || ($level(*!* $+ $ial($nick).addr) == Zyrus) halt
    if ($deurl($1-)) {
      kick # $nick You got caught spamming in $replace($mid($active,3),\b,$chr(32)) and my foot caught your rear end!! ;)
    }
  }
}

;;;;Credit to h3lp for the DeURL alias used for this Link Kicker and err0r for the idea;;;;
on *:action:*:#: {
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),nolinks) == on) {
    if ($nick($active,$nick,.@%)) || ($level(*!* $+ $ial($nick).addr) == Zyrus) halt
    if ($deurl($1-)) {
      kick # $nick You got caught spamming in $replace($mid($active,3),\b,$chr(32)) and my foot caught your rear end!! ;)
    }
  }
}

;;;;Credit to the original author of this mode lock code;;;;
on *:mode:#: {
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),modelock) == on) {
    if ($nick == $me) || ($level(*!* $+ $ial($nick).addr) == Zyrus) return
    if (+b isin $1-) { halt }
    if (-b isin $1-) { halt }
    if (+ isin $1-) { /mode # $replace($1-,+,-) }
    if (- isin $1-) { /mode # $replace($1-,-,+) }
    if {+k isin $1-) { /mode # -k $2- }
    if (-k isin $1-) { /mode # +k $2- }
    if (+l isin $1-) { /mode # +l 100 }
    if ($me isop $chan) {
      echo -a 10* $nick Attempted To Change The Room Modes 
      msg $active S eTahoma;0 Sorry $replace($nick,>,Guest_) Room Modes Currently Cannot Be Changed In The Room! 
    }
  }
}

;;;;Credit to err0r for helping with this nohammer prot;;;;
on *:rawmode:#: {
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),nohammers) == on) {
    if ($nick != $me) && ($opnick != $me) && (+ isin $1) && ((q isin $1) || (o isin $1) || (h isin $1)) {
      mode $chan -qoh $2 $2 $2
      msg $chan S eTahoma;0 Sorry $replace($nick,>,Guest_) Currently Noone Is Allowed To Give Hammers But Me!!! 
    }
  }
}

;;;;Credit to the original author for the OnlyGold code;;;;
on *:op:#: {
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),onlygold) == on) {
    if $nick isowner $chan return
    if ($opnick == $nick) return
    if ($nick == $me) || ($level(*!* $+ $ial($nick).addr) == Zyrus) return
    if ($opnick == $me) return
    if ($opnick !== $nick) && ($me !isop #) {
      mode $me +h %hostpass 
      mode # -o $opnick 
      msg $active S eTahoma;0 Sorry $replace($nick,>,Guest_) Currently Only Golds Are Allowed To Host!!!
      mode $active -o $me 
    }
    if ($opnick !== $nick) && ($me isop #) {
      mode # -o $opnick 
      msg $active S eTahoma;0 Sorry $replace($nick,>,Guest_) Currently Only Golds Are Allowed To Host!!!
    }
  }
}

;;;;Credit to the original author for the NoOwner and NoHost While Away code;;;;
;;;;Credit to Skillz for the Away Flood Code;;;;
raw 822:*: {
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right($1,-2),noowneraway) == on) {
    if ($nick($active,$nick,.)) {
      mode $active -q $nick
      msg $active S eTahoma;0 Sorry $replace($nick,>,Guest_) Currently There Are No Gold Hammers Allowed While You Are Away!!! :s 
      auser bznoown $nick
    }
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right($1,-2),nohostaway) == on) {
    if ($nick($active,$nick,.)) halt
    if ($nick($active,$nick,@)) {
      mode $active -o $nick
      msg $active S eTahoma;0 Sorry $replace($nick,>,Guest_) Currently There Are No Brown Hammers Allowed While You Are Away!!! :s
      auser bznohost $nick
    }
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right($1,-2),awayflood) == on) {
    inc -u3 %Var [ $+ [ $nick ] ]
  }
  if ($readini(iniset\messages.ini,bzchannel $+ $right($1,-2),nickaway) == on) {
    $iif(%naway = Room Message, msg $1,$iif(%naway = Action Message,describe $1,$iif(%naway = Time Reply,ctcpreply $nick TIME,$iif(%naway = Whisper Reply,whisper $1 $nick,$iif(%naway = Notice Message,notice $1 $nick,$iif(%naway = Room Broadcast,notice $1 $1)))))) $readini(iniset\messages.ini,bzchannel $+ $right($1,-2),nickawaymsg)
  }
}

raw 821:*: {
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right($1,-2),noowneraway) == on) {
    if ($nick == $ulist($nick,bznoown,1)) {
      msg $active S eTahoma;0 Welcome Back $replace($nick,>,Guest_) You Have Been Given Your Gold Hammer Back!!! ;) 
      ruser bznoown $nick
      mode $active +q $nick
    }
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right($1,-2),nohostaway) == on) {
    if ($nick == $ulist($nick,bznohost,1)) {
      msg $active S eTahoma;0 Welcome Back $replace($nick,>,Guest_) You Have Been Given Your Brown Hammer Back!!! ;) 
      ruser bznohost $nick
      mode $active +o $nick
    }
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right($1,-2),awayflood) == on) {
    if (%Var [ $+ [ $nick ] ] == 3) {
      .raw kick $1 $nick Away Flood Detected Multiple Times - Goodbye!
    }
  }
}

on bznoown:op:#: {
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right($1,-2),noowneraway) == on) {
    mode # -q $opnick
    msg # S eTahoma;0 Sorry $replace($nick,>,Guest_) Currently There Are No Gold Hammers Allowed While You Are Away!!! :s
  }
}

on bznohost:op:#: {
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right($1,-2),nohostaway) == on) {
    mode # -o $opnick
    msg # S eTahoma;0 Sorry $replace($nick,>,Guest_) Currently There Are No Brown Hammers Allowed While You Are Away!!! :s
  }
}

on *:part:#: {
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right($1,-2),noowneraway) == on) {
    if ($nick == $ulist($nick,bznoown,1)) {
      ruser bznoown $nick
    }
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right($1,-2),nohostaway) == on) {
    if ($nick == $ulist($nick,bznohost,1)) {
      ruser bznohost $nick
    }
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),speedcalc) == on) {
    set -u20 %partticks. [ $+ [ $ial($nick,1).addr ] $+ [ $chan ] ] $ticks
  }
  if ($readini(iniset\messages.ini,bzchannel $+ $right(#,-2),nickpart) == on) {
    $iif(%npart = Room Message, msg #,$iif(%npart = Action Message,describe #,$iif(%npart = Room Broadcast,notice # #))) $readini(iniset\messages.ini,bzchannel $+ $right(#,-2),nickpartmsg)
  }
}

on ^*:quit:#: {
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right($1,-2),noowneraway) == on) {
    if ($nick == $ulist($nick,bznoown,1)) {
      ruser bznoown $nick
    }
  }
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right($1,-2),nohostaway) == on) {
    if ($nick == $ulist($nick,bznohost,1)) {
      ruser bznohost $nick
    }
  }
}

on *:kick:#: {
  if ($readini(iniset\localsettings.ini,bzchannel $+ $right(#,-2),speedcalc) == on) {
    set -u20 %partticks. [ $+ [ $ial($knick,1).addr ] $+ [ $chan ] ] $ticks
  }
}
