Skip to content

RubySometimes/alchrb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alch.rb

A simplistic Runescape Alchemy API that can help you get alch prices of certain items.

Installation

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'

Dependencies

Ruby 2.0 and up

Usage Examples

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)

Full Documentation

View the Full Documentation

Releases

No releases published

Packages

No packages published

Languages