Jump to content

My bot so far.. problems! :P


Recommended Posts

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author:        A.N.Other <myemail@nowhere.com>
;
; Script Function:
;   Template AutoIt script.
;
; ----------------------------------------------------------------------------

; Script Start - Add your code below here

;===========================
; INitializing...
HotKeySet("{ESC}", "CaptureESC")
$Primary = "Left"
Dim $Primary
$secondary = "Right"
Dim $secondary

;=============================
;   Misc Func's...
Func CaptureESC()
    Exit 0
EndFunc


;============================
;   Log In....
Run("C:\Program Files\Lineage II\system\l2.exe")
WinWaitActive("Lineage II")
sleep("20000")
MouseClick($primary, 481, 331)
Sleep("100")
Send("xxxxx")
Sleep("100")
MouseClick($primary, 490, 355)
Send("xxxxx")
sleep("100")
MouseClick($primary, 461, 388)
sleep("250")
Mouseclick($primary, 505, 420)
Sleep("1000")
MouseClick($primary, 237, 493)
sleep("200")
MouseClick($primary, 512, 679)
sleep("15000")

;================================
;       Initializing set up
Mouseclick($secondary)
MouseWheel("up", 75)
Send("{F7}")
;===============================
;       Health Checking...
AdLibEnable("CheckHealth")
While 1
$Color = Pixelgetcolor(130, 38)
Wend

Func CheckHealth()
If $Color = 5379096 Then
Send("{F8}")
sleep("15000")
EndIf
EndFunc

;==================================
;       Mana Check...
AdLibEnable("CheckMana")
While 1
$MColor = PixelGetcolor(58, 51)
$Combat = PixelGetColor(160, 37)
WEnd
Func CheckMana()
If $MColor = 1057866  AND $Combat = 9699336 Then
    Send("{F12}")
    sleep("10000")
    Send("{F12}")
    sleep("100")
EndIf
EndFunc

;================================
;       Target
AdLibEnable("Targeting")
While 1
$CombatIn = PixelGetColor(133, 92)
WEnd
Func Targeting()
If $ComabatIn = 4665611 Then
    Sleep("100")
    Else
    Send("{ENTER}")
    Send("/target Grizzly Bear")
    Sleep("250")    
    Send("{ENTER}")
    sleep("100")
    If $combatin = 4665611 Then
    Send("{F4}")
    Sleep("100")
    EndIF
    Else
    Send("{ENTER}")
    Send("/target Red Bear")
        Sleep("250")
    Send("{ENTER}")
    If $combatIn = 4665611 Then
    Send("{F4}")
    sleep("100")
    EndIf
EndIf
EndFunc

Well thats what it is so far.. I have the potions working fine... But the Mana and the targeting dont work.. Anyone know why?

I think its cauze im using the while 1.. WEnd thing.. so anyone have any idea of what else i can use?

--Harpy

Link to comment
Share on other sites

Better...

****** not tested

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author:        A.N.Other <myemail@nowhere.com>
;
; Script Function:
;   Template AutoIt script.
;
; ----------------------------------------------------------------------------

; Script Start - Add your code below here

;===========================
; INitializing...
HotKeySet("{ESC}", "CaptureESC")
$Primary = "Left"
Dim $Primary
$secondary = "Right"
Dim $secondary

;=============================
;    Misc Func's...
Func CaptureESC()
    Exit 0
EndFunc  ;==>CaptureESC


;============================
;   Log In....
Run("C:\Program Files\Lineage II\system\l2.exe")
WinWaitActive("Lineage II")
Sleep("20000")
MouseClick($Primary, 481, 331)
Sleep("100")
Send("xxxxx")
Sleep("100")
MouseClick($Primary, 490, 355)
Send("xxxxx")
Sleep("100")
MouseClick($Primary, 461, 388)
Sleep("250")
MouseClick($Primary, 505, 420)
Sleep("1000")
MouseClick($Primary, 237, 493)
Sleep("200")
MouseClick($Primary, 512, 679)
Sleep("15000")

