jaytea commented on a Page, Auto-identify/auto-join by Hermes v2  -  Apr 02, 2011

Or you could do it with the binary way:

this is a good idea and generally my method of choice, but what you have there won't quite work.

breplace &auto 13 44 10

this will certainly replace $chr(13) with $chr(44), but will do nothing with $chr(10)s since you haven't given it a byte value with which to replace them. modifying the width of a binary variable (for example, removing characters) isn't a trivial low level operation, and it's not something that is made possible with /breplace alone. so this snippet sends "JOIN #chan1,\n#chan2,\n#chan3,\n" to the server, which only succeeds in joining #chan1, but then throws errors "#CHAN2, Unknown command" and "#CHAN3, Unknown command" etc.

you can get around this by also replacing $chr(10) with a comma ('breplace &a 13 44 10 44') or forgoing /breplace altogether and using join $replace($bvar(&auto, 1-).text, $crlf, $chr(44)). the first option sends extraneous commas to the server, in between channels, which are safely ignored. the only conceivable drawback to sending these unnecessary commas is if it causes the length of the overall command to exceed the 512 byte limit imposed on the length of raw messages received by the server. but when's the last time you've send someone send such a long /join line? :P as for Dean's single extra comma, certainly not a bug since it doesn't alter the behaviour or results of the code, and it's an extremely unimportant detail at the end of the day.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.