Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Name(Account) joined our world. Diablo's minions grow stronger.
- RegisterEvent(EVENT_GAMEMSG,
- function (msg, type) {
- if (type === 4 && msg.indexOf('stronger') > -1) { // join message
- var userName = msg.split('(')[0]; // split is ["Name", "Account) joined our world. Diablo's minions grow stronger."]
- // split[0] is "Name"
- // for reference only, can be done in one line with 2 splits as well - var userAccount = msg.split('(')[1].split(')')[0];
- var userAccount = msg.split('(')[1]; // split is ["Name", "Account) joined our world. Diablo's minions grow stronger."]
- // split[1] is "Account) joined our world. Diablo's minions grow stronger."
- userAccount = userAccount.split(')')[0]; // split is ["Account", " joined our world. Diablo's minions grow stronger."]
- // split[0] is "Account"
- Print(userName + " " + userAccount);
- Say("/ignore " + userName);
- }
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement