Jump to content

Linux - Incredibly slow mouse movements


Bobrocket

Recommended Posts

Edit: Using Ubuntu 14.04.2 32 bit.

 

So, I am testing my own little combat script, and it seems that it can take anywhere between 1 second to a minute to hover over an NPC. The screenshot below shows this (explanation below)

36424b3ac5d1cdfb509e76390a78cbb0.png

Code snippet:

if (npcViable(npc) && npc.getAnimation() != 361) {
						log("Found npc " + npc);
						npc.hover();
						while (!getMouse().isOnCursor(npc) && npcViable(npc)) { npc.hover(); sleep(focusRand(100, 250)); }
						if (npcViable(npc)) {
							if (getMouse().getOnCursorCount() > 1) {
								npc.interact("Attack");
								log("Attack by interact");
							}
							else {
								getMouse().click(false);
								log("Attack by click");
							}
							sleep(focusRand(450, 750));
							target = npc;
						}
						else {
							target = null;
						}
					}

It gets stuck in the while loop for the duration.

On the npc.hover() function, it will move a pixel or so for each iteration.

I can tell because of the time difference between the "Found npc" and "Attack by interact/click", as there is no computing heavy code between those log functions (and it will work flawlessly on windows)

I know that Linux is a work in progress and so forth, but otherwise it's flawless smile.png Seen no differences between Windows and Linux and it seems to use just as many resources too! biggrin.png You did a good job on the new mirror mode update

Edited by Bobrocket
Link to comment
Share on other sites

Please don't use custom methods as a basis for bug reports. Test against either:

 

MoveMouseEvent

or

InteractionEvent

 

This will help both MGI and myself find and test specific parts of code.

 

Switching from interactable.hover to a MoveMouseEvent, give me a bit of time to push the changes to my VPS.

MoveMouseEvent code:

public void hover(NPC n) throws InterruptedException {
        if (n != null) {
            EntityDestination ed = new EntityDestination(getBot(), n);
            MoveMouseEvent mme = new MoveMouseEvent(ed);
            mme.execute();
        }
    }

Seems that I get NullPointerExceptions at mme.execute();, not entirely sure why as I have never used events before (kept to the methods like hover/interact etc.) Sorry!

Link to comment
Share on other sites

Pinned it down to either Bot or ClientMouseEventHandler returning null. Directing to MGI.

 

Glad I could help :)

I got this other completely random error while running my combat script:

http://pastebin.com/41FqgA7S

 

I never call anything to do with a GroundItem, so I'm not 100% sure why this happened. Hopefully it will help.

Link to comment
Share on other sites

  • Developer

Pinned it down to either Bot or ClientMouseEventHandler returning null. Directing to MGI.

 

That is certainly impossible.

Glad I could help smile.png

I got this other completely random error while running my combat script:

http://pastebin.com/41FqgA7S

 

I never call anything to do with a GroundItem, so I'm not 100% sure why this happened. Hopefully it will help.

 

Those errors happen because the model of ground item is being 'uploaded' but the ground item data itself is not yet available to client.

Just ignore them for now

  • Like 1
Link to comment
Share on other sites

That is certainly impossible.

 

Those errors happen because the model of ground item is being 'uploaded' but the ground item data itself is not yet available to client.

Just ignore them for now

 

Alright, sorry. I was just babysitting the script and I saw an error so I thought I should report it :)

Mirror mode seems to be working brilliantly otherwise, good job :D

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...