|
|
Joined: Jul 2005
Posts: 13
Pikka bird
|
OP
Pikka bird
Joined: Jul 2005
Posts: 13 |
I want when some one wirte "!ASK" the bot will read from answers.txt. And I want him to ignore for 5 sec that's my code
on *:text:*:#wasted_generation:{
if ( $1 == *!ask *) && ( %d != null ) { return } {
.msg # $read(answers.txt)
.set %d -u5 on
}
}
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
This will only trigger if they say "!ask" noting else, you'll need to add wildcards if you want to match more. on *:text:!ask:#wasted_generation:{
if !%d {
.msg # $read(answers.txt,tn)
inc -u5 %d
}
}
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
on *:text:*:#wasted_generation: {
if ($1 == !ask) && (%d == $null) {
.msg # $read(answers.txt,tn)
.set %d -u5 on
}
}
I assume there's a reason you have the trigger within the event as an IF statement. If there isn't a reason for having it there, you can just use:
on *:text:!ask *:#wasted_generation: {
if (%d == $null) {
.msg # $read(answers.txt,tn)
.set %d -u5 on
}
}
Note also that you may want to consider another check on the trigger...
on *:text:*:#wasted_generation: {
if ($1 == !ask) && (%d == $null) {
if ($2 == $null) {
.msg $chan Please ask a question.
}
else {
.msg # $read(answers.txt,tn)
.set %d -u5 on
}
}
}
You can make this a notice if you prefer and have it message the $nick or the $chan... whatever you prefer. You could also use a halt command instead of using the else statement, but I prefer else for trying to find problems later. Just my preference.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
The correct way would be:
set -u5 %d on
1. The -u5 comes before the %d. 2. Set only outputs information when using the -s switch, by default it is silent, so prefixing it with a dot won't do anything.
Gone.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Thanks. Was copying his code and fixing things... I missed that one. That'll teach me to not copy someone else's code and fix it, but to just write it over.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
just mucking around here, what about
on *:text:$(%d,!ask):#wasted_generation:{
.msg # $read(answers.txt,tn)
set -u5 %d $crlf
}
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
It wouldn't work in that state, only if you changed it to something like: $(%d $+ !ask) but I assume you typoed.
It might be a bit too hard for the requester to understand... but it's a nice approach.
Gone.
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
lol, and i came back and edited out a extra } as well, and still missed that, well at least ya knew what i was meaning, Dont know if it would speed things up much really, and does make it harder to follow
|
|
|
|
|
|