Channel Greeting Console

By Pepsi_Man0077 on Mar 25, 2009

Image

This is an easy to use channel greeter with customable greets, channels, and controls. It will message the channel a random greeting contained within the greeter. It will only message to the channels set up. You can customize whether or not users get to add greetings and channels.

I tested it and seems to work okay. I didnt test for too long, so tell me if you find any errors please.

;§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§
;§§                        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
  }
}

Comments

Sign in to comment.
loves.enough   -  May 15, 2011

if i like to add each user greet then what can i do,,,,, help me plz and i need to add each user greetings
thanks

 Respond  
cupcake   -  Dec 16, 2010

here you go ActiveX it's a simple bot talker..it says hello
hi things like that

http://www.hawkee.com/snippet/6745/

 Respond  
Jethro   -  Dec 16, 2010

Looks like the website that hosts the bot is running relatively slow at the moment. You might want to try it later.

 Respond  
Jethro   -  Dec 16, 2010

ActiveX, this is a funny, promiscuous talking bot I made utilizing socket for someone's request:

on *:text:*:*:bottalk $1-
on *:action:*:*:bottalk $1-
on *:notice:*:*:bottalk $1-
alias -l bottalk {
  if $sock(bot) { sockclose bot }
  sockopen bot www.chat-bot.com 80
  sockmark bot $replace($strip($1-),$chr(32),+) $iif($event = text,.msg,$&
    $iif($event = action,.describe,$iif($event = notice,.notice))) $iif(#,#,$nick)
}
on *:sockread:bot:{
  var %bot | sockread %bot
  if $regex(%bot,/value="(.*)"\s>/) {
    $token($sock(bot).mark,2-,32) $regml(1)
    sockclose bot
  }
}
on *:sockopen:bot:{
  var %x onceki=&cevabi=Can+you+tell+me+something+interesting%3F&konuk=
  var %bot1 $+(%x,$token($sock(bot).mark,1,32))
  var %bot sockwrite -nt bot
  %bot POST /index.php HTTP/1.1
  %bot Host: $sock(bot).addr
  %bot Content-Type: application/x-www-form-urlencoded
  %bot Content-Length: $len(%bot1)
  %bot $crlf $+ %bot1
}

Whenever someone sends a text, action or notice in the channel or PM, the bot (the client that runs the code) will respond with a random say. Be warned that the say may be a bit sexual, so use with caution.

 Respond  
ActiveX   -  Dec 16, 2010

do you know of any script that will make my bot answer people when they say my name or the bot name? (actually speak to people within a channel)

 Respond  
cupcake   -  Dec 15, 2010

looked think this might be what your looking for...

http://www.hawkee.com/snippet/5500/

 Respond  
ActiveX   -  Dec 15, 2010

do you have any auto invite script. where people can invite to my channel automatically

 Respond  
cupcake   -  Dec 15, 2010

ActiveX put a image for you look there, will show you ..
works tested, just look at settings make sure hit the channel
and the greet you want, look at all the settings. After you
check it out let me know will delete the image.

 Respond  
ActiveX   -  Dec 15, 2010

yes, i entered my own greetings but can not figure it out

 Respond  
cupcake   -  Dec 14, 2010

Did you enter your own greet message ?
Probably have to enable, and have the #channel name .

 Respond  
ActiveX   -  Dec 14, 2010

i did that but when i enter the channel it is not greating me or anyone for that matter

 Respond  
ActiveX   -  Dec 14, 2010

how do i use the script

 Respond  
blackvenomm666   -  Dec 14, 2010
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 you change that and add a simple # $+ you would no longer need to remember to add the # in the edit box on the dialog

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)
    }
 Respond  
cupcake   -  Dec 14, 2010

Looks like you need to paste into your remote ActiveX, then just add channel..make sure you use# like #channel add messages you want.

 Respond  
ActiveX   -  Dec 14, 2010

how do i add it to my channel

 Respond  
ericfx   -  Feb 03, 2010

Hello Pepsi_Man,

Installed this script in remote section but I am not getting any random greeting. Do I have to add my own greetings first?

Sorry, still new to irc.

 Respond  
Pepsi_Man0077   -  Mar 27, 2009

Well some people like them. I personally don't use it lol but im sure someone will find use for it.

 Respond  
irchainscriptz   -  Mar 27, 2009

I had one awhile ago but didnt think ppl like that sort of stuff

 Respond  
Pepsi_Man0077   -  Mar 26, 2009

Haha Sure thanks guys. Yeah i can do that, but they wont see it cause the part and quit event is initiated after they part and quit.

 Respond  
undertaker28   -  Mar 26, 2009

this is awesome many thnx
can you now do one that gives a mesg when they leave or quit

tnx

 Respond  
Cheiron   -  Mar 26, 2009

it certainly got peoples attention lol.....

23:37:48] Ayla[EL]{t^c}{a} (Me@b) has joined #gothic
[23:37:48] <&Titan_Bot> And another one joins... well come on in then Ayla[EL]{t^c}{a}
[23:37:59] <Ayla[EL]{t^c}{a}> O_o
[23:38:13] <Ayla[EL]{t^c}{a}> omg!! the bot is talking now!!! runnnnn!!!
[23:38:29]
+lynxrecovering mews clinging to Ms Ayla "hey now please Don't leave me"
[23:39:44] <Ayla[EL]{t^c}{a}> lol pet
[23:39:51] <Ayla[EL]{t^c}{a}> I didn't leave...just rebooted
[23:41:23] <+lynxrecovering> You said run when the bot talked

say no more lol.. awesome job Pepsi_Man :D

 Respond  
Pepsi_Man0077   -  Mar 26, 2009

Thank you guys, thought another one could be used :P

Hope its useable for people

 Respond  
Cheiron   -  Mar 25, 2009

i totally agree. runs very nice on mine so far :)

 Respond  
Aucun50   -  Mar 25, 2009

Another Great dialog Pepsi looks very professional Good Job.

 Respond  
Pepsi_Man0077   -  Mar 25, 2009

Cool, thanks. If you see any errors please let me know.

 Respond  
Cheiron   -  Mar 25, 2009

got it loaded and am testing now .. will edit this post as i see it happening rather than double post. initial looks are nice and clean though :)

ran a couple of greetings up on the dialogue and it all appears to function nicely. not been able to test the add / del commands yet though. will get to that though later. gets a like and 8 score

 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.