Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Travian Bot

  1. #11
    Remend
    Remend is offline
    New member
    Join Date
    2010 Nov
    Posts
    6
    Thanks Thanks Given 
    2
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Rep Power
    0

    Re: Travian Bot

    Thank you it was really helpful!
    -- 2010-11-16, 13:24 --
    Once again I have a problem with parsing this time. The html data is the same as post#7. Using that piece of code Iam trying to take the number after '>' and before '/' :

    Code:
    var
    htm_data: array of String;
    temp_str: String;
    i: Integer; 
    begin
    temp_str := WebBrowser1.OleObject.Document.documentElement.innerHTML;
    Setlength(htm_data,length(temp_str));
    for i:=0 to length(temp_str) -1 do
    begin
      htm_data[i] := temp_str[i];
    end;
    for i:=0 to length(temp_str) -1 do
    begin
      if htm_data[i] = 'i' then
      begin
      if htm_data[i+1] = 'd' then
      if htm_data[i+4] = 'l' then
      if htm_data[i+5] = '4' then
      begin
      j := i+6;
      while htm_data[j] <> '>' do
      begin
      j := j+1;
      end;
      while htm_data[j+1] <> '/' do
      begin
      memo1.Text := memo1.Text + htm_data[j];
      j:= j+1;
      end;
      end;
      end;
      end;
    but It returns nothing... what can be possibly wrong?
    Note that temp_str length is about 11200

  2. #12
    Dwar
    Dwar is offline
    Veteran Dwar's Avatar
    Join Date
    2010 Mar
    Posts
    2,222
    Thanks Thanks Given 
    211
    Thanks Thanks Received 
    2,230
    Thanked in
    292 Posts
    Rep Power
    10

    Re: Travian Bot

    Pal, your code scares me. Please find regex library and cutoff your problem with finding substrings in string
    Note that temp_str length is about 11200
    Moreover, your code isn't optimized you need to rewrite it for better performance
    Please, post your questions on forum, not by PM or mail

    I spend my time, so please pay a little bit of your time to keep world in equilibrium

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •