In mIRC Options -> Connect -> Options -> Perform (button):
[x] Enable perform on connect
Click Add -> Quakenet -> OK
In the text box:
Code:
/g
/gg

Click OK
Click OK