I have 2 set of codes to make this work. One in alias and one in remote. Is it possible to replace both with one in remote?
alias: randomnick {
if ( $me isop #manila ) { set %op.random.channel.nick $rand($nick(#manila,0),1) | whois $nick(#manila,%op.random.channel.nick) }
}
remote: on *:{
if ( %op.random == off ) || ( %op.random == $null ) { return }}
You can put this on your remote
alias randomnick {
if ( !%op.random ) && ( $me isop #manila ) { whois $nick($v2,$rand(1,$nick($v2,0))) }
}
If this is not what you're looking for, please clarify.
Will this do a whois on the random nick every 60sec ?
Something like this maybe?
alias randomnick {
if ( %op.random == off ) || ( %op.random == $null ) || ($nick isop #) { return }
{ set %op.random On | timerrnick 0 60 randomnick }
if ( !%op.random ) && ( $me isop #manila ) { whois $nick($v2,$rand(1,$nick($v2,0))) }
}
No, but you will need to use a /timer
/timerrandomwhois 0 60 randomnick
Yes, can it be added in the same code?
You can have an alias in your remotes by using the "alias" word, but you can't have either a remote or an alias functioning as both an alias and a remote - they have to be 1 remote and 1 alias. You can't call a remote (it triggers based on an event) and you can't have an event trigger an alias (without a remote calling the alias when it [the remote] triggers).
So "can it all be in one file"? Yes. "Can it all be one function"? No.
(I guess the answer depends on which question you're asking.)
I see ok Yes all in one file please is just fine for me.
I put this in the alias right?
I get this error
* Error: /RANDOMNICK is an unknown command.
It working now, those this seem ok to you?
alias randomnick {
if ( %op.random == off ) || ( %op.random == $null ) || ($nick isop #) { return }
if ( !$timer(randomwhois) ) { timerrandomwhois 0 60 randomnick }
if ( $me isop #manila ) { whois $nick($v2,$rand(1,$nick($v2,0))) }
}
}
You can remove the "|| ($nick isop #)", not needed there.