mIRC Homepage
Posted By: Majeye [Twitch] Caster command help - 21/07/15 02:26 AM
So, really noobish question, but I can't seem to fully understand what it is I'm missing from the following code to output a link to the streamers name after the command !caster <name> is put into the chat, any help would be appreciated.

Code:
on $*:text:/!caster /Si:#majeye:{
  msg $chan GO FOLLOW THIS STREAMER twitch.tv/$2 $+ 
}
Posted By: Majeye Re: [Twitch] Caster command help - 21/07/15 02:47 AM
Nevermind, my fiance and I figured it out!

Code:
on $*:text:/!caster /Si:#:{
  var %caster = $eval($+(www.twitch.tv/,$2))
  msg $chan GO FOLLOW THIS STREAMER %caster $+ 
}
Posted By: bl968 Re: [Twitch] Caster command help - 21/07/15 06:35 AM
Eval on unparsed and unfiltered user input is dangerous.


on *:text:!caster:#majeye:{
msg $chan GO FOLLOW THIS STREAMER twitch.tv/ $+ $$2
}
Posted By: Nillen Re: [Twitch] Caster command help - 21/07/15 08:41 AM
Your code will never trigger, it triggers only on the text "!caster", you need to include a & in the trigger context.
Posted By: Majeye Re: [Twitch] Caster command help - 21/07/15 01:03 PM
Originally Posted By: Nillen
Your code will never trigger, it triggers only on the text "!caster", you need to include a & in the trigger context.


I don't know.. it works for me.
Posted By: Nillen Re: [Twitch] Caster command help - 21/07/15 04:55 PM
Your code will work since you're using a regex match. I was replying to bl968.

Granted that your code may cause people taking control over your pc however, but that's just a "minor" side effect from not knowing what you're doing I guess.
Posted By: bl968 Re: [Twitch] Caster command help - 21/07/15 10:49 PM
Err I forgot one thing...

on *:text:!caster *:#majeye:{
msg $chan GO FOLLOW THIS STREAMER twitch.tv/ $+ $$2
}

There happy?
Posted By: Majeye Re: [Twitch] Caster command help - 22/07/15 07:01 AM
Originally Posted By: Nillen
Your code will work since you're using a regex match. I was replying to bl968.

Granted that your code may cause people taking control over your pc however, but that's just a "minor" side effect from not knowing what you're doing I guess.


Do you have a link where I can read up on eval?
Posted By: Nillen Re: [Twitch] Caster command help - 22/07/15 10:20 AM
/help $eval ; in the mIRC client.
http://en.wikichip.org/wiki/mirc/msl_injection
Posted By: snoop_in_dm Re: [Twitch] Caster command help - 26/07/15 04:21 PM
Is there another thread in the forum or what would be the best scripting to add to this command to include what the caster is playing(last played) on their channel? The output would be like, "Give a follow to (caster) and was last playing (game title here)."
© mIRC Discussion Forums