Results 1 to 25 of 25

Thread: Get Price Function

  1. #1
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default Get Price Function

    It gets the current GE price, only problem is that prices often return as 22.5k though items of this price are not normally used in scripts so it shouldn't be a problem,Problem now fixed, should be useful for profit calculation.

    Simba Code:
    function GetPrice(ObjID : Integer) : Integer;
    Var
    str, str2, str3, str4 : string;
    startat, endat, com, k, b, m :integer;
    begin
    str := GetPage('http://services.runescape.com/m=itemdb_rs/g=runescape/viewitem.ws?obj='+IntToStr(ObjID))
    startat := Pos('<th scope="row">Current guide price:</th>',str)
    If(startat>0) then
      begin
        endat := Pos('<th scope="row">Today',str)
        str2 := Copy(str,(startat+46),endat-startat-63);
        k := Pos('k',str2)
        com := Pos(',',str2)
        b := Pos('b',str2)
        m := Pos('m',str2)
        str4 := str2
        If(k > 0) then
        begin
          str3 := Copy(Str2,1,k-1)
          str4 := IntToStr(StrToInt(Copy(Str3,1,Length(Str3)-2)+Copy(Str3,Length(Str3),1))*100)
        end;
        If(b > 0) then
        begin
          str3 := Copy(Str2,1,b-1)
          str4 := IntToStr(StrToInt(Copy(Str3,1,Length(Str3)-2)+Copy(Str3,Length(Str3),1))*100000000)
        end;
        If(m > 0) then
        begin
          str3 := Copy(Str2,1,m-1)
          str4 := IntToStr(StrToInt(Copy(Str3,1,Length(Str3)-2)+Copy(Str3,Length(Str3),1))*100000)
        end;
        If(com > 0) then
        begin
          str4 := Copy(Str2,1,com-1)+Copy(Str2,com+1,Length(str2)-com)
        end;
      Result := StrToInt(str4)
      end else
        begin
          Result := -1
        end
    end;

    ID's can be got from the GE website or many other websites such as this one

    If you want to try it out then you can use some of the following:
    • 554 - fire rune
    • 1517 - maple logs
    • 1048 - white partyhat
    • 1734 - thread
    • 2615 - Rune platebody (g)



    Say somebody made a Superheating Script they could do the following:
    Simba Code:
    begin

      //Setup SRL and smart here

      ProfitPerBar := StrToInt(GetPrice(2353))-StrToInt(GetPrice(440))-2*StrToInt(GetPrice(453))-StrToInt(GetPrice(561));
                                       
      WriteLn('My awesome script......');
      WriteLn('Profit Per Bar: '+IntToStr(ProfitPerBar));

      MarkTime(i)

      Repeat
      Cast;
      Bank;
      TIMESCAST := TIMESCAST+Random(2);    //Just so that the profit increases with each progress report
      If(TimeFromMark(i)>5000) then
        begin
          WriteLn('')
          WriteLn('[---------------------------------]')
          WriteLn('[' + padr(padl('Progress Report', 17 + Length('Progress Report') / 2), 33) + ']');
          WriteLn('[---------------------------------]')
          WriteLn(PadR('[  Times Cast: ' + IntToStr(TIMESCAST), 34) + ']');
          WriteLn(PadR('[  Profit Made: ' + IntToStr(ProfitPerBar*TIMESCAST), 34) + ']');
          WriteLn('[---------------------------------]')
          WriteLn('')
          MarkTime(i)
        end;
      Wait(500)
      Until(False)

    end.





    At the same time I may as well post this function, not sure what the use would be but it gets the name of that Object ID:

    Simba Code:
    function GetName(ObjID : Integer) : String;
    Var
    str : string;
    startat, endat :integer;
    begin
    str := GetPage('http://services.runescape.com/m=itemdb_rs/g=runescape/viewitem.ws?obj='+IntToStr(ObjID))
    startat := Pos('<h5>',str)
    If(startat>0) then
      begin
        endat := Pos('</h5>',str)
        Result := Copy(str,startat+4,endat-startat-4);
      end else
        begin
          Result := 'ERROR'
        end
    end;



    Running the following:
    Simba Code:
    WriteLn(GetName(554))
      WriteLn(GetPrice(554))

      WriteLn(GetName(1517))
      WriteLn(GetPrice(1517))

      WriteLn(GetName(1048))
      WriteLn(GetPrice(1048))

      WriteLn(GetName(1734))
      WriteLn(GetPrice(1734))

      WriteLn(GetName(2615))
      WriteLn(GetPrice(2615))

      WriteLn(GetName(2353))
      WriteLn(GetPrice(2353))

    Gives me:
    Code:
    Compiled successfully in 967 ms.
    Fire rune
    30
    Maple logs
    22
    White partyhat
    2100000000
    Thread
    3
    Rune platebody (g)
    444400
    Steel bar
    1229
    Successfully executed.
    Last edited by putonajonny; 12-20-2011 at 12:41 AM.

  2. #2
    Join Date
    Jun 2006
    Posts
    694
    Mentioned
    0 Post(s)
    Quoted
    31 Post(s)

    Default

    Simba Code:
    Function GetPrice1(ItemID: Integer): Integer;
      begin
        Result := CashStringToInt(Between('<td>', '</td>', GetPage('http://services.runescape.com/m=itemdb_rs/viewitem.ws?obj=' + IntToStr(ItemID))));
      end;

    Function CashStringToInt(S: string): Integer;  //TomTuff
      Var
        i, ii: Integer;
        Numbs: TStringArray;
        Temp: string;
      begin
        Temp := '';
        Numbs := ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'k', 'm', 'b'];
        for i := 1 to High(S) do
          for ii := 0 to High(Numbs) do
            if S[i] = Numbs[ii] then
              case ii of
                0..9: Temp := Temp + Numbs[ii];
                10..12:
                begin
                  Result := StrToInt(Temp);
                  case ii of
                    10: Result := Result * 100;        
                    11: Result := Result * 100000;    
                    12: Result := Result * 100000000;
                  end;
                end;
              end;
        if (Result = 0) then
          Result := StrToInt(Temp);
      end;

  3. #3
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Mine is a bit more simple Idea using RegExpressions.. Thing is I have no clue why simba bitches about it not being a float.. How in the world is 2.1 NOT a float :S

    Edit: Fixed Commas, Decimals, m, b, k.

    Code:
    var
      Price: String;
      L: Integer;
      
    Begin       
      Price:= GetPrice(15126);
      L:= Length(Price) - 1;
    
      while(ExecRegExpr('[A-z]|,', Price)) do
        if(Pos('b', Price) > 0) then
        begin
          Price:= ReplaceRegExpr('[A-z]', Price, '', true);
          SetLength(Price, Length(Price) - 1);
          Price:= ToStr(StrToFloat(Price) * pow(10, 9));
        end
        else if(Pos(',', Price) > 0) then
        begin
          Price:= ReplaceRegExpr('[A-z]|,', Price, '', true);
          Price:= ToStr(StrToFloat(Price));
        end
        else if(Pos('m', Price) > 0) then
        begin
          Price:= ReplaceRegExpr('[A-z]', Price, '', true);
          Price:= ToStr(StrToFloat(Price) * pow(10, 6));
        end
        else if(Pos('k', Price) > 0) then
        begin
          Price:= ReplaceRegExpr('[A-z]|,', Price, '', true);
          Price:= ToStr(StrToFloat(Price) * pow(10, 3));
        end;
    
      writeln(Price);
    End.
    Last edited by Brandon; 12-19-2011 at 08:14 PM.
    I am Ggzz..
    Hackintosher

  4. #4
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    I've updated it with my own method so choose whichever way you want, do you think this would be a good addition to the includes?



    Quote Originally Posted by ggzz View Post
    Mine is a bit more simple Idea using RegExpressions.. Thing is I have no clue why simba bitches about it not being a float.. How in the world is 2.1 NOT a float :S

    Edit: Fixed it with a quick SetLength..

    Code:
    var
      Price: String;
      L: Integer;
      
    Begin       
      Price:= GetPrice(7158);
      L:= Length(Price) - 1;
    
      if(ExecRegExpr('[A-z]', Price)) then
        if(PosEx('b', Price, L) > 0) then
        begin
          Price:= ReplaceRegExpr('[A-z]', Price, '', true);
          SetLength(Price, Length(Price));
          Price:= ToStr(StrToFloat(Price) * pow(10, 9));
        end
        else if(PosEx('k', Price, L) > 0) then
        begin
          Price:= ReplaceRegExpr('[A-z]', Price, '', true);
          SetLength(Price, Length(Price));
          Price:= ToStr(StrToFloat(Price) * pow(10, 3));
        end
        else if(PosEx('m', Price, L) > 0) then
        begin
          Price:= ReplaceRegExpr('[A-z]', Price, '', true);
          SetLength(Price, Length(Price));
          Price:= ToStr(StrToFloat(Price) * pow(10, 6));
        end;
    
      writeln(Price); 
    End.
    This seems to ignore numbers after the decimal point and doesn't fix the comma issue
    Last edited by putonajonny; 12-19-2011 at 07:25 PM.

  5. #5
    Join Date
    Oct 2011
    Posts
    62
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I've been trying to make myself one of these as well i dont think it works as well as these ones.

    Can someone explain the pos() and copy90 functions please?...

  6. #6
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by putonajonny View Post
    I've updated it with my own method so choose whichever way you want, do you think this would be a good addition to the includes?





    This seems to ignore numbers after the decimal point and doesn't fix the comma issue
    I just fixed/Edited it.. it only ignores decimals on the 'B'.. It's not that it ignores decimals but rather what happened is that when I did strtofloat, it kept the NULL Terminating character.. setlength - 1 did the trick.. It now gets all the decimals.
    I am Ggzz..
    Hackintosher

  7. #7
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by logical View Post
    I've been trying to make myself one of these as well i dont think it works as well as these ones.

    Can someone explain the pos() and copy90 functions please?...
    Simba Code:
    Function Pos(SubString : String; S : String) : Byte;

    Searches for "Substring" within "String", returns the character number of the first character


    Simba Code:
    Function Copy(S : String; Index : Integer; Count : Integer ) : String;

    Returns the character "index" into "S" at "Count" Characters after that, e.g.:

    Simba Code:
    a := 'hello my name is...'
    WriteLn(Copy( a, 7, 2))
    would return "my"

  8. #8
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Sorry, this won't be added into the include, at least not in core.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  9. #9
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    These functions have been made to death.

  10. #10
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    So is there any chance of this being implemented?

  11. #11
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    I'm considering putting this in SRL, thoughts?
    Simba Code:
    program pricestuff;

    type
      TGEItem = record
        p: Integer;
        id: Integer;
        dc: Integer;
        n: String;
      end;

      TGEItemArray = array of TGEItem;

    function ConvertNumber(Number: string): Integer;
    var
      p, i: Integer;
      v: array of TVariantArray;
    begin
      Number := LowerCase(Number);
      v := [TVariantArray(['k', 1000]),
            TVariantArray(['m', 1000000]),
            TVariantArray(['b', 1000000000])];

      for i := 0 to 2 do
      begin
        p := Pos(v[i][0], Number);
        if (p <> 0) then
        begin
          Delete(Number, p, Length(Number));
          try
            Result := Round(StrToFloat(Number) * v[i][1]);
          except
            Writeln(Format('This caused error in StrToFloat (%s): %s',
                           [v[i][0], Number]));
          end;
          Exit;
        end;
      end;
      Result := StrToIntDef(Number, 0);
    end;

    function __GetRegexIndex(s: TStringArray; r: String; l, h: Integer): Integer;
    var
      i: Integer;
    begin
      for i := l to h do
      begin
        if (ExecRegExpr(r, s[i])) then
        begin
          Result := i;
          exit;
        end;
      end;
      Result := 0;
    end;

    // parses RuneScript's GE database for items
    function GetGEItems(v: Variant): TGEItemArray;
    var
      vString, query, page: string;
      rsr: record
        e: string;
        rc: Integer;
      end;
      i, c: Integer;
      pStrs, xStrs: TStringArray;
      pStrsH: Integer;
    begin
      // fix var to a string
      if (VarType(v) <> varString) then
        vString := ToStr(v)
      else
        vString := v;

      // get the actual GE page information, split by lines
      query := ReplaceWrap(vString, ' ', '%20', [rfReplaceAll]);
      query := GetPage('http://rscript.org/lookup.php?type=ge&search=' + query);
      ExplodeWrap(#10, query, pStrs);


      pStrsH := High(pStrs);
      rsr.rc := 0;
      // Count the results and store any errors found. "RESULTS" field is inaccurate
      for i := 0 to pStrsH do
      begin
        if (ExecRegExpr('ERROR:.*', pStrs[i])) then
        begin
          // ERROR Message:
          rsr.e := Copy(pStrs[i], 8, Length(pStrs[i]));
          WriteLn('ERRRRROR: ' + rsr.e);
        end else if (ExecRegExpr('^ITEM:\s', pStrs[i])) then
        begin
          Inc(rsr.rc);
        end;
      end;

      //We didn't find any items, OH NOES
      if (rsr.rc = -1) then
      begin
        WriteLn('No item found.');
        if (rsr.e <> '') then
          WriteLn('GE Database encountered: ' + rsr.e);
        Exit;
      end;

      setLength(Result, rsr.rc);
      c := 0; i := -1;
      // start the item building at the first occurence of 'ITEM:\s'.
      while (c <> rsr.rc) do
      begin
        i := __GetRegexIndex(pStrs, '^ITEM:\s', i+1, pStrsH);
        // explode the string with the item index in here
        xStrs := Explode(' ', pStrs[i]);
        with Result[c] do
        begin
          p := ConvertNumber(xStrs[3]);
          dc := ConvertNumber(xStrs[4]);
          n := ReplaceWrap(Lowercase(xStrs[2]), '_', ' ', [rfReplaceAll]);

          // ID is on another line in the body of the fetched results
          xStrs := Explode(' ', pStrs[i+1]);
          id := StrToIntDef(xStrs[1], -1);
        end;

        Inc(c);
      end;
    end;

    function GetGEPrice(v: variant): Integer;
    var
      Items: TGEItemArray;
      l: Integer;
    begin
      Items := GetGEItems(v);
      l := Length(Items);
      if (l = 0) then
        Result := -1
      else if (l = 1) then
        Result := Items[0].p
      else begin
        Result := Items[0].p;
        WriteLn('GetGEPrice: Found multiple items for ' + v + ' returned first.');
      end;
    end;

    begin
      WriteLn(GetGEPrice('Dragon skirt'));
      WriteLn(GetGEItems('rune plate'));
    end.
    Last edited by Nava2; 12-21-2011 at 01:10 AM.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  12. #12
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    If you do, at least use legitimate names for the GEItem record :|

  13. #13
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    If you do, at least use legitimate names for the GEItem record :|
    But I like being concise!

    Updated a bit..
    Simba Code:
    program pricestuff;

    type
      TGEItem = record
        p: Integer;   // Current Price
        id: Integer;  // ID Tag
        dc: Integer;  // Daily Change
        n: String;    // Human Readable name
      end;

      TGEItemArray = array of TGEItem;

    function ConvertNumber(Number: string): Integer;
    var
      p, i: Integer;
      n: TIntegerArray;
    begin
      Number := LowerCase(Number);
      n := [ord('k'), 1000,
            ord('m'), 1000000,
            ord('b'), 1000000000];

      for i := 0 to 2 do
      begin
        p := Pos(chr(n[i*2]), Number);
        if (p <> 0) then
        begin
          Delete(Number, p, Length(Number));
          try
            Result := Round(StrToFloat(Number) * n[(i*2) + 1]);
          except
            Writeln(Format('This caused error in StrToFloat (%s): %s',
                           [n[i*2], Number]));
          end;
          Exit;
        end;
      end;
      Result := StrToIntDef(Number, 0);
    end;

    function __GetRegexIndex(s: TStringArray; r: String; l, h: Integer): Integer;
    var
      i: Integer;
    begin
      for i := l to h do
      begin
        if (ExecRegExpr(r, s[i])) then
        begin
          Result := i;
          exit;
        end;
      end;
      Result := 0;
    end;

    function GetGEItems(v: Variant): TGEItemArray;
    var
      vString, query, page: string;
      rsr: record
        e: string;
        rc: Integer;
      end;
      i, c: Integer;
      pStrs, xStrs: TStringArray;
      pStrsH: Integer;
    begin
      // fix var to a string
      if (VarType(v) <> varString) then
        vString := ToStr(v)
      else
        vString := v;

      // get the actual GE page information, split by lines
      query := ReplaceWrap(vString, ' ', '%20', [rfReplaceAll]);
      query := GetPage('http://rscript.org/lookup.php?type=ge&search=' + query);
      ExplodeWrap(#10, query, pStrs);


      pStrsH := High(pStrs);
      rsr.rc := 0;
      // Count the results and store any errors found. "RESULTS" field is inaccurate
      for i := 0 to pStrsH do
      begin
        if (ExecRegExpr('ERROR:.*', pStrs[i])) then
        begin
          // ERROR Message:
          rsr.e := Copy(pStrs[i], 8, Length(pStrs[i]));
          WriteLn('ERRRRROR: ' + rsr.e);
        end else if (ExecRegExpr('^ITEM:\s', pStrs[i])) then
        begin
          Inc(rsr.rc);
        end;
      end;

      //We didn't find any items, OH NOES
      if (rsr.rc = -1) then
      begin
        WriteLn('No item found.');
        if (rsr.e <> '') then
          WriteLn('GE Database encountered: ' + rsr.e);
        Exit;
      end;

      setLength(Result, rsr.rc);
      c := 0; i := -1;
      // start the item building at the first occurence of 'ITEM:\s'.
      while (c <> rsr.rc) do
      begin
        i := __GetRegexIndex(pStrs, '^ITEM:\s', i+1, pStrsH);
        // explode the string with the item index in here
        xStrs := Explode(' ', pStrs[i]);
        with Result[c] do
        begin
          p := ConvertNumber(xStrs[3]);
          dc := ConvertNumber(xStrs[4]);
          n := ReplaceWrap(Lowercase(xStrs[2]), '_', ' ', [rfReplaceAll]);

          // ID is on another line in the body of the fetched results
          xStrs := Explode(' ', pStrs[i+1]);
          id := StrToIntDef(xStrs[1], -1);
        end;

        Inc(c);
      end;
    end;

    function GetGEPrice(v: variant): Integer;
    var
      Items: TGEItemArray;
      l: Integer;
    begin
      Items := GetGEItems(v);
      l := Length(Items);
      if (l = 0) then
        Result := -1
      else if (l = 1) then
        Result := Items[0].p
      else begin
        Result := Items[0].p;
        WriteLn('GetGEPrice: Found multiple items for ' + v + ' returned first.');
      end;
    end;

    begin
      WriteLn(GetGEPrice('Dragon skirt'));
      WriteLn(GetGEItems('rune plate'));
    end.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  14. #14
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    This will be added to SRL5 soon.

  15. #15
    Join Date
    Aug 2009
    Location
    Nova Scotia, Canada
    Posts
    604
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    You make this way more complicated than it needs to be.

    Resurrected from one of my old reflection scripts:
    Simba Code:
    function LookupGePrice(ItemId: Integer): Integer;
    var
      S         : String;   // Text of webpage.
      Multiplier: Integer;  // Multiplier (k=1000, m=1000000, b=1000000000).
    begin
      Result := 0;
      S := GetPage('http://services.runescape.com/m=itemdb_rs/viewitem.ws?obj=' + IntToStr(ItemID));
      S := Trim(Between('<td>', '</td>', S));
      if (Length(S) = 0) then
        Exit;
      S := Replace(S, ',', '', [rfReplaceAll]);
      case LowerCase(Copy(S, Length(S), 1)) of
        'k': Multiplier := 1000;
        'm': Multiplier := 1000000;
        'b': Multiplier := 1000000000;
        else
          Multiplier := 1;
      end;
      if (Multiplier > 1) then
        S := Copy(S, 1, (Length(S) - 1));
      Result := Round(StrToFloatDef(S, 0) * Multiplier);
    end;
    Never ever approach a computer saying or even thinking "I will just do this quickly".

  16. #16
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Bixby Sayz View Post
    You make this way more complicated than it needs to be.

    Resurrected from one of my old reflection scripts:
    Simba Code:
    function LookupGePrice(ItemId: Integer): Integer;
    var
      S         : String;   // Text of webpage.
      Multiplier: Integer;  // Multiplier (k=1000, m=1000000, b=1000000000).
    begin
      Result := 0;
      S := GetPage('http://services.runescape.com/m=itemdb_rs/viewitem.ws?obj=' + IntToStr(ItemID));
      S := Trim(Between('<td>', '</td>', S));
      if (Length(S) = 0) then
        Exit;
      S := Replace(S, ',', '', [rfReplaceAll]);
      case LowerCase(Copy(S, Length(S), 1)) of
        'k': Multiplier := 1000;
        'm': Multiplier := 1000000;
        'b': Multiplier := 1000000000;
        else
          Multiplier := 1;
      end;
      if (Multiplier > 1) then
        S := Copy(S, 1, (Length(S) - 1));
      Result := Round(StrToFloatDef(S, 0) * Multiplier);
    end;
    You're making it more complicated than it needs to be.
    Simba Code:
    function GetPrice(id : integer) : integer;
    var
      s : string;
      i : integer;
    begin
      s := between('<td>', '</td>', GetPage('http://services.runescape.com/m=itemdb_rs/viewitem.ws?obj=' + IntToStr(id)));
      if s = '' then exit;
      result := Round(StrToFloat(copy(s, 1, length(s) - integer(ord(s[length(s)]) > 97))) * pow(10, (Integer(s[length(s)] = 'k') * 3) or (Integer(s[length(s)] = 'm') * 6) or (Integer(s[length(s)] = 'b') * 9) or 0));
    end;
    Last edited by Sex; 02-20-2012 at 02:57 AM. Reason: fix'd
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  17. #17
    Join Date
    Aug 2009
    Location
    Nova Scotia, Canada
    Posts
    604
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    Nice.
    Never ever approach a computer saying or even thinking "I will just do this quickly".

  18. #18
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Sex you forgot to lowercase the characters.

  19. #19
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Quote Originally Posted by Dgby714 View Post
    I was bored and made this.

    Is there a way to display .gif files on a form?

    Simba and SCAR:
    SCAR Code:
    program GEGraber;

    var
      frmGE: TForm;
      LabelInfo: TLabel;
      LabelName, LabelMembers, LabelMinP, LabelCIP30: TLabel;
      LabelMedP, LabelCIP90, LabelMaxP, LabelCIP180: TLabel;
      tbSearchText: TEdit;
      buttonSearch: TButton;

    type
      TItem = record
        Name: string;
        Member: boolean;
        MinP: integer;
        MedP: integer;
        MaxP: integer;
        Cip30: extended;
        Cip90: extended;
        Cip180: extended;
        Graph: string;
      end;
      TItemArray = array[0..100] of TItem;
      TSearch = record
        Name: string;
        URL: string;
        Member: boolean;
      end;
      TSearchArray = array[0..100] of TSearch;

    const
      ItemsPerPage = 20;

    function GE_GPToInt(Amount: string): integer;
    var
      Numb, Lett: string;
      TempFloat: extended;
    begin
      Lett := {$IFDEF Simba}ExtractFromStr(Amount, Letters){$ELSE}TrimOthers(TrimNumbers(Trim(Amount))){$ENDIF};
      Numb := Replace(Amount, Lett, ''{$IFDEF Simba}, []{$ENDIF});
      TempFloat := StrToFloatDef(Numb, -1.0);
      if (TempFloat = -1) then
      begin
        Result := -1;
        Exit;
      end;
      case Lett of
        'k': TempFloat := TempFloat * 1000.0;
        'm': TempFloat := TempFloat * 1000000.0;
        '': begin end;
        else
          WriteLn('Unknown Letter in GEToInt(' + Amount + ');');
      end;
      Result := StrToIntDef(FloatToStr(TempFloat), -1);
    end;

    function GE_GetPages(NumbOfItems: integer): integer;
    begin
      if (NumbOfItems = -1) then
      begin
        Result := -1;
        Exit;
      end;
      Result := NumbOfItems / ItemsPerPage;
      Result := NumbOfItems - (Result * ItemsPerPage);
      if (Result > 0) then
        Result := NumbOfItems / ItemsPerPage + 1
      else
        Result := NumbOfItems / ItemsPerPage;
    end;

    function GE_Search(Search: string; Limit: integer): TSearchArray;
    var
      URL, Content, TempStr: string;
      Pages, I, J, K: integer;
    begin
      URL := 'http://services.runescape.com/m=itemdb_rs/results.ws?query=' + Search;
      Content := GetPage(URL);
      if ((Limit = -1) or (Limit = 0)) then
        Limit := 100;

      TempStr := Between('Your search for ''<i>', '</i>'' did not return any results.', Content);
      if (TempStr = Search) then
      begin
        Result[0].Name := '';
        Result[0].URL := '';
        Result[0].Member := False;
        Exit;
      end;

      Pages := GE_GetPages(StrToIntDef(Between('<div id="search_results_text">' + #10, ' items', Content), -1));
      if (Pages = -1) then
      begin
        Result[0].Name := '';
        Result[0].URL := '';
        Result[0].Member := False;
        Exit;
      end;

      K := 0;
      for I := 1 to Pages do
      begin
        if (I <> 1) then
          Content := GetPage(URL + '&page=' + IntToStr(I));
        Content := Between('<tbody>', '</tbody>', Between('<table id="search_results_table" class="row_a">', '</table>', Content));
        for J := 0 to ItemsPerPage - 1 do
        begin
          if (K >= Limit) then
            Exit;

          TempStr := Between('<td><a ', 'a></td>', Content);
          Result[K].Name := Trim(Between('">', '</', TempStr));
          Result[K].URL := Between('href="', '">', TempStr);
          TempStr := Between('<tr', '</tr>', Content);
          Result[K].Member := (Between('<img src="http://www.runescape.com/img/main/serverlist/star_', '.png" alt="', TempStr) = 'members');

          if ((TempStr <> '') and (TempStr <> Content)) then
            Content := Replace(Content, '<tr' + TempStr + '</tr>', ''{$IFDEF Simba}, []{$ENDIF});

          if ((Result[K].Name = '') or (Result[K].URL = '')) then
            Exit;
          Inc(K);
        end;
      end;
    end;

    function GE_GetItem(Item: string): TItem;
    var
      TItemA: TSearchArray;
      Page: string;
      I: integer;
    begin
      TItemA := GE_Search(Item, 10);
      for I := 0 to High(TItemA) do
        if (LowerCase(TItemA[I].Name) = LowerCase(Item)) then
        begin
          Page := GetPage(TItemA[I].URL);
          with Result do
          begin
            Name := TItemA[I].Name;
            Member := TItemA[I].Member;
            MinP := GE_GPToInt(Between('<b>Minimum price:</b> ', #10 + '</span>', Page));
            MedP := GE_GPToInt(Between('<b>Market price:</b> ', #10 + '</span>', Page));
            MaxP := GE_GPToInt(Between('<b>Maximum price:</b> ', #10 + '</span>', Page));
            Cip30 := StrToFloatDef(Between('">', '%', Between('<b>30 Days:</b>', '</span>', Page)), -999);
            Cip90 := StrToFloatDef(Between('">', '%', Between('<b>90 Days:</b>', '</span>', Page)), -999);;
            Cip180 := StrToFloatDef(Between('">', '%', Between('<b>180 Days:</b>', '</span>', Page)), -999);;
            Graph := Between('<td><img name="object" src="', '&amp;scale=0&amp;axis=0" alt=""></td>', Page);
          end;
          Break;
        end;

      if (Result.Name = '') then
        Result.Name := 'Unknown Item';
    end;

    function GE_GetItems(Items: TStringArray): TItemArray;
    var
      I: integer;
    begin
      for I := 0 to High(Items) do
        Result[I] := GE_GetItem(Items[I]);
    end;

    type
      LastSearch = record
        Text: string;
        Time: integer;
      end;

    var
      LastItem: LastSearch;

    procedure OnClick(sender: TObject);
    var
      TempItem: TItem;
      CIP30, CIP90, CIP180: string;
      TimeRemaining: integer;
    begin
      if (tbSearchText.text = '') then
      begin
        LabelInfo.Caption := 'Info: You can''t search for nothing...';
        Exit;
      end;

      if (tbSearchText.text = LastItem.Text) then
        if (LastItem.Time < (GetTickCount - 30000)) then
        begin
          LastItem.Text := '';
          LastItem.Time := 0;
        end;

      if (not (tbSearchText.text = LastItem.Text)) then
      begin
        LastItem.Text := tbSearchText.text;
        LastItem.Time := GetTickCount;
        LabelInfo.Caption := 'Info: Searching for ' + tbSearchText.text;
        Wait(100);
        TempItem := GE_GetItem(tbSearchText.text);
        Wait(100);
        LabelInfo.Caption := 'Info: Showing info for ' + tbSearchText.text;
        LabelName.Caption := 'Item: ' + TempItem.Name;
        LabelMembers.Caption := 'Members: ' + BoolToStr(TempItem.Member);
        LabelMinP.Caption := 'Minimum Price: ' + IntToStr(TempItem.MinP);
        LabelMedP.Caption := 'Market Price: ' + IntToStr(TempItem.MedP);
        LabelMaxP.Caption := 'Maximum Price: ' + IntToStr(TempItem.MaxP);

        CIP30 := FloatToStr(TempItem.Cip30);
        CIP90 := FloatToStr(TempItem.Cip90);
        CIP180 := FloatToStr(TempItem.Cip180);
        if (StrToFloat(CIP30) > 0) then
          CIP30 := '+' + CIP30;
        if (StrToFloat(CIP90) > 0) then
          CIP90 := '+' + CIP90;
        if (StrToFloat(CIP180) > 0) then
          CIP180 := '+' + CIP180;
        LabelCIP30.Caption := 'CIP 30 Days: ' + CIP30 + '%';
        LabelCIP90.Caption := 'CIP 90 Days: ' + CIP90 + '%';
        LabelCIP180.Caption := 'CIP 180 Days: ' + CIP180 + '%';
       
        if (TempItem.Name = 'Unknown Item') then
        begin
          LastItem.Text := '';
          LastItem.Time := 0;
        end;
      end else
      begin
        TimeRemaining := ((LastItem.Time + 30000) - GetTickCount) / 1000;
        LabelInfo.Caption := 'Info: You alredy have info showing for ' + tbSearchText.text +
        #10 + '                                                                          ' +
        '(Retry in ' + IntToStr(TimeRemaining) + 'secs)';
      end;
    end;

    procedure InitForm;
    begin
      frmGE := {$IFDEF Simba}TForm.Create(nil){$ELSE}CreateForm{$ENDIF};
      with frmGE do
      begin
        Left := 471;
        Top := 337;
        {$IFDEF Simba}Width := 325;{$ELSE}Width := 335;{$ENDIF}
        {$IFDEF Simba}Height := 140;{$ELSE}Height := 168;{$ENDIF}
        Caption := 'GEGraber by Dgby714';
      end;

      LabelInfo := TLabel.Create(frmGE);
      with LabelInfo do
      begin
        Parent := frmGE;
        Left := 8;
        Top := 33;
        Width := 26;
        Height := 13;
        Caption := 'Info: ';
      end;

      LabelName := TLabel.Create(frmGE);
      with LabelName do
      begin
        Parent := frmGE;
        Left := 8;
        Top := 48;
        Width := 26;
        Height := 13;
        Caption := 'Item: ';
      end;

      LabelMembers := TLabel.Create(frmGE);
      with LabelMembers do
      begin
        Parent := frmGE;
        Left := 8;
        Top := 64;
        Width := 74;
        Height := 13;
        Caption := 'Members: False';
      end;

      LabelMinP := TLabel.Create(frmGE);
      with LabelMinP do
      begin
        Parent := frmGE;
        Left := 8;
        Top := 88;
        Width := 71;
        Height := 13;
        Caption := 'Minimum Price: 0';
      end;

      LabelCIP30 := TLabel.Create(frmGE);
      with LabelCIP30 do
      begin
        Parent := frmGE;
        Left := 160;
        Top := 88;
        Width := 62;
        Height := 13;
        Caption := 'CIP 30 Days: 0%';
      end;

      LabelMedP := TLabel.Create(frmGE);
      with LabelMedP do
      begin
        Parent := frmGE;
        Left := 8;
        Top := 104;
        Width := 66;
        Height := 13;
        Caption := 'Market Price: 0';
      end;

      LabelCIP90 := TLabel.Create(frmGE);
      with LabelCIP90 do
      begin
        Parent := frmGE;
        Left := 160;
        Top := 104;
        Width := 65;
        Height := 13;
        Caption := 'CIP 90 Days: 0%';
      end;

      LabelMaxP := TLabel.Create(frmGE);
      with LabelMaxP do
      begin
        Parent := frmGE;
        Left := 8;
        Top := 120;
        Width := 77;
        Height := 13;
        Caption := 'Maximum Price: 0';
      end;

      LabelCIP180 := TLabel.Create(frmGE);
      with LabelCIP180 do
      begin
        Parent := frmGE;
        Left := 160;
        Top := 120;
        Width := 71;
        Height := 13;
        Caption := 'CIP 180 Days: 0%';
      end;

      tbSearchText := TEdit.Create(frmGE);
      with tbSearchText do
      begin
        Parent := frmGE;
        Left := 8;
        Top := 8;
        Width := 209;
        Height := 20;
      end;

      buttonSearch := TButton.Create(frmGE);
      with buttonSearch do
      begin
        Parent := frmGE;
        Left := 240;
        Top := 8;
        Width := 75;
        Height := 23;
        Caption := 'Search';
        OnClick := @OnClick;
      end;
    end;

    procedure ShowFormModal;
    begin
      frmGE.ShowModal;
    end;

    var
      TVA: TVariantArray;

    begin
      SetArrayLength(TVA, 0);
      ThreadSafeCall('InitForm', TVA);
      ThreadSafeCall('ShowFormModal', TVA);
    end.
    Weeee

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  20. #20
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    Sex you forgot to lowercase the characters.
    They're already lowercase though ?
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  21. #21
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    They're already lowercase though ?
    Oh. Didn't know for sure.

  22. #22
    Join Date
    Nov 2011
    Location
    Turn Around...
    Posts
    528
    Mentioned
    1 Post(s)
    Quoted
    44 Post(s)

    Default

    I love this community for that particular reason!...Everyone works together to come up with the most logical way
    We are all born ignorant, but one must work hard to remain stupid. - Benjamin Franklin

  23. #23
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Dgby714 View Post
    Weeee
    Fix it.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  24. #24
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    Fix it.
    Sorry, Seems Jagex changed their site since I made that =/

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  25. #25
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Dgby714 View Post
    Sorry, Seems Jagex changed their site since I made that =/
    Fix'd.
    Simba Code:
    program GEGraber;

    var
      frmGE: TForm;
      LabelInfo: TLabel;
      LabelName, LabelMembers, LabelCIP30: TLabel;
      LabelMedP, LabelCIP90, LabelCIP180: TLabel;
      tbSearchText: TEdit;
      buttonSearch: TButton;

    type
      TItem = record
        Name: string;
        Member: boolean;
        MinP: integer;
        MedP: integer;
        MaxP: integer;
        Cip30: extended;
        Cip90: extended;
        Cip180: extended;
        Graph: string;
      end;
      TItemArray = array[0..100] of TItem;
      TSearch = record
        Name: string;
        URL: string;
        Member: boolean;
      end;
      TSearchArray = array[0..100] of TSearch;

    const
      ItemsPerPage = 20;

    function GE_GPToInt(Amount: string): integer;
    var
      Numb, Lett: string;
      TempFloat: extended;
    begin
      Lett := {$IFDEF Simba}ExtractFromStr(Amount, Letters){$ELSE}TrimOthers(TrimNumbers(Trim(Amount))){$ENDIF};
      Numb := Replace(Amount, Lett, ''{$IFDEF Simba}, []{$ENDIF});
      TempFloat := StrToFloatDef(Numb, -1.0);
      if (TempFloat = -1) then
      begin
        Result := -1;
        Exit;
      end;
      case Lett of
        'k': TempFloat := TempFloat * 1000.0;
        'm': TempFloat := TempFloat * 1000000.0;
        'b': TempFloat := TempFloat * 1000000000.0;
        '': begin end;
        else
          WriteLn('Unknown Letter in GEToInt(' + Amount + ');');
      end;
      Result := StrToIntDef(FloatToStr(TempFloat), -1);
    end;

    function GE_GetPages(NumbOfItems: integer): integer;
    begin
      if (NumbOfItems = -1) then
      begin
        Result := -1;
        Exit;
      end;
      Result := NumbOfItems / ItemsPerPage;
      Result := NumbOfItems - (Result * ItemsPerPage);
      if (Result > 0) then
        Result := NumbOfItems / ItemsPerPage + 1
      else
        Result := NumbOfItems / ItemsPerPage;
    end;

    function GE_Search(Search: string; Limit: integer): TSearchArray;
    var
      URL, Content, TempStr: string;
      Pages, I, J, K: integer;
    begin
      URL := 'http://services.runescape.com/m=itemdb_rs/g=runescape/results.ws?query=' + Search;
      Content := GetPage(URL);
      if ((Limit = -1) or (Limit = 0)) then
        Limit := 100;

      TempStr := Between('Your search for ''<i>', '</i>'' did not return any results.', Content);
      if (TempStr = Search) then
      begin
        Result[0].Name := '';
        Result[0].URL := '';
        Result[0].Member := False;
        Exit;
      end;

      Pages := GE_GetPages(StrToIntDef(Between(' of <em>', '</em>', Content), -1));
      if (Pages = -1) then
      begin
        Result[0].Name := '';
        Result[0].URL := '';
        Result[0].Member := False;
        Exit;
      end;

      K := 0;
      for I := 1 to Pages do
      begin
        if (I <> 1) then
          Content := GetPage(URL + '&page=' + IntToStr(I));
        Content := Between('<tr data-item-id="', '</tr>', Content);
        for J := 0 to ItemsPerPage - 1 do
        begin
          if (K >= Limit) then
            Exit;

          TempStr := Between('<a ', 'a>', Content);
          Result[K].Name := Trim(Between('">', '</', TempStr));
          Result[K].URL := Between('href="', '">', TempStr);
          TempStr := Between('<tr', '</tr>', Content);
          Result[K].Member := (Between('<img src="http://www.runescape.com/img/itemdb/', '-icon.png', Content) = 'members');
          Exit;
          if ((TempStr <> '') and (TempStr <> Content)) then
            Content := Replace(Content, '<tr data-item-id="' + TempStr + '</tr>', ''{$IFDEF Simba}, []{$ENDIF});

          if ((Result[K].Name = '') or (Result[K].URL = '')) then
            Exit;
          Inc(K);
        end;
      end;
    end;

    function substr(s : string; st : integer) : string;
    begin
      result := copy(s, st, length(s));
    end;

    function GE_GetItem(Item: string): TItem;
    var
      TItemA: TSearchArray;
      Page: string;
      I : integer;
    begin
      TItemA := GE_Search(Item, 10);
      for I := 0 to High(TItemA) do
        if (LowerCase(TItemA[I].Name) = LowerCase(Item)) then
        begin
          Page := GetPage(TItemA[I].URL);
          with Result do
          begin
            Name := TItemA[I].Name;
            Member := TItemA[I].Member;
            MinP := GE_GPToInt(Trim(Between('<th scope="row">Current guide price:</th>' + #10 + '<td>', '</td>', Page)));
            Cip30 := StrToFloatDef(substr(Between('<th scope="row">30 Day Change:</th>' + #10 + '<td class="', '%</td>', Page), 11), -999);
            Cip90 := StrToFloatDef(substr(Between('<th scope="row">90 Day Change:</th>' + #10 + '<td class="', '%</td>', Page), 11), -999);
            Cip180 := StrToFloatDef(substr(Between('<th scope="row">180 Day Change:</th>' + #10 + '<td class="', '%</td>', Page), 11), -999);
            Graph := Between('<td><img name="object" src="', '&amp;scale=0&amp;axis=0" alt=""></td>', Page);
          end;
          Break;
        end;

      if (Result.Name = '') then
        Result.Name := 'Unknown Item';
    end;

    function GE_GetItems(Items: TStringArray): TItemArray;
    var
      I: integer;
    begin
      for I := 0 to High(Items) do
        Result[I] := GE_GetItem(Items[I]);
    end;

    type
      LastSearch = record
        Text: string;
        Time: integer;
      end;

    var
      LastItem: LastSearch;

    procedure OnClick(sender: TObject);
    var
      TempItem: TItem;
      CIP30, CIP90, CIP180: string;
      TimeRemaining: integer;
    begin
      if (tbSearchText.text = '') then
      begin
        LabelInfo.Caption := 'Info: You can''t search for nothing...';
        Exit;
      end;

      if (tbSearchText.text = LastItem.Text) then
        if (LastItem.Time < (GetTickCount - 30000)) then
        begin
          LastItem.Text := '';
          LastItem.Time := 0;
        end;

      if (not (tbSearchText.text = LastItem.Text)) then
      begin
        LastItem.Text := tbSearchText.text;
        LastItem.Time := GetTickCount;
        LabelInfo.Caption := 'Info: Searching for ' + tbSearchText.text;
        Wait(100);
        TempItem := GE_GetItem(tbSearchText.text);
        Wait(100);
        LabelInfo.Caption := 'Info: Showing info for ' + tbSearchText.text;
        LabelName.Caption := 'Item: ' + TempItem.Name;
        LabelMembers.Caption := 'Members: ' + BoolToStr(TempItem.Member);
        LabelMedP.Caption := 'Guide Price: ' + IntToStr(TempItem.MinP);

        CIP30 := FloatToStr(TempItem.Cip30);
        CIP90 := FloatToStr(TempItem.Cip90);
        CIP180 := FloatToStr(TempItem.Cip180);
        if (StrToFloat(CIP30) > 0) then
          CIP30 := '+' + CIP30;
        if (StrToFloat(CIP90) > 0) then
          CIP90 := '+' + CIP90;
        if (StrToFloat(CIP180) > 0) then
          CIP180 := '+' + CIP180;
        LabelCIP30.Caption := 'CIP 30 Days: ' + CIP30 + '%';
        LabelCIP90.Caption := 'CIP 90 Days: ' + CIP90 + '%';
        LabelCIP180.Caption := 'CIP 180 Days: ' + CIP180 + '%';

        if (TempItem.Name = 'Unknown Item') then
        begin
          LastItem.Text := '';
          LastItem.Time := 0;
        end;
      end else
      begin
        TimeRemaining := ((LastItem.Time + 30000) - GetTickCount) / 1000;
        LabelInfo.Caption := 'Info: You alredy have info showing for ' + tbSearchText.text +
        #10 + '                                                                          ' +
        '(Retry in ' + IntToStr(TimeRemaining) + 'secs)';
      end;
    end;

    procedure InitForm;
    begin
      frmGE := {$IFDEF Simba}TForm.Create(nil){$ELSE}CreateForm{$ENDIF};
      with frmGE do
      begin
        Left := 471;
        Top := 337;
        {$IFDEF Simba}Width := 325;{$ELSE}Width := 335;{$ENDIF}
        {$IFDEF Simba}Height := 140;{$ELSE}Height := 168;{$ENDIF}
        Caption := 'GEGraber by Dgby714';
      end;

      LabelInfo := TLabel.Create(frmGE);
      with LabelInfo do
      begin
        Parent := frmGE;
        Left := 8;
        Top := 33;
        Width := 26;
        Height := 13;
        Caption := 'Info: ';
      end;

      LabelName := TLabel.Create(frmGE);
      with LabelName do
      begin
        Parent := frmGE;
        Left := 8;
        Top := 48;
        Width := 26;
        Height := 13;
        Caption := 'Item: ';
      end;

      LabelMembers := TLabel.Create(frmGE);
      with LabelMembers do
      begin
        Parent := frmGE;
        Left := 8;
        Top := 64;
        Width := 74;
        Height := 13;
        Caption := 'Members: False';
      end;

      LabelCIP30 := TLabel.Create(frmGE);
      with LabelCIP30 do
      begin
        Parent := frmGE;
        Left := 160;
        Top := 88;
        Width := 62;
        Height := 13;
        Caption := 'CIP 30 Days: 0%';
      end;

      LabelMedP := TLabel.Create(frmGE);
      with LabelMedP do
      begin
        Parent := frmGE;
        Left := 8;
        Top := 104;
        Width := 66;
        Height := 13;
        Caption := 'Guide Price: 0';
      end;

      LabelCIP90 := TLabel.Create(frmGE);
      with LabelCIP90 do
      begin
        Parent := frmGE;
        Left := 160;
        Top := 104;
        Width := 65;
        Height := 13;
        Caption := 'CIP 90 Days: 0%';
      end;

      LabelCIP180 := TLabel.Create(frmGE);
      with LabelCIP180 do
      begin
        Parent := frmGE;
        Left := 160;
        Top := 120;
        Width := 71;
        Height := 13;
        Caption := 'CIP 180 Days: 0%';
      end;

      tbSearchText := TEdit.Create(frmGE);
      with tbSearchText do
      begin
        Parent := frmGE;
        Left := 8;
        Top := 8;
        Width := 209;
        Height := 20;
      end;

      buttonSearch := TButton.Create(frmGE);
      with buttonSearch do
      begin
        Parent := frmGE;
        Left := 240;
        Top := 8;
        Width := 75;
        Height := 23;
        Caption := 'Search';
        OnClick := @OnClick;
      end;
    end;

    procedure ShowFormModal;
    begin
      frmGE.ShowModal;
    end;

    var
      TVA: TVariantArray;

    begin
      SetArrayLength(TVA, 0);
      ThreadSafeCall('InitForm', TVA);
      ThreadSafeCall('ShowFormModal', TVA);
    end.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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