Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • beezdul's cool mouse


    beezdul

    Recommended Posts

    ​​DTbud3z.png
    ​
    ​I'm aware that the code is pretty ugly, but you can always change it if you want.
    ​
    ​Global:

    Point[] lastPositions = new Point[15];

    ​Put this in onStart()

    getClient().getInstance().setDrawMouse(false);

    ​Put this in onPaint(Graphics2D g)

    Point currentPosition = getMouse().getPosition();
    
    // Shift all elements down and insert the new element
    for(int i=0;i<lastPositions.length - 1;i++){
    	lastPositions[i]=lastPositions[i+1];
    }
    lastPositions[lastPositions.length - 1] = new Point(currentPosition.x, currentPosition.y);
    
    // This is the point before the new point to draw to
    Point lastpoint = null;
    
    Color mColor = new Color(255, 50, 50);
    //Go in reverse
    for(int i=lastPositions.length - 1;i>=0;i--)
    {
    	Point p = lastPositions[i];
    	if(p != null)
    	{
        	if(lastpoint == null)
        		lastpoint = p;
        	
        	g.setColor(mColor);
        	g.drawLine(lastpoint.x, lastpoint.y, p.x, p.y);
    	}
    	lastpoint = p;
    	
    	//Every 2 steps - mouse fade out
    	if(i % 2 == 0)
    		mColor = mColor.darker();
    }
    
    g.setColor(Color.BLACK);
    g.drawRect(currentPosition.x - 3, currentPosition.y - 3, 7, 7);
    g.setColor(Color.WHITE);
    g.drawRect(currentPosition.x, currentPosition.y, 1, 1);
    

    Make sure to add this to onExit()!

    getClient().getInstance().setDrawMouse(true);

    ​
    ​

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.