Register for your free account! | Forgot your password?

You last visited: Today at 21:11

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

Advertisement



AutoIt AutoPot Script

Discussion on AutoIt AutoPot Script within the Dragonica Hacks, Bots, Cheats & Exploits forum part of the Dragonica category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2009
Posts: 29
Received Thanks: 9
Thumbs up AutoIt AutoPot Script

**** THIS SCRIPT ONLY WORK IN WINDOW MODE ****
**** THIS SCRIPT ONLY WORK IN WINDOW MODE ****
**** THIS SCRIPT ONLY WORK IN WINDOW MODE ****

Hi all, scripted an autoIt script that will do auto login and autopot
This script utilize a configuration file name config.dat to do the following, so it should be in the same folder as where the script is.

To terminate the script just press F11.

Auto Login (ID must be save)
Default Server/Channel Selection
Default Character Selection
As for the autopot, it is scripted to run @ 70% of the HP/MP level. (HP pot at key 1, MP pot at key 2)

It is scripted base on the game window x,y location.
So it should still work for any screen resolution and any location the game screen is drag to.

Note that the game will be minimize and restore during some parts of the auto login as during focusing on the game the mouse refuses to move. So the script will minimize the game shift the mouse, restore the game and click on where the mouse is.

So there might be high chances that it will not work good for slower computer. If that happen just edit the function "clickloc($locx, $locy)" and add some delay into the script.


CURRENTLY MY SCREEN IS USING 1680 x 1050.
SO PLEASE LET ME KNOW

The actual autoIt Script
Code:
;HotKey for terminating the script
HotKeySet("{F11}", "Terminate") 

#include <file.au3>

$i = 1
Dim $aRecords
;Window title for dragonica should be changed after every patch
$WinTitle = "Dragonica (Client Ver : 0.1.23)"	

;Force focus on dragonica
WinActivate($WinTitle)	

;Reading config file if error reading terminate script
If Not _FileReadToArray("config.dat",$aRecords) Then	
   MsgBox(4096,"Error", "Error reading configuration")
   Exit
EndIf

;Continuous looping
While $i <> 0	
	if $i = 2 Then
		Sleep(500)
		$i = 1
	Else
		;If autologin flag is true in the config file and game exist
		If ($aRecords[2] = 'True' And WinExists($WinTitle)) Then
			checkLogin()
		EndIf
		;If the game exist check for hp and mp
		If (WinExists($WinTitle)) Then
			checkHp70()
			checkMp70()
		EndIf
		$i = 2
	EndIf
WEnd

Func checkLogin()
	;Getting window x,y,width,height
	$size = WinGetPos($WinTitle)
	;Setting flags for login/server/character selection to false
	$isLoginScreen = False
	$isServerScreen = False
	$isCharScreen = False

	;Searching for 3 pixel to determine if it is really the login screen
	If 	(Hex(PixelGetColor( $size[0]+419 , $size[1]+485 ), 6) = '4d3413' And Hex(PixelGetColor( $size[0]+750 , $size[1]+440 ), 6) = 'f2455e' And Hex(PixelGetColor( $size[0]+190 , $size[1]+520 ), 6) = '89b694') Then
		$isLoginScreen = True
	EndIf
	
    ;If it is the login screen proceed to login
	If $isLoginScreen = True Then
		;Send password keypress to the game
		ControlSend($WinTitle,'','',$aRecords[4]);
		sleep(200)
		;Time to login.
		ControlSend($WinTitle,'','','{ENTER}');
	EndIf
	
	Sleep(1000)
	
	;Searching for 3 pixel to determine if it is really the server selection screen
	If 	(Hex(PixelGetColor( $size[0]+60 , $size[1]+55 ), 6) = 'fbc34f' And Hex(PixelGetColor( $size[0]+515 , $size[1]+455 ), 6) = 'f64500' And Hex(PixelGetColor( $size[0]+515 , $size[1]+700 ), 6) = 'f64700') Then
		$isServerScreen = True
	EndIf

	If $isServerScreen = True Then
		;Default server selection screen Kaye/Elga
		If $aRecords[6] = 'Kaye' Then
			ClickLoc($size[0]+210, $size[1]+350)
		ElseIf $aRecords[6] = 'Elga' Then
			ClickLoc($size[0]+330, $size[1]+350)
		EndIf
		
		Sleep(500)
		
		;Default channel selection
		If($aRecords[8] = 1 Or $aRecords[8] = 2 Or $aRecords[8] = 3) Then
			ClickLoc($size[0]+440+(($aRecords[8]-1)*160), $size[1]+518)
		ElseIf($aRecords[8] = 4 Or $aRecords[8] = 5 Or $aRecords[8] = 6) Then
			ClickLoc($size[0]+440+(($aRecords[8]-4)*160), $size[1]+561)
		ElseIf($aRecords[8] = 7 Or $aRecords[8] = 8 Or $aRecords[8] = 9) Then
			ClickLoc($size[0]+440+(($aRecords[8]-7)*160), $size[1]+604)
		ElseIf($aRecords[8] = 10) Then
			ClickLoc($size[0]+440+(($aRecords[8]-10)*160), $size[1]+647)
		EndIf
	EndIf
	
	Sleep(2000)
	
	;Searching for 3 pixel to determine if it is really the character selection screen
	If 	(Hex(PixelGetColor( $size[0]+25 , $size[1]+775 ), 6) = 'aa7640' And Hex(PixelGetColor( $size[0]+1010 , $size[1]+775 ), 6) = 'dfb677' And Hex(PixelGetColor( $size[0]+1010 , $size[1]+35 ), 6) = 'dbb070') Then
		$isCharScreen = True
	EndIf
	
	;Default character screen
	If $isCharScreen = True Then
		ClickLoc($size[0]+625, $size[1]+185+(($aRecords[10]-1)*145))
		Sleep(200)
		ControlSend($WinTitle,'','','{ENTER}');
	EndIf
	
	Sleep(3000)
EndFunc

Func checkHp70()
	$size = WinGetPos($WinTitle)
	;checking if hp falls below 70%
	$checkHp70 = Hex(PixelGetColor( $size[0]+675 , $size[1]+730 ), 6)
	
	;If hp falls below 70% autopot
	If $checkHp70 = '343434' Then
		ControlSend($WinTitle,'','','{1}');Uses hp pots
		Sleep(10000)
	EndIf
EndFunc

Func checkMp70()
	$size = WinGetPos($WinTitle)
	;checking if mp falls below 70%
	$checkMp70 =  Hex(PixelGetColor( $size[0]+675 , $size[1]+767 ), 6)

	;If mp falls below 70% autopot
	If $checkMp70 = '6D6D6C' Then
		ControlSend($WinTitle,'','','{2}');Uses mp pots
		Sleep(10000)
	EndIf
EndFunc

;FUNCTION FOR DOING CLICKING ON LOCATION OF THE SCREEN
;THIS FUNC WILL MINIMIZE AND RESTORE THE GAME INTERFACE
;AS DURING FOCUSING ON THE GAME THE MOUSE WILL NOT MOVE
Func ClickLoc($LocX, $LocY)
	WinSetState($WinTitle, "", @SW_MINIMIZE)
	MouseMove($LocX, $LocY, 0)
	WinActivate($WinTitle)
	ControlClick($WinTitle,'','','primary', 3)
	ControlClick($WinTitle,'','','primary', 3)
EndFunc

Func Terminate()
    Exit 0
EndFunc
The config.dat file
Code:
[AutoLogin]
True
[Password]
Password
[DefaultServer]
Kaye
[DefaultChannel]
5
[DefaultCharacter]
1
As the script is getting information @ a specific line so even if u don't want certain things to execute that line must still be there just empty that line or enter something the script doesn't understands

[AutoLogin] >>> True/False
[Password] >>> Autologin password
[Default Server] >>> Kaye/Elga
[DefaultChannel] >>> 1 to 10
[DefaultCharacter] >>> 1 to 4

The below is just an example
Code:
[AutoLogin]
True
[Password]
Password
[DefaultServer]

[DefaultChannel]
5
[DefaultCharacter]
The script will AutoLogin, with password as "Password".
It will skip the default server selection and proceed to choose channel 5.
And no character will be selected at the character selection screen.

Pardon me for a poorly written script. But I'm just sharing
DragonicaIt is offline  
Old 08/13/2009, 04:31   #2
 
elite*gold: 0
Join Date: Jul 2009
Posts: 2
Received Thanks: 0
wow~ i try to understand the coding but failed...
anyway, thk for sharing & try to apply to my chracter
lon3lykid is offline  
Old 08/13/2009, 21:34   #3
 
elite*gold: 0
Join Date: May 2008
Posts: 15
Received Thanks: 0
im a complete noob using autoit. i just need some enlightenment how and where to use those codes.
gentorsic is offline  
Old 08/13/2009, 23:50   #4
 
elite*gold: 0
Join Date: Jul 2007
Posts: 24
Received Thanks: 1
Quote:
Originally Posted by gentorsic View Post
im a complete noob using autoit. i just need some enlightenment how and where to use those codes.
scite script editor, c&p the code and change what has to be changed. Save it to somewhere on your computer, rightclick the file and click 'Run Script'.
B 2 The Lessed is offline  
Old 08/14/2009, 00:34   #5
 
elite*gold: 0
Join Date: Jun 2008
Posts: 30
Received Thanks: 0
Only need the Auto pot.. Can help removing the auto login script? I tried but failed, Lol ~
beansprout is offline  
Old 08/14/2009, 04:10   #6
 
elite*gold: 0
Join Date: Aug 2009
Posts: 29
Received Thanks: 9
Quote:
Originally Posted by beansprout View Post
Only need the Auto pot.. Can help removing the auto login script? I tried but failed, Lol ~
Code:
;HotKey for terminating the script
HotKeySet("{F11}", "Terminate") 

$i = 1
;Window title for dragonica should be changed after every patch
$WinTitle = "Dragonica (Client Ver : 0.1.25)"	

;Force focus on dragonica
WinActivate($WinTitle)	

;Continuous looping
While $i <> 0	
	if $i = 2 Then
		Sleep(500)
		$i = 1
	Else
		;If the game exist check for hp and mp
		If (WinExists($WinTitle)) Then
			checkHp70()
			checkMp70()
		EndIf
		$i = 2
	EndIf
WEnd

Func checkHp70()
	$size = WinGetPos($WinTitle)
	;checking if hp falls below 70%
	$checkHp70 = Hex(PixelGetColor( $size[0]+675 , $size[1]+730 ), 6)
	
	;If hp falls below 70% autopot
	If $checkHp70 = '343434' Then
		ControlSend($WinTitle,'','','{1}');Uses hp pots
		Sleep(10000)
	EndIf
EndFunc

Func checkMp70()
	$size = WinGetPos($WinTitle)
	;checking if mp falls below 70%
	$checkMp70 =  Hex(PixelGetColor( $size[0]+675 , $size[1]+767 ), 6)

	;If mp falls below 70% autopot
	If $checkMp70 = '6D6D6C' Then
		ControlSend($WinTitle,'','','{2}');Uses mp pots
		Sleep(10000)
	EndIf
EndFunc

Func Terminate()
    Exit 0
EndFunc
I'm outside now so just edit and not tested but it should work.
DragonicaIt is offline  
Thanks
1 User
Old 08/14/2009, 06:11   #7
 
elite*gold: 0
Join Date: Jun 2008
Posts: 30
Received Thanks: 0
Works for me. Screen resolution 1440 x 900 no problem

Thanks.
beansprout is offline  
Old 08/14/2009, 12:00   #8
 
elite*gold: 0
Join Date: Jul 2009
Posts: 48
Received Thanks: 0
can u make a 1280 X 800 script? thx!
gseed87 is offline  
Old 08/14/2009, 12:19   #9
 
elite*gold: 0
Join Date: Aug 2009
Posts: 29
Received Thanks: 9
Quote:
Originally Posted by gseed87 View Post
can u make a 1280 X 800 script? thx!
It works for all the resolution cause it is base on the window x,y location. Just use it and let me know
DragonicaIt is offline  
Old 08/14/2009, 13:03   #10
 
elite*gold: 0
Join Date: Jul 2009
Posts: 9
Received Thanks: 0
autoti have time set ?
notme0914 is offline  
Old 08/14/2009, 13:11   #11
 
elite*gold: 0
Join Date: Jul 2009
Posts: 9
Received Thanks: 0
if i want set auto log out n in back in every 1 hour how to set the scrript ?
notme0914 is offline  
Old 08/14/2009, 14:42   #12
 
elite*gold: 0
Join Date: Aug 2009
Posts: 29
Received Thanks: 9
Quote:
Originally Posted by notme0914 View Post
if i want set auto log out n in back in every 1 hour how to set the scrript ?
There is no implementation of such feature, will look into it if i have the time
DragonicaIt is offline  
Old 08/14/2009, 16:03   #13
 
Zacko7's Avatar
 
elite*gold: 20
Join Date: Jul 2009
Posts: 1,364
Received Thanks: 542
I'm not one to like Auto-It scripts. I'll try to find a way to prevent that "OMFG UR HaxINg TYPE THE LETTERS" from appearing. ^^
Zacko7 is offline  
Old 08/14/2009, 18:30   #14
 
elite*gold: 0
Join Date: May 2008
Posts: 15
Received Thanks: 0
newbie question. ive downloaded the auto it v3 and copied the script. but i doesnt work for me. am i gonna save the file as au3? or .dat? and save it in the FD folder?
gentorsic is offline  
Old 08/14/2009, 18:40   #15
 
elite*gold: 0
Join Date: May 2008
Posts: 15
Received Thanks: 0
i've compiled it and tried to run it along with FD 1.25 and it was detected. any solutions for this?
gentorsic is offline  
Reply


Similar Threads Similar Threads
Autoit Script als nicht Autoit erkennbar machen
02/22/2013 - AutoIt - 22 Replies
Hallo es haben wiele bestimmt schon gesehn das w0uter mal eine Anleitung gepostet hat wie man ein Autoit script so umbaut das es keins mehr ist. Die anleitung ist aber leider weg :( Dann habe ich mich selber rangesetz und was ausprobiert aber hat nichts gebracht. Dann habe ich geguckt bis wohin sein script geht als ... (kA wie man das nent halt das im hex editor ganz links diese 0x zahlen) und davor habe ich ein ha genauso eins gemacht und verglichen. Am anfang habe ich bemerkt es fengt...
need CE script for autopot and zoom only for vitality dekaron. Can someone help
02/18/2010 - Dekaron Private Server - 2 Replies
plz help if you can . Thx
Autoit autopot
10/25/2009 - Aion - 6 Replies
Was hoping I could get some help from more experienced scripters. This should be really easy =/ WinActivate("AION Client") while 1 $coord = PixelSearch(127,26,127,26,0xC81B19,1);looking for the HP pixel in a color;range of 1 If not @error Then;if the color is not found Send ("{-}") ;it presses "-"
Working autopot script
06/18/2009 - 12Sky2 - 5 Replies
i have a working autopot script, well not mine, but got it on this forum. Only thing missing is the address for hp and mp pot. Can someone please help me find the address so we can get this autopot script working at 100%.
Help with autopot script by editing data.pak..
12/03/2007 - Dekaron - 18 Replies
Hi when i try and make the autopot script by editing some of the values in the data.pak, for example: 3801,Health Potion,0,0,1,0,1,37, .... When i change the values and i try to save what I have edited, it says: Hex Workshop was unable to complete the requested opertaion. Please make sure you have enough disk space available for temporary files or change your temporary file path in preferences Not enough storage is available to process command. When I have MORE than required, I have...



All times are GMT +1. The time now is 21:12.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.