Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Sun Jun 16, 2019 9:22 am

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Need help with an Execution time script please.
Thanked: 0 time(s)  Unread post Posted: Tue May 28, 2019 5:57 am 
New User
New User

Joined: Tue May 28, 2019 5:22 am
Posts: 4
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 16
Hi all, so Im trying to made a script for a bot im making and got a bit stuck. I want the script to Logout of the game after a certain amount of time has passed (random variable), wait a certain amount of time (random variable), then log back in and run for a certain amount of time. Here is what I have so far.
     if  Macro.Execution time has exceeded("40000")
               Macro.Execute new("p", "plogout", "Yes")

     Keyboard.Press key("{<esc>}")
     Keyboard.Release keys("{<esc>}")
     Mouse.Click at pixel pattern("93,18,35,18,0,0,0,0,8,-2,255,255,255,8,0,0,0,0,2,0,255,255,255,4,0,255,255,255,2,0,255,255,255,16,0,255,255,255,14,-2,255,255,255,12,2,95,18,36,2,0,95,18,36", "10", "no", "Left")
     Function.Execute("Human Pause3")

function("Human Pause3")
          Variable.Set random number("HumanTime", "18000", "30000")

And it works for the most part, only that when it logs back in, it tried to logout again as if it was reached the Execution time limit already. I was thinking that the "Macro.Restart("yes")" would reset the timer but it seems not to or that I dont fully understand how Macro.Restart works.

An Idea just hit me that might work.... If I add Macro.Abort() after Macro.Execute new("p", "plogout", "Yes") and add Macro.Execute new with the other macro... will that reset the execution timer?

Im still new to this, sorry if any of this is poorly done.

Reply with quote  
 Post subject: Re: Need help with an Execution time script please.
Thanked: 1 time(s)  Unread post Posted: Tue May 28, 2019 4:53 pm 
Partner / License admin
Partner / License admin
User avatar

Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1899
Location: USA
Been thanked: 409 time(s)
Has thanked: 33 time(s)
Contribution Points: 16568
Short answer is yes your idea should work and I think you got it working from your other post since you had "abort" in there.

According to the script above, when the exe time is reached you use another macro to exit the game which means this one is still running (and of course past the 40k time) you should get what you first described; it saying it's already past the time limit.

"macro.restart": BEM is linear, so it reads line to line going down your script (unless you tell it to go somewhere else like with functions; but it will go back to that same spot after executing that function unless you told it to do something else). Macro.start tells it to go back to the beginning of the macro; nothing is reset automatically, you've only changed where BEM is reading.
- Although there's lots you can do with this, I mainly use it in loops or at the end of a function that marks the last task I want to do before I go back to the beginning and do "checks" again (like if you're checking HP, MP, etc). Like if using a flow chart and you're at the end of a branch and need to back to the beginning and start over because next time you may go down a different branch.

You can get it to work like you described, but I find it much easier to use stopwatches (found on the same Instructions page as macro restart (macro page). You can reset/restart stopwatches anytime you want (need to "read" stopwatch to get it to do something). Then you could use functions to exit the game instead of separate macros to exit and login.

PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  

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