mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2014
Posts: 107
M
Majeye Offline OP
Vogon poet
OP Offline
Vogon poet
M
Joined: Jan 2014
Posts: 107
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 $+ 
}

Joined: Jan 2014
Posts: 107
M
Majeye Offline OP
Vogon poet
OP Offline
Vogon poet
M
Joined: Jan 2014
Posts: 107
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 $+ 
}

Last edited by Majeye; 21/07/15 02:48 AM.
B
bl968
bl968
B
Eval on unparsed and unfiltered user input is dangerous.


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

Joined: Dec 2013
Posts: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
Your code will never trigger, it triggers only on the text "!caster", you need to include a & in the trigger context.

Joined: Jan 2014
Posts: 107
M
Majeye Offline OP
Vogon poet
OP Offline
Vogon poet
M
Joined: Jan 2014
Posts: 107
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.

Joined: Dec 2013
Posts: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
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.

B
bl968
bl968
B
Err I forgot one thing...

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

There happy?

Joined: Jan 2014
Posts: 107
M
Majeye Offline OP
Vogon poet
OP Offline
Vogon poet
M
Joined: Jan 2014
Posts: 107
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?

Joined: Dec 2013
Posts: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
/help $eval ; in the mIRC client.
http://en.wikichip.org/wiki/mirc/msl_injection

S
snoop_in_dm
snoop_in_dm
S
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)."


Link Copied to Clipboard