forked from elrebelde21/LoliBot-MD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfun-game.js
522 lines (462 loc) ยท 27.1 KB
/
fun-game.js
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
import TicTacToe from '../lib/tictactoe.js'
let timeout = 60000
let poin = 600
let poin_lose = -100
let poin_bot = 200
global.suit = global.suit ? global.suit : {}
//import MessageType from '@adiwajshing/baileys'
let MessageType = (await import(global.baileys)).default
let handler = async (m, { conn, text, command, usedPrefix, args }) => {
let pp = 'https://telegra.ph/file/c7924bf0e0d839290cc51.jpg'
let fkontak = { "key": { "participants":"0@s.whatsapp.net", "remoteJid": "status@broadcast", "fromMe": false, "id": "Halo" }, "message": { "contactMessage": { "vcard": `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD` }}, "participant": "0@s.whatsapp.net" }
try {
if (command == 'ppt' || command == 'pvp' || command == 'suit' || command == 'suitpvp') {
const time = global.db.data.users[m.sender].wait + 10000;
if (new Date - global.db.data.users[m.sender].wait < 10000) throw `*๐ ๐๐๐ฎ, ๐๐จ๐ฅ๐๐ง๐ ${Math.floor((time - new Date()) / 1000)} ๐๐ฃ๐ฉ๐๐จ ๐๐ ๐ช๐จ๐๐ง ๐ค๐ฉ๐ง๐ค๐จ ๐๐ค๐ข๐๐ฃ๐๐ค*\n\n*แดบแต สฐแตแตแตโฟ หขแตแตแต*`
let textquien = `๐๐ข๐๐๐ซ๐ ๐ฟ, ๐๐๐ฉ๐๐ฅ ๐ ๐จ ๐๐ข๐ฃ๐๐ซ๐ โ๏ธ\n\n๐พ ๐
๐ช๐๐๐ง ๐ช๐ฃ ๐๐๐ ๐๐ค๐ฃ ๐๐ก ๐๐ค๐ฉ ๐ช๐จ๐๐ง ๐ก๐ค๐จ ๐จ๐๐๐ช๐๐๐ฃ๐ฉ๐๐จ ๐๐ค๐ข๐๐ฃ๐๐ค :\nโข ${usedPrefix + command} piedra\nโข ${usedPrefix + command} papel\nโข ${usedPrefix + command} tijera\n\n๐น ๐
๐ช๐๐๐ง ๐ช๐ฃ ๐๐๐ ๐๐ค๐ฃ ๐ช๐ฃ ๐ช๐จ๐ช๐๐ง๐๐ค, ๐๐ฉ๐๐ฆ๐ช๐๐ฉ๐๐ง๐ก๐ค ๐๐๐๐ข๐ฅ๐ก๐ค :\n${usedPrefix + command} @0`
if (!m.mentionedJid[0] && !args[0]) return conn.sendButton(m.chat, textquien, wm, pp, [['Piedra ๐ฟ', `${usedPrefix + command} piedra`], ['Papel ๐', `${usedPrefix + command} papel`], ['Tijera โ๏ธ', `${usedPrefix + command} tijera`]], m)
//m.reply(textquien, m.chat, {mentions: conn.parseMention(textquien)}, {quoted: fkontak })
let who
if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.sender
else who = m.sender
let name = conn.getName(who)
let astro = Math.random();
if (astro < 0.34) {
astro = 'piedra';
} else if (astro > 0.34 && astro < 0.67) {
astro = 'tijera';
} else {
astro = 'papel';
}
global.db.data.users[m.sender].wait = new Date * 1;
if (text == astro) {
let money = global.db.data.users[m.sender].exp += 500;
conn.reply(m.chat, `\`ใ ๐๐๐๐ผ๐๐ ๐คใ\`\n\n๐ Tu: ${text}\n๐ El Bot : ${astro}\n๐ Premios : ${money} XP`, m, {contextInfo: {externalAdReply :{ mediaUrl: null, mediaType: 1, description: null, title: name, body: wm, previewType: 0, thumbnail: img.getRandom(), sourceUrl: redes.getRandom()}}})
} else if (text == 'papel') {
if (astro == 'piedra') {
let money = global.db.data.users[m.sender].money += 100
conn.reply(m.chat, `\`ใ ๐๐ผ ๐๐ผ๐๐ผ๐ฟ๐! ๐ ใ\`\n\n๐ Tu: ${text}\n๐ El Bot : ${astro}\n๐ Premios : ${money} Coins`, m, {contextInfo: {externalAdReply :{ mediaUrl: null, mediaType: 1, description: null, title: name, body: wm, previewType: 0, thumbnail: img.getRandom(), sourceUrl: redes.getRandom()}}});
} else {
let money = global.db.data.users[m.sender].exp -= 300
conn.reply(m.chat, `\`ใ ๐๐ผ ๐๐๐๐ฟ๐๐ฟ๐! ๐คก ใ\`\n\n๐ Tu: ${text}\n๐ El Bot : ${astro}\nโ Premios : -${money} XP`, m, {contextInfo: {externalAdReply :{ mediaUrl: null, mediaType: 1, description: null, title: name, body: wm, previewType: 0, thumbnail: img.getRandom(), sourceUrl: redes.getRandom()}}})
}} else if (text == 'tijera') {
if (astro == 'papel') {
let money = global.db.data.users[m.sender].money += 900
conn.reply(m.chat, `\`ใ ๐๐ผ ๐๐ผ๐๐ผ๐ฟ๐! ๐ ใ\`\n\n๐ Tu: ${text}\n๐ El Bot : ${astro}\n๐ Premios : ${money} Coins`, m, {contextInfo: {externalAdReply :{ mediaUrl: null, mediaType: 1, description: null, title: name, body: wm, previewType: 0, thumbnail: img.getRandom(), sourceUrl: redes.getRandom()}}});
} else {
let money = global.db.data.users[m.sender].money -= 300
conn.reply(m.chat, `\`ใ ๐๐ผ ๐๐๐๐ฟ๐๐ฟ๐! ๐คก ใ\`\n\n๐ Tu: ${text}\n๐ El Bot : ${astro}\nโ Premios : -${money} Coins`, m, {contextInfo: {externalAdReply :{ mediaUrl: null, mediaType: 1, description: null, title: name, body: wm, previewType: 0, thumbnail: img.getRandom(), sourceUrl: redes.getRandom()}}})
}} else if (text == 'tijera') {
if (astro == 'papel') {
let money = global.db.data.users[m.sender].exp += 1000
conn.reply(m.chat, `\`ใ ๐๐ผ ๐๐ผ๐๐ผ๐ฟ๐! ๐ ใ\`\n\n๐ Tu: ${text}\n๐ El Bot : ${astro}\n๐ Premios : ${money} XP`, m, {contextInfo: {externalAdReply :{ mediaUrl: null, mediaType: 1, description: null, title: name, body: wm, previewType: 0, thumbnail: img.getRandom(), sourceUrl: redes.getRandom()}}});
} else {
let money = global.db.data.users[m.sender].exp -= 300
conn.reply(m.chat, `\`ใ ๐๐ผ ๐๐๐๐ฟ๐๐ฟ๐! ๐คก ใ\`\n\n๐ Tu: ${text}\n๐ El Bot : ${astro}\nโ Premios : -${money} XP`, m, {contextInfo: {externalAdReply :{ mediaUrl: null, mediaType: 1, description: null, title: name, body: wm, previewType: 0, thumbnail: img.getRandom(), sourceUrl: redes.getRandom()}}})
}} else if (text == 'papel') {
if (astro == 'piedra') {
let money = global.db.data.users[m.sender].money += 1000
conn.reply(m.chat, `\`ใ ๐๐ผ ๐๐ผ๐๐ผ๐ฟ๐! ๐ ใ\`\n\n๐ Tu: ${text}\n๐ El Bot : ${astro}\n๐ Premios : ${money} coins`, m, {contextInfo: {externalAdReply :{ mediaUrl: null, mediaType: 1, description: null, title: name, body: wm, previewType: 0, thumbnail: img.getRandom(), sourceUrl: redes.getRandom()}}});
} else {
let money = global.db.data.users[m.sender].exp -= 300
conn.reply(m.chat, `\`ใ ๐๐ผ ๐๐๐๐ฟ๐๐ฟ๐! ๐คก ใ\`\n\n๐ Tu: ${text}\n๐ El Bot : ${astro}\nโ Premios : -${money} XP`, m, {contextInfo: {externalAdReply :{ mediaUrl: null, mediaType: 1, description: null, title: name, body: wm, previewType: 0, thumbnail: img.getRandom(), sourceUrl: redes.getRandom()}}})
}} else if (text == 'piedra') {
if (astro == 'tijera') {
let money = global.db.data.users[m.sender].money += 1000
conn.reply(m.chat, `\`ใ ๐๐ผ ๐๐ผ๐๐ผ๐ฟ๐! ๐ ใ\`\n\n๐ Tu: ${text}\n๐ El Bot : ${astro}\n๐ Premios : ${money} coins`, m, {contextInfo: {externalAdReply :{ mediaUrl: null, mediaType: 1, description: null, title: name, body: wm, previewType: 0, thumbnail: img.getRandom(), sourceUrl: redes.getRandom()}}});
//m.reply(`*โญโโโโ[ ๐๐ผ ๐๐ผ๐๐ผ๐ฟ๐! ๐ ]โโโโฌฃ*\nโ${name} ๐๐จ๐ฉ๐๐: ${text}\nโ๐ฑ ๐๐๐ฉ๐๐ฝ๐ค๐ฉ: ${astro}\nโ๐ฐ ๐๐ง๐๐ข๐๐ค: ${[money0].getRandom()} ๐๐๐ฉ๐๐พ๐ค๐๐ฃ๐จ\nโ๐ต ๐๐ช ๐ฟ๐๐ฃ๐๐ง๐ค: ${money} ๐๐๐ฉ๐๐พ๐ค๐๐ฃ๐จ\nโฐโโโโโโ[ ${vs} ]โโโโโโฌฃ`);
} else {
let money = global.db.data.users[m.sender].money -= 300
conn.reply(m.chat, `\`ใ ๐๐ผ ๐๐๐๐ฟ๐๐ฟ๐! ๐คก ใ\`\n\n๐ Tu: ${text}\n๐ El Bot : ${astro}\nโ Premios : -${money} coins`, m, {contextInfo: {externalAdReply :{ mediaUrl: null, mediaType: 1, description: null, title: name, body: wm, previewType: 0, thumbnail: img.getRandom(), sourceUrl: redes.getRandom()}}})}
}
if (Object.values(conn.suit).find(room => room.id.startsWith('suit') && [room.p, room.p2].includes(m.sender))) return m.reply(`โ ๏ธ ๐๐๐ง๐ข๐๐ฃ๐ ๐ฉ๐ช ๐ฅ๐๐ง๐ฉ๐๐๐ ๐๐ฃ๐ฉ๐๐จ ๐๐ ๐๐ฃ๐๐๐๐ ๐ค๐ฉ๐ง๐`)
if (Object.values(conn.suit).find(room => room.id.startsWith('suit') && [room.p, room.p2].includes(m.mentionedJid[0]))) return m.reply(`โ ๏ธ๐๐ ๐ฅ๐๐ง๐จ๐ค๐ฃ๐ ๐ ๐ก๐ ๐ฆ๐ช๐ ๐ฆ๐ช๐๐๐ง๐๐จ ๐๐๐จ๐๐๐๐๐ง ๐ ๐ช๐ฃ ๐๐จ๐ฉ๐ ๐๐ช๐๐๐ฃ๐๐ค ๐ค๐ฉ๐ง๐ ๐ฅ๐๐ง๐ฉ๐๐๐, ๐๐จ๐ฅ๐๐ง๐ ๐ ๐ฆ๐ช๐ ๐ฉ๐๐ง๐ข๐๐ฃ๐ ๐๐ ๐๐ช๐๐๐ง`)
let id = 'suit_' + new Date() * 1
let caption = `๐ฎ๐พ ๐๐ผ๐๐๐ - ๐๐๐ - ๐๐ผ๐๐๐ ๐ฎ๐พ\n\n@${m.sender.split`@`[0]} ๐ฟ๐๐๐ผ๐๐๐ผ ๐ผ @${m.mentionedJid[0].split`@`[0]} ๐ผ ๐๐ (๐๐๐) ๐ฟ๐ ๐๐๐๐ฟ๐๐ผ, ๐๐ผ๐๐๐ ๐ ๐๐๐
๐๐๐ผ\n\n> _*Escribe (aceptar) para aceptar*_\n> _*Escribe (rechazar) para rechazar*_`
let imgplaygame = `https://www.merca2.es/wp-content/uploads/2020/05/Piedra-papel-o-tijera-0003318_1584-825x259.jpeg`
conn.suit[id] = {
chat: await conn.sendMessage(m.chat, { text: caption, mentions: [m.sender, m.mentionedJid]}),
//await conn.sendButton(m.chat, caption, footer, imgplaygame, [[`Aceptar`], [`Rechazar`]], null, {mentions: conn.parseMention(caption)}),
id: id,
p: m.sender,
p2: m.mentionedJid[0],
status: 'wait',
waktu: setTimeout(() => {
if (conn.suit[id]) conn.reply(m.chat, `โณ ๐๐๐๐๐๐ ๐ฟ๐ ๐๐๐๐๐๐ผ ๐๐๐๐ผ๐๐๐๐ผ๐ฟ๐, ๐๐ ๐๐๐ ๐๐ ๐พ๐ผ๐๐พ๐๐๐ผ ๐๐๐ ๐๐ผ๐๐๐ผ ๐ฟ๐ ๐๐๐๐๐๐๐๐๐ผ`, m)
delete conn.suit[id]}, timeout), poin, poin_lose, poin_bot, timeout
}}
if (command == 'slot' || command == 'apostar' || command == 'slot1' || command == 'slot2' || command == 'slot3') {
let fa = `${mg}๐๐จ๐๐ง ๐๐๐ก ๐ก๐ ๐จ๐๐๐ช๐๐๐ฃ๐ฉ๐ ๐ข๐๐ฃ๐๐ง๐:
๐๐๐๐ข๐ฅ๐ก๐ค:
*${usedPrefix + command} 50*`.trim()
if (!args[0]) return m.reply(fa)
if (isNaN(args[0])) return m.reply(fa)
let apuesta = parseInt(args[0])
let users = global.db.data.users[m.sender]
if (apuesta < 10) return m.reply(`โ ๏ธ ๐๐๐๐๐ฌ ๐๐๐ฅ ๐๐ฉ๐จ๐ฌ๐ญ๐๐ซ ๐ฎ๐ง ๐ฆ๐ข๐ง๐ข๐ฆ๐จ๐ฌ ๐๐ *10*`)
if (users.exp < apuesta) {
return m.reply(`โ ๏ธ ๐๐ ๐๐๐๐๐๐๐ ๐๐๐๐ ๐๐๐๐๐๐๐ ๐๐๐, ๐๐ ๐๐๐๐๐๐๐๐๐
๐ ๐๐๐๐๐๐๐๐๐๐๐ ๐๐๐ ๐๐ ๐๐๐ ๐๐๐๐ ๐๐๐๐๐๐๐ ๐๐ฬ๐ ๐๐๐๐๐๐๐๐`)
}
if (command == 'slot1') {
let time = global.db.data.users[m.sender].lastslot + 60000
if (new Date - users.lastslot < 60000) return m.reply(`*๐๐ฎ๐๐ฅ๐ฏ๐ ๐๐ง: ${msToTime(time - new Date())} ๐๐๐ซ๐ ๐๐จ๐ง๐ญ๐ข๐ง๐ฎ๐๐ซ ๐๐ฉ๐จ๐ฌ๐ญ๐๐ง๐๐จ ๐๐ฑ๐ฉ* ๐ฐ`)
users.lastslot = new Date * 1
let emojis = ["๐", "โก", "๐ช"];
let a = Math.floor(Math.random() * emojis.length);
let b = Math.floor(Math.random() * emojis.length);
let c = Math.floor(Math.random() * emojis.length);
let x = [],
y = [],
z = [];
for (let i = 0; i < 3; i++) {
x[i] = emojis[a];
a++;
if (a == emojis.length) a = 0;
}
for (let i = 0; i < 3; i++) {
y[i] = emojis[b];
b++;
if (b == emojis.length) b = 0;
}
for (let i = 0; i < 3; i++) {
z[i] = emojis[c];
c++;
if (c == emojis.length) c = 0;
}
let end;
if (a == b && b == c) {
end = `๐ฅณ *QUE PRO!! HAS GANADO +${apuesta + apuesta} EXP*`
users.exp += apuesta
} else if (a == b || a == c || b == c) {
end = `๐ฏ *CASI!!, VUELVA A INTENTAR*\n*BONO DE +50 EXP*`
users.exp += 50
} else {
end = `๐ฟ *HA PERDIDO!! โ -${apuesta} EXP*`
users.exp -= apuesta
}
var hawemod = [
`${x[1]} : ${y[0]} : ${z[0]}
${z[0]} : ${y[1]} : ${x[1]}
${z[1]} : ${x[2]} : ${y[0]}`,
`${x[0]} : ${y[1]} : ${z[2]}
${y[1]} : ${z[2]} : ${x[1]}
${x[2]} : ${y[0]} : ${z[0]}`,
`${x[1]} : ${y[2]} : ${z[1]}
${y[0]} : ${z[0]} : ${x[2]}
${x[2]} : ${y[1]} : ${z[0]}`
]
const maxIterations = 25;
const arrayCasuale = generaArrayCasuale(hawemod, maxIterations);
const array = [...arrayCasuale, ];
let { key } = await conn.sendMessage(m.chat, { text: `๐น` }, { quoted: m });
for (let i = 0; i < maxIterations; i++) {
await conn.sendMessage(m.chat, { text: `๐ฐ | *RANURAS* | ๐ฐ\nโโโโโโโโ\n` + `${array[i]}` + `\n โโโโโโโโ\n๐ฐ | *SLOTS* | ๐ฐ`, edit: key }, { quoted: m });
await new Promise((resolve) => setTimeout(resolve, 1))}
return await conn.sendMessage(m.chat, {text: `
๐ฐ | *RANURAS* | ๐ฐ
โโโโโโโโ
${x[0]} : ${y[0]} : ${z[0]}
${x[1]} : ${y[1]} : ${z[1]}
${x[2]} : ${y[2]} : ${z[2]}
โโโโโโโโ
๐ฐ | *SLOTS* | ๐ฐ\n\n${end}`, edit: key}, {quoted: m})}
if (users.money < apuesta) {
throw `โ ๏ธ ๐๐จ ๐๐ฅ๐๐๐ง๐ณ๐ ๐ฉ๐๐ซ๐ ๐๐ฉ๐จ๐ฌ๐ญ๐๐ซ ๐๐จ๐ฅ๐ข๐๐จ๐ข๐ง๐ฌ, ๐ฅ๐ ๐ซ๐๐๐จ๐ฆ๐ข๐๐ง๐๐จ ๐ข๐ง๐ญ๐๐ซ๐๐๐ญ๐ฎ๐๐ซ ๐๐จ๐ง ๐๐ฅ ๐๐จ๐ญ ๐ฉ๐๐ซ๐ ๐จ๐๐ญ๐๐ง๐๐ซ ๐ซ๐๐๐ฎ๐ซ๐ฌ๐จ๐ฌ`
}
if (command == 'slot2') {
let time = global.db.data.users[m.sender].lastslot + 60000
if (new Date - users.lastslot < 60000) return m.reply(`*๐๐ฎ๐๐ฅ๐ฏ๐ ๐๐ง:${msToTime(time - new Date())} ๐๐๐ซ๐ ๐๐จ๐ง๐ญ๐ข๐ง๐ฎ๐๐ซ ๐๐ฉ๐จ๐ฌ๐ญ๐๐ง๐๐จ ๐๐จ๐ฅ๐ข๐๐จ๐ข๐ง๐ฌ* ๐ฐ`)
users.lastslot = new Date * 1
let emojis = ["๐ช", "๐ฎ", "๐งฟ"];
let a = Math.floor(Math.random() * emojis.length);
let b = Math.floor(Math.random() * emojis.length);
let c = Math.floor(Math.random() * emojis.length);
let x = [],
y = [],
z = [];
for (let i = 0; i < 3; i++) {
x[i] = emojis[a];
a++;
if (a == emojis.length) a = 0;
}
for (let i = 0; i < 3; i++) {
y[i] = emojis[b];
b++;
if (b == emojis.length) b = 0;
}
for (let i = 0; i < 3; i++) {
z[i] = emojis[c];
c++;
if (c == emojis.length) c = 0;
}
let end;
if (a == b && b == c) {
end = `๐ฅณ *QUE PRO!! HAS GANADO +${apuesta + apuesta} LoliCoins*`
users.money += apuesta
} else if (a == b || a == c || b == c) {
end = `๐ฏ *CASI!!, VUELVA A INTENTAR*\n*BONO DE +30 LoliCoins*`
users.money += 30
} else {
end = `๐ฟ *HA PERDIDO!! โ -${apuesta} LoliCoins*`
users.money -= apuesta
}
var hawemod = [
`${x[0]} : ${y[1]} : ${z[0]}
${z[0]} : ${y[0]} : ${x[1]}
${z[2]} : ${x[2]} : ${y[2]}`,
`${x[0]} : ${y[0]} : ${z[0]}
${y[1]} : ${z[1]} : ${x[1]}
${x[2]} : ${y[2]} : ${z[2]}`,
`${x[0]} : ${y[1]} : ${z[0]}
${y[1]} : ${z[0]} : ${x[1]}
${x[2]} : ${y[1]} : ${z[0]}`
]
const maxIterations = 25;
const arrayCasuale = generaArrayCasuale(hawemod, maxIterations);
const array = [...arrayCasuale, ];
let { key } = await conn.sendMessage(m.chat, { text: `๐น` }, { quoted: m });
for (let i = 1; i <= maxIterations; i++) {
await conn.sendMessage(m.chat, { text: `๐ฐ | *RANURAS* | ๐ฐ\nโโโโโโโโ\n` + `${array[i]}` + `\n โโโโโโโโ\n๐ฐ | *SLOTS* | ๐ฐ`, edit: key }, { quoted: m });
await new Promise((resolve) => setTimeout(resolve, 50))}
return await conn.sendMessage(m.chat, {text: `
๐ฐ | *RANURAS* | ๐ฐ
โโโโโโโโ
${x[0]} : ${y[0]} : ${z[0]}
${x[1]} : ${y[1]} : ${z[1]}
${x[2]} : ${y[2]} : ${z[2]}
โโโโโโโโ
๐ฐ | *SLOTS* | ๐ฐ\n\n${end}`, edit: key}, {quoted: m})}
if (users.limit < apuesta) {
throw `โ ๏ธ ๐ต๐ ๐๐๐๐๐๐๐ ๐๐๐๐ ๐๐๐๐๐๐๐ ๐ซ๐๐๐๐๐๐๐, ๐๐ ๐๐๐๐๐๐๐๐๐
๐ ๐๐๐๐๐๐๐๐๐๐๐ ๐๐๐ ๐๐ ๐๐๐ ๐๐๐๐ ๐๐๐๐๐๐๐ ๐๐ฬ๐ ๐๐๐๐๐๐๐๐`
}
if (command == 'slot3') {
let time = global.db.data.users[m.sender].lastslot + 30000
if (new Date - users.lastslot < 30000) return m.reply(`*๐๐ฎ๐๐ฅ๐ฏ๐ ๐๐ง: ${msToTime(time - new Date())} ๐๐๐ซ๐ ๐๐จ๐ง๐ญ๐ข๐ง๐ฎ๐๐ซ ๐๐ฉ๐จ๐ฌ๐ญ๐๐ง๐๐จ ๐๐ข๐๐ฆ๐๐ง๐ญ๐* ๐ฐ`)
users.lastslot = new Date * 1
let emojis = ["๐ช", "๐ฃ", "๐"];
let a = Math.floor(Math.random() * emojis.length);
let b = Math.floor(Math.random() * emojis.length);
let c = Math.floor(Math.random() * emojis.length);
let x = [],
y = [],
z = [];
for (let i = 0; i < 3; i++) {
x[i] = emojis[a];
a++;
if (a == emojis.length) a = 0;
}
for (let i = 0; i < 3; i++) {
y[i] = emojis[b];
b++;
if (b == emojis.length) b = 0;
}
for (let i = 0; i < 3; i++) {
z[i] = emojis[c];
c++;
if (c == emojis.length) c = 0;
}
let end;
if (a == b && b == c) {
end = `๐ฅณ *QUE PRO!! HAS GANADO +${apuesta + apuesta} Diamantes*`
users.limit += apuesta
} else if (a == b || a == c || b == c) {
end = `๐ *CASI!!, VUELVA A INTENTAR*\n*BONO DE +2 Diamantes*`
users.limit += 2
} else {
end = `๐ฟ *HA PERDIDO!! โ -${apuesta} Diamante*`
users.limit -= apuesta
}
var hawemod = [
`${x[0]} : ${y[1]} : ${z[0]}
${z[1]} : ${y[0]} : ${x[0]}
${z[2]} : ${x[1]} : ${y[2]}`,
`${x[0]} : ${y[1]} : ${z[0]}
${y[1]} : ${z[2]} : ${x[1]}
${x[2]} : ${y[1]} : ${z[2]}`,
`${x[0]} : ${y[0]} : ${z[1]}
${y[1]} : ${z[2]} : ${x[0]}
${x[0]} : ${y[2]} : ${z[1]}`
]
const maxIterations = 25;
const arrayCasuale = generaArrayCasuale(hawemod, maxIterations);
const array = [...arrayCasuale, ];
let { key } = await conn.sendMessage(m.chat, { text: `๐น` }, { quoted: m });
for (let i = 1; i <= maxIterations; i++) {
await conn.sendMessage(m.chat, { text: `๐ฐ | *RANURAS* | ๐ฐ\nโโโโโโโโ\n` + `${array[i]}` + `\n โโโโโโโโ\n๐ฐ | *SLOTS* | ๐ฐ`, edit: key }, { quoted: m });
await new Promise((resolve) => setTimeout(resolve, 50))}
return await conn.sendMessage(m.chat, {text: `
๐ฐ | *RANURAS* | ๐ฐ
โโโโโโโโ
${x[0]} : ${y[0]} : ${z[0]}
${x[1]} : ${y[1]} : ${z[1]}
${x[2]} : ${y[2]} : ${z[2]}
โโโโโโโโ
๐ฐ | *SLOTS* | ๐ฐ\n\n${end}`, edit: key}, {quoted: m})}
if (command == 'slot') {
await conn.sendButton(m.chat, `*Elija en que apostarรก ${apuesta}*`, botname, null, [['โก Exp', `.slot1 ${apuesta}`], ['๐ช Lolicoins', `.slot2 ${apuesta}`], ['๐ diamante', `.slot3 ${apuesta}`]], null, null, m)
}
if (command == 'apostar') {
await conn.sendButton(m.chat, `*Elija en que apostarรก ${apuesta}*`, botname, null, [['โก Exp', `.slot1 ${apuesta}`], ['๐ช Lolicoins', `.slot2 ${apuesta}`], ['๐ diamante', `.slot3 ${apuesta}`]], null, null, m)}
}
if (command == 'tictactoe' || command == 'ttc' || command == 'ttt' || command == 'xo') {
conn.game = conn.game ? conn.game : {}
if (Object.values(conn.game).find(room => room.id.startsWith('tictactoe') && [room.game.playerX, room.game.playerO].includes(m.sender))) return m.reply(`โ ๏ธ ๐๐ค๐๐๐ซ๐๐ ๐๐ก๐๐ช๐๐๐ฃ ๐๐จ๐ฉ๐ ๐๐ช๐๐๐ฃ๐๐ค ๐๐ฃ ๐ก๐ ๐จ๐๐ก๐ ๐จ๐ ๐ฆ๐ช๐๐๐ง๐ ๐๐๐๐ฃ๐๐ค๐ฃ๐๐ง ๐๐จ๐๐ง๐๐๐ *salir*\n๐๐๐ข๐๐๐๐ฃ ๐ฅ๐ช๐๐๐๐จ ๐๐ก๐๐ข๐๐ฃ๐๐ง ๐ก๐ ๐จ๐๐ก๐ ๐ช๐จ๐๐ฃ๐๐ค ๐๐ก ๐๐ค๐ข๐๐ฃ๐๐ค *${usedPrefix}delttt*`)
if (!text) return m.reply(`*โ ๏ธ ๐ฟ๐๐๐ ๐๐ ๐๐๐ง๐๐๐ ๐ช๐ฃ ๐ฃ๐ค๐ข๐๐ง๐ ๐ ๐ก๐ ๐จ๐๐ก๐\n๐๐๐๐ข๐ฅ๐ก๐ค\n${usedPrefix + command} Sala bot*`)
let room = Object.values(conn.game).find(room => room.state === 'WAITING' && (text ? room.name === text : true))
if (room) {
await conn.reply(m.chat, `โ ๏ธ ๐ผ๐ก๐๐ช๐๐๐ฃ ๐จ๐ ๐๐ ๐ช๐ฃ๐๐๐ค ๐ ๐ก๐ ๐จ๐๐ก๐ *${text}*\n๐๐ ๐ฅ๐ช๐๐๐๐ฃ ๐๐ช๐๐๐ง!! ๐ผ`, fkontak, m)
await conn.reply(m.chat, `โญ๏ธ *Clรกsico Juego del Gato, 3 en raya o tateti* โ\n\n*ยฟCรณmo jugar?*\n_Responde al Juego con un Nรบmero, el mensaje debe contener la posiscion en la que quieras estar (1,2,3,4,5,6,7,8,9)_`, fkontak, m)
room.o = m.chat
room.game.playerO = m.sender
room.state = 'PLAYING'
let arr = room.game.render().map(v => {
return {
X: 'โ',
O: 'โญ',
1: '1๏ธโฃ',
2: '2๏ธโฃ',
3: '3๏ธโฃ',
4: '4๏ธโฃ',
5: '5๏ธโฃ',
6: '6๏ธโฃ',
7: '7๏ธโฃ',
8: '8๏ธโฃ',
9: '9๏ธโฃ',
}[v]})
let str = `๐ ๐
๐ช๐๐๐ค ๐ฉ๐๐ฉ๐๐ฉ๐
๐ซ ๐
๐ช๐๐๐๐ค๐ง๐๐จ:
*โโโโโโโโโ*
โ = @${room.game.playerX.split('@')[0]}
โญ = @${room.game.playerO.split('@')[0]}
*โโโโโโโโโ*
${arr.slice(0, 3).join('')}
${arr.slice(3, 6).join('')}
${arr.slice(6).join('')}
*โโโโโโโโโ*
๐๐ช๐ง๐ฃ๐ค ๐๐:
@${room.game.currentTurn.split('@')[0]}
`.trim()
if (room.x !== room.o) await conn.sendMessage(room.x, { text: str, mentions: this.parseMention(str)}, { quoted: fkontak, m })
await conn.sendMessage(room.o, { text: str, mentions: conn.parseMention(str)}, { quoted: fkontak, m })
} else {
room = {
id: 'tictactoe-' + (+new Date),
x: m.chat,
o: '',
game: new TicTacToe(m.sender, 'o'),
state: 'WAITING' }
if (text) room.name = text
let imgplay = `https://img.freepik.com/vector-premium/juego-tres-raya-icono-contorno-lineal-neon_7280-2422.jpg`
conn.sendMessage(m.chat, { image: { url: imgplay }, caption: `๐ผ ๐
๐ช๐๐๐ค๐จ ๐๐๐ฉ๐๐ฉ๐
๐ ๐๐จ๐ฅ๐๐ง๐๐ฃ๐๐ค ๐๐ก ๐จ๐๐๐ช๐ฃ๐๐ค ๐๐ช๐๐๐๐ค๐ง ๐ฅ๐ช๐๐๐ ๐๐ฃ๐๐ง๐๐จ๐ ๐ช๐จ๐๐ฃ๐๐ค ๐๐ก ๐๐ค๐ข๐๐ฃ๐๐ค
*${usedPrefix + command} ${text}*
๐๐ ๐ฆ๐ช๐๐๐ง๐๐จ ๐๐๐๐ฃ๐๐ค๐ฃ๐๐ง ๐ก๐ ๐จ๐๐ก๐ ๐ช๐จ๐ ๐๐ก ๐๐ค๐ข๐๐ฃ๐๐ค
*${usedPrefix}delttt*` }, { mentions: conn.parseMention(text), quoted: fkontak })
conn.game[room.id] = room
}}
if (command == 'math' || command == 'mates' || command == 'matemรกticas') {
// 60000 = 1 minuto // 30000 = 30 segundos // 15000 = 15 segundos // 10000 = 10 segundos
let time = global.db.data.users[m.sender].wait + 60000
if (new Date - global.db.data.users[m.sender].wait < 60000) return await conn.reply(m.chat, `*๐ ๐๐๐๐๐๐ผ ${Math.floor((time - new Date()) / 1000)} ๐๐๐๐๐๐ฟ๐๐ ๐ผ๐๐๐๐ ๐ฟ๐ ๐๐๐๐๐๐ ๐ผ ๐
๐๐๐ผ๐*`, fkontak, m)
let mat = `${lenguajeGB['smsAvisoIIG']()}โจ ๐๐ช๐๐๐ ๐๐จ๐๐ง๐๐๐ ๐ก๐ ๐๐๐๐๐๐ช๐ก๐ฉ๐๐
*Nivel del dificultad*
${Object.keys(modes).join(' | ')}
*Ejemplo:*
${usedPrefix + command} noob
${usedPrefix + command} impossible2
๐ผ *Mientras mas dificultad mayor recompensa*`.trim()
if (args.length < 1) return await conn.reply(m.chat, mat, fkontak, m)
let mode = args[0].toLowerCase()
if (!(mode in modes)) return await conn.reply(m.chat, mat, fkontak, m)
let id = m.chat
if (id in global.math) return conn.reply(m.chat, `โ ๏ธ *แดแดแด
แดแด ษชแด สแดส แดสแดษขแดษดแดแด sษชษด สแดsแดแดษดแด
แดส แดส แดsแดแด แดสแดแด!!*`, global.math[id][0])
//let ii = global.db.data.users[m.sender].limit += 10 math.dia
let math = genMath(mode)
global.math[id] = [
await conn.reply(m.chat, `โญโใ *${wm}* ใโโฑ
โ๐พ๐ช๐๐ก ๐๐จ ๐ง๐๐จ๐ช๐ก๐ฉ๐๐๐ค ๐๐: *${math.str} = ?*
โโโโโโโโโโโโโโโโโโ
โ๐งญ ๐๐๐๐ข๐ฅ๐ค: *${(math.time / 1000).toFixed(0)} segundos*
โโโโโโโโโโโโโโโโโโ
โ๐๐๐จ๐ฅ๐ค๐ฃ๐๐ ๐ ๐๐จ๐ฉ๐ ๐ข๐๐ฃ๐จ๐๐๐ ๐ฎ ๐๐๐ฃ๐
โ๐ *${math.bonus}: XP*
โฐโโโโฐ ๐ ${vs} โฑโโโโแ`, m),
math, 4,
//await conn.reply(m.chat, `โฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธ๐๐๐๐๐๐๐ฟ๐ผ ๐ผ๐ ๐๐๐๐๐ผ๐
๐ ๐ฟ๐ ๐ผ๐๐๐๐ฝ๐ผ ๐พ๐๐ ๐๐ผ ๐๐๐๐๐๐๐๐๐ผ\n\n๐ผ๐๐๐๐๐ ๐๐๐ ๐๐๐๐๐ผ๐๐ ๐ผ๐ฝ๐๐๐ ๐๐ ๐๐๐๐ ๐๐๐๐ ๐ผ๐๐๐๐๐\n\n${wm}`, fkontak, m), math, 4,
setTimeout(() => {
if (global.math[id]) conn.reply(m.chat, `โ sแด แดแดแดสแด แดส แดษชแดแดแดแด สแด สแดsแดแดแดsแดแด แดs *${math.result}*`, global.math[id][0])
delete global.math[id]
}, math.time)
]
global.db.data.users[m.sender].wait = new Date * 1
}
if (command == 'delttt' || command == 'deltt' || command == 'delxo' || command == 'deltictactoe') {
let room = Object.values(conn.game).find(room => room.id.startsWith('tictactoe') && [room.game.playerX, room.game.playerO].includes(m.sender))
if (room == undefined) return await conn.reply(m.chat, `โ ๏ธ ๐๐ ๐๐๐๐ผ๐ ๐๐ ๐๐๐๐๐๐๐ผ ๐๐ผ๐๐๐๐ฟ๐ผ ๐๐ ๐๐ ๐
๐๐๐๐ ๐๐๐๐ ๐๐ ๐๐ผ๐๐ผ\n\n๐ซ ๐๐๐๐พ๐๐ผ๐ ๐๐ผ๐๐๐๐ฟ๐ผ (${usedPrefix}ttt sala nueva)`, fkontak, m)
delete conn.game[room.id]
await conn.reply(m.chat, `โ ๏ธ ๐๐ผ ๐๐ผ๐๐ผ ๐๐๐๐ ๐๐ ๐๐ผ๐๐ผ ๐๐๐ ๐๐๐๐๐๐๐ผ๐ฟ๐ผ`, fkontak, m)
}} catch (e) {
//await conn.reply(m.chat, `${lenguajeGB['smsMalError3']()}#report ${lenguajeGB['smsMensError2']()} ${usedPrefix + command}\n\n${wm}`, fkontak, m)
console.log(e)}}
handler.help = ["ppt", "suitpvp", "pvp", "slot", "apostar", "tictactoe", "ttt", "math", "matemรกticas", "delttt"];
handler.tags = ['game'];
handler.command = /^(ppt|suitpvp|suit|pvp|moneda|suert|currency|luck|cara|Method|slot|apostar|slot1|slot2|slot3|tictactoe|ttc|ttt|xo|math|mates|matemรกticas|delttt|deltt|delxo|deltictactoe)$/i
handler.group = true
handler.game = true
handler.register = true
export default handler
function pickRandom(list) {
return list[Math.floor(Math.random() * list.length)]}
function msToTime(duration) {
var milliseconds = parseInt((duration % 1000) / 100),
seconds = Math.floor((duration / 1000) % 60),
minutes = Math.floor((duration / (1000 * 60)) % 60),
hours = Math.floor((duration / (1000 * 60 * 60)) % 24)
hours = (hours < 10) ? "0" + hours : hours
minutes = (minutes < 10) ? "0" + minutes : minutes
seconds = (seconds < 10) ? "0" + seconds : seconds
return minutes + " m " + seconds + " s "
}
let modes = {
noob: [-3, 3,-3, 3, '+-', 15000, 30],
easy: [-10, 10, -10, 10, '*/+-', 20000, 50],
medium: [-40, 40, -20, 20, '*/+-', 30000, 200],
hard: [-100, 100, -70, 70, '*/+-', 40000, 500],
extreme: [-999999, 999999, -999999, 999999, '*/', 40000, 2500],
impossible: [-99999999999, 99999999999, -99999999999, 999999999999, '*/', 50000, 5500],
impossible2: [-999999999999999, 999999999999999, -999, 999, '/', 60000, 8500]
}
let operators = {
'+': '+',
'-': '-',
'*': 'ร',
'/': 'รท'
}
// XP
function genMath(mode) {
let [a1, a2, b1, b2, ops, time, bonus] = modes[mode]
let a = randomInt(a1, a2)
let b = randomInt(b1, b2)
let op = pickRandom([...ops])
let result = (new Function(`return ${a} ${op.replace('/', '*')} ${b < 0 ? `(${b})` : b}`))()
if (op == '/') [a, result] = [result, a]
return {
str: `${a} ${operators[op]} ${b}`,
mode,
time,
bonus,
result
}}
function generaArrayCasuale(array, ripetizioni) {
let risultato = [];
for (let i = 0; i < ripetizioni; i++) {
risultato = risultato.concat(array);
}
return risultato;
}
function randomInt(from, to) {
if (from > to) [from, to] = [to, from]
from = Math.floor(from)
to = Math.floor(to)
return Math.floor((to - from) * Math.random() + from)
}