tglogo.png

Downloading File

Filename: Channel Greeting Console
;����������������������������������������������������������������������������������������������������
;��                        Made by: PePSiMaN
;��               Title:       Channel Greeting.mrc
;��               Date:          3-24-2009
;��               Description:  Channel Greeting Console
;��
;��               DO NOT CHANGE ANYTHING IN THIS FILE
;����������������������������������������������������������������������������������������������������
 
 
dialog Greetings {
  title "Channel Greeting Console"
  size -1 -1 323 168
  option dbu
  box "Channels to Greet", 1, 2 0 160 110
  box "Greet Messages", 2, 162 0 160 110
  edit "", 3, 6 10 70 10, center autohs
  combo 4, 6 23 70 84, size
  button "Add Chan to List", 5, 79 9 65 12
  button "Del Chan from List", 6, 79 23 65 12
  combo 7, 165 9 75 98, size
  edit "Enter Greeting Here...", 8, 243 9 75 11, center autohs
  text "Note: You can use common identifiers ($nick, $+, etc.)", 9, 243 21 74 22, center
  button "Add Greeting", 10, 243 45 75 12
  button "Del Greeting", 11, 243 59 75 12
  box "User Control", 12, 2 110 160 56
  check "Enable User Control", 13, 5 118 61 10
  edit "", 14, 80 118 10 10, limit 1 center
  text "Command Prefix", 15, 91 119 44 8, center
  check "Allow to add Greets", 16, 5 130 73 10
  check "Allow to del Greets", 17, 81 130 76 10
  box "Command List - Don't include the prefix (ex: !)", 18, 162 110 160 41
  text "Adding Greets", 19, 166 120 40 8, center
  text "Delete Greets", 20, 166 137 40 8, center
  edit "", 21, 209 119 36 10
  edit "", 22, 209 136 36 10
  text "Add Channels", 23, 246 120 35 8, center
  text "Del Channels", 24, 246 137 35 8, center
  edit "", 25, 284 119 36 10
  edit "", 26, 284 136 36 10
  button "Save Settings", 27, 242 153 37 12
  button "Close", 28, 282 153 37 12, ok
  check "Allow to add Channels", 29, 5 142 70 10
  check "Allow to del Channels", 30, 81 142 60 10
  radio "All Users", 31, 4 153 38 10, push
  radio "Ops Only", 32, 43 153 38 10, push
  radio "Hops Only", 33, 82 153 38 10, push
  radio "Vops Only", 34, 121 153 38 10, push
}
 
Menu Channel {
  -
  Channel Greeting:dialog -m Greetings Greetings
}
 
on *:DIALOG:Greetings:init:*: {
  if (!$readini(Greetings.ini,Settings,Prefix)) { writeini Greetings.ini Settings Prefix ! }
  if (!$readini(Greetings.ini,Settings,UserControl)) { writeini Greetings.ini Settings UserControl True }
  if (!$readini(Greetings.ini,Settings,AddGreeting)) { writeini Greetings.ini Settings AddGreeting addgreeting }
  if (!$readini(Greetings.ini,Settings,DelGreeting)) { writeini Greetings.ini Settings DelGreeting delgreeting }
  if (!$readini(Greetings.ini,Settings,AddChannel)) { writeini Greetings.ini Settings AddChannel addchannel }
  if (!$readini(Greetings.ini,Settings,DelChannel)) { writeini Greetings.ini Settings DelChannel delchannel }
  if (!$readini(Greetings.ini,Settings,AllowAddGreets)) { writeini Greetings.ini Settings AllowAddGreets True }
  if (!$readini(Greetings.ini,Settings,AllowDelGreets)) { writeini Greetings.ini Settings AllowDelGreets True }
  if (!$readini(Greetings.ini,Settings,AllowAddChannels)) { writeini Greetings.ini Settings AllowAddChannels True }
  if (!$readini(Greetings.ini,Settings,AllowDelChannels)) { writeini Greetings.ini Settings AllowDelChannels True }
  if (!$readini(Greetings.ini,Settings,UserType)) { writeini Greetings.ini Settings UserType All }
  did -a $dname 14 $readini(Greetings.ini,Settings,Prefix)
  did -a $dname 21 $readini(Greetings.ini,Settings,AddGreeting)
  did -a $dname 22 $readini(Greetings.ini,Settings,DelGreeting)
  did -a $dname 25 $readini(Greetings.ini,Settings,AddChannel)
  did -a $dname 26 $readini(Greetings.ini,Settings,DelChannel)
  did -b $dname 14,16,17,21,22,25,26,29,30-34
  if ($readini(Greetings.ini,Settings,UserControl) = True) { did -c $dname 13 | did -e $dname 14,16,17,21,22,25,26,29,30-34 }
  if ($readini(Greetings.ini,Settings,AllowAddGreets) = True) { did -c $dname 16 }
  if ($readini(Greetings.ini,Settings,AllowDelGreets) = True) { did -c $dname 17 }
  if ($readini(Greetings.ini,Settings,AllowAddChannels) = True) { did -c $dname 29 }
  if ($readini(Greetings.ini,Settings,AllowDelChannels) = True) { did -c $dname 30 }
  if ($readini(Greetings.ini,Settings,UserType) = All) && ($readini(Greetings.ini,Settings,UserControl) = True) { did -c $dname 31 }
  if ($readini(Greetings.ini,Settings,UserType) = Ops) && ($readini(Greetings.ini,Settings,UserControl) = True) { did -c $dname 32 }
  if ($readini(Greetings.ini,Settings,UserType) = Hops) && ($readini(Greetings.ini,Settings,UserControl) = True) { did -c $dname 33 }
  if ($readini(Greetings.ini,Settings,UserType) = Vops) && ($readini(Greetings.ini,Settings,UserControl) = True) { did -c $dname 34 }
  var %x 1
  var %y 1
  while (%x <= $lines(Greetings.txt)) {
    did -a $dname 7 $read(Greetings.txt,-n,%x)
    inc %x
  }
  while (%y <= $lines(GrChannels.txt)) {
    did -a $dname 4 $read(GrChannels.txt,%y)
    inc %y
  }
}
 
on *:DIALOG:Greetings:*:*: {
  if ($devent == sclick) {
    if ($did == 5) {
      var %x 1
      while (%x <= $lines(GrChannels.txt)) {
        if ($read(GrChannels.txt,%x) = $did(3)) { halt }
        inc %x
      }
      write GrChannels.txt $did(3)
      did -a $dname 4 $did(3)
    }
    if ($did == 6) { write -dl $+ $did(7).sel GrChannels.txt | did -d $dname 4 $did(4).sel }
    if ($did == 10) { write Greetings.txt $did(8) | did -a $dname 7 $did(8) }
    if ($did == 11) { write -dl $+ $did(7).sel Greetings.txt | did -d $dname 7 $did(7).sel }
    if ($did == 13) {
      if ($did(13).state = 0) {
        did -b $dname 14,16,17,21,22,25,26,29,30-34 
        writeini Greetings.ini Settings UserControl False 
        did -u $dname 31-34
      }
      if ($did(13).state = 1) {
        did -e $dname 14,16,17,21,22,25,26,29,30-34 
        writeini Greetings.ini Settings UserControl True
        if ($readini(Greetings.ini,Settings,UserType) = All) { did -c $dname 31 } 
        if ($readini(Greetings.ini,Settings,UserType) = Ops) { did -c $dname 32 }
        if ($readini(Greetings.ini,Settings,UserType) = Hops) { did -c $dname 33 }
        if ($readini(Greetings.ini,Settings,UserType) = Vops) { did -c $dname 34 }
      }
    }
    if ($did == 16) {
      if ($did(16).state = 0) { writeini Greetings.ini Settings AllowAddGreets False }
      if ($did(16).state = 1) { writeini Greetings.ini Settings AllowAddGreets True }
    }
    if ($did == 17) {
      if ($did(17).state = 0) { writeini Greetings.ini Settings AllowDelGreets False }
      if ($did(17).state = 1) { writeini Greetings.ini Settings AllowDelGreets True }
    }
    if ($did == 27) { writeini Greetings.ini Settings Prefix $did(14) | writeini Greetings.ini Settings AddGreeting $did(21) | writeini Greetings.ini Settings DelGreeting $did(22) | writeini Greetings.ini Settings AddChannel $did(25) | writeini Greetings.ini Settings DelChannel $did(26) }
    if ($did == 29) {
      if ($did(29).state = 0) { writeini Greetings.ini Settings AllowAddChannels False }
      if ($did(29).state = 1) { writeini Greetings.ini Settings AllowAddChannels True }
    }
    if ($did == 30) {
      if ($did(30).state = 0) { writeini Greetings.ini Settings AllowDelChannels False }
      if ($did(30).state = 1) { writeini Greetings.ini Settings AllowDelChannels True }
    }
    if ($did == 31) { writeini Greetings.ini Settings UserType All }
    if ($did == 32) { writeini Greetings.ini Settings UserType Ops }
    if ($did == 33) { writeini Greetings.ini Settings UserType Hops }
    if ($did == 34) { writeini Greetings.ini Settings UserType Vops }
  }
}
 
