trung Posted August 3, 2007 Share Posted August 3, 2007 $Coord = PixelSearch(118, 118, 139, 151, 0x4E94FC, 5) If Not @error Then MouseDown("left") endif $Coord = PixelSearch(117, 117, 139, 151, 0xBC0000, 5) If Not @error Then MouseUp("left") hey guys im trying to get my mouse to click wenever it sees the blue but wen the red comes up it realeast. wen the blue is back it clicks agin and so on any idea? mine kinda reacts slow Link to comment Share on other sites More sharing options...
qazwsx Posted August 3, 2007 Share Posted August 3, 2007 well in that code you don't need to record the search to a variable. That might speed it up a little. Link to comment Share on other sites More sharing options...
trung Posted August 3, 2007 Author Share Posted August 3, 2007 can ui explain or fix it for me im really noob Link to comment Share on other sites More sharing options...
John117 Posted August 3, 2007 Share Posted August 3, 2007 (edited) not at this long myself, but the variable is the $... that you declare as something this .... $Coord = PixelSearch(118, 118, 139, 151, 0x4E94FC, 5) .... is declaring $Coord This is usually done so that you can alter the variable later and the code will understand what you are refering to. According to his post, you sould drop the variable. ie, PixelSearch(118, 118, 139, 151, 0x4E94FC, 5) will do the same thing unless other parts of your code are setup for $Coord ex of variable $x = 1 $x = $x + 1 . . . . now we have made $x = 2 Edited August 3, 2007 by Hatcheda Link to comment Share on other sites More sharing options...
John117 Posted August 3, 2007 Share Posted August 3, 2007 PixelSearch(118, 118, 139, 151, 0x4E94FC, 5) If Not @error Then MouseDown("left") endif PixelSearch(117, 117, 139, 151, 0xBC0000, 5) If Not @error Then MouseUp("left") Link to comment Share on other sites More sharing options...
Paulie Posted August 3, 2007 Share Posted August 3, 2007 $Coord = PixelSearch(118, 118, 139, 151, 0x4E94FC, 5)If Not @error ThenMouseDown("left")endif$Coord = PixelSearch(117, 117, 139, 151, 0xBC0000, 5)If Not @error Then MouseUp("left")hey guys im trying to get my mouse to click wenever it sees the blue but wen the red comes up it realeast. wen the blue is back it clicks agin and so onany idea?mine kinda reacts slowIf you are checking a specific spot to see what color the pixel is, use pixelgetcolor. pixelsearch searches the entire specfied area for a color, and then returns the coordinates of the color. if you know where the colors are going to be, and just want to know which one it is at that time, use pixelgetcolor Link to comment Share on other sites More sharing options...
enaiman Posted August 3, 2007 Share Posted August 3, 2007 Paulie is right about that. Anyway if his solution is not good enough for you then make the PixelSearch to look into a smaller area - right now you're searching almost 700 pixels for that color. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
qazwsx Posted August 3, 2007 Share Posted August 3, 2007 you could also set the priority of the script to high or real time. Link to comment Share on other sites More sharing options...
trung Posted August 3, 2007 Author Share Posted August 3, 2007 ahh cmon guys talk to me in english i said i was noob lol u guys using big words n junk can u explain more in details Link to comment Share on other sites More sharing options...
qazwsx Posted August 3, 2007 Share Posted August 3, 2007 how big is the area you need to search the pixel for? Is it just a background that is changing. Because if it is then you could ony monitor one pixel for the change. That would make the code much faster. Link to comment Share on other sites More sharing options...
enaiman Posted August 3, 2007 Share Posted August 3, 2007 Well - I'll add some more ... junk thenHere is the PixelSearch description. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
trung Posted August 3, 2007 Author Share Posted August 3, 2007 well ok lemme b more specific. im making a bot for a game called 2moon. its for fishing. the one on here doesnt work so i made my own. we have to hold down the mouse wen theres a blue bar and we let go wen it turns red then click agin wen its blue. can sumone make a quick example for me. even if its a whole enw one Link to comment Share on other sites More sharing options...
enaiman Posted August 3, 2007 Share Posted August 3, 2007 Your example is good enough and it will work. Just reduce the search area to make it more accurate and faster. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now