A simple script to hook to the games' WebSocket connection an broadcasts the received messages in custom events
2017-06-12 13:36 - v0.3
- added
roa-ws:page:*events
2017-05-30 11:28 - v0.2
- initial version
Pick one speciffic to listen to from the list below. All are prepended with roa-ws:
battleharvestcraftcarvegamestatsmychansmotdlogin_infomessagenotificationpage- theroa-ws:pageevent is still broadcasted, following are additional events for if you'd want to monitor only a speciffic page:page:updatespage:townpage:town_battlegroundspage:housepage:house_roompage:house_room_item-data.itemcontains info about a given roompage:clanspage:clan_memberspage:clan_treasury- Fundspage:clan_buildingspage:trainingpage:boostspage:questspage:inventory_items- Same for Weapon and Armor, thedata.item_typetells you which ..weapons/armorpage:inventory_toolspage:inventory_gemspage:inventory_accessoriespage:inventory_ingredientspage:inventory_consumablespage:settings_milestones- for all Milestones,data.milestone_typetells you which page ..PREMIUM/FAME/LEVEL/[TS type]_LEVELetc. andPROGRESS_CHECKfor an overview
^ These are just examples and, while an extensive list, there are more. Inspect the websocket frames to find more.
Note: "general" include events that do not have a type, if there are any.
From your userscript you can listen to these custom events with the following examples
// to listen to battle updates use
$(document).on("roa-ws:battle", function(e, data){
console.log(data); // data has parsed JSON data from the WebSocket event
});
// to listen to TS updates use
$(document).on("roa-ws:harvest", function(e, data){
console.log(data); // data has parsed JSON data from the WebSocket event
});
// crafting updates
$(document).on("roa-ws:craft", function(e, data){
console.log(data); // data has parsed JSON data from the WebSocket event
});
// chat messages
$(document).on("roa-ws:message", function(e, data){
console.log(data); // data has parsed JSON data from the WebSocket event
});
// Crystal Shop popup window
$(document).on("roa-ws:page:boosts", function(e, data){
console.log(data); // data has parsed JSON data from the WebSocket event
});
// or monitor them all - for fun ?
$(document).on("roa-ws:all", function(e, data){
console.log(data); // this is the raw data received from websocket (usually a JSON encoded string)
});