Giter VIP home page Giter VIP logo

warchat's Introduction

Warchat

This project aims to create a simple ruby interface for connecting to Blizzard’s Mobile Guild Chat.

Features

  • SRP authentication

  • Guild Chat

  • Officer Chat

  • Whispers

  • Presence notifications

Acknowledgements

A big thanks to Eike Siewertsen (www.github.com/fry), without whom this probably wouldn’t be possible.

Simple Usage example

This is a simple chat client that will let you talk in guild chat and receive messages.

require 'rubygems'
require 'warchat'

USERNAME = ''
PASSWORD = ''
CHARACTER_NAME = ''
CHARACTER_REALM = ''
HOST = "m.us.wowarmory.com" 
#HOST = "m.eu.wowarmory.com"
#HOST = "m.kr.wowarmory.com"
PORT = 8780

client = Warchat::Chat::Client.new

client.on_establish = Proc.new do |response|
  client.login CHARACTER_NAME,CHARACTER_REALM
end

client.on_message = Proc.new do |message|
  case message.type
    when Warchat::Chat::Message::CHAT_MSG_TYPE_GUILD_CHAT
      puts "[Guild] #{message.character.name}: #{message.body}"
    when Warchat::Chat::Message::CHAT_MSG_TYPE_GUILD_MOTD
      puts "MOTD: #{message.body}"
    when Warchat::Chat::Message::CHAT_MSG_TYPE_OFFICER_CHAT
      puts "[Officer] #{message.character.name}: #{message.body}"
    when Warchat::Chat::Message::CHAT_MSG_TYPE_WHISPER
      puts "[Whisper] #{message.character.name}: #{message.body}"
  end
end

begin
  client.start(USERNAME,PASSWORD,HOST,PORT)
  loop do 
    msg = gets.chomp 
    client.message msg,Warchat::Chat::Message::CHAT_MSG_TYPE_GUILD_CHAT
  end
rescue Interrupt => e
  client.close
end

warchat's People

Contributors

zgavin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.