Skip to content

Instantly share code, notes, and snippets.

@VLTNOgithub
VLTNOgithub / Thumbstick.py
Last active July 19, 2021 12:55
Thumbstick code for pc
import serial
import pydirectinput
arduino = serial.Serial('COM13', 115200, timeout=.1) # Serial input from arduino. change COM port to wherever your arduino is connected
pydirectinput.PAUSE = 0
keysDown = {} # List of currently pressed keys
@VLTNOgithub
VLTNOgithub / Thumbstick.ino
Last active July 19, 2021 12:57
Thumbstick code for arduino
const int thumbstick_pin = 8;
const int X_pin = A0; // Plug thumbstick X direction into pin A0
const int Y_pin = A1; // Plug thumbstick Y direction into pin A1
int xc;
int yc;
int TSButton;
void setup() {
for (int i = 0; i < 2; i++) {
pinMode(thumbstick_pin, INPUT);
module.exports = {
name: 'clear',
description: "A clear command!",
execute(message, args){
const amount = parseInt(args[0]) + 1;
if(isNaN(amount)){
return message.reply('That is not a valid number');
} else if(amount <= 1 || amount > 100){
return message.reply('Please input a number between 1 and 99');
module.exports = {
name: 'test',
description: "A command for testing!",
execute(message, args){
const emoji = guild.emojis.cache.first();
msg.reply(`Hello! ${emoji}`);
}
}
Collection(11) [Map] {
'640297380209491968' => Role {
guild: Guild {
members: [Collection [Map]],
channels: [Collection [Map]],
roles: [Collection [Map]],
presences: [Collection [Map]],
deleted: false,
available: true,
id: '640297380209491968',
module.exports = {
name: 'owner',
description: 'Gives the user owner',
execute(message, args){
message.member.roles.add('640298337635139624');
}
}
const { execute } = require("./site");
module.exports = {
name: 'ping',
description: 'Replys with pong',
execute(message, args){
if(message.member.roles.cache.has('640298337635139624')){
message.channel.send('pong');
} else {
message.channel.send("You don't have the permissions to run this command")
const Discord = require('discord.js');
const bot = new Discord.Client();
const fs = require('fs');
const prefix = '-';
const token = 'TOKEN';
bot.commands = new Discord.Collection();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random Name Generator</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random Name Generator</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
</head>
<body>
<div class="container">