Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Whisper scripts:
- Scripts require secondary connection to one of Twitch group chat servers - note that this connection can't be used for normal chat.
- "whisper" alias to handle sending whispers:
- ----------------START--------------------------------
- if ($context.networkName=="Twitch")
- {
- %curwind = $window
- if (%TwitchWhispers == 0)
- {
- foreach (%ic,$context.list)
- if ($context.networkName(%ic) == "TwitchWhispers")
- %TwitchWhispers = $console(%ic)
- }
- %w = $window($0,%TwitchContext)
- if (%w == 0)
- {
- %w = $window.open("i",$0,%TwitchContext,46)
- echo -w=%w Chat with $0
- echo -w=%w Common channels: %common_ch
- }
- echoprivmsg -w=%w $me "" "" $1-
- rebind %TwitchWhispers
- raw PRIVMSG #jtv :/w $0 $1-
- rebind %curwind
- }
- ----------------END---------------------------------
- OnTextInput event handler to enable normal chatting in whisper window:
- ----------------START--------------------------------
- if ($context.networkName == "Twitch")
- {
- if ($window.type == "userwindow")
- {
- echoprivmsg $me * * $0
- %curwind = $window
- %rcpt = $window.caption
- if (%TwitchWhispers == 0)
- {
- foreach (%ic,$context.list)
- if ($context.networkName(%ic) == "TwitchWhispers")
- %TwitchWhispers = $console(%ic)
- }
- rebind %TwitchWhispers
- raw PRIVMSG #jtv :/w %rcpt $0
- rebind %curwind
- }
- }
- ----------------END---------------------------------
- OnUnhandledLiteral handler - parses incoming whispers, creates new window for each user
- ----------------START--------------------------------
- if ( $context.networkname == "TwitchWhispers" )
- {
- if ( $1 == "WHISPER")
- {
- %snd_ident[] = $str.split(!,$0)[0]
- %rcv_name = $2
- %msg_text = $3
- if (%TwitchContext == 0)
- {
- foreach (%ic,$context.list)
- if ($context.networkName(%ic) == "Twitch")
- %TwitchContext = %ic
- }
- %common_ch = $chan.common(%snd_ident,%TwitchContext)
- %w = $window(%snd_ident,%TwitchContext)
- if (%w == 0)
- {
- %w = $window.open("i",%snd_ident,%TwitchContext,46)
- echo -w=%w Chat with %snd_ident
- echo -w=%w Common channels: %common_ch
- }
- echoprivmsg -w=%w %snd_ident "" "" %msg_text
- halt
- }
- }
- ----------------END---------------------------------
Advertisement
Add Comment
Please, Sign In to add comment