mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2003
Posts: 26
L
Ameglian cow
OP Offline
Ameglian cow
L
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
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Jun 2003
Posts: 242
Code:
on *:OPEN:?:*: {
  if ($away) msg $nick Sorry $nick I've been away for $+(,$duration($awaytime),) with the reason $+(,$awaymsg),)
}


Edit: Collective true .. thx smile

Last edited by r0ck0; 19/09/03 04:09 PM.
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Better to use on OPEN.

Joined: Sep 2003
Posts: 26
L
Ameglian cow
OP Offline
Ameglian cow
L
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 frown

Joined: May 2003
Posts: 161
A
Vogon poet
Offline
Vogon poet
A
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
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Sep 2003
Posts: 26
btw, I've also tried this:

on *:TEXT:* $+ ?:?:{

the $+ didnt help frown

Joined: Sep 2003
Posts: 6
N
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
N
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
N
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
N
Joined: Sep 2003
Posts: 6
Post deleted by n3wb13

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
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.

Code:
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 confused

Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
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
C
Hoopy frood
Offline
Hoopy frood
C
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
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
i noticed frown, seems regex is the only way;\


new username: tidy_trax
Joined: Sep 2003
Posts: 26
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Sep 2003
Posts: 26
Read this: http://www.gamespy.com/fargo/august03/autorpg/index.shtml

I want to make that bot as the awaychatbot grin

Joined: Jan 2003
Posts: 150
J
Vogon poet
Offline
Vogon poet
J
Joined: Jan 2003
Posts: 150
what about this?

Code:
 
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
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
*? iswm for everything more than one character long.

Joined: Jan 2003
Posts: 150
J
Vogon poet
Offline
Vogon poet
J
Joined: Jan 2003
Posts: 150
wouuups grin


Go ahead, jump. 100,000 lemmings can't be wrong.
Joined: Sep 2003
Posts: 17
A
Pikka bird
Offline
Pikka bird
A
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.

Quote:
[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:
Code:
 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 smile

Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
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 crazy :tongue:


new username: tidy_trax
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
<Insert pheonix's post here>

Also, I've just noticed that I missed the obvious $right solution..

Code:
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? }
  }
}


Link Copied to Clipboard