Postado Junho 30, 2012 12 anos Em 30/06/2012 em 18:00, Kimoszin disse: Zipa o teu projeto e me manda '-' mandei pro pvt foi?
Postado Outubro 20, 2012 12 anos To com uma duvida. porque vc colocou a groupbox? eu n intendi muito bem. to començando agora a mecher no delphi e nao intendi que função vc programou para a combobox ali voce diz hotkey(Combobox1.Text) // Pressiona oque tiver no Texto do Combobox mas oque vai tar no texto do combobox? Em 29/06/2011 em 20:58, Kimoszin disse: 1 TGroupBox 1 TButton 2 TLabeledEdit 2 TCheckBox 1 TCombobox 2 TLabel 4 TTimer Food hotkey(Combobox1.Text) // Pressiona oque tiver no Texto do Combobox StartButton CastSpell.Enabled := not(CastSpell.Enabled); Food.Enabled := not(Food.Enabled); Kick.Enabled := not(Kick.Enabled); if Checkbox1.checked then Kick.Enabled := true else Kick.Enabled := false; if Checkbox2.checked then Food.Enabled := true else Food.Enabled := false; if (Spell.Text <> '') and (Mana.Text <> '') then CastSpell.Enabled := true else CastSpell.Enabled := false; if (Kick.Enabled) or (Food.Enabled) or (CastSpell.Enabled) then StartButton.Caption := 'Stop' else StartButton.Caption := 'Start';
Postado Outubro 20, 2012 12 anos Vai ter uma lista de hotkeys de F1 à F12 que servirá para apertar no Tibia ;p
Postado Outubro 20, 2012 12 anos Da um help ae, não sei se coloquei certo, deu 26 erros. kkkkk, pf nao me chame de lixo Mostrar conteúdo oculto unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, TeCanvas; type TForm1 = class(TForm) GroupBox1: TGroupBox; StartButton: TButton; Spell: TLabeledEdit; Mana: TLabeledEdit; Label1: TLabel; Label2: TLabel; ComboBox1: TComboBox; CheckBox1: TCheckBox; CheckBox2: TCheckBox; CastSpell: TTimer; Endereço: TTimer; Kick: TTimer; Food: TTimer; procedure CastSpellTimer(Sender: TObject); procedure EndereçoTimer(Sender: TObject); procedure KickTimer(Sender: TObject); procedure FoodTimer(Sender: TObject); procedure StartButtonclick(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; PH : THandle; PID, ThID: DWORD; H : THandle; implementation {$R *.dfm} //Função para escrever na janela do Tibia function say(mensagem: string):string; var h: HWND; letra: Integer; B: Byte; begin h := FindWindow(nil, 'tibia'); for letra := 1 to Length(mensagem) do begin B := Byte(mensagem[letra]); SendMessage(h, WM_CHAR, B, 0); end; SendMessage(h, WM_CHAR, 13, 0); end; //Função para ler endereço de memoria do Tibia function LerInt(Address: Integer): Integer; var value:integer; ler :dword; begin H := FindWindow(nil, 'Tibia'); ThID := GetWindowThreadProcessId(H, @PID); PH := OpenProcess(PROCESS_ALL_ACCESS,FALSE,PID); ReadProcessMemory(PH, Ptr(Address), @Value, 4, Ler); Result:=value; end; //Função para aperta uma determinada tecla na janela do Tibia function hotkey(x :string): string; var h: HWND; i : integer; begin if x ='F1' then i := 112 else if x ='F2' then i := 113 else if x ='F3' then i := 114 else if x ='F4' then i := 115 else if x ='F5' then i := 116 else if x ='F6' then i := 117 else if x ='F7' then i := 118 else if x ='F8' then i := 119 else if x ='F9' then i := 120 else if x ='F10' then i := 121 else if x ='F11' then i := 122 else if x ='F12' then i := 123; h := FindWindow(nil, 'Tibia'); // acha a janela do tibia SendMessage(h, WM_KEYdown, i, 0); //pressiona a tecla SendMessage(h, WM_KEYUP, i, 0); //solta tecla procedure TForm1.StartButtonclick(Sender: TObject); begin CastSpell.Enabled := not(CastSpell.Enabled); Food.Enabled := not(Food.Enabled); Kick.Enabled := not(Kick.Enabled); if Checkbox1.checked then Kick.Enabled := true else Kick.Enabled := false; if Checkbox2.checked then Food.Enabled := true else Food.Enabled := false; if (Spell.Text <> '') and (Mana.Text <> '') then CastSpell.Enabled := true else CastSpell.Enabled := false; if (Kick.Enabled) or (Food.Enabled) or (CastSpell.Enabled) then StartButton.Caption := 'Stop' else StartButton.Caption := 'Start'; end; procedure TForm1.CastSpellTimer(Sender: TObject); begin if StrToInt(Label2.Caption) > (StrToInt(Mana.Text)) then say(Spell.text) // Se a mana do player for maior que a mana que foi digitada no component mana, entao vai falar a magia end; procedure TForm1.EndereçoTimer(Sender: TObject); begin Label2.caption := IntToStr(Lerint($0081CE5C)); // Vai ler o endereço da mana do personagem e transforma em numero para o label2 end; procedure TForm1.FoodTimer(Sender: TObject); begin hotkey(Combobox1.Text) // Pressiona oque tiver no Texto do Combobox end; procedure TForm1.KickTimer(Sender: TObject); begin Var TibiaHandle : THandle; begin TibiaHandle:=FindWindow(nil,'Tibia'); // Pega a janela do Tibia SendMessage(TibiaHandle,WM_KEYDOWN,VK_CONTROL,1); // Pressiona o Ctrl SendMessage(TibiaHandle,WM_KEYDOWN,VK_UP,1); // Pressiona a tecla para cima SendMessage(TibiaHandle,WM_KEYUP,VK_UP,1); // Libera a tecla SendMessage(TibiaHandle,WM_KEYDOWN,VK_DOWN,1); // Pressiona a tecla para baixo SendMessage(TibiaHandle,WM_KEYUP,VK_DOWN,1); // Libera a tecla SendMessage(TibiaHandle,WM_KEYUP,VK_CONTROL,1); // Libera o Ctrl end; end. Edited___________ tinha esquecido de postar os erros: Mostrar conteúdo oculto Checking project dependencies... Compiling Project1.dproj (Debug configuration) [DCC Error] Unit1.pas(109): E2070 Unknown directive: 'TForm1' [DCC Error] Unit1.pas(111): E2003 Undeclared identifier: 'CastSpell' [DCC Error] Unit1.pas(111): E2029 ')' expected but identifier 'Enabled' found [DCC Error] Unit1.pas(115): E2066 Missing operator or semicolon [DCC Error] Unit1.pas(115): E2029 'THEN' expected but identifier 'checked' found [DCC Error] Unit1.pas(120): E2003 Undeclared identifier: 'Checkbox2' [DCC Error] Unit1.pas(125): E2003 Undeclared identifier: 'Spell' [DCC Error] Unit1.pas(130): E2003 Undeclared identifier: 'Kick' [DCC Error] Unit1.pas(139): E2003 Undeclared identifier: 'Label2' [DCC Error] Unit1.pas(146): E2066 Missing operator or semicolon [DCC Error] Unit1.pas(150): E2070 Unknown directive: 'TForm1' [DCC Error] Unit1.pas(152): E2003 Undeclared identifier: 'Combobox1' [DCC Error] Unit1.pas(152): E2029 '(' expected but ')' found [DCC Error] Unit1.pas(154): E2014 Statement expected, but expression of type 'Text' found [DCC Error] Unit1.pas(156): E2070 Unknown directive: 'TForm1' [DCC Error] Unit1.pas(158): E2029 Statement expected but 'VAR' found [DCC Error] Unit1.pas(158): E2029 'END' expected but 'VAR' found [DCC Error] Unit1.pas(158): E2029 'END' expected but 'VAR' found [DCC Error] Unit1.pas(158): E2029 ';' expected but 'VAR' found [DCC Error] Unit1.pas(168): E2029 '.' expected but ';' found [DCC Error] Unit1.pas(24): E2065 Unsatisfied forward or external declaration: 'TForm1.CastSpellTimer' [DCC Error] Unit1.pas(25): E2065 Unsatisfied forward or external declaration: 'TForm1.EndereçoTimer' [DCC Error] Unit1.pas(26): E2065 Unsatisfied forward or external declaration: 'TForm1.KickTimer' [DCC Error] Unit1.pas(27): E2065 Unsatisfied forward or external declaration: 'TForm1.FoodTimer' [DCC Error] Unit1.pas(28): E2065 Unsatisfied forward or external declaration: 'TForm1.StartButtonclick' [DCC Fatal Error] Project1.dpr(5): F2063 Could not compile used unit 'Unit1.pas' Failed Editado Outubro 20, 2012 12 anos por cainan (veja o histórico de edições)
Postado Outubro 21, 2012 12 anos Citar [DCC Error] Unit1.pas(120): E2003 Undeclared identifier: 'Checkbox2' [DCC Error] Unit1.pas(125): E2003 Undeclared identifier: 'Spell' [DCC Error] Unit1.pas(130): E2003 Undeclared identifier: 'Kick' [DCC Error] Unit1.pas(139): E2003 Undeclared identifier: 'Label2' Esses dizem que você não alterou o nome dos itens no form: A checkbox, os timers, e a label, os outros erros tive preguiça de pensar. Editado Outubro 21, 2012 12 anos por alfbru (veja o histórico de edições)
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.