AutoIt v3 Skips send() inputs - keypress

I checked out AutoIt for my first time and got a little program to make some inputs for a little game to sell IronIngots(take IronIngots, use "Zuflucht"-Spell, sell IronIngots, use "Zuflucht"-Spell and from beginning). I suppose i made it so it should work, but sadly, it bugs a bit around. It's based on pressing keys for mey instead of user sitting there and always pressing the same keys. But sometimes it lags and skip single keypresses. Can u tell me if there are some mistakes? even if i start the programm with same startressources (same ingame position) Different results are spectated.
Can u help me?
Thats the code:
Sleep(3000)
_Ausfuehren()
Func _Ausfuehren()
While 1
_ganzeRundeMitBlut()
WEnd
EndFunc
#cs
Fertig
#ce
Func _ganzeRundeMitBlut()
_EineRunde()
_Bluttrank(3)
_EineRunde()
_Bluttrank(2)
EndFunc
#cs Fertig
#ce
Func _EineRunde ()
_Silber()
_Zuflucht(0)
_Shop()
_Zuflucht(1)
EndFunc
#cs Fertig
#ce
Func _Bluttrank($Anzahl)
_Press("{ESC}")
_Press("{ENTER}")
_Press("{RIGHT}")
_Press("{ENTER}")
While $Anzahl > 0
_Press("{ENTER}")
$Anzahl = $Anzahl - 1
Sleep(2000)
WEnd
_Press("{ESC}")
_Press("{ESC}")
_Press("{ESC}")
EndFunc
#cs Fertig
#ce
Func _Zuflucht ($is_home)
_Press("{ESC}")
_Press("{DOWN}")
_Press("{ENTER}")
_Press("{ENTER}")
_Press("{RIGHT}")
_Press("{DOWN}")
_Press("{DOWN}")
_Press("{ENTER}")
_Press("{ENTER}")
If($is_home) Then
_Press("{DOWN}")
_Press("{ENTER}")
EndIf
EndFunc
#cs Fertig
#ce
Func _Shop ()
_Press("{UP}")
_Press("{ENTER}")
Sleep(200)
_Press("{ENTER}")
Sleep(500)
_Press("{ENTER}")
_Press("{ENTER}")
_Press("{DOWN}")
_Press("{ENTER}")
_Press("{DOWN}")
_Press("{DOWN}")
_Press("{DOWN}")
_Press("{DOWN}")
_Press("{DOWN}")
_Press("{DOWN}")
_Press("{DOWN}")
_Press("{DOWN}")
_Press("{RIGHT}")
_Press("{ENTER}")
_Press("{UP}")
_Press("{UP}")
_Press("{UP}")
_Press("{UP}")
_Press("{UP}")
_Press("{UP}")
_Press("{UP}")
_Press("{UP}")
_Press("{UP}")
_Press("{UP}")
_Press("{ENTER}")
_Press("{ESC}")
_Press("{ESC}")
EndFunc
#cs Fertig
#ce
Func _Silber ()
_Press("{RIGHT}")
_Press("{ENTER}")
_Press("{ENTER}")
_Press("{ENTER}")
_Press("{ENTER}")
_Press("{ENTER}")
EndFunc
#cs Fertig
#ce
Func _Press ($press_str)
Send($press_str)
Sleep(700)
EndFunc

The reason for you problem is most likely that the script is too fast for the game to cope. As the scrip will press the keys 1000's of times faster than a human. I have slowed your script down by adding some sleep(100) This will make it pause for 0.1 seconds before pressing the next key. If you are still having the problem try increasing the delay. If it works to could try shorting it for extra speed
Sleep(3000)
_Ausfuehren()
Func _Ausfuehren()
While 1
_ganzeRundeMitBlut()
WEnd
EndFunc
#cs
Fertig
#ce
Func _ganzeRundeMitBlut()
_EineRunde()
_Bluttrank(3)
_EineRunde()
_Bluttrank(2)
EndFunc
#cs Fertig
#ce
Func _EineRunde ()
_Silber()
_Zuflucht(0)
_Shop()
_Zuflucht(1)
EndFunc
#cs Fertig
#ce
Func _Bluttrank($Anzahl)
sleep(100)
_Press("{ESC}")
sleep(100)
_Press("{ENTER}")
sleep(100)
_Press("{RIGHT}")
sleep(100)
_Press("{ENTER}")
While $Anzahl > 0
_Press("{ENTER}")
sleep(100)
$Anzahl = $Anzahl - 1
Sleep(2000)
WEnd
sleep(100)
_Press("{ESC}")
sleep(100)
_Press("{ESC}")
sleep(100)
_Press("{ESC}")
sleep(100)
EndFunc
#cs Fertig
#ce
Func _Zuflucht ($is_home)
sleep(100)
_Press("{ESC}")
sleep(100)
_Press("{DOWN}")
sleep(100)
_Press("{ENTER}")
sleep(100)
_Press("{ENTER}")
sleep(100)
_Press("{RIGHT}")
sleep(100)
_Press("{DOWN}")
sleep(100)
_Press("{DOWN}")
sleep(100)
_Press("{ENTER}")
sleep(100)
_Press("{ENTER}")
sleep(100)
If($is_home) Then
sleep(100)
_Press("{DOWN}")
sleep(100)
_Press("{ENTER}")
sleep(100)
EndIf
EndFunc
#cs Fertig
#ce
Func _Shop ()
sleep(100)
_Press("{UP}")
sleep(100)
_Press("{ENTER}")
Sleep(200)
_Press("{ENTER}")
Sleep(500)
_Press("{ENTER}")
sleep(100)
_Press("{ENTER}")
sleep(100)
_Press("{DOWN}")
sleep(100)
_Press("{ENTER}")
sleep(100)
_Press("{DOWN}")
sleep(100)
_Press("{DOWN}")
sleep(100)
_Press("{DOWN}")
sleep(100)
_Press("{DOWN}")
sleep(100)
_Press("{DOWN}")
sleep(100)
_Press("{DOWN}")
sleep(100)
_Press("{DOWN}")
sleep(100)
_Press("{DOWN}")
sleep(100)
_Press("{RIGHT}")
sleep(100)
_Press("{ENTER}")
sleep(100)
_Press("{UP}")
sleep(100)
_Press("{UP}")
sleep(100)
_Press("{UP}")
sleep(100)
_Press("{UP}")
sleep(100)
_Press("{UP}")
sleep(100)
_Press("{UP}")
sleep(100)
_Press("{UP}")
sleep(100)
_Press("{UP}")
sleep(100)
_Press("{UP}")
sleep(100)
_Press("{UP}")
sleep(100)
_Press("{ENTER}")
sleep(100)
_Press("{ESC}")
sleep(100)
_Press("{ESC}")
sleep(100)
EndFunc
#cs Fertig
#ce
Func _Silber ()
sleep(100)
_Press("{RIGHT}")
sleep(100)
_Press("{ENTER}")
sleep(100)
_Press("{ENTER}")
sleep(100)
_Press("{ENTER}")
sleep(100)
_Press("{ENTER}")
sleep(100)
_Press("{ENTER}")
sleep(100)
EndFunc
#cs Fertig
#ce
Func _Press ($press_str)
Send($press_str)
Sleep(700)
EndFunc

Related

I get an error when I host my discord.py bot on replit

When I host locally it works but when I host on replit it gives me this error. Initially I thought it was due to the server part I created via this video but the error comes directly from the main bot. What could be the problem?
Hosting a free bot has become quite a challenge lately. Why should I spend money on vps if my project is small?
error
Traceback (most recent call last):
File "main.py", line 401, in <module>
client.run(TOKENS)
File "/home/runner/PeppeBOT/venv/lib/python3.10/site-packages/discord/client.py", line 828, in run
asyncio.run(runner())
File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/runner/PeppeBOT/venv/lib/python3.10/site-packages/discord/client.py", line 817, in runner
await self.start(token, reconnect=reconnect)
File "/home/runner/PeppeBOT/venv/lib/python3.10/site-packages/discord/client.py", line 745, in start
await self.login(token)
File "/home/runner/PeppeBOT/venv/lib/python3.10/site-packages/discord/client.py", line 580, in login
data = await self.http.static_login(token)
File "/home/runner/PeppeBOT/venv/lib/python3.10/site-packages/discord/http.py", line 801, in static_login
data = await self.request(Route('GET', '/users/#me'))
File "/home/runner/PeppeBOT/venv/lib/python3.10/site-packages/discord/http.py", line 680, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 429 Too Many Requests (error code: 0): <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Access denied | discord.com used Cloudflare to restrict access</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/main.css" />
<script>
(function(){if(document.addEventListener&&window.XMLHttpRequest&&JSON&&JSON.stringify){var e=function(a){var c=document.getElementById("error-feedback-survey"),d=document.getElementById("error-feedback-success"),b=new XMLHttpRequest;a={event:"feedback clicked",properties:{errorCode:1015,helpful:a,version:1}};b.open("POST","https://sparrow.cloudflare.com/api/v1/event");b.setRequestHeader("Content-Type","application/json");b.setRequestHeader("Sparrow-Source-Key","c771f0e4b54944bebf4261d44bd79a1e");
b.send(JSON.stringify(a));c.classList.add("feedback-hidden");d.classList.remove("feedback-hidden")};document.addEventListener("DOMContentLoaded",function(){var a=document.getElementById("error-feedback"),c=document.getElementById("feedback-button-yes"),d=document.getElementById("feedback-button-no");"classList"in a&&(a.classList.remove("feedback-hidden"),c.addEventListener("click",function(){e(!0)}),d.addEventListener("click",function(){e(!1)}))})}})();
</script>
<script defer src="https://performance.radar.cloudflare.com/beacon.js"></script>
</head>
<body>
<div id="cf-wrapper">
<div class="cf-alert cf-alert-error cf-cookie-error hidden" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>
<div id="cf-error-details" class="p-0">
<header class="mx-auto pt-10 lg:pt-6 lg:px-8 w-240 lg:w-full mb-15 antialiased">
<h1 class="inline-block md:block mr-2 md:mb-2 font-light text-60 md:text-3xl text-black-dark leading-tight">
<span data-translate="error">Error</span>
<span>1015</span>
</h1>
<span class="inline-block md:block heading-ray-id font-mono text-15 lg:text-sm lg:leading-relaxed">Ray ID: 795444d5a895b0c3 •</span>
<span class="inline-block md:block heading-ray-id font-mono text-15 lg:text-sm lg:leading-relaxed">2023-02-06 13:35:25 UTC</span>
<h2 class="text-gray-600 leading-1.3 text-3xl lg:text-2xl font-light">You are being rate limited</h2>
</header>
<section class="w-240 lg:w-full mx-auto mb-8 lg:px-8">
<div id="what-happened-section" class="w-1/2 md:w-full">
<h2 class="text-3xl leading-tight font-normal mb-4 text-black-dark antialiased" data-translate="what_happened">What happened?</h2>
<p>The owner of this website (discord.com) has banned you temporarily from accessing this website.</p>
</div>
</section>
<div class="feedback-hidden py-8 text-center" id="error-feedback">
<div id="error-feedback-survey" class="footer-line-wrapper">
Was this page helpful?
<button class="border border-solid bg-white cf-button cursor-pointer ml-4 px-4 py-2 rounded" id="feedback-button-yes" type="button">Yes</button>
<button class="border border-solid bg-white cf-button cursor-pointer ml-4 px-4 py-2 rounded" id="feedback-button-no" type="button">No</button>
</div>
<div class="feedback-success feedback-hidden" id="error-feedback-success">
Thank you for your feedback!
</div>
</div>
<div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">
<p class="text-13">
<span class="cf-footer-item sm:block sm:mb-1">Cloudflare Ray ID: <strong class="font-semibold">795444d5a895b0c3</strong></span>
<span class="cf-footer-separator sm:hidden">•</span>
<span id="cf-footer-item-ip" class="cf-footer-item hidden sm:block sm:mb-1">
Your IP:
<button type="button" id="cf-footer-ip-reveal" class="cf-footer-ip-reveal-btn">Click to reveal</button>
<span class="hidden" id="cf-footer-ip">34.74.131.130</span>
<span class="cf-footer-separator sm:hidden">•</span>
</span>
<span class="cf-footer-item sm:block sm:mb-1"><span>Performance & security by</span> <a rel="noopener noreferrer" href="https://www.cloudflare.com/5xx-error-landing" id="brand_link" target="_blank">Cloudflare</a></span>
</p>
<script>(function(){function d(){var b=a.getElementById("cf-footer-item-ip"),c=a.getElementById("cf-footer-ip-reveal");b&&"classList"in b&&(b.classList.remove("hidden"),c.addEventListener("click",function(){c.classList.add("hidden");a.getElementById("cf-footer-ip").classList.remove("hidden")}))}var a=document;document.addEventListener&&a.addEventListener("DOMContentLoaded",d)})();</script>
</div><!-- /.error-footer -->
</div><!-- /#cf-error-details -->
</div><!-- /#cf-wrapper -->
<script>
window._cf_translation = {};
</script>
<script>(function(){var js = "window['__CF$cv$params']={r:'795444d5a895b0c3',m:'Dd87hwfU_SGSbuhSCmEIgD4OJgNU9bZXc65YvwTsSWk-1675690525-0-Af7JL6WCgpne12E1VutyYAlLnWrvoh/+MVaM+Dch+KEt5KTJYCZEFTRYzIAIqarUap1plo8VlvVhzUe1OB/Hw0FA7SealXU/Uq/+mAJjPxLFRi9lCCCmdMNpckywRQaZz7LVgUU9VefBQqqQ2Il04v0=',s:[0x33c1ad0932,0xfae449c46d],u:'/cdn-cgi/challenge-platform/h/b'};var _cpo=document.createElement('script');_cpo.nonce='',_cpo.src='/cdn-cgi/challenge-platform/h/b/scripts/cb/invisible.js?cb=795444d5a895b0c3',document.getElementsByTagName('head')[0].appendChild(_cpo);";var _0xh = document.createElement('iframe');_0xh.height = 1;_0xh.width = 1;_0xh.style.position = 'absolute';_0xh.style.top = 0;_0xh.style.left = 0;_0xh.style.border = 'none';_0xh.style.visibility = 'hidden';document.body.appendChild(_0xh);function handler() {var _0xi = _0xh.contentDocument || _0xh.contentWindow.document;if (_0xi) {var _0xj = _0xi.createElement('script');_0xj.nonce = '';_0xj.innerHTML = js;_0xi.getElementsByTagName('head')[0].appendChild(_0xj);}}if (document.readyState !== 'loading') {handler();} else if (window.addEventListener) {document.addEventListener('DOMContentLoaded', handler);} else {var prev = document.onreadystatechange || function () {};document.onreadystatechange = function (e) {prev(e);if (document.readyState !== 'loading') {document.onreadystatechange = prev;handler();}};}})();</script></body>
</html>
discord bot code
import discord
from discord import client
from discord import app_commands
from webserver import keep_alive
import datetime
import asyncio
import os
print("PeppeBOT si sta avviando...")
class VerifySelectMenuTipologia(discord.ui.Select):
def __init__(self):
options=[
discord.SelectOption(label="Giocatore", description="Se vuoi partecipare ai nostri tornei!"),
discord.SelectOption(label="Spettatore", description="Se vuoi solo assistere ai nostri tornei!")
]
super().__init__(placeholder="Seleziona la tua tipologia:",max_values=1,min_values=1,options=options)
async def callback(self, interaction: discord.Interaction):
if self.values[0] == "Giocatore":
self.spettatore = 918003194519511060
spettatore = interaction.guild.get_role(self.spettatore)
await interaction.user.add_roles(spettatore)
self.svincolato = 917269610556968970
svincolato = interaction.guild.get_role(self.svincolato)
await interaction.user.add_roles(svincolato)
elif self.values[0] == "Spettatore":
self.spettatore = 918003193982644224
spettatore = interaction.guild.get_role(self.spettatore)
await interaction.user.add_roles(spettatore)
self.membro = 918025325538078750
membro = interaction.guild.get_role(self.membro)
await interaction.user.add_roles(membro)
self.attività = 917117040035237939
attività = interaction.guild.get_role(self.attività)
await interaction.user.add_roles(attività)
self.boh = 1058541599455465483
boh = interaction.guild.get_role(self.boh)
await interaction.user.remove_roles(boh)
await interaction.delete_original_response()
class VerifySelectMenuTipologiaView(discord.ui.View):
def __init__(self, *, timeout = 180):
super().__init__(timeout=timeout)
self.add_item(VerifySelectMenuTipologia())
class VerifySelectMenuFasciaEta(discord.ui.Select):
def __init__(self):
options=[
discord.SelectOption(label="18+", description="Se sei maggiorenne!"),
discord.SelectOption(label="14-17", description="Se sei tra i 14 e i 17 anni!"),
discord.SelectOption(label="13-",description="Se hai meno di 14 anni!")
]
super().__init__(placeholder="Seleziona la tua fascia d'età",max_values=1,min_values=1,options=options)
async def callback(self, interaction: discord.Interaction):
if self.values[0] == "18+":
self.maggiorenne = 1071955516252758167
maggiorenne = interaction.guild.get_role(self.maggiorenne)
await interaction.user.add_roles(maggiorenne)
await interaction.response.edit_message(content="Manca solo l'ultima selezione! Sei un giocatore o uno spettatore?", view=VerifySelectMenuTipologiaView())
elif self.values[0] == "14-17":
self.mezzo = 1071955345532014652
mezzo = interaction.guild.get_role(self.mezzo)
await interaction.user.add_roles(mezzo)
await interaction.response.edit_message(content="Manca solo l'ultima selezione! Sei un giocatore o uno spettatore?", view=VerifySelectMenuTipologiaView())
elif self.values[0] == "13-":
self.minorenne = 1071955284534247534
minorenne = interaction.guild.get_role(self.minorenne)
await interaction.user.add_roles(minorenne)
await interaction.response.edit_message(content="Manca solo l'ultima selezione! Sei un giocatore o uno spettatore?", view=VerifySelectMenuTipologiaView())
class VerifySelectMenuFasciaEtaView(discord.ui.View):
def __init__(self, *, timeout = 180):
super().__init__(timeout=timeout)
self.add_item(VerifySelectMenuFasciaEta())
class VerifyModal(discord.ui.Modal, title='Verifica'):
nickname = discord.ui.TextInput(
label="Nickname di haxball:",
placeholder="Scrivi qui il tuo nickname di haxball (ricorda non potrai più cambiarlo)",
min_length=1,
max_length=10,
)
async def on_submit(self, interaction: discord.Interaction):
await interaction.user.edit(nick= f'{self.nickname}')
await interaction.response.send_message(content="Ottimo! Ora seleziona la tua fascia d'età", view=VerifySelectMenuFasciaEtaView(), ephemeral=True)
class VerifyButton(discord.ui.View):
def __init__(self) -> None:
super().__init__(timeout=None)
#discord.ui.button(label="Verificati", style=discord.ButtonStyle.green, custom_id="verify_button")
async def verify(self, interaction: discord.Interaction, button: discord.ui.Button):
if type(client.role) is not discord.Role: client.role = interaction.guild.get_role(918025325538078750)
if client.role not in interaction.user.roles:
modal = VerifyModal()
await interaction.response.send_modal(modal)
else:
await interaction.response.send_message("Sei già verificato!", ephemeral=True, delete_after=10)
class PersistentViewBot(discord.Client):
def __init__(self):
super().__init__(intents = discord.Intents.all())
self.synced = False
self.added = False
self.role = 918025325538078750
async def on_ready(self):
await self.wait_until_ready()
if not self.synced:
await tree.sync(guild = discord.Object(id=917112143420215338))
self.synced = True
if not self.added:
self.add_view(VerifyButton())
self.added = True
print(self.user, " si è avviato!")
print("ID :", self.user.id)
global logs_moderazione
global logs_generali
logs_moderazione = self.get_channel(917274076962258975)
logs_generali = self.get_channel(917274597466972230)
embed = discord.Embed(
color=0x03c03c
)
embed.set_author(
name=f'Avvio/Riavvio del Bot!',
)
await tree.sync(guild=discord.Object(id=1006702784797749288))
await logs_moderazione.send(embed=embed)
await tree.sync(guild=discord.Object(id=guild_id))
client = PersistentViewBot()
tree = app_commands.CommandTree(client)
guild_id = 917112143420215338
#client.event
async def on_member_join(member):
guild = member.guild
firstrole = guild.get_role(1058541599455465483)
await member.add_roles(firstrole)
tab1 = guild.get_role(918002005040046100)
await member.add_roles(tab1)
tab2 = guild.get_role(918003746850623529)
await member.add_roles(tab2)
tab3 = guild.get_role(918003750944272425)
await member.add_roles(tab3)
tab4 = guild.get_role(917119249145798716)
await member.add_roles(tab4)
mention = member.mention
guild_id = member.guild
member_count = guild_id.member_count
embed = discord.Embed(
description=str(f"{mention} è entrato su **{guild}!**\nIn tutto ora ci sono **{member_count}** membri."),
color=0x222222
)
await logs_generali.send(embed=embed)
#client.event
async def on_member_remove(member):
name = member.mention
guild = member.guild
member_count = guild.member_count
embed = discord.Embed(
description=str(str(f"**{name}** è uscito da **{guild}!**\nIn tutto ora ci sono **{member_count}** membri.")),
color=0x222222
)
await logs_generali.send(embed=embed)
#Comandi di Moderazione
#Clear [COMPLETO]
clear_cooldown = app_commands.Cooldown(1,600)
def clear_cooldown_checker(interaction: discord.Interaction):
return clear_cooldown
#app_commands.checks.dynamic_cooldown(clear_cooldown_checker, key=lambda i: (i.user.id))
#tree.command(name = "clear", description = "Cancella gli ultimi messaggi inviati ", guild=discord.Object(id=guild_id))
async def clear(ctx, limit: int):
await ctx.response.defer(ephemeral=False, thinking=False)
embed = discord.Embed(
color=0xa61022
)
if limit == 0:
embed.set_author(
name="Non puoi cancellare 0 messaggi!",
)
await ctx.response.send_message(embed=embed, delete_after=10.0)
app_commands.Cooldown.reset(clear_cooldown)
embed = discord.Embed(
color=0x03c03c
)
if limit == 1:
embed.set_author(
name=f'Ho cancellato ufficialmente un messaggio!',
icon_url=f'{ctx.user.avatar}'
)
else:
embed.set_author(
name=f'Ho cancellato ufficialmente {limit} messaggi!',
icon_url=f'{ctx.user.avatar}'
)
await ctx.channel.purge(limit=limit, before=ctx.created_at)
await ctx.followup.send(embed=embed)
embed = discord.Embed(
color=0xFFD000
)
if limit == 1:
embed.set_author(
name=f'{ctx.user.name} ha cancellato un messaggio',
icon_url=f'{ctx.user.avatar}'
)
else:
embed.set_author(
name=f'{ctx.user.name} ha cancellato {limit} messaggi',
icon_url=f'{ctx.user.avatar}'
)
embed.add_field(
name='Messaggi cancellati da:',
value=f'{ctx.user.name}',
inline=True
)
embed.add_field(
name='Quantità:',
value=f'{limit}',
inline=True
)
embed.add_field(
name='Canale dove è stato eseguito il comando:',
value=f'{ctx.channel.mention}',
inline=True
)
await logs_moderazione.send(embed=embed)
await asyncio.sleep(10)
await ctx.delete_original_response()
#clear.error
async def clear_error(ctx, error):
await ctx.response.defer(ephemeral=False, thinking=False)
if isinstance(error, app_commands.CommandOnCooldown):
cooldown = error.cooldown
cd = round(cooldown.get_retry_after())
time = str(datetime.timedelta(seconds=cd))
embed = discord.Embed(
description=f"**Riprova tra `{time}`**",
color=0xa61022
)
embed.set_author(
name="Sei in cooldown!",
icon_url=ctx.user.avatar
)
await ctx.followup.send(embed=embed)
await asyncio.sleep(10)
await ctx.delete_original_response()
#acclear [COMPLETO]
#tree.command(name = "acclear", description = "Cancella con accuratezza gli ultimi messaggi inviati ", guild=discord.Object(id=guild_id))
async def acclear(ctx, message_id: str):
await ctx.response.defer(ephemeral=False, thinking=False)
embed = discord.Embed(
color=0xa61022
)
def message_limit(m):
messageID = message.id
return m.id != messageID
channel = ctx.channel
try:
message = await channel.fetch_message(message_id)
except:
embed.set_author(
name="Non ho trovato il messaggio!",
icon_url=ctx.user.avatar
)
await ctx.response.send_message(embed=embed, delete_after=10.0)
await asyncio.sleep(10)
return 0
embed = discord.Embed(
color=0x03c03c
)
embed.set_author(
name=f'Ho cancellato fino al messaggio:\n{message.content}',
icon_url=f'{ctx.user.avatar}'
)
await ctx.channel.purge(limit=10000, before=ctx.created_at, check=message_limit, after=message)
if message.content == "":
await ctx.followup.send(embed=embed)
embed = discord.Embed(
color=0xFFD000
)
embed.set_author(
name=f'{ctx.user.name} ha cancellato fino al messaggio:\nNon ha testo',
icon_url=f'{ctx.user.avatar}'
)
embed.add_field(
name='Messaggi cancellati da:',
value=f'{ctx.user.name}',
inline=True
)
embed.add_field(
name='Fino al messaggio:',
value=f'Non ha testo',
inline=True
)
embed.add_field(
name='Canale dove è stato eseguito il comando:',
value=f'{ctx.channel.mention}',
inline=True
)
await logs_moderazione.send(embed=embed)
await asyncio.sleep(10)
await ctx.delete_original_response()
else:
await ctx.followup.send(embed=embed)
embed = discord.Embed(
color=0xFFD000
)
embed.set_author(
name=f'{ctx.user.name} ha cancellato fino al messaggio:\n{message.content}',
icon_url=f'{ctx.user.avatar}'
)
embed.add_field(
name='Messaggi cancellati da:',
value=f'{ctx.user.name}',
inline=True
)
embed.add_field(
name='Fino al messaggio:',
value=f'{message.content}',
inline=True
)
embed.add_field(
name='Canale dove è stato eseguito il comando:',
value=f'{ctx.channel.mention}',
inline=True
)
await logs_moderazione.send(embed=embed)
await asyncio.sleep(10)
await ctx.delete_original_response()
#tree.command(name = 'verifybutton', description='Crea il bottone per verificarsi', guild=discord.Object(id=guild_id))
async def verifybutton(ctx):
embed = discord.Embed(
description=str("Benvenuto nel server, prima di poter accedere a tutti i canali è importante verificarsi rispondendo a delle domande molto semplici ossia."),
color=0x222222
)
embed.set_author(
name='PeppeBOT',
icon_url=f'{client.user.avatar}'
)
embed.set_footer(text=f'Haxball Biglassic')
embed.add_field(
name='Domande:',
value="1.Qual è il tuo nickname di haxball?\n2.Qual è la tua fascia d'età?\n3.Sei uno spettatore o un giocatore?",
inline=False
)
embed.add_field(
name='Come rispondere alle domande:',
value="Nella prima domanda dovrai decidere quale nick di haxball utilizzare per questo server senza poterlo cambiare in futuro (ovviamente con le sue regole).\nNella seconda domanda dovrai specificare la tua fascia d'età tra:\n**1.** 13-\n**2.** 14-17\n**3.** 18+\nNella terza domanda dovrai semplicemente dirci se sei venuto per giocare ai tornei organizzati da noi (e quindi essere un effettivo giocatore) oppure se sei venuto semplicemente per conversare e guardare le partite del torneo da spettatore.",
inline=False
)
await ctx.channel.send(embed = embed, view = VerifyButton())
await ctx.response.send_message(content="** **", delete_after=0.1)
sesso_cooldown = app_commands.Cooldown(1,10)
def sesso_cooldown_checker(interaction: discord.Interaction):
return sesso_cooldown
#app_commands.checks.dynamic_cooldown(sesso_cooldown_checker, key=lambda i: (i.user.id))
#tree.command(name = "sesso", description = "Cancella gli ultimi messaggi inviati ", guild=discord.Object(id=guild_id))
async def sesso(ctx):
print(sesso_cooldown)
await ctx.response.send_message("andrea")
await ctx.edit_original_response(content="andrea2")
app_commands.Cooldown.reset(sesso_cooldown)
#sesso.error
async def sesso_error(ctx, error):
if isinstance(error, app_commands.CommandOnCooldown):
cooldown = error.cooldown
cd = round(cooldown.get_retry_after())
time = str(datetime.timedelta(seconds=cd))
embed = discord.Embed(
description=f"**Riprova tra `{time}`**",
color=0xa61022
)
embed.set_author(
name=f"Sei in cooldown!",
icon_url=ctx.user.avatar
)
await ctx.response.send_message(embed=embed)
for i in range(10):
await asyncio.sleep(1)
cd = round(cooldown.get_retry_after())
time = str(datetime.timedelta(seconds=cd))
embed = discord.Embed(
description=f"**Riprova tra `{time}`**",
color=0xa61022
)
embed.set_author(
name=f"Sei in cooldown!",
icon_url=ctx.user.avatar
)
await ctx.edit_original_response(embed=embed)
keep_alive()
TOKENS = os.environ['SECRET_DISCORD_TOKENS']
client.run(TOKENS)
webserver
from flask import Flask
from threading import Thread
app = Flask('')
#app.route("/")
def home():
return "sono vivo"
def run():
app.run(host= '0.0.0.0', port= 8080)
def keep_alive():
t = Thread(target=run)
t.start()
This error occurs when your bot has sent too many requests in a short amount of time. To resolve this, type kill 1 in the shell (located in the bottom window of the Replit IDE) and hit enter. This will halt your bot's processes and reset its connection. Remember to rerun the bot to reconnect.

