|
Joined: Nov 2003
Posts: 102
Vogon poet
|
OP
Vogon poet
Joined: Nov 2003
Posts: 102 |
Hey, Needing a small script that will simply say Hello to all the users as they join the channel and also ask age. A feature to add them to a list of approved people would be fantastic but also not required
So basicly on join would get a reply like
Hello USER , Welcome to #CHAN . May we have your age Please ?
Would like to add users to the list and maybe even be able to setup custom welcome messages for Known users? And if all possible...all the commands in a pop window including the part involving custom messages maybe??
Take your time . Hope to get some good results on this
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
on ^*:join:#channel: {
.msg $nick Hello $nick $+ , Welcome to #channel . May we have your age Please ?
}
Change #channel to your channel name, and place it in remote in your mirc. ALT + R will open up the script editor/remote. you can also use:
on ^*:join:#channel: {
if ($nick == moo) .msg moo Hello $nick $+ , you are moo.
elseif ($nick == foo) .msg $nick hello $nick $+ , you aren't moo.
elseif ($nick == baa) .msg $nick hello $nick $+ , you aren't foo or moo.
else {
.msg $nick Hello $nick $+ , Welcome to #channel . May we have your age Please ?
}
}
the . hide the message from you, not fun watch all messages sent if you are on active channel.
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Nov 2003
Posts: 102
Vogon poet
|
OP
Vogon poet
Joined: Nov 2003
Posts: 102 |
Hey thanks for the reply. I am having issues. I use 2 scripts. I use invision to chat with and i use PNP as my bot sort of speak. This code you gave me works well with invision but i cant get it to work on PNP ....Thats where i am wanting it...any ideas as to why it wouldnt work ? This is the code as its sitting on my script at the moment
on ^*:join:#chat18+: {
.msg $nick Hello $nick $+ , Welcome to #chat18+ . May we have your age Please ?
}
Last edited by ToRmEnTeD; 28/10/08 03:08 PM.
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
on *@:join:#: {
if ($chan == #chat18+) {
if ($nick == moo) { .msg moo Hello $nick $+ , you are moo. }
elseif ($nick == foo) { .msg $nick hello $nick $+ , you aren't moo. }
elseif ($nick == boo) { .msg $nick hello $nick $+ , you aren't foo or moo. }
else {
.msg $nick Hello $nick $+ , Welcome to $chan $+ . May we have your age Please ?
}
}
}
try this one then, tested and working for me, make sure you don't have any other on *:join: abow this code.
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Nov 2003
Posts: 102
Vogon poet
|
OP
Vogon poet
Joined: Nov 2003
Posts: 102 |
Thanks still dont work on PNP but im thinking that maybe its because i already have an onjoin event being used on that script..I have it set to auto whois on join ..not on the same files ,the 2 scripts but they are both onjoin events from the same bot/script. I am just going to host it on the Invision client. However i have another smaller problem. I dont see anything on Invision when it sends the greet to a user that just joined....How would i go about see it?
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
You could put sparta's code in a new remote file or combine it with another onjoin event you already have.
|
|
|
|
Joined: Nov 2003
Posts: 102
Vogon poet
|
OP
Vogon poet
Joined: Nov 2003
Posts: 102 |
I am ok with the code...Just having to use it on antother script than i had planed...but all im wanting to know now is how do i change that script so i can see when my script greets someone that enters.....I dont see anything the way it is. everyone else sees it but me . I know it might be nice to know how to have it the way it is right now but for right now i would like to see it saying it
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
To see the messages in the sending client itself, remove all the dots in front of the "msg" commands (msg <something> instead of .msg <something>).
|
|
|
|
Joined: Nov 2003
Posts: 102
Vogon poet
|
OP
Vogon poet
Joined: Nov 2003
Posts: 102 |
Ahh ok ...and I think that was already kinda told to me but i didnt get it .Thanks for clearing that up. Works fine. Still cant figure out why its not working on PNP...I have other Onjoin scripts running like a whois onjoin and a peak users script...But they are all seperate scripts Anyways thanks to all of you. Another good script
|
|
|
|
Joined: Nov 2003
Posts: 102
Vogon poet
|
OP
Vogon poet
Joined: Nov 2003
Posts: 102 |
been sitting here messing with this trying to get the text it sends to channel to be ACTION/ME text. ..Cant seem to get anything to work trying it. Any thing i need to do other than change the MSG to ME or ACTION ? I even tried /ME and it didnt do anything. Still works fine using msg tho
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
You can try /describe
/describe <nick|channel> <message>
|
|
|
|
Joined: Nov 2003
Posts: 102
Vogon poet
|
OP
Vogon poet
Joined: Nov 2003
Posts: 102 |
Yup that worked perfect Thanks a million
|
|
|
|
Joined: Nov 2003
Posts: 102
Vogon poet
|
OP
Vogon poet
Joined: Nov 2003
Posts: 102 |
Ahh im back again...Ok this script is working great for the most part... I basicly just have 2 msgs...the one asking for age and then one i have for known people that i have added. So my code is this...
on *@:join:#: {
if ($chan == #chat18+) {
if ($nick == AnTiSoCiaL) { /describe $chan Hey $nick $+ , Welcome Back :) }
elseif ($nick == Zule) { /describe $Chan Hey $nick $+ , Welcome Back. :) }
elseif ($nick == Bad_Idea) { /describe $nick Hey $nick $+ , Welcome back :) }
elseif ($nick == SloFlyer) { /describe $nick Hey $nick $+ , Welcome back :) }
elseif ($nick == Merkin_Man) { /describe $nick Hey $nick $+ , Welcome back :) }
elseif ($nick == AKASHA) { /describe $nick Hey $nick $+ , Welcome back :) }
else {
/describe $chan Hello $nick $+ , Welcome to $chan $+ . May we have your age Please ?
}
}
}
My problem is that when "at least" the users Bad_idea joins my script sends her a /msg instead of a /describe msg Noone wants a PM everytime you join. It dont do it to my client "Antisocial" It seems to work fine. Anything wrong with the code that would cause this? Also a HUGE question...Could somone make this into a pop-up so i could just right click on someones nick and add them to the known list so the would get the welcome back msg and not the age question? right now im adding them by hand ...ok but kinda pain
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
How do you store the nick? in a text file or variable ? PS / aren't needed in a remote script, so you don't need /describe
Last edited by sparta; 31/10/08 12:20 PM.
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Jan 2007
Posts: 1,156
Hoopy frood
|
Hoopy frood
Joined: Jan 2007
Posts: 1,156 |
Look at your code. Once you get to 'Bad Idea' you switch to /describe $nick instead of describe $chan.
Also, look u have the same command over and over.
What you want to do is create a list of nicks then if the nick is in the list, welcome them back. Otherwise ask for age.
I have to leave for work otherwise I'd write something for you. If it isn't done when I get home I'll do it, but most likely this will be taken care of.
A text file is easy for this sort of thing, but I don't like using them. I'd probably make this an ini file seperating the nicks by channel or something.
|
|
|
|
Joined: Jul 2008
Posts: 12
Pikka bird
|
Pikka bird
Joined: Jul 2008
Posts: 12 |
on *@:join:#chat18+: {
if $istok(AnTiSoCiaL Zule Bad_Idea SloFlyer Merkin_Man AKASHA,$nick,32) { describe $chan Hey $nick $+ , Welcome Back :) }
else { describe $chan Hello $nick $+ , Welcome to $chan $+ . May we have your age Please ? }
} Sorry for my short explanation, but not mastered the English
Last edited by mOX; 31/10/08 12:54 PM.
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
I made this for you, if i understand right you want to ask any new user there age, and if they have been on the channel 1 time before, then you just want to great them with a welcome message? here we go:
on *:join:#: {
if ($nick != $me) && ($chan == #chat18+) {
if (!$isfile($+(join.txt))) { write join.txt }
if ($nick isin $read(join.txt, w, $+(*,$nick,*))) { describe $Chan Hey $nick $+ , Welcome Back. :) }
else {
describe $chan Hello $nick $+ , Welcome to $chan $+ . May we have your age Please ?
write join.txt $nick
}
}
}
This will create the file join.txt first time someone join the channel, then it will add the nick to the txt file, and after that it will scan the file, if a nick is in the text file. then it will just great the user, if a user are new, then it will add the user and ask for the age, and next time he join it will be a great with welcome. hope this is what you looking for.
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Nov 2003
Posts: 102
Vogon poet
|
OP
Vogon poet
Joined: Nov 2003
Posts: 102 |
Almost i am wanting a script that i can kinda just add them as we get to know them. 1 time visit could be tricked by just a quick join and part... Its really important that we be able to add them only after we are trusting of them.lots of idiots on our server
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
Then remove the "write join.txt $nick" part from the script, then use this one to manual adding:
menu nicklist {
Add user:{ write join.txt $1 }
}
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Nov 2003
Posts: 102
Vogon poet
|
OP
Vogon poet
Joined: Nov 2003
Posts: 102 |
Hi and thanks for your help. I am still very new. I think i did what you said? I removed the line and replaced it with the second bit you gave me ...Code looks like such but i am pretty sure its my fault lol Do you see what i did?
on *:join:#: {
if ($nick != $me) && ($chan == #chat18+) {
if (!$isfile($+(join.txt))) { write join.txt }
if ($nick isin $read(join.txt, w, $+(*,$nick,*))) { describe $Chan Hey $nick $+ , Welcome Back. :) }
else {
describe $chan Hello $nick $+ , Welcome to $chan $+ . May we have your age Please ?
menu nicklist {
Add user:{ write join.txt $1 }
}
}
}
}
This is what i get in my status window...
[3:13pm] gazer3 (ewcflash@ewc-0f0ecf17.dsl.as9105.com) has joined. «10 people»
[3:13pm] * @ToRmEnTeD Hello gazer3, Welcome to #chat18+. May we have your age Please ?
[3:13pm] ERROR > 421: Unknown command: MENU
[3:13pm] ERROR > 421: Unknown command: ADD
[3:13pm] <@KrazyKitty> yea
[3:13pm] gazer3 (ewcflash@ewc-0f0ecf17.dsl.as9105.com) has parted. «9 people»
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
on *:join:#: {
if ($nick != $me) && ($chan == #chat18+) {
if (!$isfile($+(join.txt))) { write join.txt }
if ($nick isin $read(join.txt, w, $+(*,$nick,*))) { describe $Chan Hey $nick $+ , Welcome Back. :) }
else {
describe $chan Hello $nick $+ , Welcome to $chan $+ . May we have your age Please ?
;write join.txt $nick
}
}
}
menu nicklist {
Add user:{ write join.txt $1 }
}
Just copy and paste, don't change anything and see if it working as you want it to right click in the nick list and you should see the menu there, the nick you have highlighted will be the one you add to the list..
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Nov 2003
Posts: 102
Vogon poet
|
OP
Vogon poet
Joined: Nov 2003
Posts: 102 |
ha, Works perfect! Thanks very much
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
If you want it to auto add in the future, just remove the ; in the end of the code: ;write join.txt $nick and you can edit the adding thing too.
menu nicklist {
Add user:{ write join.txt $1 | echo -a Added $1 to the list. }
}
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Nov 2003
Posts: 102
Vogon poet
|
OP
Vogon poet
Joined: Nov 2003
Posts: 102 |
wow man i was just messing with it and you even fixed my first problem...your code works with my PNP so i dont need to run it on my chat script anymore Very nice man . Greatly apprecate your services!
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
This one uses variables for nick storage and does the same thing instead of the text file: on *:JOIN:#: {
if ($nick != $me) && ($chan == #chat18+) {
if ($istok(%Users,$nick,44)) { describe # Hey $nick $+ , welcome back. :) }
else { describe # Hello $nick $+ , welcome to $chan $+ . May we have your age please? }
}
}
menu nicklist {
Add user: {
if ($1 isin %Users) { echo 4 -a * User $1 has already been added. }
else { set %Users $addtok(%Users,$1,44) | echo 2 -a * $1 added to the list. }
}
Delete user: {
if ($1 !isin %Users) { echo 4 -a * User $1 does not exist. }
else {
set %Users $remtok(%Users,$1,1,44) | echo 2 -a * User $1 has been removed from the list.
}
}
} Also a delete feature is added so you can remove nicknames stored that you don't want anymore.
Last edited by Tomao; 01/11/08 07:13 AM.
|
|
|
|
Joined: Dec 2007
Posts: 48
Ameglian cow
|
Ameglian cow
Joined: Dec 2007
Posts: 48 |
Wouldn't this be a perfect situation for user levels? o.O
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
One problem that I can foresee using variables for this, is if you are running the code on multiple channels and/or multiple networks, especially if there is a large number of users per channel and/or a network that allows very long nicks.
Eg: 5 networks @ 10 channels/network, 100 nicks/channel & 50 characters/nick. Some quick math gives me a total of 255,000 characters, which, if all stored in the one variable, would exceed (or at least push) the current limits for the number of characters allowed in a variable.
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
So what is your recommendation on such matter? Using a hash table perhaps?
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
While hash tables are one way of handling this, Kol's suggestion makes a lot of sense.
|
|
|
|
|