Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Mabinogi > Mabinogi Hacks, Bots, Cheats & Exploits
You last visited: Today at 19:05

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

Advertisement



[Release] Thin thread making bot(Autoit)

Discussion on [Release] Thin thread making bot(Autoit) within the Mabinogi Hacks, Bots, Cheats & Exploits forum part of the Mabinogi category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2008
Posts: 61
Received Thanks: 6
[Release] Thin thread making bot(Autoit)

Had this around for a while,and seeing nothing similar being posted(save for cobweb gathering ones) thought I'd put it here in case anyone has any kind of use for this.It did rely on mod_potato's autopick for gathering cobwebs from a spider-farm so commented that part for obvious reasons.

Might need more crippling on some parts,I won't bother testing it as I don't play mabi anymore(testing it crippled I mean,it worked fine otherwise)

Images needed etc on comments.

Code:
#Include <Imagesearch.au3>
#include <GUIConstantsEX.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
MsgBox (0,"Startbox","Push ok to start")
HotKeySet("{ESC}", "Terminate")

WinActivate("Mabinogi")
WinActive("Mabinogi")


Global $inputweavingbutton,$weavingbutton

;$fullinv=0

Popup()
Sleep (2000)

;Commenting this out cause it relied on potato's auto pick up feature.
;Do ;This starts gathering cobwebs,make sure you are at the spider farm without autopick
;	GatherCobwebs()
;Until $fullinv=1

While 1 ;Main loop of weaving,gathering,blabla
	While $fullinv=1 
	GoinHS()
	
	Weave()
	Sleep(1000)
	
	OutofHS()
	
	Popupwait()
	
	;If $fullinv=0 Then
	;	Do
	;		GatherCobwebs()
	;	Until $fullinv=1
	;EndIf
	WEnd
WEnd

;Func GatherCobwebs() ;Function that gathers cobwebs,obviously needs a working mod_potato for autopick
;	Send ("{Enter}")
;	Send ("/pick")
;	Send ("{Enter}")
;	Sleep(30000)
;	CheckINV()
;	If $fullinv=1 Then
;		Send ("{Enter}")
;		Send ("/pick")
;		Send ("{Enter}")
;	EndIf
;	Sleep(1000)
;EndFunc

Func GoinHS()
	Send ("{U}")
	$goin=_Imagesearch("Goin.jpg",$x,$y,80) ;Image is supposed to be the homestead entry button
	MouseClick("left",$x,$y,1,2)
EndFunc

Func Popup() 
	GUICreate("Thin Thread bot",328, 128, 202, 178)
	$inputweavebutton=GUICtrlCreateInput("",184, 32, 25, 21,$ES_UPPERCASE)
	GUICtrlSetLimit(-1, 2)
	$Label1 = GUICtrlCreateLabel("Weaving Skill Button", 120, 32, 64, 40)
	$Button1 = GUICtrlCreateButton("Start!", 128, 96, 75, 25, 0)
	GUISetState(@SW_SHOW)
	Do
		$msg = GUIGetMsg()
		
		If $msg = $button1 Then
			$weavingbutton=Number(GuiCtrlRead($inputweavingbutton))
			
			$msg = $GUI_EVENT_CLOSE
		EndIf
	Until $msg = $GUI_EVENT_CLOSE
	GUIDelete()
EndFunc

Func Popupwait()
	GuiCreate("Waiting",100,150,100,100)
	$Button1=GuiCtrlCreateButton("Start Again!",50,100,50,50,0)
	GUISetState(@SW_SHOW)
	Do
		$msg=GUIGetMsg()
		
		If $msg=$Button1 Then
			$msg=$GUI_EVENT_CLOSE
		EndIf
	Until $msg=$GUI_EVENT_CLOSE
	GuiDelete()
EndFunc

Func OutofHS()
	Send ("{U}")
	$goout=_Imgesearch("goout.jpg",$x,$y,80) ;Suppoosed to be the button that gets you out of homestead.
	MouseClick("left",$x,$y,1,2)
EndFunc

Func Weave()
	Send("{$weavingbutton}")
	$count=0
	$result1 = _ImageSearch("Cobweb.bmp",1,$x1,$y1,100) ;Stack of 5 cobwebs in inventory slot.
	$result2 = _ImageSearch("Slot.bmp",1,$x2,$y2,100) ;Empty slot at production window.
	While $result1=1
		Do
			$result1 = _ImageSearch("Cobweb.bmp",1,$x1,$y1,100)
			$result2 = _ImageSearch("Slot.bmp",1,$x2,$y2,100)
			If $result1=1 and $result2=1 Then
				MouseMove($x1,$y1,1)
				MouseClick("left",$x1,$y1,1,1)
				Sleep(100)
				MouseMove($x2,$y2,1)
				MouseClick("left",$x2,$y2,1,1)
				Sleep(100)
				$count=$count+1
			EndIf
		Until $count=10
		If $count=10 Then
			$button= _Imagesearch("start.jpg",1,$x,$y,100) ;Start button of production window.
			MouseClick ("left",$x,$y,1,1)
		EndIf
		Send("{$weavingbutton}")
		$result1= _ImageSearch("Cobweb.bmp",1,$x1,$y1,100)
		$result2 = _ImageSearch("Slot.bmp",1,$x2,$y2,100)
		$count=0
	WEnd
	If $result1=0 Then
		$result3=_Imagesearch("cancel.jpg",1,$x,$y,100) ;Cancel button on production window.
		Mouseclick ("left",$x,$y,1,1)
		;$fullinv=0
	EndIf
EndFunc

;Func CheckINV()
;	$result=_Imagesearch("emptyinvslot.jpg",1,$x,$y,90) ;Empty inventory slot image.
;	If $result=0 Then
;		$fullinv=1
;	EndIf
;EndFunc
SKAKERA is offline  
Old 05/22/2012, 21:29   #2
 
elite*gold: 0
Join Date: Sep 2010
Posts: 33
Received Thanks: 3
I made this one last week, it gathers cobwebs from a spider farm and then goes to homestead and uses your spinning wheel, it stops when it sees a full thin thread bag.

Code:

HotKeySet("{END}","Exitscript")
OnAutoItExitRegister("Exitscript")
Global $a[2], $b[2]
Local $i, $j
Local $findImage, $resultPosition, $tolerance
Local $Point[2]
;$x and $y used as placeholders only, do not use for actual variables
Local $x,$y
Global $Winpos[4]
$Winpos=WinGetPos("Mabinogi")


;BODY START

Sleep(2000)


While 1

	;Fill inv with cobwebs
	Send("{ALTDOWN}")
	Sleep(200)
	While ImageSearch(".\InvSlot.bmp",1,$a[0],$a[1],5)=1
		Sleep(100)
		Do
		Until ImageSearch(".\Cobweb1.bmp",1,$a[0],$a[1],60)=1
		Sleep(200)
		MouseMove($a[0],$a[1],2)
		Sleep(100)
		MouseClick("Left")
		Sleep(500)
	WEnd
	Send("{ALTUP}")
	Sleep(200)

	;Go to Homestead

	If ImageSearch(".\Home1.bmp",1,$a[0],$a[1],5)=0 Then Exit 5
	Sleep(200)
	MouseMove($a[0],$a[1],2)
	Sleep(100)
	MouseClick("Left")
	Sleep(600)
	If ImageSearch(".\Home2.bmp",1,$a[0],$a[1],5)=0 Then Exit 6
	Sleep(200)
	MouseMove($a[0],$a[1],2)
	Sleep(100)
	MouseClick("Left")
	Sleep(5000)


	;Prepare for weaving, change to bare hands
	Do
		Send("{TAB}")
		Sleep(1000)
	Until ImageSearch(".\Tab1.bmp",1,$a[0],$a[1],5)=1

	;Use the transformation
	Send("{F10}")
	Sleep(3000)

	;Use the spinning wheel
	Do
		Send("{-}")
		Sleep(1000)
		$j=Weav1()
		Sleep(300)
		If ImageSearch(".\Start.bmp",1,$a[0],$a[1],5)=0 then Exit 4
		Sleep(200)
		MouseMove($a[0],$a[1],2)
		Sleep(100)
		MouseClick("Left")
		Sleep(10000)
		If $j=1 Then
			If ImageSearch(".\Cobweb2.bmp",1,$a[0],$a[1],5)=0 Then $j=2
		EndIf
	Until $j=2

	;When 100 or more thread is produced stop.
	If ImageSearch(".\ThinThread.bmp",1,$a[0],$a[1],5)=1 then Exit 1

	;Prepare for Gathering, change to bow
	Do
		Send("{TAB}")
		Sleep(1000)
	Until ImageSearch(".\Tab2.bmp",1,$a[0],$a[1],5)=1

	;Leave Homestead

	If ImageSearch(".\Exit.bmp",1,$a[0],$a[1],5)=0 Then Exit 7
	Sleep(200)
	MouseMove($a[0],$a[1],2)
	Sleep(100)
	MouseClick("Left")
	Sleep(600)
	If ImageSearch(".\Exit2.bmp",1,$a[0],$a[1],5)=0 Then Exit 8
	Sleep(200)
	MouseMove($a[0],$a[1],2)
	Sleep(100)
	MouseClick("Left")
	Sleep(15000)
WEnd
;MsgBox(0,"","")

;BODY END



;Fill the weaving window with cobwebs(5 stack)

Func Weav1()
	;Loop till full wheel
	Do
		;Locate cobweb
		$i=0
		Do

			;If all cobweb is used, break loop
			$i+=1
			If $i=10 then Return 2
		Until ImageSearch(".\Cobweb2.bmp",1,$a[0],$a[1],5)=1
		;Locate empty slot
		$i=0
		Do

			;If it cannot be found then maybe spinning wheel is not active
			$i+=1
			If $i=10 Then
				Send("{-}")
				Sleep(500)
				EndIf
			;perhaps no? okay something is wrong, KILL IT KILL IT NOW!
			If $i=20 Then Exit 9
		Until ImageSearch(".\Empty.bmp",1,$b[0],$b[1],5)=1

		;Move the web and verify
		Do
			Sleep(200)
			MouseMove($a[0],$a[1],2)
			Sleep(100)
			MouseClick("Left")
			Sleep(600)
			MouseMove($b[0],$b[1],2)
			Sleep(600)
			MouseClick("Left")
			Sleep(1300)
		Until ImageSearchLocal(".\Cobweb3.bmp",$a,5)=1

	Until ImageSearch(".\Empty.bmp",1,$x,$y,5)=0

	Return 1
EndFunc






;Imagesearch for .png in the entire region defined by winpos.

Func ImageSearch($findImage,$resultPosition,ByRef $x, ByRef $y, $tolerance)
	Local $result

	;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom)
	if $tolerance>0 then $findImage = "*" & $tolerance & " " & $findImage
	$result = DllCall(".\ImageSearchDLL.dll","str","ImageSearch","int",$Winpos[0],"int",$Winpos[1],"int",$Winpos[2],"int",$Winpos[3],"str",$findImage)

	; If error exit
	If UBound($result)=0 then Return 0
    if $result[0]="0" then Return 0

	; Otherwise get the x,y location of the match and the size of the image to
	; compute the centre of search
	$array = StringSplit($result[0],"|")

   $x=Int(Number($array[2]))
   $y=Int(Number($array[3]))
   if $resultPosition=1 then
      $x=$x + Int(Number($array[4])/2)
      $y=$y + Int(Number($array[5])/2)
   endif
   return 1
EndFunc

;A VERY local image search to return only success or fail
Func ImageSearchLocal($findImage, $Point, $tolerance)
	Local $result

	;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom)
	if $tolerance>0 then $findImage = "*" & $tolerance & " " & $findImage
	$result = DllCall(".\ImageSearchDLL.dll","str","ImageSearch","int",$Point[0]-12,"int",$Point[1]-12,"int",$Point[0]+12,"int",$Point[1]+12,"str",$findImage)

	; If error exit
	If UBound($result)=0 then Return 0
	if $result[0]="0" then Return 0

	; Otherwise get the x,y location of the match and the size of the image to
	; compute the centre of search
	;$array = StringSplit($result[0],"|")

	;$x=Int(Number($array[2]))
	;$y=Int(Number($array[3]))
	;if $resultPosition=1 then
	;$x=$x + Int(Number($array[4])/2)
	;$y=$y + Int(Number($array[5])/2)
	;endif
   return 1
EndFunc

Func Exitscript()
	Send("{ALTUP}")
	Exit
EndFunc
Balthamel is offline  
Reply


Similar Threads Similar Threads
Hey guys. i want some1 help me with making autoit bot!
07/31/2011 - Archlord - 13 Replies
Hey guys im looking for lil help since im "new guy here and junior member" And i need to learn some things i still dont know,but i got good idea by making autoit bot that could be simple and pretty good. il need help for it. we will make something like normal bot.. but its gonna WORK and it wont be complicated so new players know how to use it too...PM ME IF U WANNA HELP ME UP!
AutoIt bot making!
12/21/2009 - CO2 Guides & Templates - 8 Replies
Alright first you need to get AutoIt (autoitscript.com) Look for the downloads etc. Once downloaded right click on your desktop and go to New (like where you can create a new folder etc) And it will say new Autoit script and have the little picture, click it for the name, name it like test.au3. Ill explain a little program first the concept of Mouse clicking. MouseClick&#40;&#34;left&#34;&#41 ; Alright this will left click many times in VERY rapid succession. Now lets make it a little bit more...



All times are GMT +1. The time now is 19:06.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.