Insert Query Giving Missing Expression Error

Below I have 2 exact same queries
1st one is generated via python code
2nd is export data as insert from oracle sqldeveloper
While second query inserts data properly ,first query is giving missing expression error
Queries
INSERT INTO NCSUSR.COLL_CLIENT_SUBMISSION_DTLS (ccsd_id, ccsd_file_id, ccsd_batch_dt, ccsd_cm_id, ccsd_cm_pan_no, ccsd_tm_id, ccsd_tm_pan_no,ccsd_cp_code, ccsd_cp_pan_no, ccsd_cli_cd, ccsd_cli_pan_no, ccsd_account_type, ccsd_segment_indicator, ccsd_ucc, ccsd_cp_fin_ledger_bal_a, ccsd_cp_fin_ledger_bal_b, ccsd_cp_fin_peak_ledger_bal_c, ccsd_cp_bg, ccsd_cp_fdr, ccsd_cp_apr_sec_cash_com, ccsd_cp_apr_sec_non_cash_com, ccsd_cp_non_apr_sec, ccsd_cp_cc_apr_comm, ccsd_cp_othr_coll, ccsd_tm_cred_enty_ledger_epi, ccsd_tm_pool_account, ccsd_tm_cash_retained, ccsd_tm_bg, ccsd_tm_fdr, ccsd_tm_apr_sec_cash_com, ccsd_tm_apr_sec_non_cash_com, ccsd_tm_non_apr_sec, ccsd_tm_cc_apr_comm, ccsd_tm_othr_coll, ccsd_cm_cash_placed, ccsd_cm_bg, ccsd_cm_fdr, ccsd_cm_apr_sec_cash_com, ccsd_cm_apr_sec_non_cash_com, ccsd_cm_non_apr_sec, ccsd_cm_cc_apr_comm, ccsd_cm_othr_coll, ccsd_cm_cash_retained, ccsd_cm_rtd_bg, ccsd_cm_rtd_fdr, ccsd_cm_rtd_apr_sec_cash_com, ccsd_cm_rtd_apr_sec_n_cash_com, ccsd_cm_rtd_non_apr_sec, ccsd_cm_rtd_cc_apr_comm, ccsd_cm_rtd_othr_coll, ccsd_nccl_cash_placed, ccsd_nccl_bg, ccsd_nccl_fdr, ccsd_nccl_apr_sec_cash_com, ccsd_nccl_aprv_sec_non_cash_com, ccsd_nccl_cc_apr_comm, ccsd_email_flag, ccsd_sms_flag, ccsd_status, ccsd_created_dt, ccsd_created_by, ccsd_modified_dt, ccsd_modified_by) VALUES {3,12345678,to_timestamp('16-SEP-21','DD-MON-RR HH.MI.SSXFF AM'),'A1017','BCIPB1234B','01266','BCIPB1234T','NCDXPRE01',null,null,'BCIPB1234M','P','CM',null,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,'N','N','Y',to_timestamp('16-SEP-21','DD-MON-RR HH.MI.SSXFF AM'),'SYSTEM',null,null};
INSERT INTO NCSUSR.COLL_CLIENT_SUBMISSION_DTLS (ccsd_id, ccsd_file_id, ccsd_batch_dt, ccsd_cm_id, ccsd_cm_pan_no, ccsd_tm_id, ccsd_tm_pan_no,ccsd_cp_code, ccsd_cp_pan_no, ccsd_cli_cd, ccsd_cli_pan_no, ccsd_account_type, ccsd_segment_indicator, ccsd_ucc, ccsd_cp_fin_ledger_bal_a, ccsd_cp_fin_ledger_bal_b, ccsd_cp_fin_peak_ledger_bal_c, ccsd_cp_bg, ccsd_cp_fdr, ccsd_cp_apr_sec_cash_com, ccsd_cp_apr_sec_non_cash_com, ccsd_cp_non_apr_sec, ccsd_cp_cc_apr_comm, ccsd_cp_othr_coll, ccsd_tm_cred_enty_ledger_epi, ccsd_tm_pool_account, ccsd_tm_cash_retained, ccsd_tm_bg, ccsd_tm_fdr, ccsd_tm_apr_sec_cash_com, ccsd_tm_apr_sec_non_cash_com, ccsd_tm_non_apr_sec, ccsd_tm_cc_apr_comm, ccsd_tm_othr_coll, ccsd_cm_cash_placed, ccsd_cm_bg, ccsd_cm_fdr, ccsd_cm_apr_sec_cash_com, ccsd_cm_apr_sec_non_cash_com, ccsd_cm_non_apr_sec, ccsd_cm_cc_apr_comm, ccsd_cm_othr_coll, ccsd_cm_cash_retained, ccsd_cm_rtd_bg, ccsd_cm_rtd_fdr, ccsd_cm_rtd_apr_sec_cash_com, ccsd_cm_rtd_apr_sec_n_cash_com, ccsd_cm_rtd_non_apr_sec, ccsd_cm_rtd_cc_apr_comm, ccsd_cm_rtd_othr_coll, ccsd_nccl_cash_placed, ccsd_nccl_bg, ccsd_nccl_fdr, ccsd_nccl_apr_sec_cash_com, ccsd_nccl_aprv_sec_non_cash_com, ccsd_nccl_cc_apr_comm, ccsd_email_flag, ccsd_sms_flag, ccsd_status, ccsd_created_dt, ccsd_created_by, ccsd_modified_dt, ccsd_modified_by) VALUES (3,12345678,to_timestamp('16-SEP-21','DD-MON-RR HH.MI.SSXFF AM'),'A1017','BCIPB1234B','01266','BCIPB1234T','NCDXPRE01',null,null,'BCIPB1234M','P','CM',null,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,'N','N','Y',to_timestamp('16-SEP-21','DD-MON-RR HH.MI.SSXFF AM'),'SYSTEM',null,null);
Error Getting for 1st Query :
Error starting at line 1 in command:
INSERT INTO NCSUSR.COLL_CLIENT_SUBMISSION_DTLS (ccsd_id, ccsd_file_id, ccsd_batch_dt, ccsd_cm_id, ccsd_cm_pan_no, ccsd_tm_id, ccsd_tm_pan_no,ccsd_cp_code, ccsd_cp_pan_no, ccsd_cli_cd, ccsd_cli_pan_no, ccsd_account_type, ccsd_segment_indicator, ccsd_ucc, ccsd_cp_fin_ledger_bal_a, ccsd_cp_fin_ledger_bal_b, ccsd_cp_fin_peak_ledger_bal_c, ccsd_cp_bg, ccsd_cp_fdr, ccsd_cp_apr_sec_cash_com, ccsd_cp_apr_sec_non_cash_com, ccsd_cp_non_apr_sec, ccsd_cp_cc_apr_comm, ccsd_cp_othr_coll, ccsd_tm_cred_enty_ledger_epi, ccsd_tm_pool_account, ccsd_tm_cash_retained, ccsd_tm_bg, ccsd_tm_fdr, ccsd_tm_apr_sec_cash_com, ccsd_tm_apr_sec_non_cash_com, ccsd_tm_non_apr_sec, ccsd_tm_cc_apr_comm, ccsd_tm_othr_coll, ccsd_cm_cash_placed, ccsd_cm_bg, ccsd_cm_fdr, ccsd_cm_apr_sec_cash_com, ccsd_cm_apr_sec_non_cash_com, ccsd_cm_non_apr_sec, ccsd_cm_cc_apr_comm, ccsd_cm_othr_coll, ccsd_cm_cash_retained, ccsd_cm_rtd_bg, ccsd_cm_rtd_fdr, ccsd_cm_rtd_apr_sec_cash_com, ccsd_cm_rtd_apr_sec_n_cash_com, ccsd_cm_rtd_non_apr_sec, ccsd_cm_rtd_cc_apr_comm, ccsd_cm_rtd_othr_coll, ccsd_nccl_cash_placed, ccsd_nccl_bg, ccsd_nccl_fdr, ccsd_nccl_apr_sec_cash_com, ccsd_nccl_aprv_sec_non_cash_com, ccsd_nccl_cc_apr_comm, ccsd_email_flag, ccsd_sms_flag, ccsd_status, ccsd_created_dt, ccsd_created_by, ccsd_modified_dt, ccsd_modified_by) VALUES {3,12345678,to_timestamp('16-SEP-21','DD-MON-RR HH.MI.SSXFF AM'),'A1017','BCIPB1234B','01266','BCIPB1234T','NCDXPRE01',null,null,'BCIPB1234M','P','CM',null,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,'N','N','Y',to_timestamp('16-SEP-21','DD-MON-RR HH.MI.SSXFF AM'),'SYSTEM',null,null}
Error at Command Line:1 Column:1,308
Error report:
SQL Error: ORA-00936: missing expression
00936. 00000 - "missing expression"
*Cause:
*Action:
There is a } at the end of the first insert, instead of )
It should be
INSERT INTO NCSUSR.COLL_CLIENT_SUBMISSION_DTLS (ccsd_id, ccsd_file_id, ccsd_batch_dt, ccsd_cm_id, ccsd_cm_pan_no, ccsd_tm_id, ccsd_tm_pan_no,ccsd_cp_code, ccsd_cp_pan_no, ccsd_cli_cd, ccsd_cli_pan_no, ccsd_account_type, ccsd_segment_indicator, ccsd_ucc, ccsd_cp_fin_ledger_bal_a, ccsd_cp_fin_ledger_bal_b, ccsd_cp_fin_peak_ledger_bal_c, ccsd_cp_bg, ccsd_cp_fdr, ccsd_cp_apr_sec_cash_com, ccsd_cp_apr_sec_non_cash_com, ccsd_cp_non_apr_sec, ccsd_cp_cc_apr_comm, ccsd_cp_othr_coll, ccsd_tm_cred_enty_ledger_epi, ccsd_tm_pool_account, ccsd_tm_cash_retained, ccsd_tm_bg, ccsd_tm_fdr, ccsd_tm_apr_sec_cash_com, ccsd_tm_apr_sec_non_cash_com, ccsd_tm_non_apr_sec, ccsd_tm_cc_apr_comm, ccsd_tm_othr_coll, ccsd_cm_cash_placed, ccsd_cm_bg, ccsd_cm_fdr, ccsd_cm_apr_sec_cash_com, ccsd_cm_apr_sec_non_cash_com, ccsd_cm_non_apr_sec, ccsd_cm_cc_apr_comm, ccsd_cm_othr_coll, ccsd_cm_cash_retained, ccsd_cm_rtd_bg, ccsd_cm_rtd_fdr, ccsd_cm_rtd_apr_sec_cash_com, ccsd_cm_rtd_apr_sec_n_cash_com, ccsd_cm_rtd_non_apr_sec, ccsd_cm_rtd_cc_apr_comm, ccsd_cm_rtd_othr_coll, ccsd_nccl_cash_placed, ccsd_nccl_bg, ccsd_nccl_fdr, ccsd_nccl_apr_sec_cash_com, ccsd_nccl_aprv_sec_non_cash_com, ccsd_nccl_cc_apr_comm, ccsd_email_flag, ccsd_sms_flag, ccsd_status, ccsd_created_dt, ccsd_created_by, ccsd_modified_dt, ccsd_modified_by) VALUES {3,12345678,to_timestamp('16-SEP-21','DD-MON-RR HH.MI.SSXFF AM'),'A1017','BCIPB1234B','01266','BCIPB1234T','NCDXPRE01',null,null,'BCIPB1234M','P','CM',null,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,'N','N','Y',to_timestamp('16-SEP-21','DD-MON-RR HH.MI.SSXFF AM'),'SYSTEM',null,null);
INSERT INTO NCSUSR.COLL_CLIENT_SUBMISSION_DTLS (ccsd_id, ccsd_file_id, ccsd_batch_dt, ccsd_cm_id, ccsd_cm_pan_no, ccsd_tm_id, ccsd_tm_pan_no,ccsd_cp_code, ccsd_cp_pan_no, ccsd_cli_cd, ccsd_cli_pan_no, ccsd_account_type, ccsd_segment_indicator, ccsd_ucc, ccsd_cp_fin_ledger_bal_a, ccsd_cp_fin_ledger_bal_b, ccsd_cp_fin_peak_ledger_bal_c, ccsd_cp_bg, ccsd_cp_fdr, ccsd_cp_apr_sec_cash_com, ccsd_cp_apr_sec_non_cash_com, ccsd_cp_non_apr_sec, ccsd_cp_cc_apr_comm, ccsd_cp_othr_coll, ccsd_tm_cred_enty_ledger_epi, ccsd_tm_pool_account, ccsd_tm_cash_retained, ccsd_tm_bg, ccsd_tm_fdr, ccsd_tm_apr_sec_cash_com, ccsd_tm_apr_sec_non_cash_com, ccsd_tm_non_apr_sec, ccsd_tm_cc_apr_comm, ccsd_tm_othr_coll, ccsd_cm_cash_placed, ccsd_cm_bg, ccsd_cm_fdr, ccsd_cm_apr_sec_cash_com, ccsd_cm_apr_sec_non_cash_com, ccsd_cm_non_apr_sec, ccsd_cm_cc_apr_comm, ccsd_cm_othr_coll, ccsd_cm_cash_retained, ccsd_cm_rtd_bg, ccsd_cm_rtd_fdr, ccsd_cm_rtd_apr_sec_cash_com, ccsd_cm_rtd_apr_sec_n_cash_com, ccsd_cm_rtd_non_apr_sec, ccsd_cm_rtd_cc_apr_comm, ccsd_cm_rtd_othr_coll, ccsd_nccl_cash_placed, ccsd_nccl_bg, ccsd_nccl_fdr, ccsd_nccl_apr_sec_cash_com, ccsd_nccl_aprv_sec_non_cash_com, ccsd_nccl_cc_apr_comm, ccsd_email_flag, ccsd_sms_flag, ccsd_status, ccsd_created_dt, ccsd_created_by, ccsd_modified_dt, ccsd_modified_by) VALUES (3,12345678,to_timestamp('16-SEP-21','DD-MON-RR HH.MI.SSXFF AM'),'A1017','BCIPB1234B','01266','BCIPB1234T','NCDXPRE01',null,null,'BCIPB1234M','P','CM',null,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,'N','N','Y',to_timestamp('16-SEP-21','DD-MON-RR HH.MI.SSXFF AM'),'SYSTEM',null,null);

