|
Joined: Sep 2003
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2003
Posts: 26 |
hello guys..
I've stumbled upon a problem. I'm trying to write a script that will reply (kinda like a very simple chatbot) to private messages when im away. I've tried zillion ways.. but the st00pid thing wont reply to the messages...
( I know you cant trigger it yourself, thats not the problem :P )
|
|
|
|
Joined: Jun 2003
Posts: 242
Fjord artisan
|
Fjord artisan
Joined: Jun 2003
Posts: 242 |
on *:OPEN:?:*: {
if ($away) msg $nick Sorry $nick I've been away for $+(,$duration($awaytime),) with the reason $+(,$awaymsg),)
}
Edit: Collective true .. thx
Last edited by r0ck0; 19/09/03 04:09 PM.
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
|
|
|
|
Joined: Sep 2003
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2003
Posts: 26 |
But open only gets triggered once.. I want that the awayscript will say more than 1 line. I just want a really simple chatbot to reply when im away. --- on *:TEXT:$me:?:{ if ($away) { /msg $nick Hello } } on *:TEXT:*?:?:{ if ($away) { /msg $nick say what? } } on *:TEXT:*!?:?:{ if ($away) { /msg $nick please dont shout } } etc... --- something like that... but that doesnt work
|
|
|
|
Joined: May 2003
Posts: 161
Vogon poet
|
Vogon poet
Joined: May 2003
Posts: 161 |
Why would you want to give people the impression that you're there when you're away?
|
|
|
|
Joined: Sep 2003
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2003
Posts: 26 |
btw, I've also tried this: on *:TEXT:* $+ ?:?:{ the $+ didnt help
|
|
|
|
Joined: Sep 2003
Posts: 6
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Sep 2003
Posts: 6 |
of course it didn't work!
*? represents any string longer than one character so, when they say your name, mIRC would not know, if *? or $me should trigger
|
|
|
|
Joined: Sep 2003
Posts: 6
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Sep 2003
Posts: 6 |
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
That's not accurate, mIRC always triggers the first matching event in each file. Also note that on TEXT is bound to get you flooded off by a lamer or two. on *:TEXT:$($me):?:{
if ( $away ) { msg $nick Hello }
}
on $*:TEXT:/!\?$/:?:{
if ( $away ) { msg $nick please dont shout }
}
on $*:TEXT:/\?$/:?:{
if ( $away ) { msg $nick say what? }
} ^Using regex because I couldn't figure out how to match ? without it
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
on *:TEXT:*:?:{ if ($away) && ($+(*,$chr(63)) iswm $1-) { ...... } } or on *:TEXT:$($+(*,$chr(63)),1):?:{ ...... }
new username: tidy_trax
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
Both of those always trigger for me, no matter what I get sent in a PM.
[18:23:55] <a7tcv62r> a [18:23:55] ..... is an unknown command [18:24:05] <a7tcv62r> a [18:24:05] .... is an unknown command
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
i noticed , seems regex is the only way;\
new username: tidy_trax
|
|
|
|
Joined: Sep 2003
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2003
Posts: 26 |
|
|
|
|
Joined: Jan 2003
Posts: 150
Vogon poet
|
Vogon poet
Joined: Jan 2003
Posts: 150 |
what about this?
on *:TEXT:*:?:{
if ($away) {
if ($1 == $me) { msg $nick Hello }
elseif (*! iswm $1-) { msg $nick please dont shout }
elseif (? isin $($ $+ $0,2)) { msg $nick say what? }
}
}
that's what i figured out....
Last edited by J0ke; 19/09/03 08:20 PM.
Go ahead, jump. 100,000 lemmings can't be wrong.
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
*? iswm for everything more than one character long.
|
|
|
|
Joined: Jan 2003
Posts: 150
Vogon poet
|
Vogon poet
Joined: Jan 2003
Posts: 150 |
wouuups
Go ahead, jump. 100,000 lemmings can't be wrong.
|
|
|
|
Joined: Sep 2003
Posts: 17
Pikka bird
|
Pikka bird
Joined: Sep 2003
Posts: 17 |
what pheonix suggested with the $chr is true, just taht you should replace the .... with the actual commands, so this won't happen. [18:23:55] <a7tcv62r> a [18:23:55] ..... is an unknown command [18:24:05] <a7tcv62r> a [18:24:05] .... is an unknown command another idea to how this can be done: on *:TEXT:*:?: {
if ($chr(63) isin $1-) { msg $nick say what?! }
elseif ($chr(33) isin $1-) { msg $nick don't yell at me! }
else { msg $nick hello }
} this will trigger on any message sent, and then check if ? is in the text, if not it'll check if the ! is in the text, and if none of them are, it'll just say hello. have fun with this
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
no, what i said was wrong because it shouldnt matter that '.....' is an unknown command, because it shouldnt of been executed in the 1st place :tongue:
new username: tidy_trax
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
<Insert pheonix's post here> Also, I've just noticed that I missed the obvious $right solution.. on *:TEXT:*:?:{
if ($away) {
if ($1 == $me) { msg $nick Hello }
elseif (*! iswm $1-) { msg $nick please dont shout }
elseif ( $right($1-,1) == ? ) { msg $nick say what? }
}
}
|
|
|
|
|