Skip to content

Instantly share code, notes, and snippets.

View EncodeTheCode's full-sized avatar
💭
Coding useful tools for workflow.

EncodeTheCode

💭
Coding useful tools for workflow.
View GitHub Profile
import win32gui
import win32process
import win32api
import win32con
import ctypes
from ctypes import wintypes
# Constants
WC_LISTVIEW = "SysListView32"
#include <windows.h>
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
switch (uMsg) {
case WM_CLOSE:
// Ignore the close message
return 0;
case WM_DESTROY:
// Ignore the destroy message
return 0;
#include <windows.h>
#include <tlhelp32.h>
#include <commctrl.h>
#include <tchar.h>
#pragma comment(lib, "comctl32.lib")
BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam) {
char className[256];
GetClassNameA(hwnd, className, sizeof(className));
class Player {
constructor(name, level = 1, currentXP = 0, totalXP = 0, xpForNextLevel = 100, xpGrowthRate = 1.5) {
this.name = name;
this.level = level;
this.currentXP = currentXP;
this.totalXP = totalXP;
this.xpForNextLevel = xpForNextLevel;
this.xpGrowthRate = xpGrowthRate;
}
class Player {
constructor(level = 1, currentXP = 0, totalXP = 0, xpForNextLevel = 100, xpGrowthRate = 1.5) {
this.level = level;
this.currentXP = currentXP;
this.totalXP = totalXP;
this.xpForNextLevel = xpForNextLevel;
this.xpGrowthRate = xpGrowthRate;
}
addXP(amount) {
-- Define the Player class
Player = {}
Player.__index = Player
-- Constructor
function Player:new(level, currentXP, totalXP, xpForNextLevel, xpGrowthRate)
local obj = {
level = level or 1,
currentXP = currentXP or 0,
totalXP = totalXP or 0,
-- Define the Player table
P = {
l = 1, -- level
c = 0, -- currentXP
t = 0, -- totalXP
n = 100, -- XP for next level
g = 1.5 -- XP growth rate
}
-- Function to add XP to the player
-- Define the Player table
Player = {
level = 1,
currentXP = 0,
totalXP = 0,
xpForNextLevel = 100, -- Initial XP required for level 2
xpGrowthRate = 1.5 -- How much more XP is needed for each subsequent level
}
-- Function to add XP to the player
-- Define the Player table
Player = {
level = 1,
currentXP = 0,
totalXP = 0,
xpForNextLevel = 100, -- Initial XP required for level 2
xpGrowthRate = 1.5 -- How much more XP is needed for each subsequent level
}
-- Function to add XP to the player
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Battleship</title>
<link rel="stylesheet" href="styles.css">
<style>
body {
display: flex;