Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding > Coding Tutorials
You last visited: Today at 14:11

  • Please register to post and access all features, it's quick, easy and FREE!

 

Tutorial: how to write a pixelbot in Autoit

Reply
 
Old   #1
 
elite*gold: 20
Join Date: Dec 2012
Posts: 725
Received Thanks: 330
Tutorial: how to write a pixelbot in Autoit

Hello!

Since the newest updates, pixelbots have been getting more popular. I noticed that there are not many Autoit tutorials for a Darkorbit pixelbot, so I decided to make one This is my first tutorial, and I am still learning Autoit, so bear with me...
Before I begin, you should have Autoit downloaded. Have SciTE.exe and Au3Info.exe open (both can be found in the Autoit folder).


First we need to make a while statement:
Next, we need to tell the bot to search for Bonusboxes around your ship:
To find the color of a bonus box (or palladium ) use the au3info window:
Simply click and drag the crosshairs/target to whatever you want to be collected and it will tell you the pixel color.
NOTE: Your info window must be on the "mouse" tab!
Then find the coordinates for the top left and bottom right of your collecting area with the info window:
Here is where everything goes:
Next, we need to add code of what the bot should do if it spots the pixel:
Next we need to make the ship move if there is nothing to collect:


After that, you have a simple yet working boxbot. To make it collect palladium, switch the pixel color and change the minimap coordinates to accomodate the fog area instead of the entire minimap. Here is the whole source:
Bot with added pause feature (Special thanks to Fluttershy)
Bot with other features (Timer, count of boxes collected, etc. Again, special thanks to Fluttershy)

Thanks to Forsaken and Dr.Toni for their tutorials and Fluttershy for adding features in the code. Feel free to pm me any questions that you have.



Bone-marrow is offline  
Thanks
19 Users
Old   #2

 
elite*gold: 100
Join Date: Mar 2013
Posts: 5,394
Received Thanks: 2,368
You learned from my Tutorial... Amazing


Dr.Toni. is offline  
Thanks
2 Users
Old   #3
 
elite*gold: 20
Join Date: Dec 2012
Posts: 725
Received Thanks: 330
Quote:
Originally Posted by Dг.Tσпi™ View Post
You learned from my Tutorial... Amazing
Your tutorial helped a lot, thanks a bunch for posting it.
Bone-marrow is offline  
Thanks
1 User
Old   #4
 
elite*gold: 0
Join Date: Oct 2012
Posts: 284
Received Thanks: 32
One question what about a npc pixel bot? U can make a tutorial for it ? Or someone ?


MuPowe is offline  
Old   #5

 
elite*gold: 100
Join Date: Mar 2013
Posts: 5,394
Received Thanks: 2,368
I could do it yes... but you have to learn Pixelsearch and imagesearch and you can do it yourself
Dr.Toni. is offline  
Thanks
1 User
Old   #6
 
elite*gold: 20
Join Date: Dec 2012
Posts: 725
Received Thanks: 330
Quote:
Originally Posted by MuPowe View Post
One question what about a npc pixel bot? U can make a tutorial for it ? Or someone ?
Try putting NPCs on low and inputting the pixel color from lordakias or streuners. Like Dr.Toni said, it would probably be better to use imagesearch. Perhaps I should make another tutorial
Bone-marrow is offline  
Old   #7
 
elite*gold: 110
Join Date: Sep 2012
Posts: 3,815
Received Thanks: 1,453
Dont convert the random floating number into integer . use the third parameter its much faster .

dont declare the Opt in a while . it needs to put at start of a func or on script start .

use the instant miusemove parameter .

give the while $pause = true and change it in the while to false (a little suggestion to make the code better)
YatoDev is offline  
Thanks
1 User
Old   #8
 
elite*gold: 20
Join Date: Dec 2012
Posts: 725
Received Thanks: 330
Quote:
Originally Posted by »FlutterShy™ View Post
Dont convert the random floating number into integer . use the third parameter its much faster .

dont declare the Opt in a while . it needs to put at start of a func or on script start .

use the instant miusemove parameter .

give the while $pause = true and change it in the while to false (a little suggestion to make the code better)
Okay, I understood a bit of what you said...
-Change MouseMove($Box[0],$Box[1],1) to MouseMove($Box[0],$Box[1],0)
-Change MouseMove(int(Random(1390,1580)), int(Random(805,915)), 1) to MouseMove(int(Random(1390,1580)), int(Random(805,915)), 0)
-Move Opt("MouseCoordMode", 1) Above the while loop

I am not sure about this, but are you also suggesting:
-Change MouseMove(int(Random(1390,1580)), int(Random(805,915)), 0) to MouseMove(Random(1390,1580), Random(805,915), 0)
-Change While 1 to While <$pause=true> (In which case, would I have to declare $pause somewhere above the while?)

Thanks for the suggestions, please correct me if I am wrong.
Bone-marrow is offline  
Old   #9
 
elite*gold: 110
Join Date: Sep 2012
Posts: 3,815
Received Thanks: 1,453
i wrote that on my smartphone so here is what i mean exactly

That will be better

Code:
#RequireAdmin

Global $pause = False

ProcessSetPriority("script name.exe",4)

HotKeySet("{ESC}", "_quit")
HotKeySet("{F1}", "_Pause")

Opt("MouseCoordMode", 1)

While 1
	If $pause = False Then
		$Box = PixelSearch(80,85,1745,1050,0xFFFFDD)
		If IsArray($Box) Then
			MouseMove($Box[0],$Box[1],0)
			MouseClick("left")
			Sleep(1750)
		Else
			MouseMove(Random(1390,1580,1), Random(805,915,1), 0)
			MouseClick("left")
			Sleep(2000)
		EndIf
	Else
		sleep(150)
	EndIf
WEnd

Func _quit()
   Exit
EndFunc

Func _Pause()
	If $pause = True Then
		$pause = False
	ElseIf $pause = False Then
		$pause = True
	EndIf
EndFunc
YatoDev is offline  
Thanks
2 Users
Old   #10
 
elite*gold: 20
Join Date: Dec 2012
Posts: 725
Received Thanks: 330
Quote:
Originally Posted by »FlutterShy™ View Post
i wrote that on my smartphone so here is what i mean exactly

That will be better

Code:
#RequireAdmin

Global $pause = False

ProcessSetPriority("script name.exe",4)

HotKeySet("{ESC}", "_quit")
HotKeySet("{F1}", "_Pause")

Opt("MouseCoordMode", 1)

While 1
	If $pause = False Then
		$Box = PixelSearch(80,85,1745,1050,0xFFFFDD)
		If IsArray($Box) Then
			MouseMove($Box[0],$Box[1],0)
			MouseClick("left")
			Sleep(1750)
		Else
			MouseMove(Random(1390,1580,1), Random(805,915,1), 0)
			MouseClick("left")
			Sleep(2000)
		EndIf
	Else
		sleep(150)
	EndIf
WEnd

Func _quit()
   Exit
EndFunc

Func _Pause()
	If $pause = True Then
		$pause = False
	ElseIf $pause = False Then
		$pause = True
	EndIf
EndFunc
Very nice, you added a pause feature. I'll add it to the first post and give you credit. There are other things that can be added such as timers instead of sleep commands, imagesearch for minimap coords, select area, etc. This is just a starting point for now.
Bone-marrow is offline  
Thanks
1 User
Old   #11
 
elite*gold: 110
Join Date: Sep 2012
Posts: 3,815
Received Thanks: 1,453
when i have time i post new versions of my script ^^
pixelbots like this arent needed everymore , talanted coders will use trapdoor

#Updates :
-Added Timer (Time Difference between start and exit)
-Added counter for collected boxes

Code:
#RequireAdmin

Global $pause = False

Global $count = 0

ProcessSetPriority("script name.exe",4)

HotKeySet("{ESC}", "_quit")
HotKeySet("{F1}", "_Pause")

Opt("MouseCoordMode", 1)
$Timer = TimerInit()
While 1
	If $pause = False Then
		$Box = PixelSearch(80,85,1745,1050,0xFFFFDD)
		If IsArray($Box) Then
			MouseMove($Box[0],$Box[1],0)
			MouseClick("left")
			Sleep(1750)
			$count = $count + 1
		Else
			MouseMove(Random(1390,1580,1), Random(805,915,1), 0)
			MouseClick("left")
			Sleep(2000)
		EndIf
	Else
		sleep(150)
	EndIf
WEnd

Func _quit()
	$Diff = TimerDiff($Timer)
	$Diff = $Diff / 1000
	MsgBox(0,"Boxes Collected","You collected ~ " & $count & " BonusBoxes " & @CRLF & "in ~ " & $Diff & " Seconds")
	Exit
EndFunc

Func _Pause()
	If $pause = True Then
		$pause = False
	ElseIf $pause = False Then
		$pause = True
	EndIf
EndFunc
YatoDev is offline  
Thanks
1 User
Old   #12
 
elite*gold: 20
Join Date: Dec 2012
Posts: 725
Received Thanks: 330
Quote:
Originally Posted by »FlutterShy™ View Post
when i have time i post new versions of my script ^^
pixelbots like this arent needed everymore , talanted coders will use trapdoor

#Updates :
-Added Timer (Time Difference between start and exit)
-Added counter for collected boxes

More code? Thanks , I will add this later.
You are probably right though, Ink's dll will make the best pixelbots (vm is inefficient), but I can't see the harm in learning a little autoit. You clearly know autoit well, I appreciate the advice and sources. Btw, doesn't "4" in the process priorities add cpu-usage?
Bone-marrow is offline  
Old   #13
 
elite*gold: 110
Join Date: Sep 2012
Posts: 3,815
Received Thanks: 1,453
Quote:
Originally Posted by Bone-marrow View Post
Btw, doesn't "4" in the process priorities add cpu-usage?
yes but make script faster ^^
YatoDev is offline  
Thanks
1 User
Old   #14
 
elite*gold: 0
Join Date: Sep 2013
Posts: 3
Received Thanks: 0
Is there a way to add multiple pixels that it can search for? Cause right now, it only pick ups like 1/20 of the boxes it finds xD

EDIT: Nvm, figured it out ^.^

Can you fix the bonus box counter though? it doesent seem to work. tyty
sasdfasdfas is offline  
Old   #15
 
elite*gold: 20
Join Date: Dec 2012
Posts: 725
Received Thanks: 330
Quote:
Originally Posted by sasdfasdfas View Post
Is there a way to add multiple pixels? Cause right now, it only pick ups like 1/20 of the boxes it finds xD
You can add shade variation or have multiple pixel searches.


Bone-marrow is offline  
Reply

Tags
autoit, bot, how to make a pixelbot, pixelbot, tutorial



« Previous Thread | Next Thread »

Similar Threads
[TUT] How to write your own Pixelbot [AutoIT]
At first you need to find the right pixel colour... We will do it with the AutoIT Tool: AutoIT Window Info ...
37 Replies - Coding Tutorials
Autoit Pixelbot für Browsergame
Hy leute suche ein paar leute die lust und laune haben mit mir einen Pixelbot für das Spiel Darkorbit zu machen. Was ihr können müsst: ihr...
5 Replies - AutoIt
AutoIT PixelBot Hilfe
Hey ich hätte mal ein paar Fragen... Also wie ja oben steht brauche ich Hilfe bei einem PixelBot zum Farmen. Der Bot soll davon unterscheiden...
3 Replies - AutoIt



All times are GMT +1. The time now is 14:11.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.