Jump to content

Error message


Recommended Posts

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

WinWait("LastChaos - Aeria Games & Entertainment (Window 1024x768)","")

If Not WinActive("LastChaos - Aeria Games & Entertainment (Window 1024x768)","") Then WinActivate("LastChaos - Aeria Games & Entertainment (Window 1024x768)","")

WinWaitActive("LastChaos - Aeria Games & Entertainment (Window 1024x768)","")

;HotKeySet('{enter}', '_Exit') ;This sets the key to exit script (which is currently enter) anything after a semicolon is a comment, and does not affect the script

;While 1 = 1 ;Read it like a sentence. This means that while one equals one (hint: thats always), it runs the following.

;Sleep(10) ;Wait 10 milliseconds. If you want 5 minutes, the number would be 5 times 60 times 1000. 1 second = 1000 Milliseconds

;WEnd

;Func _Exit()

;Exit

;EndFunc ;Last 3 lines just make the script turn off when enter is pressed.

HotKeySet('{esc}', '_Exit') ;Hotkey escape

Dim $Coord, $Click, $Target, $SearchResult

$Target = 0x5B9600 ;What you are targeting. This is a color in hex or decimal notation. Currently its set for white.

$Click = "Right" ;Which mouse button. Right click selects without moving, so if the script misses the monster, it wont start walking where it missed, as it would with left click.

While 1 = 1

Sleep(100) ;I added the sleep there so it only clicks once every 100 milliseconds. Without this, the camera is often messed up because the mouse is dragged while its right clicking, moving the camera.

$SearchResult = PixelSearch(252,196,768,487,$Target,5,3) ;First set of numbers is where it searches. Remember, keep LC centered (untouched) when you start the program. If you run LC in a different resolution than you set the pixel search coordinates for it will not work. (continued below)

;The first number is variation (5). This means it varies the hue by 5, so it is not exactly green always. The second number is step. (continued below)

;Pixel search searches every pixel, at 2, it skips every other pixel. This makes it go faster, searching every pixel is unnecessary. Three could probably work, as well. If you want it to go faster, push this number up a little (personally I think its fine).

If @error Then

Else

MouseClick($Click, $SearchResult[0] +25, $SearchResult[1] +60, 7, 3);Clicks with right key, a little below and to the right, so it clicks on mosnter instead of name.

if $SearchResult = PixelSearch(237,193,806,638,$Target,5,1) Then

Send("{F1}") ;Press "A" in LC, This should be the action window, in "general" tab. Drag regular "Attack" into F1.

Send("{F3}") ;Drag the gather hotkey (horse or yourself). Horse is nice, but yourself makes it look less like a bot, I think.

Else

Send("{Right}") ;Right arrow key is sent, to rotate your camera

$SearchResult = PixelSearch(342,342,1000,342,$Target,5,3)

MouseClick($Click, $SearchResult[0] +25, $SearchResult[1] +60, 7, 3);Clicks with right key, a little below and to the right, so it clicks on mosnter instead of name.

if $SearchResult = PixelSearch(237,193,806,638,$Target,5,1) Then

Send("{F1}") ;Press "A" in LC, This should be the action window, in "general" tab. Drag regular "Attack" into F1.

Send("{F3}") ;Drag the gather hotkey (horse or yourself). Horse is nice, but yourself makes it look less like a bot, I think.

EndIf

EndIf

EndIf

WEnd

Func _Exit()

Exit

EndFunc

While 1

Sleep(5*60*1000);Minutes*Seconds*Milliseconds. Change the first number to change amount of minutes.

Send("{F3}")

WEnd

I get an error that looks like this.

MouseClick($Click, $SearchResult[0] +25, $SearchResult[1] +60, 7, 3)

MouseClick($Click, $SearchResult^ERROR

Error: Subscript used with non-array variable

please help and thx.

Link to comment
Share on other sites

For pixelsearch: Failure: Sets @error to 1 if color is not found.

So check @error before you MouseClick, because if it failed, $SearchResults will not be an array

I'm not to sure how to fix this, unless you mean my coords are wrong then its up to me anyway.

Link to comment
Share on other sites

Replace this:

MouseClick($Click, $SearchResult[0] +25, $SearchResult[1] +60, 7, 3)oÝ÷ Û­8b±«­¢+Ù%ÉɽȱÐìÐìÄQ¡¸5½ÕÍ
±¥¬ ÀÌØí
±¥¬°ÀÌØíMÉ¡IÍÕ±ÑlÁt¬ÈÔ°ÀÌØíMÉ¡IÍÕ±ÑlÅt¬ØÀ°Ü°Ì¤

This way it will not try to click if the pixel was not found.

Nice thank you very much, getting a couple small errors but i think i can handle from here.
Link to comment
Share on other sites

Replace this:

MouseClick($Click, $SearchResult[0] +25, $SearchResult[1] +60, 7, 3)oÝ÷ Û­8b±«­¢+Ù%ÉɽȱÐìÐìÄQ¡¸5½ÕÍ
±¥¬ ÀÌØí
±¥¬°ÀÌØíMÉ¡IÍÕ±ÑlÁt¬ÈÔ°ÀÌØíMÉ¡IÍÕ±ÑlÅt¬ØÀ°Ü°Ì¤

This way it will not try to click if the pixel was not found.

Up and working for me =D thanks again
Link to comment
Share on other sites

  • 4 weeks later...

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...