iDollarsteam 13 Posted February 15, 2013 Report Share Posted February 15, 2013 I need to find the coordinates (position) of an object on a webpage (with one of the corners of the browser window as the point of origin) and be able to save those coordinates in two variables (x,y)... I think that there is a way using jquery and the eval function in a variable but I'm not a javascript coder and I can't get that code to work using that object id or any other tag to select it... Can anyone give me a hand with this? PLS!!! Quote Link to post Share on other sites
HelloInsomnia 1103 Posted February 15, 2013 Report Share Posted February 15, 2013 http://www.ubotstudio.com/forum/index.php?/topic/12962-cursor-postion-xy-locator-plugin-free/ Quote Link to post Share on other sites
iDollarsteam 13 Posted February 15, 2013 Author Report Share Posted February 15, 2013 http://www.ubotstudio.com/forum/index.php?/topic/12962-cursor-postion-xy-locator-plugin-free/ TJ you are great! He did it in few minutes after I asked him to help me... he's a genius!!! Edit: The plugin is working fine it can find the mouse coordinates but it is not useful as a solution for the topic of this thread Quote Link to post Share on other sites
iDollarsteam 13 Posted February 15, 2013 Author Report Share Posted February 15, 2013 I installed it... well it is not working ... on the download page it say: "Use the mouse over function to move your mouse over an area, then use the plugin to capture the X, Y position to variables and use as needed" ... mouse over do not move the mouse so the plugin will get the cursor position (over the run button or where you last moved the mouse with your hand) ... navigate("http://www.ubotstudio.com/", "Wait") mouse over(<innertext="Verify Emails">, "No") wait(1) plugin command("GetMousePosition.dll", "Get Mouse X,Y", #x, #y) ui stat monitor("x=", #x) ui stat monitor("y=", #y) ... so in the above example if I want to get the x and y coordinates of the "verify Emails" element o the page and insert them in the Move Mouse command or in the Click Mouse command the commands will click on the run button of the bot not on the Verify Email on the page... Quote Link to post Share on other sites
iDollarsteam 13 Posted February 17, 2013 Author Report Share Posted February 17, 2013 so...nobody knows a solution to this problem?? Quote Link to post Share on other sites
Praney Behl 314 Posted February 18, 2013 Report Share Posted February 18, 2013 Well TJ's plugin tells you the X and Y positions of the "Mouse Cursor" not and object on the page. However to find the position of an object on a webpage you can use some jQuery. There are 2 ways to do it: 1. Using offset() : $(function(){ var posObject = $('#container'), posX = posObject.offset().left, posY = posObject.offset().top; });jQuery Reference & More information on using the offset function: offset(). 2. Using position() :$(function(){ var posObject = $('#container'), posX = posObject.position().left, posY = posObject.position().top; }); jQuery Reference & More information on using the position function: position(). Hope it helps, Praney 1 Quote Link to post Share on other sites
iDollarsteam 13 Posted February 18, 2013 Author Report Share Posted February 18, 2013 Well TJ's plugin tells you the X and Y positions of the "Mouse Cursor" not and object on the page. However to find the position of an object on a webpage you can use some jQuery. There are 2 ways to do it: 1. Using offset() : $(function(){ var posObject = $('#container'), posX = posObject.offset().left, posY = posObject.offset().top; });jQuery Reference & More information on using the offset function: offset(). 2. Using position() :$(function(){ var posObject = $('#container'), posX = posObject.position().left, posY = posObject.position().top; }); jQuery Reference & More information on using the position function: position(). Hope it helps, Praney I have found this to but I don't know how to implement them in ubot ... I have the "ID" tag of an object from the page... I replace the #container with it? For example, I have a div: <div class="container_24"> and I want to find the x and y on the page. I load jquery in a run javascript command then I set up a variable like this: set(#test, $eval("$(function() \{ var posObject = $(\'<div class=\"container_24\">\'), posX = posObject.position().left, posY = posObject.position().top; \}); posX; posY;"), "Global") What is wrong with this code? how can I make it return the x and y ? Quote Link to post Share on other sites
Praney Behl 314 Posted February 18, 2013 Report Share Posted February 18, 2013 Did you add the jQuery reference:<script src="http://code.jquery.com/jquery-latest.js"></script>?? It won't work without it. Quote Link to post Share on other sites
iDollarsteam 13 Posted February 19, 2013 Author Report Share Posted February 19, 2013 Did you add the jQuery reference:<script src="http://code.jquery.com/jquery-latest.js"></script>?? It won't work without it.yes I included the entire jquery code in a "run javascript" command in ubot... it is not working... may be I did not write the "set" command ok... can you test it for me and see if you can make it work? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.