nathan546
Active Members-
Posts
38 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
nathan546's Achievements
Seeker (1/7)
1
Reputation
-
NeilClough reacted to a post in a topic:
Config file
-
just write a script to find the pixel color like this Func PixelGet() MsgBox(4096, "Paused", "Put your cursor on a pixel color",) Sleep(2000) $Mouse = MouseGetPos() $Pixel = PixelGetColor($Mouse[0], $Mouse[1]) IniWrite("Config.ini", "Pixels", "Pixels", $Pixel) MsgBox(4096, "Paused", "Pixel color set",) EndFunc
-
My config file [Pixels] Pixels1=7105751 // part of the Autoit icon color left=0 top=0 right=1024 bottom=768 Pixel1() Start() Func Pixel1() MsgBox(4096, "Paused", "1. Put your cursor on a color of the mine",) Sleep(2000) $Mouse1 = MouseGetPos() $Pixel1 = PixelGetColor($Mouse1[0], $Mouse1[1]) IniWrite("Config.ini", "Pixels", "Pixels1", $Pixel1) MsgBox(4096, "Paused", "Mine Color Set",) EndFunc Func Start() $left = IniRead("Config.ini", "Pixels", "Left", "Not Found") $top = IniRead("Config.ini", "Pixels", "Top", "Not Found") $right = IniRead("Config.ini", "Pixels", "Right", "Not Found") $bottom = IniRead("Config.ini", "Pixels", "Bottom", "Not Found") $Pixel1 = IniRead("Config.ini", "Pixels", "Pixels1", "Not Found") $Pixel2 = PixelSearch($left, $top, $right, $bottom, $Pixel1) If @error = 1 Then MsgBox(4096, "Paused", "Error",) Exit EndIf MouseClick("left", $Pixel1[0], $Pixel1[1]) EndFunc Now it just says Error and exits it never clicks anywhere at all. This 1 clicks on the right spot unless its already on the right spot then it just messes up, so why does this 1 partly work but the other 1 doesn't Pixel1() Sleep(2000) PixelClick1() Func PixelClick1() $Mouse = MouseGetPos() $Pixel1 = IniRead("Config.ini", "Pixels", "Pixels1", $Pixel1) $Pixel2 = PixelGetColor($Mouse[0], $Mouse[1]) $coord = PixelSearch( 0, 0, 1024, 768, $Pixel1) If $Pixel1 = $Pixel2 Then MouseClick("Left", $Pixel2, $Pixel2, 1, 1) Else MouseClick("Left", $coord[0], $coord[1], 1, 1) EndIf EndFunc Func Pixel() Pixel1() EndFunc Func Pixel1() MsgBox(4096, "Paused", "1. Put your cursor on a color",) Sleep(2000) $Mouse1 = MouseGetPos() $Pixel1 = PixelGetColor($Mouse1[0], $Mouse1[1]) IniWrite("Config.ini", "Pixels", "Pixels1", $Pixel1) MsgBox(4096, "Paused", "Color Set",) EndFunc
-
Ok i tried remaking it off what you said it gives me the same Subscript Error. Func PixelClick() $left = IniRead("Config.ini", "Pixels", "left", "Not Found") $top = IniRead("Config.ini", "Pixels", "top", "Not Found") $right = IniRead("Config.ini", "Pixels", "right", "Not Found") $bottom = IniRead("Config.ini", "Pixels", "bottom", "Not Found") $Pixels1 = IniRead("Config.ini", "Pixels", "Pixels1", "Not Found") $Pixel1 = PixelSearch($left, $top, $right, $bottom, $Pixels1) If @error = 1 Then MsgBox(4096, "Paused", "Error",) EndIf MouseClick("left", $Pixel1[0], $Pixel1[1]) EndFunc
-
it always logs me out after like a day forgot to log back in, anyways heres a another question. How come when I put this it clicks at the top left hand corner of the screen (where coordinates 1,1 would click) The red part doesn't work and says MouseClick("Left", $coord[0], $coord[1], 1, 1) MouseClick("Left", $coord^ERROR Error: Subscript used with a non-Array variable But when I take them out it clicks in the top left hand corner of the screen. Func PixelClick() $Mouse = MouseGetPos() $Pixel1 = IniRead("Config.ini", "Pixels", "Pixels1", $Pixel1) $Pixel2 = PixelGetColor($Mouse[0], $Mouse[1]) $coord = PixelSearch( 0, 0, 1024, 768, $Pixel1) If $Pixel1 = $Pixel2 Then MouseClick("Left", $Pixel2, $Pixel2, 1, 1) Else MouseClick("Left", $coord[0], $coord[1], 1, 1) EndIf EndFunc Func Pixel() Pixel1() EndFunc Func Pixel1() MsgBox(4096, "Paused", "1. Put your cursor on a pixel",) Sleep(2000) $Mouse1 = MouseGetPos() $Pixel1 = PixelGetColor($Mouse1[0], $Mouse1[1]) IniWrite("Config.ini", "Pixels", "Pixels1", $Pixel1) MsgBox(4096, "Paused", "Pixel Set",) EndFunc Then if I use this outside of my script it works as long as the mouse isnt on the right pixel color given. Pixel1() Sleep(2000) PixelClick1() Func PixelClick1() $Mouse = MouseGetPos() $Pixel1 = IniRead("Config.ini", "Pixels", "Pixels1", $Pixel1) $Pixel2 = PixelGetColor($Mouse[0], $Mouse[1]) $coord = PixelSearch( 0, 0, 1024, 768, $Pixel1) If $Pixel1 = $Pixel2 Then MouseClick("Left", $Pixel2, $Pixel2, 1, 1) // add [0] [1]? Else MouseClick("Left", $coord[0], $coord[1], 1, 1)//has [0] [1] EndIf EndFunc Func Pixel() Pixel1() EndFunc Func Pixel1() MsgBox(4096, "Paused", "1. Put your cursor on a pixel",) Sleep(2000) $Mouse1 = MouseGetPos() $Pixel1 = PixelGetColor($Mouse1[0], $Mouse1[1]) IniWrite("Config.ini", "Pixels", "Pixels1", $Pixel1) MsgBox(4096, "Paused", "Pixel Color Set",) EndFunc EDIT: I didn't know your post Ill give it a try.
-
You learn so much more by doing the research yourself, and writing the code on your own that pasting other people's examples into your program and making small changes. The problem with doing that is that you don't know if there's a better way to do what your goal is. I normally don't write code as complete as the linked example, but I already had it written. It's not excatally what you want, but it should demonstrate how the critical functions work, such as hotkeys, and the MouseGetPos command. Minor edit I dont copy and paste usually, I just look at it till I understand what im doing. Anyways time to go look at your source and help file to see what I can come up with.
-
I disagree with that ive learned everything about guis for autoit by looking after other peoples scripts and using bits and peices till i figure out how to do it . Anyways ill take a look at them and try to figure it out.
-
I did that just 2 days ago for a "Keep mouse in boundry" script. Keep mouse in boundry is basically what I need but more complex to where it has to click a certain color too. Maybe i don't get what he means but how is getting the cursor coordinates going to keep it from clicking outside the boundry? EDIT: Something like this is what i need $XY = PixelSearch(1, 2, 3, 4, Color Here) If Not @ERROR Then Sleep(3500) MouseClick("left",$XY[0],$XY[1], 1, 0) EndIf only i need to be able to set the 1, 2, 3, and 4 to click in a certain area like inside a X on the screen (i can do the color but thats no good right now).
-
I need the Dimensions of the square/rectangle though not the cursor coordinates, I alrdy have a script made for that. Actually i have the bot completly made its just the screen shifts some then it starts clicking off the area and im going to make sure it clicking the right color and if its not im going to make it shut off or reask for coordinates, or maybe just let it click randomly at that pixel color if it messes up.
-
I know but, im trying to make a bot so a place can set the left,top,right,and bottom coordinates and then it will search for a pixel color inside those coordinates and click it. So is it possible and how would I do it? EDIT: Also i dont need to it to do it to the whole screen, i need it to do a part of the screen in rectangle, or square form because their is more than 1 part of the screen that has the same color and it will start clicking the wrong spot.
-
Is it possible to get the Top left, Top right,Bottom Left, and Bottom Right cordinates for Pixel Checksum/Search using a script of some sort. Like you would put your cursor on the left, top, right, bottom coordinates of rectangle, and it would return the cordinates to you so you could use them in a script? If so how would I do this(tell me if you cant do it so im not waiting). Thanks.
-
Im trying to take a input box and take whatever text someone enters into it and save that to a config by clicking a save button. Here is what i have Func Save() IniWrite("Config.ini", "Config", "Something", $input_1) EndFunc Opt("GUICoordMode", 1) Opt("GUINotifyMode", 1) GuiCreate("MyGUI", 392,273,(@DesktopHeight-392)/2, (@DesktopHeight-273)/2 , 0x04CF0000) $input_1 = GUISetControl("input", "Hi", 20, 20, 70, 20) $button_1 = GUISetControl("button", "Save", 20, 50, 70, 20) GuiShow() While 1 sleep(100) $msg = GuiMsg(0) Select Case $msg = -3 Exit Case $msg = 0 Case $msg = $input_1 Case $msg = $button_1 Save() EndSelect WEnd Exit When i click the save button it saves as [Config] Something=3 Anyone know how to make it save as what is entered into the input box?
-
When it clicks its, it clicks completly at the top of my screen, so the cordinates 1, 1 work but thats about all. $user = IniRead("Config.ini", "Cordinates", "user", "not found") MouseClick("left", $user, 1, 1) [Cordinates] user=1, 1 but if user is something like user=800, 700 it doesnt even get close to where its supposed to click.
-
Forgot to log in Also i just tried this and it doesnt work Sleep(1000) MsgBox(4096, "Paused", "Put your cursor on the coordinates",) Sleep(5000) $pos = MouseGetPos() MsgBox(4096, "Paused", "Blah blah",) Sleep(2000) MouseClick("left", $pos[0] & ", " & $pos[1], 1) oh well off to sleep *hopes someone knows*
-
I have my autoit set to do a script to open a differnt from during the script its running( Run("blank.exe") ) When it gets to that part it minimizes the game its in and goes to my desktop and starts clicking around and stuff is there a way to make it not minimize the games? Also is there a way to make a shortcut key that will pause/stop autoit.
-
nevermind I had to do something like If $character = 1 Then Send("{ENTER}") If $character = 2 Then Send("{RIGHT}") Heres another stupid question how do I send 2 things in 1 send like Send("{RIGHT}", "{LEFT}") EDIT: Havnt used autoit in like 4 months it was Send("{RIGHT}{LEFT}")