;================================
;       Initializing set up
MouseClick($secondary)
MouseWheel("up", 75)
Send("{F7}")
;===============================

AdlibEnable("Checker")

While 1
    Sleep(20); slow down processor use
WEnd

;==================================
; check all other functions

Func Checker()
    CheckHealth()
    CheckMana()
    Targeting()
EndFunc  ;==>Checker

;==================================
;       Health Checking...

Func CheckHealth()
    $Color = PixelGetColor(130, 38)
    If $Color = 5379096 Then
        Send("{F8}")
        Sleep("15000")
    EndIf
EndFunc  ;==>CheckHealth

;==================================
;       Mana Check...

Func CheckMana()
    $Combat = PixelGetColor(160, 37)
    $MColor = PixelGetColor(58, 51)
    If $MColor = 1057866 And $Combat = 9699336 Then
        Send("{F12}")
        Sleep("10000")
        Send("{F12}")
        Sleep("100")
    EndIf
EndFunc  ;==>CheckMana

;================================
;       Target

Func Targeting()
    $CombatIn = PixelGetColor(133, 92)
    If $CombatIn = 4665611 Then
        Sleep("100")
    Else
        Send("{ENTER}")
        Send("/target Grizzly Bear")
        Sleep("250")
        Send("{ENTER}")
        Sleep("100")
    EndIf
    If $CombatIn = 4665611 Then
        Send("{F4}")
        Sleep("100")
    Else
        Send("{ENTER}")
        Send("/target Red Bear")
        Sleep("250")
        Send("{ENTER}")
    EndIf
    If $CombatIn = 4665611 Then
        Send("{F4}")
        Sleep("100")
    EndIf
EndFunc  ;==>Targeting

8)

NEWHeader1.png

Link to comment
Share on other sites

Okay well i kinda mixed yours with mine.. so thanks man :D it seems to work good.. except i cant really test because well.. It works fine until the targeting.. an error pops up saying we are using $CombatIn without it being defined

--Harpy

Nevermind... I found it out.. i had it as $comabatIn :D thanks man.. gunna test it now!

Edited by Harpydog
Link to comment
Share on other sites

OKay.. well i tested my new code.. Doestwork

;================================
;       Target
Func TargetGriz()
  $CombatIn = PixelGetColor(133, 92)
  $Combatred = PixelGetColor(133, 92)
If $CombatIn = 4665611 Then
    Sleep("100")
    Else
    Send("{ENTER}")
    Send("/target Grizzly Bear")    
    Sleep("150")
    Send("{ENTER}")
    sleep("100")
    EndIF
    If $combatin = 4665611 Then
        Send("{F4}")
        Sleep("100")
        
        Else
    Send("{ENTER}")
    send("/target Red Bear")
    sleep("150")
    send("{ENTER}")
    sleep("100")
    If $Combatred = 4665611 Then
        Send("{F4}")
        Sleep("100")
        EndIf
EndIf 
EndFunc

That is my coding for teh 2 mobs i want to attack... but when i test.. it just types /target griz bear..

It targets it.. but then i dont attack.. i just go and type in target red bear.. hmm

Maybe i should take it down to just the griz til i figure autoit out a bit better

-Harpy

Link to comment
Share on other sites

Okay guys.. well I changed it a bit... And well I got it working enough so I get in.. all the things work.. it targets a grizzly bear.. sends me to attack.. just like i want.. but the thing is... It keeps on typing in.. target grizzly bear =/ anyone got a suggestion ?

my code goes like this...

;================================
;       Target
Func TargetGriz()
  $CombatIn = PixelGetColor(7, 100)
If $CombatIn = 3025431 Then
    Sleep("100")
    Else
    Send("{ENTER}")
    Send("/target Grizzly Bear")    
    Sleep("150")
    Send("{ENTER}")
    sleep("100")
    If $combatin = 3025431 Then
        Send("{F4}")
        Sleep("100")
        
    EndIf
EndIf 
EndFunc

If anyone has any ideas please say :D

--Harpy

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...