mIRC Home    About    Download    Register    News    Help

Print Thread
#245895 12/05/14 11:35 PM
Joined: Apr 2014
Posts: 19
R
Pikka bird
OP Offline
Pikka bird
R
Joined: Apr 2014
Posts: 19
I found a script so that people can join a queue for viewer games but I'm trying to set it so a user can enter their in-game username after "!joinqueue" so that it will display that instead of their Twitch username. What I'm trying to do it have the command be: !joinqueue <their in-game username>



This is what I have so far:

on *:text:!joinqueue *:#: {
if ($read(list.txt,nw,$3)) { msg $chan You're already in the queue. | return }
else write list.txt $$3
msg $chan $$3 has been added to the queue!
}

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Code:
on *:text:!joinqueue *:#: { 
if ($read(list.txt,nw,$2)) { msg $chan You're already in the queue. | return }
else write list.txt $2 
msg $chan $2 has been added to the queue!
}
You just change $3 to $2. $3 meaning the third word a user puts. So for instance:
$1 !joinqueue $2 userid $3 blank


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2014
Posts: 170
Vogon poet
Offline
Vogon poet
Joined: Apr 2014
Posts: 170
I have something similar to this, but for some reason it won't read anything after a space... For instance

USER: !joinqueue Gamer Tag
BOT: Gamer has been added to the queue!

Any fix around this? right now I just try to have people add underscores for spaces.. but I'd like to not have to explain why every time lol

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Your script is set to
Code:
msg # $2 has been added to the queue!
So you need to add $2- or $2 $3.
$2- means the 2nd word and everything after. $2 $3 means the 2nd word and the 3rd word. It's a simple principle.

Examples:
Quote:
msg # $2 has been added to the queue!
USER: !joinqueue Gamer Tag Example
BOT: Gamer has been added to the queue!

msg # $2 $3 has been added to the queue!
USER: !joinqueue Gamer Tag Example
BOT: Gamer Tag has been added to the queue!

msg # $2- has been added to the queue!
USER: !joinqueue Gamer Tag Example
BOT: Gamer Tag Example has been added to the queue!


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2014
Posts: 170
Vogon poet
Offline
Vogon poet
Joined: Apr 2014
Posts: 170
Thanks Nillen smile

Just saw that you responded to this. Helped me out a lot. No hassle now!!!


Link Copied to Clipboard