Is there a way to switch case by scrolling? I want it so that when I scroll up, the cases change in one direction, and when I scroll down, the cases change in the other direction. I hope that makes sense.
I have figured out how to achieve this using hotkeys, but now I am looking for a solution that involves scrolling (without clicking on the scroll).
document.addEventListener('keydown', function (e) {
if (ws) {
switch (e.keyCode) {
// T
case 84:
if (player.items[ITEM_TYPE.WINDMAIL]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.WINDMAIL].id + ",null]");
break;
// G
case 71:
e.stopPropagation();
if (player.items[ITEM_TYPE.SPIKES]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.SPIKES].id + ",null]");
break;
// Z
case 90:
e.stopPropagation();
if (player.items[ITEM_TYPE.EXTRAS]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.TURRET].id + ",null]");
break;
// F
case 70:
e.stopPropagation();
if (player.items[ITEM_TYPE.PITTRAP]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.PITTRAP].id + ",null]");
break;
}
}
}, true);
The above code works well with hotkeys, but my goal is to achieve the same functionality using scrolling instead. Can anyone provide assistance?