|
Joined: May 2005
Posts: 79
Babel fish
|
OP
Babel fish
Joined: May 2005
Posts: 79 |
this is part of what i have.. on *:text:*:#: {
if ($1 = $setting(quotes,prefix) $+ quote) {
if ($1 = $setting(quotes,prefix) $+ addquote) && ($setting(quotes,chatterquotes) = 1) { now when i do !quote nick it works but why won't !addquote nick work? thanks for any help.
|
|
|
|
Joined: Apr 2004
Posts: 759
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 759 |
its a case of bracket mismatching :tongue: [code] on *:text:*:#: { if ($1 = $setting(quotes,prefix) $+ quote) { ;here everything goes when $1 is !quote so the if statement below can never return $true since its placed ;somewhere that only gets triggered if $1 is !quote and therefor $1 can never be !addquote at the same time if ($1 = $setting(quotes,prefix) $+ addquote) && ($setting(quotes,chatterquotes) = 1) { [code] FIX: [code] on *:text:*:#: { if ($1 = $setting(quotes,prefix) $+ quote) { commands } if ($1 = $setting(quotes,prefix) $+ addquote) && ($setting(quotes,chatterquotes) = 1) { commands } } [code]
$maybe
|
|
|
|
Joined: May 2005
Posts: 79
Babel fish
|
OP
Babel fish
Joined: May 2005
Posts: 79 |
I thought it was something like that, but the second part is still not getting triggered, here's the full thing. on *:text:*:#: {
if ($1 = $setting(quotes,prefix) $+ quote) && ($setting(quotes,sendquotes) = 1) {
var %u = $2, %t = $ini(system/data/quotes.ini,%u,0)
if (%t != 0) {
var %n = $r(1,%t) | msg $chan Quote by: %u on $asctime($ini($quote_file,%u,%n),ddd doo mmm/yy @ h:nnt)) ( $+ $dur($calc($ctime - $ini($quote_file,%u,%n))) ago) $+ ; $readini($quote_file,%u,$ini($quote_file,%u,%n))
}
if ($1 = $setting(quotes,prefix) $+ addquote) && ($setting(quotes,chatterquotes) = 1) {
if ($4) { writeini system/data/quotes.ini $3 $ctime $4- | notice $nick Added $4 on $asctime(ddd doo mmm/yy @ h:nnt) for $+ $nick | _quote_refresh }
}
}
}
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
You still didn't move the IF statement like was shown... (the quote and addquote IF statements need to be at the same "tab" level... not having one inside the other): on *:text:*:#: {
if ($1 = $setting(quotes,prefix) $+ quote) && ($setting(quotes,sendquotes) = 1) {
var %u = $2, %t = $ini(system/data/quotes.ini,%u,0)
if (%t != 0) {
var %n = $r(1,%t) | msg $chan Quote by: %u on $asctime($ini($quote_file,%u,%n),ddd doo mmm/yy @ h:nnt)) ( $+ $dur($calc($ctime - $ini($quote_file,%u,%n))) ago) $+ ; $readini($quote_file,%u,$ini($quote_file,%u,%n))
}
}
elseif ($1 = $setting(quotes,prefix) $+ addquote) && ($setting(quotes,chatterquotes) = 1) {
if ($4) { writeini system/data/quotes.ini $3 $ctime $4- | notice $nick Added $4 on $asctime(ddd doo mmm/yy @ h:nnt) for $+ $nick | _quote_refresh }
}
} Note that I also changed it to elseif as that will speed up the code slightly.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: May 2005
Posts: 79
Babel fish
|
OP
Babel fish
Joined: May 2005
Posts: 79 |
Yeah my bad, thanks guys, i had to swap the $N identifiers about to after i changed it, working good now though
|
|
|
|
|