Sunday, 22 October 2023

Add a Twitch randomised fact command

 

I recently had a conversation with a friend on stream about creating a twitch chat command that would put a random fact in to the chat.
After some poking around with Streamer.bot I came up with this.
This may not be the most efficient method for doing this, but it was something I was able to set up in a few minutes.

You essentially have a number of actions which are your facts being entered into chat and another action, which is triggered by a twitch !command, that gets a random number between 1 and the amount of facts you have and selects the corresponding action.

I thought I'd leave it here in case anyone finds a use for it.
Do you have an idea for streamer.bot that you want to turn into a reality, drop a comment and let me know!
If you haven't already, I'd suggest you also check out their discord, there's some very friendly and clever people over there. https://discord.gg/VmdKdmVya2

Add a randomised Foxy Facts chat command


go to actions tab

right-click in action list

click add



Give it a name

and you might want to add them to a group for ease of viewing later

click ok



For that action go right-click on sub-actions on the right

hover over "Twitch" and "chat"

click send message to channel



enter the fact

click ok



do that for all the quotes you have


right-click and add another action

do the same as before (add a name like “Foxy Facts”, group, click ok)

right-click in sub-action, hover over "core", "logic", click "Get Random Number"




Enter from “1” and the number of facts you have



Click OK


right click in sub-action again, hover over "core", "logic", click "If/Else"



enter the variable as "randomNumber"

enter the value as 1

click "do action" (the button will say <No Action Selected>)



scroll and select the first fact action



we need to add a sub-action for each fact we have

so, we right-click "core", "logic", then "If/Else"

enter the variable the same "randomNumber"

enter the value of 2 and so on

click "do action" (the button will say <No Action Selected>)


Once we've done all that, we need to set a trigger

click on the “Commands” tab

right-click on the list and click “Add”



Give it a name

give it a command like “!foxyfact”



if you want to set a cool-down, you can do that on the bottom right


click OK


Go back to “Actions” and click on “Foxy Facts”


right-click in “Triggers”

Hover over “Core”, “Commands” and “Command Triggered”



scroll and select the second fact action and so on



Now, whenever someone puts “!foxyfacts” (Or whatever you called it)

It will put a random foxy fact in chat.

Saturday, 13 May 2023

A falling out, A genius idea and an idiot moment.

The modem and the router had an argument in the early hours of Thursday night.

They are no longer on speaking terms, so that's why the network has  been down.

Regardless of my attempts of mediation, the two remain inconsolable.


I thought about purchasing a replacement, but I didn't really want to spend £100-200 on a new Draytek.

That's when I came up with the genius idea of making my own router, with black jack and hookers.


I started looking up OPNsense virtual appliance installation and configuration.

Thinking about the physical aspect, cables and such, my first priority was getting the internet over to the server. On the opposite side of the house. 

The current solution was trunking from the master socket up to the office, where the Draytek router resided. From there essentially a patch lead ran from that, through the loft, down into the opposite bedroom, which is my wife's art studio.

Inside the cupboard, aside from some jackets and art supplies, reside my main server, Which provide hypervisor and file services, along with my backup server (which is not entirely live) and a unifi access point.

The first thing I thought of was a spare mikrotik router.

That's when it hit me. You idiot, just use that.


Cut to three hours later and I have it configured to give my pc an IP address and also take an IP address from the crappy nowTV modem/router.

I would have rather preserved my IP reservations, but I decided I didn't have the energy to connect back to the Draytek to note down all the reservations manually, so I plugged in the rest of the network.

I added a few NAT port forwarding rules in place, but at the time of writing, that traffic is still being blocked somewhere upstream, so will require further investigation.


At least now the network has internet access again, so my wife can stream.

I still need to get port forwarding working so that I can start using "private cloud services" and soon my Minecraft mod can get back in the server when they want to.

I'm hoping as the LAN range is the same, the existing client leases will be honoured from a new DHCP server and get given the same IP. That being the case setting the reservations will be a lot easier.

Edit: They were.

Mikrotik's web GUI takes a bit of getting used, but it is starting to make sense. I suppose that's the same with any routers GUI.


Around the outside, I replaced my POE switch, this week.

I had a really old d-link web smart switch, it really wasn't happy. After the third time of waking up to find no network access, I decided to replace it.

I got a tiny 5 port Tenda unmanaged POE switch. Its smaller, quieter and cheaper to run. Yes, I lost VLANning, but the only reason I wanted that isn't a requirement any more.

It arrived and I realised my mistake. This device was POE powered. I hastened to start the returns process, but then remembered that I still had an old POE injector. 

It was only 10/100.

Ok, back to Amazon, cancel the return and grab a gigabit injector.


What I was actually hoping to sort out this weekend, aside from mowing the lawn and doing laundry, was maybe getting cabling down to the living room, or getting a spare Cisco AP installed in the dining room.

This would have been to improve bandwidth for my raspberry pi, who was trying to talk to the unifi on the other side of the house. This resulted in a, let's say, changeable experience when streaming content.


That will have to be for future Rob.