1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
|
#ifndef __SLOTS__SCREEN_H__184802466018249
#define __SLOTS__SCREEN_H__184802466018249
#include <menu.h>
#include <curses.h>
#include <signal.h>
#define phrases (const char *[]){\
"WE CLOWN IN THIS MF, TAKE YO SENSITIVE ASS BACK TO @GENTOOMEMES",\
"R.I.P VxHeaven",\
"tmp(2) nuked by Smelly",\
"99% of Ransomware Operators quit before compromising a bank",\
"Equation Group wuz here",\
"Lazarus wuz here",\
"LockBit wuz here",\
"Sponsored by Equation Group",\
"Sponsored by Lazarus",\
"Sponsored by LockBit",\
"Free my boy Ross Ulbricht he did nothing wrong",\
"Stay off the dark web, kids",\
"FREE BITCOIN JUST 3 SPINS AWAY",\
"We all glow in the dark",\
"Shoutouts to Simpleflips",\
"Shoutouts to BugHunter",\
"Shoutouts to EyeDeeKay",\
":beecat:",\
":3",\
"You think Jack Rhysider will interview me now?",\
"Check out \"Darknet Diaries\"",\
"Chill and losing it since 2016",\
"POOL'S CLOSED",\
"I've been diagnosed with snaids (snail aids)",\
"My balls itch",\
"We killin filez and shiit",\
"lonix users BTFO once again",\
"This space left intentionally blank",\
"Thinking of a way out is self-centered at best",\
"Searching for the punchline to an infinite jest?",\
"Still learning what it means to feel",\
"Killroy was NOT here",\
"Go fuck yourself lmao",\
"It's so over",\
"We're so back",\
"It never even began",\
"Pepito they shot Trump",\
"This shit ain't nothing to me man",\
"I'm him, I will continue to be him",\
"THERE ARE MOSQUITOS IN YOUR URETHRA, GET THEM OUT!!!",\
"Something wicked this way comes",\
"Schizo hour",\
"Man I could really use some Chicken Bouillon rn",\
"Fuck my digital footprint, I need a digital footjob",\
"Having my weekly \"Ted was right\" moment",\
"Why aren't you in the gym?",\
"Proof?",\
"I've gone completely mental",\
"The rage consumes me",\
"Go outside. Now.",\
"Beautiful Day Sunny Morning",\
"Fuck crypto all my homies hate crypto",\
"stfu fedsmoker is my dad he'll eat you alive",\
"Almost dog in hot car'd myself",\
\
/* by @danielsprofile on telegram */ \
"Daniel Spears loves femboys",\
"LizardSquad > Razer",\
"Sponsored by Major League Gaming",\
"Sponsored by LemonParty.org",\
"Sponsored by FTX",\
"RIP Harambe",\
"Shoutout Elliot Alderson",\
"Ted Kaczynski was right",\
"The FBI watches me jerk off to MILFs lol",\
"robux generator free online 2024 100%% working undetected",\
"Doge wuz here",\
"We like Fortnite we like Fortnite",\
"We live in a society",\
"Hab you seen a alien pls?",\
"using a flipperzero makes me an APT, right?",\
"Subscribe to PewDiePie"\
}
#define menu_choices (const char *[]){\
"Spin",\
"Buy spins",\
"Quit"\
}
#define STATIC_ARRSIZE(arr) (sizeof((arr)) / sizeof((arr)[0]))
#define FUCKED_UP_ENTER 10
// functions for the userpointer for each menu item. Defines callbacks and type of function called
#define userfuncs (struct funcholder []){ \
{.callback = spin, .type = FH_SPIN}, \
{.callback = buy, .type = FH_BUY}, \
{.callback = quit, .type = FH_QUIT} \
}
enum custom_colors {
// Unspecified color
CC_UNSPEC = -1,
/* The standard curses colors are defined here as to prevent custom colors from reusing pre-existing
// colors, in case the defaults are to be used */
CURSES_BLACK = COLOR_BLACK, // ncurses' default black
CURSES_RED = COLOR_RED, // ncurses' default red
CURSES_GREEN = COLOR_GREEN, // ncurses' default green
CURSES_YELLOW = COLOR_YELLOW, // ncurses' default yellow
CURSES_BLUE = COLOR_BLUE, // ncurses' default blue
CURSES_MAGENTA = COLOR_MAGENTA, // ncurses' default magenta
CURSES_CYAN = COLOR_CYAN, // ncurses' default cyan
CURSES_WHITE = COLOR_WHITE, // ncurses' default white
/* Start custom color definitions */
CC_RED, // RGB: 255, 0, 0
CC_ORANGE, // RGB: 255, 128, 0
CC_YELLOW, // RGB: 255, 255, 0
CC_GREEN, // RGB: 0, 255, 0
CC_BLUE, // RGB: 0, 0, 255
CC_PURPLE, // RGB: 155, 0, 255
CC_MAGENTA, // RGB: 255, 0, 255
CC_WHITE, // RGB: 255, 255, 255
CC_BLACK, // RGB: 0, 0, 0
CC_WINNING, // RGB: 232, 185, 35
// This isn't actually a color, even if you try to use it as one
CC_TOOBIG
};
enum customcolor_pairs {
CCP_UNDEFINED = -1,
CCP_CURSES_DEFAULT = 0,
CCP_TESTING, // Text: White, BG: Red
CCP_BANNER, // Text: White, BG: Curses' Blue
CCP_RED, // Text: White, BG: Red
CCP_ORANGE, // Text: Black, BG: Orange
CCP_YELLOW, // Text: Black, BG: Yellow
CCP_GREEN, // Text: Black, BG: Green
CCP_BLUE, // Text: White, BG: Blue
CCP_PURPLE, // Text: White, BG: Purple
CCP_MAGENTA, // Text: White, BG: Magenta
CCP_WHITE, // Text: Black, BG: White
CCP_WINNING1, // Text: White, BG: Gold
CCP_WINNING2, // Text: Gold, BG: White
CCP_TOOBIG
};
#define NUMCOLORCYCLE 4
#define COLORWIDTH (CCP_WHITE - CCP_RED)
#define NUMCOLORPAIRS (COLORWIDTH + 1)
struct slotholder {
WINDOW *slotwin;
int slotx;
int sloty;
WINDOW *subslot[3];
char slotchar[3][3];
};
struct funcholder {
int (*callback)(void*);
enum type {
FH_UNSPEC,
FH_SPIN,
FH_BUY,
FH_QUIT,
FH_TOOBIG
} type;
};
struct params {
// Previously spinp
WINDOW *bannerwin;
struct slotholder *slots;
WINDOW *menuholder;
MENU *menu;
int (*decrypt_callback)(void*);
void *decrypt_args;
// Previously buyp
unsigned int price;
int numspins;
};
//////////////////////////////////// SPECIFICALLY USEFUL FUNCS ////////////////////////////////////
// Catch SIGINT and SIGWINCH signals
void catcher(int signum, siginfo_t *info, void *ucontext);
// Initialize sodium, curses, and set the proper locale. Exits on error, returns 0 otherwise
int doinit(const struct sigaction *handler);
// Initialize colors & define a few custom colors & color pairs. Exits on error, returns 0 otherwise
int docolors(void);
// Initialize a set of items using an array of items, an array of menu options, and an array of funcholder structs
int init_items(ITEM *items[], const char *menuopts[], size_t menuopts_size, struct funcholder usrptrs[]);
// Initialize the individual slot wheels & the window they sit on
int init_slotholder(struct slotholder *slots);
// Set a specific, custom menu format
int init_custom_menu_format(WINDOW *menuholder, MENU *menu, const int fmtdim[2], Menu_Options toggleon, Menu_Options toggleoff);
// Create the vx-gambleground banner
WINDOW* create_banner(int col, int randomnum, const char *passphrase);
// Deal with menu items when a user hits enter
int handle_menuitem(MENU *menu, struct params *params);
// Deal with switching menu contexts
int handle_input(WINDOW *menuholder, MENU *menu, struct params *params);
// Spin the wheel
int spin(void *params);
// Increase number of spins
int buy(void *params);
// Quit out
int quit(void *params);
//////////////////////////////////// GENERALLY USEFUL FUNCTIONS ////////////////////////////////////
// Converts value from within the range of [oldmin, oldmax] to a value within the range [newmin, newmax]
float normalize(float value, float oldmin, float oldmax, float newmin, float newmax);
// Find the result of x + offset and constrain it to the range [min, max]. x must be >= min
int rangemod(int x, int offset, int min, int max);
// Initialize a new curses color using standard rgb values (0-255) instead of curses' 0-1000 range
int init_rgb_color(int colornum, int red, int green, int blue);
#define RGB_MIN 0
#define RGB_MAX 255
#define CURSESCOLOR_MIN 0
#define CURSESCOLOR_MAX 1000
// Create a box starting at (x, y) with a specified width and height
int mvwcreate_box(WINDOW *win, int y, int x, int height, int width, const chtype chars[6]);
#endif
|