On Join

By KilllerX on Apr 13, 2010

Well... I finally got around to working more on my bot. Which I test out frequently. and I figured well there are welcome messages. but are they like this? So decided to make it the way I did.

Basically what it does is reads a line from a file. and those lines read lines from another file. so the file it is reading looks something like this

Hello $nick $+ , would you like a $read(alcohol.txt) today?
Hello $nick $+ , would you like a $read(pop.txt) today?

and such on. So the chances of seeing the same Welcome message over and over (the same annoying message) are no longer a problem.

Granted this is an Easy welcome message. but I like it. because I have like a list of 5 different welcomes types. and like massive amounts of pops, alcohols, pies, and things like that. which would mean you have like a .001% chance of seeing the same welcome message.

and then so you can add more welcomes.
ex.
type
!aw Hello $nick $+ .

for it to add that line of text to the welcome file.

On *:Join:#:{
 msg # $read(welcome.txt)
}

on *:text:!aw*:#:{
  if ($nick isreg $chan) { msg # sorry only mod status can add welcomes }
  if ($nick isop $chan) {
    /write welcome.txt  $nick $+: $2-
    msg $chan Your greeting messege has been added.
  }
}

Comments

Sign in to comment.
Bielie   -  Apr 25, 2010

oke great

 Respond  
KilllerX   -  Apr 22, 2010

Thank you... and the Failed to join because already in it, didn't work for me. And I got it working. I actually looked into using that. but then it didn't auto redirect to a different IP so I found the code I had for that and now I got it working.

 Respond  
Bielie   -  Apr 21, 2010

@killerX This might be what your looking for:

on *:TEXT:?join*:#:{
  if (!$(,$+(%,flood,$nick))) {
    set -u3 $+(%,flood,$nick)
  }

  if ($address($nick,2) != $address($me,2)) {
    notice $nick You need to be a Moderator of this bot to use this command.
    return
  }

  notice $nick 5Conneting to $2 , Please wait......

  if ($2 == $null) {
    notice $nick 4Failed14 to join the channel because you didn't provide a channel name!
    return
  }

  if ($me ison $2) {
    .timer 1 3 notice $nick 4Failed14 to join $2 because I'm already in that channel!
    return
  }
  set -u5 %!join $+ $2 $chan
  join $2
}

else {
  .timer 1 3 msg $chan 2Succesfully14 joined channel $chan 
}

on *:JOIN:#:{
  if ($eval($+(%,!join,$chan),2) != $null) {
    .timer 1 3 msg $v1 3Successfully 5joined channel $chan 
    msg $chan 14I joined this channel because it was requested by the host of this Bot.
    unset %!join $+ $chan
  }
}
raw 474:*:{
  if ($eval($+(%,!join,$2),2) != $null) {
    notice Sphex 4Failed 14to join $2 because the bot has been banned from that channel.
    unset %!join $+ $chan
  }
}
 Respond  
Kerli   -  Apr 14, 2010

I have something like that, but I never had ip issues.

 Respond  
KilllerX   -  Apr 13, 2010

Yah. I am still learning I am trying to look into a !join command to get my bot into another channel with out me having to put him in there.

which I know would look something like this

on @:text:!join*:{
join $2
}

But the thing is sometimes it is in a differant Ip.. such as mine is in a 199.9.249.114 and they want it into a ip that is 199.9.252.165.. I need to figure out how to make it so that it goes to that server to join the channel.

And Jethro with that I have I know it is basic. but I have fully tested it and it does exactly what I want it to do. I know your way would work to. It does not welcome the host (the mIRC bot). and thanks for the feed back.

 Respond  
Kerli   -  Apr 13, 2010

Works fine, it seems, but too simple. Really, it's just a welcome message with a $read for a txt document in it, which is far too easy to do. Especially since you didn't provide a txt document. But I like the command added so you can change it from IRC without having to dig into your bot's txt documents. Nice touch.

Anyhow, glad you're starting to learn more mIRC! ;D

 Respond  
Jethro   -  Apr 13, 2010

I changed it back to $read(welcome.txt) If you prefer the use of /play command. You may have to add the -cr switch. The -c switch tells mirc that any identifier in the file will be treated as a command, and the -r switch tells mirc to play a line randomly.

 Respond  
Jethro   -  Apr 13, 2010

You do not want to welcome the client that runs the code, and you have to make sure welcome.txt exists or you'll get an error:

on !*:join:#: {
  if ($isfile(welcome.txt)) { msg # $read(welcome.txt) }
}
on *:text:!aw *:#: {
  if ($nick(#,$nick,vr)) {
    msg # sorry only mod status can add welcomes!
  }
  else {
    write welcome.txt $2-
    msg # $nick $+ , your greeting messege has been added.
  }
}
 Respond  
WorldDMT   -  Apr 13, 2010

hi
on join event is # not $

in write file i think the $nick must be $!nick

and if the user is voiced ? what about him?

so the code can be like this

on *:text:!aw*:#:{
  if ($nick(#,$nick,vr)) msg # sorry only mod status can add welcomes
  else {
    write welcome.txt ...
    ......
  }
}
 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.