mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2014
Posts: 21
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Nov 2014
Posts: 21
alias catbotv2 return #oldschoolnat,#thecatbot,#anm60forjesus,#berwickpkr
on *:join:$($catbotv2): {
timerCat 0 600 catmessage $chan
}
alias catmessage {
var %rand = $rand(1,16)
if (%rand == 1) { msg $1 Meow }
elseif (%rand == 2) { msg $1 Purr! }
elseif (%rand == 3) { msg $1 *Licks myself clean* }
elseif (%rand == 4) { msg $1 *Sniffs around* }
elseif (%rand == 5) { msg $1 *Yawns* }
elseif (%rand == 6) { msg $1 *Curls up into a ball and falls asleep* }
elseif (%rand == 7) { msg $1 *Rolls over onto my back* }
elseif (%rand == 8) { msg $1 *Hisses* }
elseif (%rand == 9) { msg $1 *Chases after a ball I have found* }
elseif (%rand == 10) { msg $1 *Sits down on a random user's knees* }
elseif (%rand == 11) { msg $1 *Smiles* }
elseif (%rand == 12) { msg $1 *Stretches* }
elseif (%rand == 13) { msg $1 *Licks a random user's hand clean* }
elseif (%rand == 14) { msg $1 *Pees on the ground* }
elseif (%rand == 15) { msg $1 *Poos on the ground* }
elseif (%rand == 16) { msg $1 *Pukes everywhere* }
}

At the moment, it only works in Berwickpkr's channel

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Instead of using the channel like that on the join event, use $istok() instead.

/help $istok

Also, your timer is called TimerCat which means it will re-enable itself for the last channel it joins. You need to name it TimerCat. $+ $chan
for it to work on multiple channels


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Nov 2014
Posts: 21
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Nov 2014
Posts: 21
What do you mean by $istok?

on *:join:#oldschoolnat,#thecatbot,#anm60forjesus,#berwickpkr: {
timerCat. $chan 0 600 catmessage $chan
}
alias catmessage {
var %rand = $rand(1,16)
if (%rand == 1) { msg $1 Meow }
elseif (%rand == 2) { msg $1 Purr! }
elseif (%rand == 3) { msg $1 *Licks myself clean* }
elseif (%rand == 4) { msg $1 *Sniffs around* }
elseif (%rand == 5) { msg $1 *Yawns* }
elseif (%rand == 6) { msg $1 *Curls up into a ball and falls asleep* }
elseif (%rand == 7) { msg $1 *Rolls over onto my back* }
elseif (%rand == 8) { msg $1 *Hisses* }
elseif (%rand == 9) { msg $1 *Chases after a ball I have found* }
elseif (%rand == 10) { msg $1 *Sits down on a random user's knees* }
elseif (%rand == 11) { msg $1 *Smiles* }
elseif (%rand == 12) { msg $1 *Stretches* }
elseif (%rand == 13) { msg $1 *Licks a random user's hand clean* }
elseif (%rand == 14) { msg $1 *Pees on the ground* }
elseif (%rand == 15) { msg $1 *Poos on the ground* }
elseif (%rand == 16) { msg $1 *Pukes everywhere* }
}

Also the script does not work now

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Well, you should be having errors saying #channelname UNKNOWN COMMAND now since you didn't append it to the actual timer name using $+

Hell $+ o will translate to Hello
Same with timer. TimerCat. $+ $chan will turn into TimerCat.#channel

By istok I meant like this.

Code:
on:join:#: { 
if ($istok($catbotv2,#,44)) { timerCat. $+ # 0 600 catmessage $chan }
}


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Jul 2006
Posts: 4,153
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,153
He doesn't need $istok, having the list of channel hardcoded works as well as using $() with an alias returning the hardcoded list.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2014
Posts: 107
M
Vogon poet
Offline
Vogon poet
M
Joined: Jan 2014
Posts: 107
Nillen is showing 'best practices'. Does he *need* it? probably not... is it better than hard-coding? YES.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
He's not hardcoding it. He has an alias that returns the channels in correct syntax for the on text command.

My suggestion was based on my lack of knowledge in that actually working.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Link Copied to Clipboard