Logstash: configuring aggregate + elapsed filters

I have these logs:
"03.08.2020 10:56:38","Event LClick","Type Menu","t=0","beg"
"03.08.2020 10:56:38","Event LClick","Type Menu","Detail SomeDetail","t=109","end"
"03.08.2020 10:56:40","Event LClick","t=1981","beg"
"03.08.2020 10:56:40","Event LClick","t=2090","end"
"03.08.2020 10:56:41","Event LClick","Type ToolBar","t=3026","beg"
"03.08.2020 10:56:43","Event LClick","Type ToolBar","Detail User_Desktop","t=4477","end"
"03.08.2020 10:56:44","Event FormActivate","Name Form_Name:IsaA","t=5444"
"03.08.2020 10:56:51","Event LClick","t=12543","beg"
"03.08.2020 10:56:51","Event LClick","t=12605","end"
"03.08.2020 10:56:52","Event LClick","Form ","Type Label","Name Application.for.training","t=13853","beg"
"03.08.2020 10:57:54","Event LClick","Form Application.for.training","Type Label","Name Application.for.training","t=75442","end"
"03.08.2020 10:57:54","Event FormActivate","Name List.form","t=75785"
"03.08.2020 10:58:04","Event Wheel","Form List.form","Type FormTable","Name Список","t=85769","beg"
"03.08.2020 10:58:04","Event Wheel","Form List.form","Type FormTable","Name Список","t=85769","end"
"03.08.2020 10:58:04","Event Wheel","Form List.form","Type FormTable","Name Список","t=85847","beg"
"03.08.2020 10:58:04","Event Wheel","Form List.form","Type FormTable","Name Список","t=85847","end"
"03.08.2020 10:58:04","Event Wheel","Form List.form","Type FormTable","Name Список","t=85879","beg"
"03.08.2020 10:58:04","Event Wheel","Form List.form","Type FormTable","Name Список","t=85879","end"
"03.08.2020 10:58:04","Event Wheel","Form List.form","Type FormTable","Name Список","t=85925","beg"
"03.08.2020 10:58:04","Event Wheel","Form List.form","Type FormTable","Name Список","t=85925","end"
"03.08.2020 10:58:08","Event LClick","Form List.form","Type FormTable","Name Список","t=89373","beg"
"03.08.2020 10:58:08","Event LClick","Form List.form","Type FormTable","Name Список","Detail Data","t=89451","end"
"03.08.2020 10:58:15","Event LClick","Form List.form","Type FormTable","Name Список","t=96580","beg"
"03.08.2020 10:58:15","Event LClick","Form List.form","Type FormTable","Name Список","Detail Data","t=96643","end"
"03.08.2020 10:58:15","Event LBtnDbl","Form List.form","Type FormTable","Name Список","t=96752","beg"
"03.08.2020 10:59:22","Event FormActivate","Name Another.Form","t=164004"
"03.08.2020 10:59:22","Event LBtnDbl","Form Another.Form","Type FormTable","Name Список","Detail Data","t=164004","end"
"03.08.2020 10:59:25","Event LClick","Form Another.Form","Type ToolBar","Name КоманднаяПанельПереченьРеквизитов","t=167171","beg"
"03.08.2020 10:59:26","Event LClick","Form Another.Form","Type ToolBar","Name КоманднаяПанельПереченьРеквизитов","Detail Заполнить","t=167249","end"
...
My logstash config:
input {
beats {
port => '5044'
}
}
filter {
grok {
patterns_dir => ['./patterns']
match => { 'message' => '%{TIME:timestamp}(","Event\s)(?<Event>([^"]+))(","Form\s)?(?<Form>([^"]+))?(","ParentType\s)?(?<parent_type>([^"]+))?(","ParentName\s)?(?<parent_name>([^"]+))?(","Type\s)?(?<type>([^"]+))?(","Name\s)?(?<Name_of_form>([^"]+))?(","Detail\s)?(?<Detail>([^"]+))?(","t=)?(?<t>([\d]+))?(",")?(?<Status>(end|beg))?' }
add_tag => [ '%{Status}' ]
}
dissect {
mapping => {
'[log][file][path]' => 'C:\Program Files\Filebeat\logs\%{somethingtoo}\%{something}\%{user}\%{filename}.txt'
}
}
date {
match => [ 'timestamp', 'dd.MM.yyyy HH:mm:ss' ]
}
elapsed {
unique_id_field => 'Event'
start_tag => 'beg'
end_tag => 'end'
new_event_on_match => false
}
if 'elapsed' in [tags] {
aggregate {
task_id => '%{Event}'
code => 'map["duration"] = [(event.get("elapsed_time")*1000).to_i]'
map_action => 'create'
}
}
mutate {
remove_field => ['timestamp', 'ecs', 'log', 'tags', 'message', '#version', 'something', 'somethingtoo', 'filename', 'input', 'host', 'agent', 't', 'parent_type', 'parent_name', 'type']
rename => {'elapsed_time' => 'Event_duration'}
}
}
output {
elasticsearch {
hosts => ['localhost:9200']
index => 'test'
}
}
Question: now I calculate the time difference between the lines using beg (the beginning of an action) and end (the end of an action). But that doesn't make much sense because it's almost always 0 seconds. How would I implement it like this: when a form field appears in the line (if 'Form' in message), consider the difference between the first appearance of a certain form and the last appearance. How can I implement this if it is not clear what to bind the end_tag to.
For the logs above, I should get the following:
Some form is activated (Event FormActivate), in a separate field form name (Name Name_of_form). Then the actions of this form follow (the time of which must be counted) and then the activation of the new form and so on until the end of the file.
As long as the form is the same. Move on.
The last appearance of this form in a row
Elapsed_time: "08/03/2020 10:58:15" - "08/03/2020 10:58:04" = 11 seconds
I would be very grateful for any help!

