Try using the program \"X-mouse button control\". You can set all sorts of key combinations for different mouse buttons. What I do is set the middle mouse button to \"Simulated Keys\", set the key sequence to \'{LMB}\', then set \"How to send the key strokes\" to \'6 Repeatedly while button is down\', set the auto repeat delay to 10.
Now, when you hold down the middle mouse button, you are actually sending 100 left button clicks per second, and you\'ll refine a 255 stack in 3 seconds!