Brandon
2011-07-27 15:53:45
[ATTACH]11480[/ATTACH] [ATTACH]11481[/ATTACH]
I noticed that when Smart is minimized and then restored to the screen, it has to regain focus and it has to Re-enter a thread.. but that thread only checked for mouse clicks on the client I believe.. so I added the part for detecting keyboard events.. Also when smart is just starting up (not at login screen yet), all keyboard and mouse events are passed through the eventnazi without lag.
Another problem is that Smart only allows input through the event nazi when the mouse is clicks on the client.. So while smart is using the mouse, input cannot go through… U'd have to either minimize/restore smart to restart the thread for input.. or u can spam click the client really fast while typing with another hand to get input to the screen.. This is because it gains focus when you click the screen for some reason.. I looked at the ClickMouse procedure and noticed it does getfocus().. but the movemouse one doesn't so while the mouse moves, u can't type.. and while its clicking, u can type.. but our scripts click so fast the input doesn't go through..
Below is my edits to the client that lets input through after u minimized a couple times to re-enter the thread.. Right now Im typing right through smart just like RSBuddy and RSBot but it only works after I after the thread is transfered.. so basically when your script logs u in and starts, just minimize and restore twice.. and let the script do whatever.. if u try typing, it will go straight through without lag.. Tested with My fungus script, Flight's ZMI and Livid Farmer.
Bugs: Sometimes the first letter of a sentence doesn't go through but this is rare..
Client.Java
I noticed that when Smart is minimized and then restored to the screen, it has to regain focus and it has to Re-enter a thread.. but that thread only checked for mouse clicks on the client I believe.. so I added the part for detecting keyboard events.. Also when smart is just starting up (not at login screen yet), all keyboard and mouse events are passed through the eventnazi without lag.
Another problem is that Smart only allows input through the event nazi when the mouse is clicks on the client.. So while smart is using the mouse, input cannot go through… U'd have to either minimize/restore smart to restart the thread for input.. or u can spam click the client really fast while typing with another hand to get input to the screen.. This is because it gains focus when you click the screen for some reason.. I looked at the ClickMouse procedure and noticed it does getfocus().. but the movemouse one doesn't so while the mouse moves, u can't type.. and while its clicking, u can type.. but our scripts click so fast the input doesn't go through..
Below is my edits to the client that lets input through after u minimized a couple times to re-enter the thread.. Right now Im typing right through smart just like RSBuddy and RSBot but it only works after I after the thread is transfered.. so basically when your script logs u in and starts, just minimize and restore twice.. and let the script do whatever.. if u try typing, it will go straight through without lag.. Tested with My fungus script, Flight's ZMI and Livid Farmer.
Bugs: Sometimes the first letter of a sentence doesn't go through but this is rare..
Client.Java
blitThread = createBlitThread();
BlockingEventQueue.addComponent(canvas, new EventRedirect() {
@Override
public void dispatched(AWTEvent e) {
if ((e instanceof MouseEvent && e.getID() == MouseEvent.MOUSE_CLICKED) || (e instanceof KeyEvent)){ [B]//Added the KeyEvent Part..[/B]
clientFrame.requestFocusInWindow();
}
}
});
EventNazi.java Added the getfocus and loosefocus..
public synchronized Point windMouse(int x, int y) {
if (canInteract()) {
if (!focused) getFocus();
double speed = (Math.random() * 15D + 15D) / 10D;
if (!mousein) looseFocus(false);
return windMouseImpl(cx,cy,x,y,9D,3D,5D/speed,10D/speed,10D*speed,8D*speed);
}
return null;
}
public synchronized Point moveMouse(int x, int y) {
if (canInteract()) {
if (!focused) getFocus();
return moveMouseImpl(x,y);
}
return null;
}
Your going to Have to Change the Extension back to .DLL if you plan on using the precompiled on below..