sass with compass - compile error

I try to use my private sass files together with compass and I get following error:
"sass file.scss:file.css
Syntax error: (“lighten-5”: #ffebee, “lighten-4”: #ffcdd2, “lighten-3”: #ef9a9a, “lighten-2”: #e57373, “lighten-1”: #ef5350, “base”: #f44336, “darken-1”: #e53935, “darken-2”: #d32f2f, “darken-3”: #c62828, “darken-4”: #b71c1c, “accent-1”: #ff8a80, “accent-2”: #ff5252, “accent-3”: #ff1744, “accent-4”: #d50000) isn’t a valid CSS value."
And here is my .scss file which seems to cause the problem.
$m-red: (
"lighten-5": #fdeaeb,
"lighten-4": #f8c1c3,
"lighten-3": #f3989b,
"lighten-2": #ee6e73,
"lighten-1": #ea454b,
"base": #e51c23,
"darken-1": #d0181e,
"darken-2": #b9151b,
"darken-3": #a21318,
"darken-4": #8b1014,
);
$red: (
"lighten-5": #FFEBEE,
"lighten-4": #FFCDD2,
"lighten-3": #EF9A9A,
"lighten-2": #E57373,
"lighten-1": #EF5350,
"base": #F44336,
"darken-1": #E53935,
"darken-2": #D32F2F,
"darken-3": #C62828,
"darken-4": #B71C1C,
"accent-1": #FF8A80,
"accent-2": #FF5252,
"accent-3": #FF1744,
"accent-4": #D50000
);
$pink: (
"lighten-5": #fce4ec,
"lighten-4": #f8bbd0,
"lighten-3": #f48fb1,
"lighten-2": #f06292,
"lighten-1": #ec407a,
"base": #e91e63,
"darken-1": #d81b60,
"darken-2": #c2185b,
"darken-3": #ad1457,
"darken-4": #880e4f,
"accent-1": #ff80ab,
"accent-2": #ff4081,
"accent-3": #f50057,
"accent-4": #c51162
);
$purple: (
"lighten-5": #f3e5f5,
"lighten-4": #e1bee7,
"lighten-3": #ce93d8,
"lighten-2": #ba68c8,
"lighten-1": #ab47bc,
"base": #9c27b0,
"darken-1": #8e24aa,
"darken-2": #7b1fa2,
"darken-3": #6a1b9a,
"darken-4": #4a148c,
"accent-1": #ea80fc,
"accent-2": #e040fb,
"accent-3": #d500f9,
"accent-4": #aa00ff
);
$deep-purple: (
"lighten-5": #ede7f6,
"lighten-4": #d1c4e9,
"lighten-3": #b39ddb,
"lighten-2": #9575cd,
"lighten-1": #7e57c2,
"base": #673ab7,
"darken-1": #5e35b1,
"darken-2": #512da8,
"darken-3": #4527a0,
"darken-4": #311b92,
"accent-1": #b388ff,
"accent-2": #7c4dff,
"accent-3": #651fff,
"accent-4": #6200ea
);
$indigo: (
"lighten-5": #e8eaf6,
"lighten-4": #c5cae9,
"lighten-3": #9fa8da,
"lighten-2": #7986cb,
"lighten-1": #5c6bc0,
"base": #3f51b5,
"darken-1": #3949ab,
"darken-2": #303f9f,
"darken-3": #283593,
"darken-4": #1a237e,
"accent-1": #8c9eff,
"accent-2": #536dfe,
"accent-3": #3d5afe,
"accent-4": #304ffe
);
$blue: (
"lighten-5": #E3F2FD,
"lighten-4": #BBDEFB,
"lighten-3": #90CAF9,
"lighten-2": #64B5F6,
"lighten-1": #42A5F5,
"base": #2196F3,
"darken-1": #1E88E5,
"darken-2": #1976D2,
"darken-3": #1565C0,
"darken-4": #0D47A1,
"accent-1": #82B1FF,
"accent-2": #448AFF,
"accent-3": #2979FF,
"accent-4": #2962FF
);
$light-blue: (
"lighten-5": #e1f5fe,
"lighten-4": #b3e5fc,
"lighten-3": #81d4fa,
"lighten-2": #4fc3f7,
"lighten-1": #29b6f6,
"base": #03a9f4,
"darken-1": #039be5,
"darken-2": #0288d1,
"darken-3": #0277bd,
"darken-4": #01579b,
"accent-1": #80d8ff,
"accent-2": #40c4ff,
"accent-3": #00b0ff,
"accent-4": #0091ea
);
$cyan: (
"lighten-5": #e0f7fa,
"lighten-4": #b2ebf2,
"lighten-3": #80deea,
"lighten-2": #4dd0e1,
"lighten-1": #26c6da,
"base": #00bcd4,
"darken-1": #00acc1,
"darken-2": #0097a7,
"darken-3": #00838f,
"darken-4": #006064,
"accent-1": #84ffff,
"accent-2": #18ffff,
"accent-3": #00e5ff,
"accent-4": #00b8d4
);
$teal: (
"lighten-5": #e0f2f1,
"lighten-4": #b2dfdb,
"lighten-3": #80cbc4,
"lighten-2": #4db6ac,
"lighten-1": #26a69a,
"base": #009688,
"darken-1": #00897b,
"darken-2": #00796b,
"darken-3": #00695c,
"darken-4": #004d40,
"accent-1": #a7ffeb,
"accent-2": #64ffda,
"accent-3": #1de9b6,
"accent-4": #00bfa5
);
$green: (
"lighten-5": #E8F5E9,
"lighten-4": #C8E6C9,
"lighten-3": #A5D6A7,
"lighten-2": #81C784,
"lighten-1": #66BB6A,
"base": #4CAF50,
"darken-1": #43A047,
"darken-2": #388E3C,
"darken-3": #2E7D32,
"darken-4": #1B5E20,
"accent-1": #B9F6CA,
"accent-2": #69F0AE,
"accent-3": #00E676,
"accent-4": #00C853
);
$light-green: (
"lighten-5": #f1f8e9,
"lighten-4": #dcedc8,
"lighten-3": #c5e1a5,
"lighten-2": #aed581,
"lighten-1": #9ccc65,
"base": #8bc34a,
"darken-1": #7cb342,
"darken-2": #689f38,
"darken-3": #558b2f,
"darken-4": #33691e,
"accent-1": #ccff90,
"accent-2": #b2ff59,
"accent-3": #76ff03,
"accent-4": #64dd17
);
$lime: (
"lighten-5": #f9fbe7,
"lighten-4": #f0f4c3,
"lighten-3": #e6ee9c,
"lighten-2": #dce775,
"lighten-1": #d4e157,
"base": #cddc39,
"darken-1": #c0ca33,
"darken-2": #afb42b,
"darken-3": #9e9d24,
"darken-4": #827717,
"accent-1": #f4ff81,
"accent-2": #eeff41,
"accent-3": #c6ff00,
"accent-4": #aeea00
);
$yellow: (
"lighten-5": #fffde7,
"lighten-4": #fff9c4,
"lighten-3": #fff59d,
"lighten-2": #fff176,
"lighten-1": #ffee58,
"base": #ffeb3b,
"darken-1": #fdd835,
"darken-2": #fbc02d,
"darken-3": #f9a825,
"darken-4": #f57f17,
"accent-1": #ffff8d,
"accent-2": #ffff00,
"accent-3": #ffea00,
"accent-4": #ffd600
);
$amber: (
"lighten-5": #fff8e1,
"lighten-4": #ffecb3,
"lighten-3": #ffe082,
"lighten-2": #ffd54f,
"lighten-1": #ffca28,
"base": #ffc107,
"darken-1": #ffb300,
"darken-2": #ffa000,
"darken-3": #ff8f00,
"darken-4": #ff6f00,
"accent-1": #ffe57f,
"accent-2": #ffd740,
"accent-3": #ffc400,
"accent-4": #ffab00
);
$orange: (
"lighten-5": #fff3e0,
"lighten-4": #ffe0b2,
"lighten-3": #ffcc80,
"lighten-2": #ffb74d,
"lighten-1": #ffa726,
"base": #ff9800,
"darken-1": #fb8c00,
"darken-2": #f57c00,
"darken-3": #ef6c00,
"darken-4": #e65100,
"accent-1": #ffd180,
"accent-2": #ffab40,
"accent-3": #ff9100,
"accent-4": #ff6d00
);
$deep-orange: (
"lighten-5": #fbe9e7,
"lighten-4": #ffccbc,
"lighten-3": #ffab91,
"lighten-2": #ff8a65,
"lighten-1": #ff7043,
"base": #ff5722,
"darken-1": #f4511e,
"darken-2": #e64a19,
"darken-3": #d84315,
"darken-4": #bf360c,
"accent-1": #ff9e80,
"accent-2": #ff6e40,
"accent-3": #ff3d00,
"accent-4": #dd2c00
);
$brown: (
"lighten-5": #efebe9,
"lighten-4": #d7ccc8,
"lighten-3": #bcaaa4,
"lighten-2": #a1887f,
"lighten-1": #8d6e63,
"base": #795548,
"darken-1": #6d4c41,
"darken-2": #5d4037,
"darken-3": #4e342e,
"darken-4": #3e2723
);
$blue-grey: (
"lighten-5": #eceff1,
"lighten-4": #cfd8dc,
"lighten-3": #b0bec5,
"lighten-2": #90a4ae,
"lighten-1": #78909c,
"base": #607d8b,
"darken-1": #546e7a,
"darken-2": #455a64,
"darken-3": #37474f,
"darken-4": #263238
);
$grey: (
"lighten-5": #fafafa,
"lighten-4": #f5f5f5,
"lighten-3": #eeeeee,
"lighten-2": #e0e0e0,
"lighten-1": #bdbdbd,
"base": #9e9e9e,
"darken-1": #757575,
"darken-2": #616161,
"darken-3": #424242,
"darken-4": #212121
);
$shades: (
"black": #000000,
"white": #FFFFFF,
"transparent": transparent
);
$colors: (
"m-red": $m-red,
"red": $red,
"pink": $pink,
"purple": $purple,
"deep-purple": $deep-purple,
"indigo": $indigo,
"blue": $blue,
"light-blue": $light-blue,
"cyan": $cyan,
"teal": $teal,
"green": $green,
"light-green": $light-green,
"lime": $lime,
"yellow": $yellow,
"amber": $amber,
"orange": $orange,
"deep-orange": $deep-orange,
"brown": $brown,
"blue-grey": $blue-grey,
"grey": $grey,
"shades": $shades
);
Without compass everything compiles perfect. What's wrong with the file above?
Edit:
Isolated code:
$new_m-red: ( lighten-5: #fdeaeb);
$new_colors: ( "m-red": $m-red);
// Color Classes
#each $color_name,
$color in $new_colors {
#each $color_type,
$color_value in $color{
#if $color_type=="base" {
.#{$color_name} {
background-color: $color_value !important;
}
.#{$color_name}-text {
color: $color_value !important;
}
}
#else {
.#{$color_name}.#{$color_type} {
background-color: $color_value !important;
}
.#{$color_name}-text.text-#{$color_type} {
color: $color_value !important;
}
}
}
}
Compass version:
Compass 1.0.3 (Polaris)
SASS Sass 3.4.19 (Selective Steve)
error:
modified /sass/file/_color.scss
error /sass/file.scss (Line 49 of /sass/file/_color.scss: ("lighten-5": #fdeaeb) isn't a valid CSS value.)
I tried without quotes:
modified /sass/file/_color.scss
error /sass/file.scss (Line 49 of /sass/file/free/_color.scss: (lighten-5: #fdeaeb) isn't a valid CSS value.)

How to connect multiple markers using google map in codeigniter?

I have to connect multiple markers points to show direction in google map. I have used codeigniter. I have referred this link
There is no such example of connecting routes between markers. Kindly help me out.
Controller:
public function geoLocation(){
$this->load->library('googlemaps');
$config['center'] = '37.4419, -122.1419';
$config['zoom'] = 'auto';
$config['directions'] = TRUE;
$config['directionsStart'] = 'Hadapsar, Pune, India';
//$config['directionsDivID'] = 'swargate, Pune, India';
$config['directionsEnd'] = 'Bavdhan, Pune, India';
$this->googlemaps->initialize($config);
$data['map'] = $this->googlemaps->create_map();
$this->load->view('google-map', $data);
}
my updated controller method:
public function index()
{
$this->load->library('googlemaps');
$config['center'] = 'Pune, India';
$config['zoom'] = 'auto';
$config['directionsMode']="WALKING";
$config['directionsWaypointArray'] = array('Hadapsar, Pune, India','Swargate, Pune, India','Bavdhan, Pune, India');
$this->googlemaps->initialize($config);
$marker = array();
$marker['position'] = 'Hadapsar, Pune, India';
//$marker['onmouseover'] = 'ahssdfsdf';
$marker['infowindow_open']= true;
$this->googlemaps->add_marker($marker);
$marker['position'] = 'Bavdhan, Pune, India';
$this->googlemaps->add_marker($marker);
$data['map'] = $this->googlemaps->create_map();
$this->load->view('welcome_message', $data);
}
}
This is my html code:
<?php echo $map['js']; ?>
<div id="nevi">
<div id="menu">
<div id="TabbedPanels1" class="TabbedPanels">
<ul class="TabbedPanelsTabGroup">
<li class="TabbedPanelsTab" tabindex="0" style="font-size:14px" id="today_st">Today's status </li>
<li class="TabbedPanelsTab" id="report" tabindex="0" style="font-size:14px">Reports</li>
</ul>
<div class="TabbedPanelsContentGroup" style="margin-top:74px;">
<div class="TabbedPanelsContent">
<?php echo $map['html']; ?>
</div>
</div>
</div>
</div>
</div>
You need to specify this:
directionsWaypointArray
According to the code:
var $directionsWaypointArray = array(); // An array of waypoints. eg array("Boston, MA", "Times Square, NY");
Waypoints are the bits between your start and end points, so I assume you'd just need to do:
$config['directionsStart'] = 'Hadapsar, Pune, India';
$config['directionsEnd'] = 'Bavdhan, Pune, India';
$config['directionsWaypointArray'] = array("swargate, Pune, India");

Resources