A simplistic Runescape Alchemy API that can help you get alch prices of certain items.
You can get the newest gem of Alch.rb. Just enter the following in your command line:
$ gem install alch
That's it! You are now able to include the API into your projects.
If you plan on using alch in a class or file, you have to require it at the top of your Ruby file, like so:
require 'alch'
Ruby 2.0 and up
A very basic use case:
require 'alch'
# Create ruby and nature rune items
item = Item.new(1603)
nature_rune = Item.new(Runes::NATURE_RUNE_ID)
# output => 'Profit from alching Ruby: -692'
print "Profit from alching #{item.name}: "
puts item.high_alch - (item.price + nature_rune.price)
Alternatively, you can also get the Item's ID by the Item's name.
require 'alch'
# Create ruby and nature rune items
item = Item.new(Item.id_by_name('ruby'))
nature_rune = Item.new(Runes::NATURE_RUNE_ID)
# output => 'Profit from alching Ruby: -692'
print "Profit from alching #{item.name}: "
puts item.high_alch - (item.price + nature_rune.price)