Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joeychilson/osrscache
A library for reading the Old School Runescape cache.
https://github.com/joeychilson/osrscache
cache go jagex osrs runescape
Last synced: 1 day ago
JSON representation
A library for reading the Old School Runescape cache.
- Host: GitHub
- URL: https://github.com/joeychilson/osrscache
- Owner: joeychilson
- License: mit
- Created: 2024-07-06T12:07:47.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-20T23:21:28.000Z (3 months ago)
- Last Synced: 2024-08-21T01:05:55.017Z (3 months ago)
- Topics: cache, go, jagex, osrs, runescape
- Language: Go
- Homepage:
- Size: 147 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# osrscache
A Go library for reading the Old School Runescape cache.
Note: This library is still under development.
## Usage
```go
package mainimport (
"log"
"time""github.com/joeychilson/osrscache"
"github.com/joeychilson/osrscache/openrs2"
)func main() {
startTime := time.Now()store, err := openrs2.Open("./cache")
if err != nil {
log.Fatalf("opening store: %v", err)
}cache := osrscache.New(store)
items, err := cache.Items()
if err != nil {
log.Fatalf("getting items: %v", err)
}
log.Printf("loaded %d items", len(items))npcs, err := cache.NPCs()
if err != nil {
log.Fatalf("getting npcs: %v", err)
}
log.Printf("loaded %d npcs", len(npcs))objs, err := cache.Objects()
if err != nil {
log.Fatalf("getting objects: %v", err)
}
log.Printf("loaded %d objects", len(objs))structs, err := cache.Structs()
if err != nil {
log.Fatalf("getting structs: %v", err)
}
log.Printf("loaded %d structs", len(structs))enums, err := cache.Enums()
if err != nil {
log.Fatalf("getting enums: %v", err)
}
log.Printf("loaded %d enums", len(enums))sprites, err := cache.Sprites()
if err != nil {
log.Fatalf("getting sprites: %v", err)
}
log.Printf("loaded %d sprites", len(sprites))textures, err := cache.Textures()
if err != nil {
log.Fatalf("getting textures: %v", err)
}
log.Printf("loaded %d textures", len(textures))log.Printf("took: %v", time.Since(startTime))
}
```## Acknowledgements
- [runelite](https://github.com/runelite/runelite)
- [osrs-wiki](https://github.com/osrs-wiki/cache-mediawiki)
- [openrs2](https://github.com/openrs2/openrs2)