Guys.I looked over the most simplest problem =P. run my bot as a script not an exe. Halfslashed help me haha i feel like a real idiot right now sorry guys.
Here's the script if you need it. and pictures is up to you .
Here's the bot with a few tweaks and comments on the bot.
Code:
#include <ImageSearch.au3>
Global $Paused
HotKeySet("{PAUSE}", "TogglePause") ; Pause the script with "Pause"
HotKeySet("{ESC}", "Stop") ; End the script with ESC
$x1=0
$y1=0
$x2=0
$y2=0
MsgBox(0,"Notice","Click OK to start")
sleep(3000)
While 1
Send ("{F3}") ; Smash Hotkey
Send ("{ALTDOWN}")
Sleep(4000)
Send ("{CTRLDOWN}")
Sleep (500)
MouseClick ("left")
Sleep (500)
MouseClick ("left")
Sleep (500)
MouseClick ("left")
Sleep (500)
MouseClick ("left")
Sleep (500)
MouseClick ("left")
Sleep (500)
Send ("{CTRLUP}")
Sleep (4000)
$result = _ImageSearch("Fomor.png",1,$x1,$y1,100)
if $result=1 Then ; If there is a fomor scroll, pick it up
MouseMove($x1,$y1,0)
sleep (250)
MouseClick("left",$x1,$y1,1,3)
sleep(1000)
EndIf
$result2 = _ImageSearch("Gold.png",1,$x2,$y2,100)
if $result2=1 Then ; If there is gold on the ground, pick it up
MouseMove($x2,$y2,0)
sleep (250)
MouseClick("left",$x3,$y3,1,3)
sleep(1000)
EndIf
Send ("{ALTUP}")
WEnd
Func TogglePause() ; Pause function
$Paused = not $Paused
While $Paused
ToolTip("paused")
sleep(100)
WEnd
EndFunc
Func Stop() ; End function
Exit 0
EndFunc
#include <ImageSearch.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
Global Const $VK_DELETE = 0x2E
Global Const $VK_ESCAPE = 0x1B
Global $hFunc,$pFunc,$hHook,$hMod
Global $x=0,$y=0,$result,$window="Mabinogi"
Opt("OnExitFunc","_cleanUp")
$hFunc = DllCallbackRegister('_KeyboardHook', 'lresult', 'int;uint;uint')
$pFunc = DllCallbackGetPtr($hFunc)
$hMod = _WinAPI_GetModuleHandle(0)
$hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, $pFunc, $hMod)
MsgBox(0,"Notice","Click OK to start")
If Not WinActive($window) Then WinActivate($window)
Sleep(3000)
While 1
If WinActive($window) Then
Send ("{F3}") ; Smash Hotkey
Send ("{ALTDOWN}")
Send ("{CTRLDOWN}")
Sleep (500)
If $x = 0 Then
Local $pos = MouseGetPos()
$x = $pos[0]
$y = $pos[1]
EndIf
MouseClick ("primary",$x,$y,4,100)
Sleep (500)
Send ("{CTRLUP}")
Sleep (4000)
$result = _ImageSearch("Fomor.png",1,$x,$y,100)
If $result = 1 Then ; If there is a fomor scroll, pick it up
MouseMove($x,$y,0)
Sleep (250)
MouseClick("primary",$x,$y,1)
Sleep(1000)
EndIf
$result = _ImageSearch("Gold.png",1,$x,$y,100)
If $result = 1 Then ; If there is gold on the ground, pick it up
MouseMove($x,$y,0)
Sleep (250)
MouseClick("primary",$x,$y,1)
Sleep(1000)
EndIf
Send ("{ALTUP}")
Else
Sleep(1000)
EndIf
WEnd
;Functions
Func _cleanUp()
ControlSend("", "", "", "text", 0)
Send("{ALTUP}")
Send("{CTRLUP}")
_WinAPI_UnhookWindowsHookEx($hHook)
DllCallbackFree($hFunc)
EndFunc
Func _KeyboardHook($iCode, $iwParam, $ilParam)
Local $tKBDLLHS = DllStructCreate($tagKBDLLHOOKSTRUCT, $ilParam)
Local $iVkCode
If $iCode > -1 Then
$iVkCode = DllStructGetData($tKBDLLHS, 'vkCode')
If $iwParam = $WM_KEYUP Then
Switch $iVkCode
Case $VK_ESCAPE
;Exits.
Exit(0)
Case $VK_DELETE
;Short pause.
Sleep(10000)
EndSwitch
EndIf
EndIf
Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam)
EndFunc
I also use autoit for other projects so I probably have a ton more practice with it.
That code is not tested and that should have a working exit and pause hot key, they worked for me when I played as hotkeyset does not work with mabinogi.
The bot runs fine for a bit, but then he starts to attack a tree or signpost or something. I was wondering if there was any way to make my character stop hitting them and go back to monsters without me having to intervene?
Also, even if a monster is closer to the mouse when it clicks to attack it stays attacking the non monster. (Sorry if that doesn't make sense. =\)
I'm trying use Theri's script but I keep getting an error on the ALTUP line, flame all you want for my general lack
of know how in AutoIt but then at least point me in the right direction.
I've already searched the AutoIt section of the forums and looked at several Tutorials and Guides for AutoIt and
none of them seem to cover my error.
I'm not at home now and most my scripts are on my external drive. I see you fixed the missing bracket. For the other problem I probably forgot to include a line, I'll post up when I figure out what I forgot.
edit:
Add
Code:
#include <WinAPI.au3>
to the top. The origonal code in the post has been updated to fix both errors.
quick question: i've made autoit scripts for past nexon events, and was wondering how u get the hotkeys to work in mabi. i used 2 example script from the help files.
Cloud nine 08/31/2010 - General Gaming Discussion - 2 Replies Somthing for Cloud nine pls can help ? Bot or som hacks.... ty
any cloud nine hacks 06/15/2010 - General Gaming Discussion - 7 Replies just wondering if there was a trainer or something
Cloud Nine 12/10/2009 - General Gaming Discussion - 0 Replies Need bot for game...
[Release] Basic Structure for Cloud Saint's Jar 08/19/2009 - CO2 PServer Guides & Releases - 1 Replies I don't use LOTF or CoEmu but I know the quest has been release. This structure of the item packet is for the Jar. You have to find the method for adding a soul in the jar. I'm on the older client, I don't want to take the time to search...
Length -> UInt16 //I think it's 36 like the other
Type -> UInt16 //0x3F0 or 1008
UniqId -> UInt32 //Random Number
ItemId -> UInt32 //750000 for the Jar
ToKill -> UInt16 //0 to 65535
Type -> UInt16 //1 to 20 (Monster)
SubType -> UInt16 //0x01 ->...
Cloud Saint Jar 12/09/2007 - Conquer Online 2 - 1 Replies Is there a possible way to use Jar more than the allocated times per CO a day?
Like use the jar many time not 3 times?