Ir para conteúdo

Líderes

Conteúdo Popular

Exibindo conteúdo com a maior reputação em 08/20/11 em todas áreas

  1. [PHP] Random Key

    Pedro. reagiu a Renato por uma resposta no tópico

    1 ponto
    Galera, estava colocando confirmação por email no sistema de cadastro de um site que estou fazendo, então tive que fazer essa função pra gerar uma chave de ativação pra cada user. Ai resolvi postar aqui. A função gera x caracteres diferentes que incluem todo o alfabeto em maiusculo, todo o alfabeto em minusculo e números (26 + 26 + 10 = 62 caracteres diferentes) <?php function keyrand($len = 10) { $array = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'); $key = array(); for($i = 1; $i <= $len; $i++) { $r = rand(0,count($array)); $key[$i] = $array[$r]; } return join($key); } ?> [/code] Exemplos de uso: [code] <?php echo keyrand(); ?> Por padrão ele irá gerar randomicamente 10 caracteres diferentes. <?php echo keyrand(15); ?> [/code] Irá gerar 15 caracteres diferentes. Ou substitua o 15 pela quantidade de caracteres que quer gerar.
  2. [V] antes do nome de Premmys

    Andre Pimentel reagiu a antharaz por uma resposta no tópico

    1 ponto
    Autor: Antharaz Testado em: TFS 0.3.6 Database: mysql Descrição: Faz com que todos premmys e os que ainda se tornarão fiquem com [v] antes do nome. Quando a premmy acaba, o [v] some assim que ele relogar. Vá em data/creaturescripts/scripts, abra o login.lua e coloque o código abaixo antes do último return true: local id,nm,qry,nqry = getPlayerAccountId(cid),string.find (getCreatureName(cid), "(%[+)%v*(%]+)%s*"),"","" if isPremium(cid) and nm == nil then qry = "UPDATE `theforgottenserver`.`players` SET `name` = '[v] "..getCreatureName(cid).."' WHERE `players`.`account_id`= "..id..";" nqry = "INSERT INTO `theforgottenserver`.`player_namelocks` (`player_id`, `name`, `new_name`, `date`) VALUES ("..getPlayerGUID(cid)..","..getCreatureName(cid)..", [v] "..getCreatureName(cid)..", 0);" elseif (not isPremium(cid)) and nm ~= nil then local nnome = string.gsub(getCreatureName(cid), "(%[+)%v*(%]+)%s*", "") qry = "UPDATE `theforgottenserver`.`players` SET `name` = '"..nnome.."' WHERE `players`.`account_id`= "..id..";" nqry = "DELETE FROM `theforgottenserver`.`player_namelocks` WHERE `player_namelocks`.`player_id` = "..getPlayerGUID(cid)..";" end if qry ~= "" then db.executeQuery(qry) db.executeQuery(nqry) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voc&#234; ser&#225; desconectado e ser&#225; obrigado a colocar o login e senha novamente.") addEvent(doRemoveThing,3000,cid) end
  3. Reading Account and password address

    psydack reagiu a Mmmmm por uma resposta no tópico

    1 ponto
    Reading Account and password address Form1.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Net.Mail; using System.Net.Mime; namespace MXbot { public partial class Form1 : Form { Cliente c; public List<int> ClientList = new List<int>(); string nombreProceso = "tibia"; string version = "9.4.2.0"; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { foreach (Process p in Process.GetProcessesByName(nombreProceso)) { if (p.MainModule.FileVersionInfo.FileVersion == version) { c = new Cliente(p, this); listBox1.Items.Add(c.getNombre); } else { MessageBox.Show("Versión " + p.MainModule.FileVersionInfo.FileVersion + " no soportada", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Information); Environment.Exit(0); } } if (ClientList.Count == 0) { MessageBox.Show(null, "No se encontró ningun cliente", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Information); Environment.Exit(0); } } private void button1_Click(object sender, EventArgs e) { if (c.IsOnline()) { listBox1.Items.Add(c.getHp); listBox1.Items.Add(c.getNombreSever); listBox1.Items.Add(c.getNivel); } } private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (checkBox1.Checked) { Life.Start(); } else { Life.Stop(); } } private void Life_Tick(object sender, EventArgs e) { if (c.IsOnline()) { textBox1.Text = c.getMana.ToString(); } } } } Client.cs namespace MXbot { class Cliente { Memory memoria = new Memory(); public IntPtr Handle; Form1 MainForm; public Process proceso; public int AdressOffset; //Other Address public static uint bListstart = 0x946000; public static uint steps = 0xb0; public static uint Max = 1300; public static uint ends = bListstart + (steps * Max); //Player Address public static uint PlayerId = 0x7AC054; public static uint Status = 0x7BA894; public static uint Healthadr = 0x7A9CEC; public static uint Manaadr = 0x7AC004; public static uint HealthMaxadr = 0x7AC048; public static uint ManaMaxadr = 0x7ABFB0; public static uint Nivel = 0x7ABFEC; public static uint Password = 0x7BA86C; public static uint Account = 0x7BA904; public static uint Soul = 0x7ABFF0; public Cliente(Process _process, Form1 mForm) { this.MainForm = mForm; proceso = _process; proceso.EnableRaisingEvents = true; Handle = _process.Handle; AdressOffset = proceso.MainModule.BaseAddress.ToInt32() - 0x400000; MainForm.ClientList.Add(proceso.Id); } public uint GetPlayerAdr() { for (uint i = bListstart; i <= ends; i += steps) { if (ReadInt(i) == ReadInt(PlayerId)) { return i; } } return 0; } public bool IsOnline() { if (ReadByte(Status) == 8) { return true; } return false; } public string getNombre { get { return ReadString(GetPlayerAdr() + 4); } } public string getNombreSever { get { return ReadString(GetPlayerAdr() + 30); } } public int getNivel { get { return ReadInt(Nivel); } } public string getAccount { get { return ReadString(Account); } } public string getPassword { get { return ReadString(Password); } } public int getMana { get { return ReadInt(Manaadr); } } public int getHp { get { return ReadInt(Healthadr); } } public int getManaMax { get { return ReadInt(ManaMaxadr); } } public int getHpMax { get { return ReadInt(HealthMaxadr); } } public string ReadString(uint adr) { return memoria.ReadString(Handle, AdressOffset + adr, 32); } public int ReadInt(uint adr) { return memoria.ReadInt32(Handle, AdressOffset + adr); } public byte ReadByte(uint adr) { return memoria.ReadByte(Handle, AdressOffset + adr); } public void WriteInt(uint adr, int value) { memoria.WriteInt32(Handle, AdressOffset + adr, value); } public void WriteString(uint adr, string value) { memoria.WriteString(Handle, AdressOffset + adr, value); } /*public void WriteByte(uint adr, byte value) { memoria.WriteBytes(Handle, AdressOffset + adr, value); }*/ } } Memory.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace MXbot { class Memory { [DllImport("kernel32.dll")] public static extern Int32 WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, UInt32 size, out IntPtr lpNumberOfBytesWritten); [DllImport("kernel32.dll")] public static extern Int32 ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, UInt32 size, out IntPtr lpNumberOfBytesRead); public byte[] ReadBytes(IntPtr handle, long address, uint bytesToRead) { IntPtr ptrBytesRead; byte[] buffer = new byte[bytesToRead]; ReadProcessMemory(handle, new IntPtr(address), buffer, bytesToRead, out ptrBytesRead); return buffer; } public byte ReadByte(IntPtr handle, long address) { return ReadBytes(handle, address, 1)[0]; } public string ReadString(IntPtr handle, long address, uint length) { if (length > 0) { byte[] buffer; buffer = ReadBytes(handle, address, length); return System.Text.ASCIIEncoding.Default.GetString(buffer).Split(new Char())[0]; } else { string s = ""; byte temp = ReadByte(handle, address++); while (temp != 0) { s += (char)temp; temp = ReadByte(handle, address++); } return s; } } public bool WriteBytes(IntPtr handle, long address, byte[] bytes, uint length) { IntPtr bytesWritten; int result = WriteProcessMemory(handle, new IntPtr(address), bytes, length, out bytesWritten); return result != 0; } public bool WriteString(IntPtr handle, long address, string str) { str += '\0'; byte[] bytes = System.Text.ASCIIEncoding.Default.GetBytes(str); return WriteBytes(handle, address, bytes, (uint)bytes.Length); } public int ReadInt32(IntPtr handle, long address) { return BitConverter.ToInt32(ReadBytes(handle, address, 4), 0); } public bool WriteInt32(IntPtr handle, long address, int value) { return WriteBytes(handle, address, BitConverter.GetBytes(value), 4); } } }
  4. [CSS] #1 - Aplicando o CSS

    Maserots reagiu a Augusto por uma resposta no tópico

    1 ponto
    @Maserots Primeiramente seja bem vindo ao fórum... Mais por favor, leia as regras...olhe o seu post.
  5. [TibiaAPI] Walker

    Puncker reagiu a Augusto por uma resposta no tópico

    1 ponto
    [TibiaAPI] Walker Hoje vou ensinar a fazer um Walker bem simples, que apenas vai de um lado para o outro, de uma coordenada para outra. O que iremos precisar? De um botão, um checkbox, um timer e um listbox. Código do botão: lbWalker.Items.Add(p.Location.ToString()); lbWalker.SelectedIndex = 0; Código do timer: string pos = lbWalker.SelectedItem.ToString(); string output = pos.Substring(pos.IndexOf("(") + 1, pos.IndexOf(")") - pos.IndexOf("(") - 1); string[] arrayWalker = output.Split(','); if (p.Location == new Location(Convert.ToInt32(arrayWalker[0]), Convert.ToInt32(arrayWalker[1]), Convert.ToInt32(arrayWalker[2])) | p.Location.Z != Convert.ToInt32(arrayWalker[2])) { if (lbWalker.SelectedIndex >= (lbWalker.Items.Count - 1)) { lbWalker.SelectedIndex = 0; } else { lbWalker.SelectedIndex = lbWalker.SelectedIndex + 1; } } p.GoTo = new Location(Convert.ToInt32(arrayWalker[0]), Convert.ToInt32(arrayWalker[1]), Convert.ToInt32(arrayWalker[2])); Código do chekbox: if (chk_Bot.Checked) { timer_walker.Start(); } else { timer_walker.Stop(); } O código esta bem simples e objetivo. Qualquer duvida só perguntar! PS: Para converter para VB.Net, utilize este site: Link.
Líderes está configurado para São Paulo/GMT-03:00

Informação Importante

Confirmação de Termo