mIRC Home    About    Download    Register    News    Help

Print Thread
L
LexMortis
LexMortis
L
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 )

R
r0ck0
r0ck0
R
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,015
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,015
Better to use on OPEN.

L
LexMortis
LexMortis
L
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?

L
LexMortis
LexMortis
L
btw, I've also tried this:

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

the $+ didnt help frown

N
n3wb13
n3wb13
N
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

N
n3wb13
n3wb13
N
Post deleted by n3wb13

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

P
pheonix
pheonix
P
on *:TEXT:*:?:{
if ($away) && ($+(*,$chr(63)) iswm $1-) { ...... }
}
or
on *:TEXT:$($+(*,$chr(63)),1):?:{ ...... }

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

P
pheonix
pheonix
P
i noticed frown, seems regex is the only way;\

L
LexMortis
LexMortis
L
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: 149
J
Vogon poet
Offline
Vogon poet
J
Joined: Jan 2003
Posts: 149
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.
Joined: Dec 2002
Posts: 3,015
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,015
*? iswm for everything more than one character long.

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

A
Agent_Mike
Agent_Mike
A
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

P
pheonix
pheonix
P
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:

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