bombsquad-plugin-manager/plugins/utilities/sorry.py

69 lines
1.8 KiB
Python
Raw Permalink Normal View History

2024-05-16 18:44:57 +03:00
import babase
import bauiv1 as bui
import bauiv1lib.party
import random
import bascenev1 as bs
from bascenev1 import screenmessage as push
# "%" random from sory
# "$" random from cash
sory = ["Sorry", "Sry", "Sryyy", "Sorryy"]
cash = ["My bad", "My fault", "My mistake", "My apologize"]
lmao = [
"Oops %",
"% didn't mean to",
"%, that happens",
"$, apologies!",
"Ah I slipped, very %",
"$, didn't mean to.",
"Ah, % about that",
"A- I did that $",
"%, didn't mean to.",
"$, forgive the slip",
"%, didn't mean to mess up",
"Ah % $",
"$, forgive the error",
"%, $ entirely"
]
2024-05-16 16:07:23 +00:00
2024-05-16 18:44:57 +03:00
class SorryPW(bauiv1lib.party.PartyWindow):
def __init__(s, *args, **kwargs):
super().__init__(*args, **kwargs)
2024-05-16 16:07:23 +00:00
s._delay = s._a = 50 # 5 seconds
2024-05-16 18:44:57 +03:00
s._btn = bui.buttonwidget(
parent=s._root_widget,
size=(50, 35),
2024-05-16 16:07:23 +00:00
scale=0.7,
2024-05-16 18:44:57 +03:00
label='Sorry',
button_type='square',
position=(s._width - 60, s._height - 83),
on_activate_call=s._apologize
)
def _ok(s, a):
2024-05-16 16:07:23 +00:00
if s._btn.exists():
bui.buttonwidget(edit=s._btn, label=str((s._delay - a) / 10)
if a != s._delay else 'Sorry')
s._a = a
else:
return
2024-05-16 18:44:57 +03:00
def _apologize(s):
2024-05-16 16:07:23 +00:00
if s._a != s._delay:
push("Too fast!")
return
2024-05-16 18:44:57 +03:00
else:
2024-05-16 16:07:23 +00:00
bs.chatmessage(random.choice(lmao).replace(
'%', random.choice(sory)).replace('$', random.choice(cash)))
for i in range(10, s._delay+1):
bs.apptimer((i-10)/10, bs.Call(s._ok, i))
2024-05-16 18:44:57 +03:00
# ba_meta require api 8
# ba_meta export plugin
2024-05-16 16:07:23 +00:00
2024-05-16 18:44:57 +03:00
class byBordd(babase.Plugin):
def __init__(s):
bauiv1lib.party.PartyWindow = SorryPW