|
Joined: Apr 2014
Posts: 170
Vogon poet
|
OP
Vogon poet
Joined: Apr 2014
Posts: 170 |
I'll test now for you man. Appreciate it. Huge help  EDIT: Alright, semi-tested. It works on join, can add and remove, and turn it off and on. The !welcome command (to show if it's on or not) doesn't work for some reason. Not a huge deal though, I believe it's on by default. And it messages when you do !welcome (on/off) so that tells you if it's on anyway. Not able to test for the flood at the moment, but it's blessing so I'm sure that works anyway :P The !welcome reset is also not working, for me at least. But, I'll try to sort it out a bit  Also, if you have an old welcome script, you'll need to re-do all the welcome messages (I just copy/pasted them from the old one under the new [vip.#channelnamehere] in the welcome file. Thanks again bless! EDIT2: After a little more testing, I think I've found the problem. When I do "!welcome on/off" it messes something up. After turning it on and not leaving it on by default it stops letting me edit messages, removing messages, and resetting unknown. Which is fine, for me anyway, since I don't mind going in and taking it out when I need to. Again, thank you blessing.
Last edited by Bramzee; 18/05/14 08:47 PM.
|
|
|
|
Joined: Mar 2014
Posts: 215
Fjord artisan
|
Fjord artisan
Joined: Mar 2014
Posts: 215 |
I expanded on this a little  Someone says "!welcome [message]" and it sets that to be their join message. When they enter it will be that message  The $read(sreglist.txt,nw,$nick) is my list of nicknames that i want to have a join message (so it's not spammy)you can easily replace it with if ($nick isop $chan) { on *:join:#: { if ($readini(Welcome.ini,Messages,$nick)) msg # $v1 }
on *:TEXT:!welcome *:#: {
if ($read(sreglist.txt,nw,$nick)) {
if ($readini(Welcome.ini,Messages,$nick)) {
remini Welcome.ini Messages $nick
msg # changed $nick $+ 's welcome message to " $+ $2- $+ "
.timerWriteWelcomeMessage 1 1 writeini Welcome.ini Messages $nick $2-
}
else {
msg # set $nick $+ 's welcome message to " $+ $2- $+ "
writeini Welcome.ini Messages $nick $2-
}
}
}
|
|
|
|
Joined: Jan 2004
Posts: 1,361
Hoopy frood
|
Hoopy frood
Joined: Jan 2004
Posts: 1,361 |
Never use a timer with user input without the safe alias, not that you should be using a timer here at all anyway. And always use the "n" switch for both $read and $readini. You also don't need to remini if you're going to writeini afterward. on *:join:#: { if ($readini(Welcome.ini,n,Messages,$nick)) msg # $v1 }
on *:text:!welcome *:#: {
if ($read(sreglist.txt,nw,$nick)) {
if ($readini(Welcome.ini,n,Messages,$nick)) {
msg # changed $nick $+ 's welcome message to " $+ $2- $+ "
}
else {
msg # set $nick $+ 's welcome message to " $+ $2- $+ "
}
writeini Welcome.ini Messages $nick $2-
}
}
alias safe return $!decode( $encode($1,m) ,m)
|
|
|
|
Joined: Apr 2014
Posts: 191
Vogon poet
|
Vogon poet
Joined: Apr 2014
Posts: 191 |
Thanks for helping testing it. Do appreciate.  !welcome doesn't work but !welcome reset works, for me. changes: * Added code that allows vip user (that already in the file) to change their own custom msg (idea from judge2020) usage: `welcome <msg> Note: - command only can be triggered when !welcome is on - it has floodcontrol 10secs * added n switch for $readini. forgot about that. thanks to Loki.
on $*:TEXT:/^[!`]welcome/iS:#:{
var %file welcome.ini, %stat $iif($readini(%file,n,$+(stat.,#),welcome),$v1,on)
if $1 == !welcome && $nick isop # {
if !$2 { msg # !welcome is %stat }
elseif $2 == on || $2 == off {
writeini %file $+(stat.,#) welcome $lower($2)
msg # !welcome turned $lower($2)
}
elseif $2 == reset {
remini %file $+(unknown.,#)
msg # !welcome has been reset.
}
elseif !$3 {
remini %file $+(vip.,#) $2
msg # $2 $+ 's custom message removed.
}
else {
var %m $readini(%file,n,$+(vip.,#),$2)
writeini %file $+(vip.,#) $2 $3-
remini %file $+(unknown.,#) $2
msg # $2 $+ 's custom message $iif(%m,changed,added) ( $3- )
}
}
elseif $1 == `welcome && %stat == on && $readini(%file,n,$+(vip.,#),$nick) && !%flood.welcome. [ $+ [ $+(#,.,$nick) ] ] {
writeini %file $+(vip.,#) $nick $2-
msg # $nick $+ 's custom message changed ( $2- )
set -u10 %flood.welcome. [ $+ [ $+(#,.,$nick) ] ] on
}
}
on @!*:JOIN:#:{
var %file welcome.ini, %stat $iif($readini(%file,n,$+(stat.,#),welcome),$v1,on)
if %stat == off { return }
if $readini(%file,n,$+(vip.,#),$nick) { msg # $v1 }
elseif !$readini(%file,n,$+(unknown.,#),$nick) {
writeini %file $+(unknown.,#) $nick $ctime
var %nicks $addtok($readini(%file,n,$+(stat.,#),delay),$nick,32)
if !%flood.welcome. [ $+ [ # ] ] {
msg # Welcome to the stream $replace(%nicks,$chr(32),$+($chr(44),$chr(32))) $+ .
remini %file $+(stat.,#) delay
set -u10 %flood.welcome. [ $+ [ # ] ] on
}
else {
writeini %file $+(stat.,#) delay %nicks
$+(.timerwelcome.,#) 1 5 welcome %file #
}
}
}
alias -l welcome {
var %nicks $replace($readini($1,$+(stat.,$2),delay),$chr(32),$+($chr(44),$chr(32)))
if %nicks {
if $me ison $2 { msg $2 Welcome to the stream %nicks $+ . }
remini $1 $+(stat.,$2) delay
}
}
|
|
|
|
Joined: Apr 2014
Posts: 170
Vogon poet
|
OP
Vogon poet
Joined: Apr 2014
Posts: 170 |
Somehow I've missed the last few posts in here. However, I appreciate the help. the ability for regs to set their own message is awesome and was something I did on my own, but your way is definitely cleaner and more reliable ha. I'll add it in as soon as I'm home and back on my computer. Thanks again guys.
|
|
|
|
Joined: Apr 2014
Posts: 170
Vogon poet
|
OP
Vogon poet
Joined: Apr 2014
Posts: 170 |
So, not to dig up old threads... But, I got a small "mini-raid" the other day. The messages weren't popping up for people when more than one joined. It would welcome just one, and then ignore the rest for a little bit and welcome the next person that joined. Sorry if this is what is supposed to happen, and I just mis-read the post. But, as far as I could tell it was supposed to welcome multiple users at the same time? I tried looking through it after my stream was over but at that point I was exhausted and just couldn't. I just got back from my sisters grad party and figured I'd stop in here for some help before my stream tonight. Thanks <3
|
|
|
|
|