Jump to content

Simple Newbie question about loop


Recommended Posts

func Teleport_Air_Altar();Requires Teleport_Skilling_Area
      While 1;Trying to loop till it finds a pixel (NPC)
   $pixels = PixelSearch(290,32,498,212,0x999709,50)
   if @error Then
   sleep(1000)
   ContinueLoop
      WEnd
   if NOT(@error) Then
   MouseMove($pixels[0],$pixels[1],);Hoovers teleport NPC
   sleep(300)
   LC($pixels[0],$pixels[1])
   sleep(2750)
   MouseMove(266,413);Selects Air Altar Teleport
   LC(266,413)
   sleep(4000)
EndIf
EndIf
EndFunc

Link to comment
Share on other sites

Hello.

 

Welcome to the forum.

Please read up the forum rules (game automation, topic #1) ;)

 

Func Teleport_Air_Altar();Requires Teleport_Skilling_Area
    While 1;Trying to loop till it finds a pixel (NPC)
        $pixels = PixelSearch(290, 32, 498, 212, 0x999709, 50)
        If @error Then
            Sleep(1000)
            ContinueLoop
        Else
            MouseMove($pixels[0], $pixels[1],);Hoovers teleport NPC
            Sleep(300)
            LC($pixels[0], $pixels[1])
            Sleep(2750)
            MouseMove(266, 413);Selects Air Altar Teleport
            LC(266, 413)
            Sleep(4000)
        EndIf
    WEnd
EndFunc   ;==>Teleport_Air_Altar

 

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

Hint:

Func Coffee_watcher(); check the web cam, if coffee is available
    While 1;Trying to loop till it finds a pixel (NPC)
        $pixels = PixelSearch(290, 32, 498, 212, 0x999709, 50)
        If @error Then
            Sleep(1000)
            ContinueLoop
        Else ; trigger info, that coffee is not available
            MouseMove($pixels[0], $pixels[1],)
            Sleep(300)
            LC($pixels[0], $pixels[1])
            Sleep(2750)
            MouseMove(266, 413)
            LC(266, 413)
            Sleep(4000)
        EndIf
    WEnd
EndFunc   ;==>Coffee_watcher

That's basically the same question, isn't it?

:D

 

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

func Teleport_Air_Altar();Requires Teleport_Skilling_Area
      Do;Trying to loop till it finds a pixel (NPC)
   $pixels = PixelSearch(290,32,498,212,0x8E8C08,10)
   sleep(500)
   Until @error = 0
   MouseMove($pixels[0],$pixels[1]);Hoovers teleport NPC
   sleep(300)
   LC($pixels[0],$pixels[1])
   sleep(2750)
   MouseMove(266,413);Selects Air Altar Teleport
   LC(266,413)
   sleep(4000)
EndFunc

WOW that code that u've posted there is so similar, anyway i've found this code to work aswell ^. If u're already here, maybe you u know a way to use only window coordinates? Like that desktop coords wouldnt matter and only window coords would be used.

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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