Thread: [Essentials Script] My Script Library
View Single Post
  #8    
Old October 5th, 2012 (7:30 AM).
☆Rei☆'s Avatar
☆Rei☆ ☆Rei☆ is offline
  • Platinum Tier
 
Join Date: Aug 2009
Location: Nearby my feet.
Age: 21
Gender: Female
Nature: Calm
Posts: 1,749
Mouse testing

Code:
################################################################################
# Simple mouse Testing
# By Hansiec
# Uses:
# Shows some usage of Essentials' built in mouse functions
################################################################################

def is_pressing_mouse_left?
  return Input.pressex?(Input::LeftMouseKey)
end

def is_clicking_mouse_left?
  return Input.pressex?(Input::LeftMouseKey)
end

def is_pressing_mouse_right?
  return Input.pressex?(Input::RightMouseKey)
end

def is_clicking_mouse_right?
  return Input.pressex?(Input::RightMouseKey)
end

def get_mouse_position
  pos = Mouse.getMousePos
  if pos == nil
    print "Mouse is not on the screen!"
  else
    print "Your mouse is at X: #{pos[0]} Y: #{pos[1]}"
  end
  return pos
end

get_mouse_position
And some other scripts:
https://rapidshare.com/files/3556486514/Scripts.zip
Reply With Quote