on *:TEXT:*:*: {
  if ($readini(Greetings.ini,Settings,UserControl) = True) {
    if ($readini(Greetings.ini,Settings,UserType) = Ops) && ($nick !isop $chan) { halt }
    if ($readini(Greetings.ini,Settings,UserType) = Hops) && ($nick !ishop $chan) { halt }
    if ($readini(Greetings.ini,Settings,UserType) = Vops) && ($nick !isvoice $chan) { halt }
    if ($readini(Greetings.ini,Settings,AllowAddGreets) = True) && ($left($1,1) = $readini(Greetings.ini,Settings,Prefix)) && ($right($1,-1) = $readini(Greetings.ini,Settings,AddGreeting)) {
      write Greetings.txt $2-
      notice $nick Added Greeting: $2-
    }
    if ($readini(Greetings.ini,Settings,AllowDelGreets) = True) && ($left($1,1) = $readini(Greetings.ini,Settings,Prefix)) && ($right($1,-1) = $readini(Greetings.ini,Settings,DelGreeting)) {
      if ($read(Greetings.txt,w,$2-)) {
        var %line $readn
        notice $nick Deleted Greeting: $2-
        write -dl $+ %line Greetings.txt
      }
      else { notice $nick Sorry, That greeting was not found }
    }
    if ($readini(Greetings.ini,Settings,AllowAddChannels) = True) && ($left($1,1) = $readini(Greetings.ini,Settings,Prefix)) && ($right($1,-1) = $readini(Greetings.ini,Settings,AddChannel)) {
      if ($chr(35) !isin $2) { notice $nick Invalid Channel | halt }
      var %x 1
      while (%x <= $lines(GrChannels.txt)) {
        if ($2 = $read(GrChannels.txt,%x)) { notice $nick Channel already exists in database | halt }
        inc %x
      }
      write GrChannels.txt $2
      notice $nick Added Channel: $2
    }
    if ($readini(Greetings.ini,Settings,AllowDelChannels) = True) && ($left($1,1) = $readini(Greetings.ini,Settings,Prefix)) && ($right($1,-1) = $readini(Greetings.ini,Settings,DelChannel)) {
      if ($read(GrChannels.txt,w,$2)) {
        var %line $readn
        notice $nick Deleted Channel: $2
        write -dl $+ %line GrChannels.txt
      }
      else { notice $nick Sorry, That channels was not found }
    }
  }
}
 
on *:JOIN:*: {
  var %x 1
  while (%x <= $lines(GrChannels.txt)) {
    if ($chan = $read(GrChannels.txt,%x)) && ($nick != $me) {
      var %greet $rand(1,$lines(Greetings.txt))
      msg $chan $read(Greetings.txt,%greet)
    }
    inc %x
  }
}

Related Files


Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand