euphemism

BarPrice

Jan 1st, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.84 KB | None | 0 0
  1. function GetProfit(WhatBar: String; out Profit: Integer): Boolean;
  2. var
  3.   Page, BarProfit, BarString, BarType: String;
  4. begin
  5.  
  6.   Result := False;
  7.  
  8.   case LowerCase(WhatBar) of
  9.  
  10.     'bronze':  BarType := 'Bronze';
  11.     'iron':    BarType := 'Iron';
  12.     'silver':  BarType := 'Silver';
  13.     'steel':   BarType := 'Steel';
  14.     'gold':    BarType := 'Gold';
  15.     'mithril': BarType := 'Mithril';
  16.     'adamant': BarType := 'Adamant';
  17.     'rune':    BarType := 'Rune';
  18.  
  19.   end;
  20.  
  21.   BarType := '</td><td> <span class="GEIcon"><a href="/wiki/' + BarType + '_bar';
  22.  
  23.   Page := GetPage('http://runescape.wikia.com/wiki/Calculator:Magic/Superheat');
  24.  
  25.   BarString := Between(BarType, '<tr>', Page);
  26.  
  27.   BarProfit := Between('>', '<', Between('e="c', '/s', BarString));
  28.  
  29.   Profit :=StrToIntDef(BarProfit, -1337);
  30.  
  31.   Result := (Profit <> -1337);
  32. end;
Advertisement
Add Comment
Please, Sign In to add comment