# Remove this line! orgfree doesn't seem to like perl files #!/usr/bin/perl require LWP::UserAgent; $ua=LWP::UserAgent->new; $ua->timeout(3000); # List of ID's of items of interest # This is at the end of the URL for the GE database page for that item # For example, 7936 is pure essence, from the URL # http://services.runescape.com/m=itemdb_rs/Pure_essence/viewitem.ws?obj=7936 @items=(453,451,2363,449,2361,2359,43,6034,536,11284,560,7936,8782,8778,6016,11730,5297,1925,5100,12776,12123,12788); # This hash automatically updates itself... no need to change! %price=( 453=>273, 451=>17000, 2363=>19600, 449=>1182, 2361=>3055, 2359=>1642, 43=>160, 6034=>1012, 536=>5184, 11284=>34900000, 560=>388, 7936=>123, 8782=>1902, 8778=>551, 6016=>4343, 11730=>9500000, 5297=>537, 1925=>36, 5100=>1447, 12776=>2604, 12123=>270, 12788=>3772, ); # Update prices $prices=""; for $id(@items){ $r=$ua->get("http://itemdb-rs.runescape.com/viewitem.ws?obj=$id"); if($r->is_success and $r->content=~/Market price:<\/b> ([\d,.]+[mk]?)/){ $curr=$1; $curr=~s/,//g; if($curr=~s/m//){$curr*=1000000;} if($curr=~s/k//){$curr*=1000;} $curr=int($curr); $r->content=~/(.*)\n<\/div>\n
status_line,"\n"; } $prices.="\t$id=>$price{$id},\n"; sleep 1; } # Add lines here to keep track of combinations of the above prices, for example profit/loss of training methods print "Addy bar - 15 tips = ",$price{2361}-15*$price{43},".\n"; # Update previous price list open FILE,"; } close FILE; $str=~s/\%price=\([^\)]*\)/\%price=\(\n$prices\)/; open FILE,">rspc.pl"; print FILE $str; close FILE; # Pause print "Done, press enter.\n"; ;