Ir para conteúdo
  • Cadastre-se

[Resolvido] Problemas com SendKeys


Posts Recomendados

Gente estou com problema para fazer o healer do meui Bot, estou ultilizando SendKeys mas ele aparece um erro

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.ArgumentException: Keyword "Exura" is not valid.

at System.Windows.Forms.SendKeys.ParseKeys(String keys, IntPtr hwnd)

at System.Windows.Forms.SendKeys.Send(String keys, Control control, Boolean wait)

at System.Windows.Forms.SendKeys.Send(String keys)

at MBot.Pages.Heal.timerHealSpell_Tick(Object sender, EventArgs e) in C:\Users\Cliente\Desktop\Joao\Bots\MBot\Pages\Heal.cs:line 50

at System.Windows.Forms.Timer.OnTick(EventArgs e)

at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************

mscorlib

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)

CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

----------------------------------------

MBot

Assembly Version: 1.0.0.0

Win32 Version: 1.0.0.0

CodeBase: file:///C:/Users/Cliente/Desktop/Joao/Bots/MBot/bin/Release/MBot.exe

----------------------------------------

System.Windows.Forms

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.1 built by: RTMRel

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System.Drawing

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.1 built by: RTMRel

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

System

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.1 built by: RTMRel

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

TibiaAPI

Assembly Version: 2.10.1.0

Win32 Version: 2.10.1.0

CodeBase: file:///C:/Users/Cliente/Desktop/Joao/Bots/MBot/bin/Release/TibiaAPI.DLL

----------------------------------------

System.Xml

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.1 built by: RTMRel

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

----------------------------------------

System.Core

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.1 built by: RTMRel

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

----------------------------------------

************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

For example:

<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the computer

rather than be handled by this dialog box.

E este é o timer


        private void timerHealSpell_Tick(object sender, EventArgs e)

        {

            if (client.LoggedIn == true)

            {

                if (cboxLowSpell.Checked == true)

                {

                    if (cboxHealLow.Text == "Exura")

                    {

                        if (player.Health <= nmMinHealthLow.Value & player.Mana >= 20)

                            SendKeys.Send("{" + cboxHealLow.Text + "}");

                    }

                }

            }

        }

Qual o problema? Não estou conseguindo corrigir ;x

Link para o post
Compartilhar em outros sites

SendKeys "Exura"? A função do SendKeys não é enviar uma mensagem no console e bater um enter... Seria um pressionamento de teclas não?

Diga o que você quer fazer.

@Edit

Seria isto que você quer fazer?

Client.Console.Say(cboxHealLow.Text)

Então caso o combobox esteja escrito "Exura" ele envia pro console "Exura".

Editado por Puncker (veja o histórico de edições)

"A esperança é o sonho do homem acordado."

Aristóteles

Link para o post
Compartilhar em outros sites

Como dito, a função SendKeys é para envio de teclas ao Windows.

Pense também no resto da lógica do programa. Você vai colocar um condicional para cada possível magia a ser digitada?

Editado por Flamer (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

auhaua é verdad epunker depois que eu me toquei ki eu tava fazendo errado uahauhua

vou ja arrumei aqui... se alguem aqui quiser fexar o tópico fica a vontade

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo