Skip to content

Commit

Permalink
1.4.91 by Charles Fettinger 2019-02-28
Browse files Browse the repository at this point in the history
    - Add shine $text effect
    - Convert <DURATION> to allow partial seconds i.e. 10.5 seconds
  • Loading branch information
Charles Fettinger committed Mar 1, 2019
1 parent bbc4dcd commit 4c4a613
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 23 deletions.
38 changes: 21 additions & 17 deletions CLP_StreamlabsSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
# Versions
#---------------------------------------
"""
1.4.91 by Charles Fettinger 2019-02-28
- Add shine $text effect
- Convert <DURATION> to allow partial seconds i.e. 10.5 seconds
1.4.9 by Charles Fettinger 2019-01-17
- Maintenance version combining view branch with main branch.
Expand Down Expand Up @@ -687,7 +691,7 @@ def NewParameters(parseString, userid, username, targetid, targetname, message):

"""Grabs a random gif from Giphy based on your search term
$giphy(search term, duration seconds)
$giphy(Epic+Fail, 15)
$giphy(Epic+Fail, 15.5)
NOTE:error messages are part of the flow, if no error occurs-return original parsestring
"""
if "$giphy(" in parseString:
Expand All @@ -702,7 +706,7 @@ def NewParameters(parseString, userid, username, targetid, targetname, message):
errorString = "[ERROR: Seems like you have a space in the () or forgot to set a time]"
if result:
fullGif = result.group(0)
gifDuration = int(result.group("duration"))
gifDuration = int(float(result.group("duration")) *1000)
GifSearch = result.group("search")
errorString = "[ERROR:No Results found for " + GifSearch + " in " + MySet.giphytype + "]"
"""check search term for results"""
Expand All @@ -717,7 +721,7 @@ def NewParameters(parseString, userid, username, targetid, targetname, message):
GiphyImageId = GetApiGiphyId(api,GifSearch)
GifLink = MySet.giphyimageurl.format(GiphyImageId)
"""broadcast image using existing gif code"""
f = {"duration": gifDuration*1000, "link": GifLink}
f = {"duration": gifDuration, "link": GifLink}
Parent.BroadcastWsEvent("EVENT_GIF", json.dumps(f, encoding='utf-8-sig'))
errorString = None

Expand All @@ -729,23 +733,23 @@ def NewParameters(parseString, userid, username, targetid, targetname, message):


"""Plays a youtube video
$movyt(videoid, start seconds, duration seconds)
$movyt(Vz7SS2qh-6k, 50, 15)
$movyt(videoid, start milliseconds, duration seconds)
$movyt(Vz7SS2qh-6k, 500, 15.2)
"""
if "$movyt(" in parseString:
#Parent.Log("movyt Result", parseString)
result = RegMovie.search(parseString)

if result:
fullMov = result.group(0)
movDuration = int(result.group("duration"))
movDuration = int(float(result.group("duration")) *1000)
movStart = int(result.group("start"))
movLink = result.group("link")

#Parent.Log("movyt Params", movLink + " start: " + str(movStart) + " end:" + str(movDuration + movStart))

"""broadcast movie url"""
f = {"link": movLink, "start": movStart, "duration": movDuration*1000}
f = {"link": movLink, "start": movStart, "duration": movDuration}
Parent.BroadcastWsEvent("EVENT_YUT", json.dumps(f, encoding='utf-8-sig'))

parseString = parseString.Replace(fullMov,"")
Expand All @@ -755,7 +759,7 @@ def NewParameters(parseString, userid, username, targetid, targetname, message):

"""Plays a Twitch Clip in html 5
$movtw(id, start seconds, duration seconds)
$movtw(BlushingVastFloofPeteZaroll,10,20)
$movtw(BlushingVastFloofPeteZaroll,10,20.5)
NOTE:error messages are part of the flow, if no error occurs-return original parsestring
"""
if "$movtw(" in parseString:
Expand All @@ -768,7 +772,7 @@ def NewParameters(parseString, userid, username, targetid, targetname, message):
errorString = "[ERROR: Seems like you have a space in the () or forgot to set a parameter]"
if result:
fullMov = result.group(0)
movDuration = int(result.group("duration"))
movDuration = int(float(result.group("duration")) *1000)
movStart = int(result.group("start"))
movLink = result.group("link")
header = {"Client-ID": MySet.twitchapikey}
Expand All @@ -785,7 +789,7 @@ def NewParameters(parseString, userid, username, targetid, targetname, message):
errorString = "[ERROR: Movie Clip Not Found]"
if(len(movLink) > 1):
#broadcast twitch clip url
f = {"link": movLink, "start": movStart, "duration": movDuration*1000, "type": movType, "uri": useURI}
f = {"link": movLink, "start": movStart, "duration": movDuration, "type": movType, "uri": useURI}
Parent.BroadcastWsEvent("EVENT_MOV", json.dumps(f, encoding='utf-8-sig'))
errorString = None

Expand All @@ -798,7 +802,7 @@ def NewParameters(parseString, userid, username, targetid, targetname, message):

"""Plays a video in html 5
$movie(url, start seconds, duration seconds)
$movie(https://i.giphy.com/media/l0Iy7oLKbCIrcOS1q/200.mp4, 5, 15)
$movie(https://i.giphy.com/media/l0Iy7oLKbCIrcOS1q/200.mp4, 5, 15.5)
"""
if "$movie(" in parseString:
#Parent.Log("movie Result", parseString)
Expand All @@ -807,7 +811,7 @@ def NewParameters(parseString, userid, username, targetid, targetname, message):

if result:
fullMov = result.group(0)
movDuration = int(result.group("duration"))
movDuration = int(float(result.group("duration")) *1000)
movStart = int(result.group("start"))
movLink = result.group("link")
pathResult = RegPath.search(movLink)
Expand All @@ -823,7 +827,7 @@ def NewParameters(parseString, userid, username, targetid, targetname, message):
#Parent.Log("movie Params", movLink + " start: " + str(movStart) + " end:" + str(movDuration + movStart))

#broadcast movie url
f = {"link": movLink, "start": movStart, "duration": movDuration*1000, "type": movType, "uri": useURI}
f = {"link": movLink, "start": movStart, "duration": movDuration, "type": movType, "uri": useURI}
Parent.BroadcastWsEvent("EVENT_MOV", json.dumps(f, encoding='utf-8-sig'))

parseString = parseString.Replace(fullMov,"")
Expand Down Expand Up @@ -1004,8 +1008,8 @@ def NewParameters(parseString, userid, username, targetid, targetname, message):
if pathResult:
GifLink = GetDataURI(GifLink,"image")

gifDuration = int(result.group("duration"))
f = {"duration": gifDuration*1000, "link": GifLink}
gifDuration = int(float(result.group("duration")) *1000)
f = {"duration": gifDuration, "link": GifLink}
Parent.BroadcastWsEvent("EVENT_GIF", json.dumps(f, encoding='utf-8-sig'))

parseString = parseString.replace(fullGif, "")
Expand All @@ -1019,12 +1023,12 @@ def NewParameters(parseString, userid, username, targetid, targetname, message):
fullText = result.group(0)
textMessage = result.group("message").replace("+", " ")
textStyle = result.group("style").replace("+", " ")
textDuration = int(result.group("duration"))
textDuration = int(float(result.group("duration")) *1000)

#Parent.Log("text Params", textMessage + " style: " + textStyle + " duration:" + str(textDuration))

# broadcast messge
f = {"duration": textDuration*1000, "message": textMessage, "style": textStyle}
f = {"duration": textDuration, "message": textMessage, "style": textStyle}
Parent.BroadcastWsEvent("EVENT_TEXT", json.dumps(f, encoding='utf-8-sig'))

parseString = parseString.replace(fullText, "")
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# Castorr's Lazy Pack

**Latest Version:** 1.4.9
**Latest Version:** 1.4.91

**Download:** [CastorrsLazyPack1.4.9.zip](https://github.com/Oncorporation/CastorLazyPack/releases/download/CastorLazyPack1.4.9/CastorLazyPack1.4.9.zip)
**Download:** [CastorrsLazyPack1.4.91.zip](https://github.com/Oncorporation/CastorLazyPack/releases/download/CastorLazyPack1.4.91/CastorLazyPack1.4.91.zip)

**Updated:** Charles Fettinger 2019-01-17
**Updated:** Charles Fettinger 2019-02-28

## Synopsis
This script is a plugin for the Streamlabs Chatbot.
Extra $parameters and !sr info when missing id/url

## Update History
1.4.91 by Charles Fettinger 2019-02-28
- Add shine $text effect
- Convert <DURATION> to allow partial seconds i.e. 10.5 seconds

1.4.9 by Charles Fettinger 2019-01-17
- Maintenance version combining view branch with main branch.

Expand Down Expand Up @@ -190,7 +194,7 @@ Completely new parameters, most of them are doable through api calls.
$torand - Returns target and random user if no target is present
$sound(FILE.FORMAT) - Plays the sound, file must be name.fileformat and be placed in the sounds folder.
$sync(<MESSAGE>,<COUNTDOWN>,<YOUTUBE VIDEO ID>,<START TIME>) - counts down to sync players in various games, set the message, optionally set a youtube video to play during the count down (if not used leave empty) and set start time of video
$text(<MESSAGE>,<STYLE>,<DURATION>) - displays <MESSAGE> (use + for spaces) in index.html for <DURATION> seconds with <STYLE> effect applied (fire,glitch,blue,matrix,normal,sunny,sparks,spin included as examples)
$text(<MESSAGE>,<STYLE>,<DURATION>) - displays <MESSAGE> (use + for spaces) in index.html for <DURATION> seconds with <STYLE> effect applied (fire,glitch,blue,matrix,normal,sunny,sparks,spin,shine included as examples)
$gif(<LINK>,<DURATION>) - Shows the gif linked in the index.html for <DURATION> seconds, link can also be the full filepath including fileformat (c:/users/castorr/desktop/test.gif)
$giphy(<SEARCH TERM>,<DURATION>) - find gifs or stickers from Giphy based on <SEARCH TERM> and plays in the index.html for <DURATION>
$movie(<LINK>,<START TIME>,<DURATION>) - Shows the movie linked in the index.html starting at <START TIME> for <DURATION> seconds, link can also be the full filepath including fileformat (c:/users/castorr/desktop/movie.mp4)
Expand Down
6 changes: 5 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Contribution by: Surn @ https://www.twitch.tv/Surn
#############################
# Versions #
#############################
1.4.91 by Charles Fettinger 2019-02-28
- Add shine $text effect
- Convert <DURATION> to allow partial seconds i.e. 10.5 seconds

1.4.9 by Charles Fettinger 2019-01-17
- Maintenance version combining view branch with main branch.

Expand Down Expand Up @@ -189,7 +193,7 @@ $sessionfollows - Show amount of follows for current session
$lastfollow - Returns name of last follower
$torand - Returns target and random user if no target is present
$sound(FILE.FORMAT) - Plays the sound, file must be name.fileformat and be placed in the sounds folder. Example: $sound(Test.mp3)
$text(<MESSAGE>,<STYLE>,<DURATION>) - displays <MESSAGE> (use + for spaces) in index.html for <DURATION> seconds with <STYLE> effect applied (fire,glitch,blue,matrix,normal,sunny,sparks,spin included)
$text(<MESSAGE>,<STYLE>,<DURATION>) - displays <MESSAGE> (use + for spaces) in index.html for <DURATION> seconds with <STYLE> effect applied (fire,glitch,blue,matrix,normal,sunny,sparks,spin,shine included)
$gif(<LINK>,<DURATION>) - Shows the gif linked in the index.html for <DURATION> seconds, link can also be the full filepath including fileformat (c:/users/castorr/desktop/test.gif)
$giphy(<SEARCH TERM>,<DURATION>) - find gifs or stickers from Giphy based on <SEARCH TERM> and plays in the index.html for <DURATION>
$movie(<LINK>,<START TIME>,<DURATION>) - Shows the movie linked in the index.html starting at <START TIME> for <DURATION> seconds, link can also be the full filepath including fileformat (c:/users/castorr/desktop/movie.mp4)
Expand Down
83 changes: 82 additions & 1 deletion text.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,49 @@
-webkit-text-fill-color: transparent;
text-align: center;
}
.shine {
font-size: 11vmin;
color: #000000;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
background-color: transparent;
background-image: linear-gradient(-45deg, #EE7752, #E73C7E, #23A6D5, #23D5AB);
display: flex;
justify-content: center;
align-items: center;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-align: center;
background-size: 400% 400%;
-webkit-animation: Gradient 15s ease infinite;
-moz-animation: Gradient 15s ease infinite;
animation: Gradient 15s ease infinite;
overflow: hidden;
}
.shine:before {
width: 100%;
height: 100%;
content: "";
background-image: -webkit-linear-gradient(top left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 45%, rgba(255, 255, 255, 0.5) 48%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0.5) 52%, rgba(255, 255, 255, 0) 57%, rgba(255, 255, 255, 0) 100%);
-webkit-animation-name: ShineAnimation;
-webkit-animation-duration: 5s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: cubic-bezier(0.12, 0.89, 0.98, 0.47);
-moz-animation-name: ShineAnimation;
-moz-animation-duration: 5s;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: cubic-bezier(0.12, 0.89, 0.98, 0.47);
-ms-animation-name: ShineAnimation;
-ms-animation-duration: 5s;
-ms-animation-iteration-count: infinite;
-ms-animation-timing-function: cubic-bezier(0.12, 0.89, 0.98, 0.47);
display: block;
position: absolute;
top: 0;
left: -100%;
z-index: 2;
-webkit-transform: skew(-20deg);
transform: skew(-20deg);
}
.sparks {
font-size: 11vmin;
color: #000000;
Expand Down Expand Up @@ -72,7 +115,6 @@
-ms-animation-iteration-count: infinite;
-ms-animation-timing-function: ease;
-o-transition: rotate(3600deg);

}
.matrix {
font-size: 11vmin;
Expand Down Expand Up @@ -209,4 +251,43 @@
@keyframes spin {
from {transform:rotate(0deg);}
to {transform:rotate(360deg);}
}

@-moz-keyframes ShineAnimation {
from {left: -100%;}

to {left: 100%;}
}
@-webkit-keyframes ShineAnimation {
from {left: -100%;}

to {left: 100%;}
}
@keyframes ShineAnimation {
from {left: -100%;}

to {left: 100%;}
}
@-webkit-keyframes Gradient {
0% {background-position: 0% 50%}

50% {background-position: 100% 50%}

100% {background-position: 0% 50%}
}

@-moz-keyframes Gradient {
0% {background-position: 0% 50%}

50% {background-position: 100% 50%}

100% {background-position: 0% 50%}
}

@keyframes Gradient {
0% {background-position: 0% 50%}

50% {background-position: 100% 50%}

100% {background-position: 0% 50%}
}

0 comments on commit 4c4a613

Please sign in to comment.