Jump to content

A little more help please.


jessegk
 Share

Recommended Posts

I have been trying to get this script running but there is a bug I can't figure out.

I am a novice autoit user so ANY tips would be appreciated on how to clean up or better write the script.

This script is for eve. What it is supposed to do is target the nearest asteroid(it targets fine), then start a laser. It is not supposed to target another asteroid unless it finds that $color1 is not a certain color(12558712). That works fine and dandy and it targets if there is not a target up and starts a laser, but the problem is, after it has targeted the asteroid and the laser is running, something screws up and it starts the targeting again. Is <> what I should be using there?

My best guess was the color not being updated, which i fixed (I think?) by putting the $color variables inside the loop. I am almost 100% positive the color decimal is correct. I wrote another script to test it, it works fine. Any help here would be appreciated. There is probably something right under my nose :whistle:

Sleep (1000)
$Startlaser = 0
While 1
$color1 = PixelGetColor ( 899 , 40 )
$color2 = PixelGetColor ( 1257 , 746 ); not used yet
    Sleep(200)
if $Startlaser = 1 Then ;if it has done the whole target nearest thing(below), start the mining laser
    Send ( "{f1}" , 0);laser key
    $Startlaser = 0; make sure laser key isnt hit unless something is retargeted
elseIf $color1 <> 12558712 Then ;if no target, target the nearest astroid on the overview
    Sleep (1000)
    MouseClick ( "right" , 1119, 75 , 1 , 5  )
    Sleep (500)
    MouseClick ( "left" , 1119, 138 , 1 , 5  );lockon
    Sleep (16000)
    $Startlaser = 1; targeting has finished, next loop start laser
Endif
Wend
Link to comment
Share on other sites

I have been trying to get this script running but there is a bug I can't figure out.

I am a novice autoit user so ANY tips would be appreciated on how to clean up or better write the script.

This script is for eve. What it is supposed to do is target the nearest asteroid(it targets fine), then start a laser. It is not supposed to target another asteroid unless it finds that $color1 is not a certain color(12558712). That works fine and dandy and it targets if there is not a target up and starts a laser, but the problem is, after it has targeted the asteroid and the laser is running, something screws up and it starts the targeting again. Is <> what I should be using there?

My best guess was the color not being updated, which i fixed (I think?) by putting the $color variables inside the loop. I am almost 100% positive the color decimal is correct. I wrote another script to test it, it works fine. Any help here would be appreciated. There is probably something right under my nose :whistle:

Sleep (1000)
$Startlaser = 0
While 1
$color1 = PixelGetColor ( 899 , 40 )
$color2 = PixelGetColor ( 1257 , 746 ); not used yet
    Sleep(200)
if $Startlaser = 1 Then ;if it has done the whole target nearest thing(below), start the mining laser
    Send ( "{f1}" , 0);laser key
    $Startlaser = 0; make sure laser key isnt hit unless something is retargeted
elseIf $color1 <> 12558712 Then ;if no target, target the nearest astroid on the overview
    Sleep (1000)
    MouseClick ( "right" , 1119, 75 , 1 , 5  )
    Sleep (500)
    MouseClick ( "left" , 1119, 138 , 1 , 5  );lockon
    Sleep (16000)
    $Startlaser = 1; targeting has finished, next loop start laser
Endif
Wend
By looking at your code, I can only guess your problem (never played eve). Your problem: $color1 is having trouble being equal to 12558712, meaning it has to be something to do with PixelGetColor or something else.

Just thought I'd point out my guess on why it's not working :)

Kurt

Awaiting Diablo III..

Link to comment
Share on other sites

By looking at your code, I can only guess your problem (never played eve). Your problem: $color1 is having trouble being equal to 12558712, meaning it has to be something to do with PixelGetColor or something else.

Just thought I'd point out my guess on why it's not working :whistle:

Kurt

Thanks. I will start messing around with that and see what I can do. Maybe I skipped something.

Link to comment
Share on other sites

Is <> what I should be using there?

No it isn't! I think I found your problem. <> is used to test if two values are not equal, however = tests if two values are equal.

Therefore replace:

elseIf $color1 <> 12558712 ThenoÝ÷ Ùh­Øb±«­¢+Ù±Í%ÀÌØí½±½ÈÄôÄÈÔÔàÜÄÈQ¡¸

I'm hoping this will work :whistle: Tell me how it does.

Kurt

Awaiting Diablo III..

Link to comment
Share on other sites

No it isn't! I think I found your problem. <> is used to test if two values are not equal, however = tests if two values are equal.

Therefore replace:

elseIf $color1 <> 12558712 ThenoÝ÷ Ùh­Øb±«­¢+Ù±Í%ÀÌØí½±½ÈÄôÄÈÔÔàÜÄÈQ¡¸oÝ÷ Øý)x-+0Yp¢¹zYfz0×hz®®ßêº^!©©­ëmÊË«zØZ¶+¢ºÞrÔáz·Á©íÛh¢yrµªàzÖ§{¬µêèض¨Ú'z+ ¢wéíê%vÞÈ(æ§Ê'v+,j®Ëajج­©¢Z+r)àEç¥élxôߧ(õØ-×nyó½vÇ!yÉ"h±ç¢}§(â²z-¶«y·jëø­É÷öØ­ç²Ú-j¸µ©ÞÁ«-zº"tò¢é'£
j|¨¶«Á¬¬¶+×­+)æ¬z×¥8ZK¢»kÊ)à¶^.®Ò,¶)eq©÷ö×âêÞ¶¬¢ëHjo}²êÞ"¯zØ^rh­È^rH§¸ Ò0®^jX­¶W¬r¸©¶Úç$jwlyèܱ«­¢+Ø(ÀÌØí½±½ÈÄôA¥á±Ñ
½±½È äÀä°Ðà¤)¥ÀÌØí½±½ÈÄôÄØÌÄØØÐàQ¡¸)µÍ½à Ä°ÅÕ½ÐíÑÍÐÅÕ½Ðì°ÅÕ½ÐíÑÉб½­ÅÕ½Ðì¤)±Í)µÍ½à Ä°ÅÕ½Ðí¹¼ÑÉÐͱѰÅÕ½ÐìÅÕ½ÐìµÀìÀÌØí½±½ÈĤ)¹¥

This works fine. Although it is not in a loop like the other script. I am going to experiment some more. If you get any ideas I will be refreshing this page like a madman.

Link to comment
Share on other sites

elseIf $color1 <> 12558712 is checking to see if a color is not there because if it isn't, it needs to target a new asteroid.

Woops, guess I was wrong. It would be so much easier if I had an idea of what the game is like. Well, I'll take another shot at it!

If this experiment does infact work:

$color1 = PixelGetColor ( 909 , 48 )
if $color1 = 16316648 Then
msgbox (1,"test","target locked")
else
msgbox (1,"no target selected  ,"" & $color1)
endifoÝ÷ Ù8^«ªlÝý²Ø^ÂÝx(~Ø^±Êâ¦ÛajÝý²Ø^¦ºéßÙ«ºyâ
.¶âuæ¬Ùm1¬zÚò¶¬jëh×6Sleep (1000)
$Startlaser = 0
While 1
    $color1 = PixelGetColor ( 899 , 40 )
    $color2 = PixelGetColor ( 1257 , 746 ); not used yet
    Sleep(200)
    If $Startlaser = 1 Then ;if it has done the whole target nearest thing(below), start the mining laser
        Send ( "{f1}" , 0);laser key
        $Startlaser = 0; make sure laser key isnt hit unless something is retargeted
    else
        If NOT $color1 = 12558712 Then ;if no target, target the nearest astroid on the overview
            Sleep (1000)
            MouseClick ( "right" , 1119, 75 , 1 , 5  )
            Sleep (500)
            MouseClick ( "left" , 1119, 138 , 1 , 5  );lockon
            Sleep (16000)
            $Startlaser = 1; targeting has finished, next loop start laser
        EndIf
    EndIf
Wend

If your experiment did infact work, this should.

Good Luck, :whistle:

Kurt

Awaiting Diablo III..

Link to comment
Share on other sites

Woops, guess I was wrong. It would be so much easier if I had an idea of what the game is like. Well, I'll take another shot at it!

If this experiment does infact work:

$color1 = PixelGetColor ( 909 , 48 )
if $color1 = 16316648 Then
msgbox (1,"test","target locked")
else
msgbox (1,"no target selected  ,"" & $color1)
endifoÝ÷ Ù8^«ªlÝý²Ø^ÂÝx(~Ø^±Êâ¦ÛajÝý²Ø^¦ºéßÙ«ºyâ
.¶âuæ¬Ùm1¬zÚò¶¬jëh×6Sleep (1000)
$Startlaser = 0
While 1
    $color1 = PixelGetColor ( 899 , 40 )
    $color2 = PixelGetColor ( 1257 , 746 ); not used yet
    Sleep(200)
    If $Startlaser = 1 Then ;if it has done the whole target nearest thing(below), start the mining laser
        Send ( "{f1}" , 0);laser key
        $Startlaser = 0; make sure laser key isnt hit unless something is retargeted
    else
        If NOT $color1 = 12558712 Then ;if no target, target the nearest astroid on the overview
            Sleep (1000)
            MouseClick ( "right" , 1119, 75 , 1 , 5  )
            Sleep (500)
            MouseClick ( "left" , 1119, 138 , 1 , 5  );lockon
            Sleep (16000)
            $Startlaser = 1; targeting has finished, next loop start laser
        EndIf
    EndIf
Wend

If your experiment did infact work, this should.

Good Luck, :)

Kurt

With that script nothing happens in game, but when I alt tabbed back to my desktop, the mouse moved and did the targeting thing. :whistle:

Maybe I need to test this out and have it check a very solid color.

Link to comment
Share on other sites

It's definately the color then. Perhaps the color is always "active" and that's the reason you aren't mouse moving/clicking.

Kurt

Yea I am trying to think of another thing to color check.

edit: Would PixelSearch be of any use to me? How do the x y left right work on this? It says in the helpfile "bottom coordinate of rectangle." etc, I cant seem to get my head around what they mean by that.

Edited by jessegk
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...