Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Thu Nov 21, 2024 7:19 pm

All times are UTC




Post a reply
Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
Font colour
Options:
BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Please click and drag the 2 correct statements to the right hand side.
Please click and drag the 2 correct statements to the right hand side.
Please select the options below to the correct list to avoid automated registrations.
Statements
2 correct statements
Elephants can fly
Chickens can talk
Dogs have 4 legs
Fish can swim
   

Topic review - Timeouts
Author Message
  Post subject:  Re: Timeouts  Reply with quote
Remember, you can edit this line:

Code:
if  Variable.Is greater than (Math)("Switch Enemies", "14999") //Edit the "14999" of your liking, keep in mind that 1 second = 1000 ms.


You can try to type '5000' instead if your character can kill a lot faster. If that works fine with no problems, you can perhaps notch it down to '4500'.
Post Posted: Tue Sep 27, 2011 1:14 pm
  Post subject:  Re: Timeouts  Reply with quote
Thank you.
but it is waiting 15 sec to switch enemies even when it is already dead.
Post Posted: Tue Sep 27, 2011 1:10 pm
  Post subject:  Re: Timeouts  Reply with quote
A small correction, to see how long has passed since the stop watch was started, you first need to read the stopwatch value using Macro.Read stopwatch, like this:

Code:
 begin
     if  Color.At coordinate is within (RGB range)("113", "129", "44", "0", "529", "663")
          begin
               Keyboard.Press key("{<tab>}")
               Macro.Pause("300")
               Macro.Start stopwatch("Switch Enemies")
               begin loop()
                    Keyboard.Press key("{<f1>}")
                    Macro.Pause("320")
                    Macro.Read stopwatch("Switch Enemies", "time")
                    if  Variable.Is greater than (Math)("time", "14999")
                         begin
                              Macro.Reset stopwatch("Switch Enemies")
                              Macro.Stop stopwatch("Switch Enemies")
                              Macro.Break from loop("no")
                         end
               end
          end
 end
Post Posted: Sun Sep 25, 2011 9:24 am
  Post subject:  Re: Timeouts  Reply with quote
Nice first attempt, it's just sometimes knowledge is power and the more you know about certain functions, the better. And that knowledge will be brought now~ (Ah, a little note: you can use the [.code][/code] feature (without the period) to wrap your code around.)

Concerning time, there's a command called Macro.Start stopwatch() that essentially lets you create a timer. Then we'll 'Read the stopwatch' and compare it to an if statement to see if the time exceeds 15 seconds (This function uses the unit 'ms' miliseconds, so 1 second = 1000 ms). The important part is that we need the timer to stop and reset itself so that way it'll only count for those 15 seconds the moment it finds another enemy to target on.

Here's a small example:

Code:
 Macro.Start stopwatch("Switch Enemies")
 begin loop()
     Macro.Read stopwatch("Switch Enemies", "time")
     if  Variable.Is greater than (Math)("time", "14999")
          begin
               Macro.Reset stopwatch("Switch Enemies")
               Macro.Stop stopwatch("Switch Enemies")
               Macro.Break from loop("no")
          end
 end


The Macro.Break from loop "no" signifies to break the loop immediately. If you want this to loop infinity until you want it to stop, there's a tickmark you can check called 'Infinite' under loops. You can click on that and your entire macro will loop regardless. Make sure under 'Trigger' that you actually set up a hotkey to stop your macro (I recommend Ctrl+A).

I'll go under the assumption that 'tab' is to switch enemies, and to make this macro efficient, you already got one pixel detection that essentially activates the whole macro, so we'll leave the beginning part alone, and get rid of the second pixel detection. Here's a revised code I came up with on the fly, let me know what you think and report back. You may edit this particular line if you choose to edit the amount of seconds:

Code:
if  Variable.Is greater than (Math)("Switch Enemies", "14999") //Edit the "14999" of your liking, keep in mind that 1 second = 1000 ms.


Modified code for you (with a bit of Gigus on the side):

Code:
begin
     if  Color.At coordinate is within (RGB range)("113", "129", "44", "0", "529", "663")
          begin
               Keyboard.Press key("{<tab>}")
               Macro.Pause("300")
               Macro.Start stopwatch("Switch Enemies")
               begin loop()
                    Keyboard.Press key("{<f1>}")
                    Macro.Pause("320")
                    Macro.Read stopwatch("Switch Enemies", "time")
                    if  Variable.Is greater than (Math)("time", "14999")
                         begin
                              Macro.Reset stopwatch("Switch Enemies")
                              Macro.Stop stopwatch("Switch Enemies")
                              Macro.Break from loop("no")
                         end
               end
          end
end


Edit: Reflects on Gigus's post. I must of been on a sugar rush typing this out~
Post Posted: Sun Sep 25, 2011 3:54 am
  Post subject:  Timeouts  Reply with quote
I dont know nothing yet how to create a macro so don't laught :p
i want to it select the mob then attack and when it die select another mob. but sometimes it stuck in walls,tree etc.. so i want to add timeouts. (15 segs) then select another mob.
also if someone can improve it i would be happy,thank you.


Code:

begin
     if  Color.At coordinate is within (RGB range)("113", "129", "44", "0", "529", "663")
          begin loop("1024")
               Keyboard.Press key("{<tab>}")
               Macro.Pause("300")
               Keyboard.Press key("{<f1>}")
               Macro.Pause("320")
               if  Color.At coordinate is not within (RGB range)("113", "129", "44", "0", "530", "660")
                    begin
                         Keyboard.Press key("{<f1>}")
                         Macro.Pause("310")
                    end
          end
 end


Post Posted: Sun Sep 25, 2011 1:31 am

All times are UTC


Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group