Random placement in screen overlay

I’ve been trying to recreate the random emote overlay like !showemote and after realizing that no has made it open source I am trying it myself. I’m only using the kappa emote right now as testing and I have the parameters of the pixels that the emote should show up in. Although I can’t find out how to implement the random command into the pixel placement. This is my code so far:

$(“.screen_div”).html(“

”);

When this runs it produces the emote along the left edge and a little below the top. However it is not random and will be placed there, or off screen, for all tests. If you know how to properly use the random command to create the expected output, please let me know. As well is there a list or array of global twitch emote ID’s such as the kappa one above? That would be very useful and would avoid a lot of manual coding.

I see that the command line ran the code and now there is a big emote. Here is the code with the emote removed:

$overlay_screen(“.screen_div”).html(“png of emote’ style=‘position: absolute; left: $random(5,95)%; transform: translateX(-50%); bottom: $random(100,450)px; width: 200px;’ />”);

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.