Erm. Well. Trying to describe this verbally would be exceedingly difficult. I'll be happy to give you a couple of pointers, but trying to describe Lego construction verbally is virtually impossible. I've long since taken apart the Lego bot to free up parts for other projects, so I can't really look at anything more than the online pictures, anyway. Have you looked into macro recording keyboards? I know EQ is programmed to exclude external software macro/cheat systems, but they make keyboards that store repeated keypresses in their own internal memory, unrelated to the computer's memory. That may do all you need, and it will likely come out cheaper than Lego parts. The Lego Technics set I used has now been rolled into the Mindstorms set, which is hugely expensive. You might consider Erector sets. You can do all of the same things, and as I remember, the basic erector motor is already geared way down with an internal gearbox, which will save you much trouble in the long run. Or, Lego may make a motor with an integral gearbox as part of the mindstorms set. It'd be worth the cost.
Oh, BTW, If I'm being too simplistic with the below, forgive me. It's not condescension. It's just that I never know how much background experience people have in this kind of thing, and it's easier to be too basic than have to go back and explain later. There is a lot here, even leaving out the basics of Lego gearbox design, so bear with me.
The first thing I would suggest is taking a look at: http://www.owlnet.rice.edu/~elec201/Course_Notes.htm. It is the course notes for a Rice University class involving designing robots out of Lego, as a non-engineering major's introduction to engineering. It has good sections on building Lego gearboxes. I cannot describe to you how to do that. You're on your own there. My Lego kit is like 15 years old, anyway, so the Lego parts (especially the motors!) are radically different now. You will need to gear down the Lego motor significantly in order to make it useful. This is for two reasons. One, if you let the mechanism run at the full speed of the motor, it will move much too fast for EQ to accept the keypresses. BTW, if you just need one key repeated, simply put a heavy weight on the macro key you've programmed in-game, and let EQ just reject 9 out of ten of the repeats- works great for building up find direction or building up mage spells like summon food (just let it pile up on the ground as a public service) or that nifty one that sends out a harmless ball of light (flare? been a while), or whatever. Two, the basic Lego motor will be too weak to reliably press buttons at the end of a long arm. I can't tell you how to do this. You have to experiment with it. See the reference above for hints. If you look at the picture of the side view, you'll see something interesting. Every gear except the last big gear on the right is there solely to slow down and power up the Lego motor. If you can find a prefab Lego motor with speed reduction already built in, you're like 70% done. Gearbox design is a bit tedious, and generally requires a lot of false starts and reworking. Skim thru the course notes above for help if you do end up building your own gearbox. I know it's daunting, as it was intended as a full semester textbook, but most of the topics won't apply to you, and can be safely skipped. (I haven't read all of it, either- a friend of mine took the course, and asked me for mechanical advice, so I skimmed parts of it.) The tips on gearing and Lego design should be looked at, though, as they'll save you some trial-and-error work.
I can give you some ideas about the actual bits
of the machine that interface with the keyboard, though. There's two
basic, key parts you have to make:
1) A reciprocating arm (well, two of them)
2) A cam driven switch
The reciprocating arm assembly starts with the last big gear on the right (there are two recip arms. The other side is a mirror image, with the arm designed to lift 180 degrees out of phase, if I remember correctly, such that one is up while the other is down). Ignoring all the step-down gearbox components, the reciprocating arm that actuall presses the keys is simply a big rotating gear, a vertical shaft, and a hinged horizontal bar. Look at the third picture on the webpage. You can see the big grey gear at the right, and the yellow vertical shaft, and the long horizontal hinged bar. At the end of the horizontal bar is a little finger with a rubber Lego tire, designed to press the key better. It's unimportant to the mechanism otherwise. Now, compare the Lego photo to the attached schematic picture I just whipped up in AutoCAD, rec-arm.gif. The schematic is four "snapshots" of the positions of the mechanism at four times in it's rotation, numbered steps one through four. These have nothing to do with the steps mentioned on the webpage. They're just for convenience as we talk here.
At snapshot one, the vertical shaft (I'll call it "shaft" from now on) is in it's middle position, being pulled up by the rotating gear. It's pinned, off center, to the gear, as you can see. As the shaft in step 1 is being pulled up, it pulls the horizontal hinged bar (the "bar") up on one end. It acts like a see-saw, so the right end of the bar will be pushed down as the left end is pulled up. So, the gear turns, pulling the shaft upwards, and see-sawing the right end of the bar (the button pressing end) downward.
At snapshot two, the vertical shaft has been pulled to it's highest point, and the gear has started to push it back down again. The bar end will have been pulled up to it's highest point, and the other end see-sawed down to it's lowest, at this step. The keyboard button should be fully depressed by this point. You'll need to experiment with exact heights and friction for the finger (or however the bar interfaces with the keyboard), such that the key is just pressed, but the whole robot isn't lifted up as the key bottoms out. You'll see I have a black tire on my finger, which is just friction fit, so I can push it up or down a bit for fine tuning. When I started out, the whole thing would tend to walk all over the place. Rubber feet and heavy weights (like the battery pack on the top) help in that regard.
At snapshot three, the shaft is again in it's middle position, but on the opposite side. The bar has again been lifted to it's horizontal position, away from the keyboard key again. The wheel is turning, and continuing to lower the shaft, and raise the button pressing end of the bar.
And finally, at snapshot four, you'll see the shaft is at it's lowest position, and the button pressing end of the bar is at it's highest point. It's just starting to lower, and return to position one again. And the cycle then repeats.
If you wanted two buttons, like I have, you'd make a mirror image duplicate of the reciprocating arm assembly, on the other side of the framework, and mounted on the other end of the same drive-shaft. Depending on your task, you'll need to adjust the phase of the two arms. For example, you might rotate the large drive gear on arm two such that it's in position three while the first arm is on position one. In this way, the keys will be pressed sequentially, such that your Everquest in-game macros go off in the right order. You can see how mine is done in the pictures, sort of. And, if you can do all you need to do from the keyboard, you don't need to go on.
However, if you need mouse clicking as part of your programming/macroing, you'll need to make some kind of cam switch. There are many ways to do this. Probably, you'll need to buy a cheap mouse to sacrifice to the cause. (Don't do this with your new hundred dollar optical mouse!) Open the case of the mouse. Look under the left mouse button. There'll be some kind of switch mechanism. To either side of the switch, there'll be a wire or contact. Now, this is the tricky bit. Get a long length of two-stranded wire. Two strand ribbon cable or bell wire (for making dollhouses and model train sets) works great. You'll want several feet, so you can still use your mouse without jerking the wire around too much. Now, take one end of the dual-wire, strip the ends, and affix it so that one wire is on each side of the switch. Solder is good, if you know how, or otherwise you'll just have to twist it around wires or something. Your goal is to still leave the regular mouse button operating, since most machines get all snarky if you switch mouses while they are booted up. You want a working mouse to start with (also necessary if you need to deal with an in-game emergency whilst using the 'bot). Anyway, once you've affixed the wires around the switch for the left mouse button, you'll want to test it. Strip the other end of the two strands of wire. Now, you should be able to touch the bare ends of the wire together and get the left mouse button to signal/click. Test it while running something else. Don't worry, it's only 5 volts. You should be able to click and drag using the bare wire ends just like using the mouse button. If not, check your connections. The wire, with the stripped ends held together, should short across the mouse button, effectively making a redundant button- which will be our goal here.
Now, put your mouse back together. You may need to take a knife or file to cut a groove in the mouse casing for the new ribbon cable. I used zip-ties to hold the ribbon cable to the mouse cable partway down, to minimize the clutter of loose wires on my desk. Making the second mouse button switch is relatively simple. You can go buy one at Radio Shack. You want a Normally Open, Momentary Connect switch. The one I used is visible in the last picture. (I just had it laying around from another project). Big heavy buttons are not advised, as the springs are heavy and hard to press with puny Lego parts. Or, you can make your own simple reed switch. You just need a length of flexible metal and a contact. Affix the metal to a little piece of wood, or a Lego brick, or whatever. When the metal strip is pressed down, it should touch a metal contact, and spring back up to break the circuit when released. Affix one bared wire end to the contact, the other to the flexible metal strip. I'm sure you've seen this kind of thing before- like old-timey morse code keys, or just about every electronics science project you ever saw in elementary school. See the schematic sketch for one way to make a reed switch. A small round-head machine screw, screwed directly into the top of a Lego brick, would work fine for a contact, or just about anything else conductive will do. You may need to use a screw to hold down your reed on the non-moving end. You'll need to permanently modify or glue your Lego block to do this, no matter what. Plain old superglue (the watery kind, not the gel) works great for Lego plastics- use sparingly, or the Lego will melt/deform. I glued my switch to the side of a Lego block, as you can see.
Anyway, so now you have a second, remote button for your mouse. You should be able to left-click with either button. Now, you need a cam assembly to press the remote switch. You'll want to make your cam turn at the same rate as your key-pressing arms. This means attaching it to the same drive shaft somehow. You can see how I did it, but the switch for me was an afterthought. You can probably more easily build it into your Lego mechanism without the bulky sidecar like I have. The cam is simple. Take a Lego gear or pulley, and shove the drive-shaft through it in one of the off-center holes. And let the gear just intermittently press the switch closed as it rotates. Look at the camswitch.gif schematic.
You can see that the cam only contacts the switch on step four as it rotates around. Alternately, if your switch requires it, you can put the gear/pulley centered on the driveshaft, and use a peg shoved through it off-center to flick the switch as it passes. This is what I did, since my switch worked better that way (it had a heavy spring). But my geartrain bogged down a bit trying to press it, every rotation, and really strained the motor and drained batteries. However, if you go with the home-made reed switch, and your metal reed is long and flexible, the off center cam shown in the schematic .gif will work a lot better, as it puts much less strain on the Lego drivetrain. It will gently roll the reed closed, instead of trying to flick the switch all at once like mine. And if you mount your reedswitch on a Lego brick, you'll be able to fairly easily integrate it into your design.
From there, it's just a matter of programming. My switch was 90 degrees out of phase with each of the reciprocating arms. So, for example, if we number each 90 degrees of rotation, the left arm was pressing it's key on one (0 degrees turned), the mouse click on two (90 degrees), the right arm presses on three (180 degrees), and nothing was pressed on four (270 degrees). Or, you can rotate the gears such that things happen in any order you need. Note that the pause on step four can be useful, too, depending on how fast your mechanism runs, as EQ takes time to do operations (like opening and closing backpacks). As mentioned on the webpage, some operations are ignored due to current game status (like trying to fish while your backpack is open). You'll need to figure these things out, and program your macros and set the order/phase of your operations accordingly. And, of course, you'll have to manually place your mouse pointer before you start, and avoid jostling it (a wide rubber band around the lower half will keep it from sliding easily, and can be removed quickly). And keep an eye on your guy. The GMs and other players take a dim view of this kind of thing, and will likely jack with you if you do it in the open unattended. Not to mention the occasional aggressive mob if you do this outside of guard-view.
Good luck, and let me know how it comes out! If you have the capability, I'd love to see pictures!
-Nathan