StreamElements / widgets

279 stars 118 forks source link

Every Follow = $0.10 to Charity Widget Counter #47

Open AlphaxNu opened 9 months ago

AlphaxNu commented 9 months ago

Looking to make a widget to do just that, Every Follow = $0.10 to Charity Widget Counter. Is that even possible?

Example: Daily Widget: 15 Follows = $1.50 Total Monthly: 200 Follows = $20.00

c4ldas commented 9 months ago

Yeah, that is possible. Do you want that to persist over streams or reset every stream? You need to listen to onEventReceived and check if obj.detail.listener is follower-latest. If, so add $0.10 to the counter.

https://dev.streamelements.com/docs/widgets/6707a030af0b9-custom-widget-events

The downside is that if you refresh the overlay, the counter will reset, so maybe you want to make it persistent, in that case you can store it on SE_API.store()

https://dev.streamelements.com/docs/widgets/186263f447d1d-custom-widget#se-api

If you have any questions, just drop it and we can try to help you.

AlphaxNu commented 9 months ago

@c4ldas Thanks for the reply!

I want it to be persistent for the month of December and not reset

c4ldas commented 9 months ago

@c4ldas Thanks for the reply!

I want it to be persistent for the month of December and not reset

I created it for you and added instructions in my repository:

https://github.com/c4ldas/streamelements-widgets/tree/main/charity-follower-counter

The widget will only show the value, but you can add another text widget with the text you want and put on the side of the value to meet your needs :)

In case you have any questions, just let me know.

AlphaxNu commented 9 months ago

@c4ldas thank you so much! I'll give it a try and let you know how it goes