|
You last visited: Today at 00:13
Advertisement
Click every rectangle 1 time.
Discussion on Click every rectangle 1 time. within the AutoIt forum part of the Coders Den category.
02/06/2014, 17:52
|
#1
|
elite*gold: 0
Join Date: Feb 2014
Posts: 9
Received Thanks: 0
|
Click every rectangle 1 time.
I want to make a bot for mff. an auto plant and water bot, but how can i make it click every square 1 time?
This is my code right now:
Code:
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:\users\ruud\documents\koda\forms\mff bot.kxf
$Form1_1 = GUICreate("Form1", 150, 213, 200, 128)
$Exit = GUICtrlCreateButton("Exit", 80, 80, 65, 25)
$Plant = GUICtrlCreateButton("Plant!", 8, 80, 65, 25)
$Seeds = GUICtrlCreateCombo("Seeds", 8, 16, 124, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Carrot")
GUICtrlSetCursor (-1, 2)
GUICtrlCreateInput("", 40, 48, 33, 21)
$From = GUICtrlCreateLabel("From", 8, 48, 27, 17)
$To = GUICtrlCreateLabel("To", 80, 48, 17, 17)
GUICtrlCreateInput("", 98, 48, 33, 21)
$Username = GUICtrlCreateInput("Username", 8, 112, 121, 21)
$Password = GUICtrlCreateInput("Password", 8, 144, 121, 21)
$Login = GUICtrlCreateButton("Login!", 8, 176, 137, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Exit
Exit
Case $Plant
_bot()
Case $Login
_Login()
func _bot()
EndFunc
func _Login()
$_Username = GUICtrlRead($Username)
$_Password = GUICtrlRead($Password)
MouseMove(585, 160, 10)
Sleep(300)
MouseClick("left")
Sleep(300)
Send($_Username)
Sleep(300)
MouseMove(772, 160, 10)
Sleep(300)
MouseClick("left")
Sleep(300)
Send($_Password)
Sleep(300)
MouseMove(962, 160, 10)
MouseClick("left")
EndFunc
EndSwitch
WEnd
|
|
|
02/06/2014, 18:01
|
#2
|
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
|
Quote:
Originally Posted by xX4m4zingXx
I want to make a bot for mff. an auto plant and water bot, but how can i make it click every square 1 time?
|
Edit:
sry i forgot the $y part of the loop before... here's the correct one:
Code:
Dim $middleOfTheFirstRect[2] = [<x>,<y>], $widthOfRects = <width>, $heightOfRects = <heigth>
For $x=0 To 11
For $y=0 To 9
MouseClick('left', $middleOfTheFirstRect[0]+$x*$widthOfRects, $middleOfTheFirstRect[1]+$y*$heightOfRects, 1, 0)
Next
Next
|
|
|
02/06/2014, 18:18
|
#3
|
elite*gold: 0
Join Date: Feb 2014
Posts: 9
Received Thanks: 0
|
Can you explain me where to add it and if i to edit something
and can you maybe explain me how it works/ what it means?
I am a beginner. I began yesterday.
|
|
|
02/06/2014, 18:25
|
#4
|
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
|
Quote:
Originally Posted by xX4m4zingXx
Can you explain me where to add it and if i to edit something
and can you maybe explain me how it works/ what it means?
I am a beginner. I began yesterday.
|
for loops are incrementing the given variable from the given start, to the given endpoint...
Code:
For <variable>=<startpoint> to <endpoint>
<action>
Next
for example:
Code:
For $variable=1 to 5
MsgBox(0, "for loop example", "current value of "&$variable>)
Next
is equal to:
Code:
MsgBox(0, "for loop example", "current value of 1")
MsgBox(0, "for loop example", "current value of 2")
MsgBox(0, "for loop example", "current value of 3")
MsgBox(0, "for loop example", "current value of 4")
MsgBox(0, "for loop example", "current value of 5")
so all you have to do is looping through the x and y coordinates in your case...
using 2 for-loops would be a nice and clean way to do that.
starting @ the middle of the first rectangle and walk through them all, by simply increasing the coordinates by width and heigth of the rects...
|
|
|
02/06/2014, 19:24
|
#5
|
elite*gold: 0
Join Date: Feb 2014
Posts: 9
Received Thanks: 0
|
But when i do this and someone does have another screen resolution. will it then work?
Bump
|
|
|
02/09/2014, 12:52
|
#6
|
elite*gold: 0
Join Date: Feb 2014
Posts: 9
Received Thanks: 0
|
Ok i added this in my bot but it goes from top to bottom i want to go it from left to right :$
and if someone does have another screen resolution does it work then?
|
|
|
02/09/2014, 12:59
|
#7
|
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
|
Quote:
Originally Posted by xX4m4zingXx
Ok i added this in my bot but it goes from top to bottom i want to go it from left to right :$
and if someone does have another screen resolution does it work then?
|
it handles the inner loop first...
simply change the order of the loops, to make it go from left to right first.
in order to get the middle of the first rect, you could used pixelsearch.
|
|
|
02/09/2014, 13:10
|
#8
|
elite*gold: 0
Join Date: Feb 2014
Posts: 9
Received Thanks: 0
|
Quote:
Originally Posted by lolkop
it handles the inner loop first...
simply change the order of the loops, to make it go from left to right first.
in order to get the middle of the first rect, you could used pixelsearch.
|
I just found out that loops 
but if i want to use pixelsearch for what do i have to seek then? the whole screen(where you plant) or just 1 rectangle? and can you make a bot scroll down so it makes sure that you can see the whole screen(where you plant)
|
|
|
02/09/2014, 13:15
|
#9
|
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
|
Quote:
Originally Posted by xX4m4zingXx
I just found out that loops 
but if i want to use pixelsearch for what do i have to seek then? the whole screen(where you plant) or just 1 rectangle? and can you make a bot scroll down so it makes sure that you can see the whole screen(where you plant)
|
if you wanna make it work in any case, you'll have to switch to paket based stuff.
pixelbased bots will allways find their limits... since you can't hande the users browser settings, scrolling down won't fix any problems... pixelsearch will only work, if the pixel you're looking for, is currently visible on the users screen.
|
|
|
02/09/2014, 14:05
|
#10
|
elite*gold: 0
Join Date: Feb 2014
Posts: 9
Received Thanks: 0
|
Ok, but can't you make that when you see only half of the screen and the bot sees that 2 that you can make it scroll?
|
|
|
02/12/2014, 22:07
|
#11
|
elite*gold: 0
Join Date: Feb 2014
Posts: 9
Received Thanks: 0
|
bump
|
|
|
02/12/2014, 22:25
|
#12
|
elite*gold: 0
Join Date: Jan 2013
Posts: 426
Received Thanks: 129
|
you can also use controlclick so it clicks on parts of the screen that are not visible.
or if you want it to farm while you are afk then you can also use winhttp.
|
|
|
02/15/2014, 02:57
|
#13
|
elite*gold: 0
Join Date: Feb 2014
Posts: 9
Received Thanks: 0
|
but is it possible to make this bot i have now:
Code:
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:\users\ruud\documents\koda\forms\mff bot.kxf
$Form1_1 = GUICreate("Form1", 150, 213, 200, 128)
$Exit = GUICtrlCreateButton("Exit", 80, 80, 65, 25)
$Plant = GUICtrlCreateButton("Plant!", 8, 80, 65, 25)
$Seeds = GUICtrlCreateCombo("Seeds", 8, 16, 124, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Carrot")
GUICtrlSetCursor (-1, 2)
GUICtrlCreateInput("", 40, 48, 33, 21)
$From = GUICtrlCreateLabel("From", 8, 48, 27, 17)
$To = GUICtrlCreateLabel("To", 80, 48, 17, 17)
GUICtrlCreateInput("", 98, 48, 33, 21)
$Username = GUICtrlCreateInput("Username", 8, 112, 121, 21)
$Password = GUICtrlCreateInput("Password", 8, 144, 121, 21)
$Login = GUICtrlCreateButton("Login!", 8, 176, 137, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Exit
Exit
Case $Plant
_bot()
Case $Login
_Login()
func _bot()
Dim $middleOfTheFirstRect[2] = [569, 244], $widthOfRects = 40, $heightOfRects = 40
For $y=0 To 9
For $x=0 To 11
MouseClick('left',$middleOfTheFirstRect[0]+$x*$widthOfRects ,$middleOfTheFirstRect[1]+$y*$heightOfRects , 1, 0)
Next
Next
EndFunc
func _Login()
$_Username = GUICtrlRead($Username)
$_Password = GUICtrlRead($Password)
MouseMove(585, 160, 10)
Sleep(300)
MouseClick("left")
Sleep(300)
Send($_Username)
Sleep(300)
MouseMove(772, 160, 10)
Sleep(300)
MouseClick("left")
Sleep(300)
Send($_Password)
Sleep(300)
MouseMove(962, 160, 10)
MouseClick("left")
EndFunc
EndSwitch
WEnd
that it works on every screen resolution and that it can find the place to plant?
|
|
|
03/08/2014, 20:22
|
#14
|
elite*gold: 0
Join Date: Feb 2014
Posts: 9
Received Thanks: 0
|
Bump
|
|
|
03/08/2014, 20:38
|
#15
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
To get it work on every resoulution you either have to do it for every resolution or make a better bot without clicking.
|
|
|
 |
Similar Threads
|
NOZER'S FREE ELO BOOSTING - LIMITED TIME ONLY [CLICK HERE]
07/21/2013 - League of Legends Trading - 27 Replies
LIMITED TIME ONLY
Proof:http://puu.sh/3cOXY.jpg
Hey ePVP, I'm fairly new to this community and have been offering ELO boosts for a while now. So far I've had 10+ customers so far, but many vouches. As of recently, one vouch went extremely sour and I noticed that a main factor in people trusting my service is a large amount of reputation/trades. In light of this, I am offering some free boosts. If you are interested, please add me on skype: nozerlol
Requirements:
I can only boost 1-2...
|
If you know any 90 cap private server click me, if not don't waste your time
03/31/2012 - SRO Private Server - 8 Replies
Hello everyone! I opened this topic to ask for a 90 cap private silkroad server if there is any, I'm tired of searching for one, maybe I'm blind and can't see it so if you know any please reply :) Thanks a lot
|
C++ Rectangle Hilfe
12/21/2010 - C/C++ - 5 Replies
Hey,
ich brauche mal kurz Hilfe.
Es geht darum, dass dieses Rextangle(viereck), wenn ich mit der Pfeiltaste nach unten drücke um 10 nach unten gesetzt werden soll. Nur kommen da 2 Fehler beim erstellen
void D3D9Menu::Boarderstest(LPDIRECT3DDEVICE9 pDevice,ID3DXFont* pFont)
{
if(GetAsyncKeyState(VK_DOWN)&1)
{
DrawRectangle(pDevice,10,10,150,10,1,MenuRahmen3) = DrawRectangle(pDevice,10,10 +10,150,10,1,MenuRahmen3);
|
Looking for Program that records mouse click time
12/05/2006 - Conquer Online 2 - 1 Replies
what the topic says, anyone know of anything? I want to know the exact times (down to the second) when i left click/ right click my mouse in the game
|
All times are GMT +1. The time now is 00:15.
|
|