Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Fri Jul 19, 2019 10:57 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Question about loop
Thanked: 0 time(s)  Unread post Posted: Wed Jan 16, 2019 2:54 pm 
New User
New User



Joined: Wed Jan 16, 2019 2:41 pm
Posts: 2
Been thanked: 0 time(s)
Has thanked: 1 time(s)
Contribution Points: 10
I have this piece of code that I want to execute.

Code:
 Begin
     Macro.Pause("4000")
     begin loop()
          Humanly.Pause("85", "125")
          Humanly.Click at coordinate("1327", "798", "left", "no")
          Humanly.Click at coordinate("1287", "800", "left", "no")
          Color.Wait for color at coordinate to change("1295", "789")
          Humanly.Pause("85", "125")
          Humanly.Click at coordinate("1280", "490", "left", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("865", "848", "left", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("804", "787", "left", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("1200", "585", "right", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("1199", "690", "left", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("681", "263", "right", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("641", "363", "left", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("1079", "184", "left", "yes")
          Humanly.Pause("182", "375")
     end
 end
 


It's basically a Runescape macro that clicks on 2 different items in the inventory multiple times and then starts depositing the crafted items in the bank once the last item is done (that's where the color change comes in play). However, with my current code it will just click on the two inventory slots once and then try to bank the items. How do I tune it so that it repeats the two lines above "Color.Wait for color at coordinate to change("1295", "789")" until the color actually changes? I tried adding another loop but then it just never proceeds to the banking part.

Edit: Also, I'm pretty new to Runescape. Will this get me banned and are there any ways to improve it? I don't really want to have it randomize the clicks too much as it only takes 1 wrong click before you find yourself at the opposite edge of the map :lol:


Top
 Profile  
Reply with quote  
 Post subject: Re: Question about loop
Thanked: 0 time(s)  Unread post Posted: Thu Jan 17, 2019 1:41 am 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1903
Location: USA
Been thanked: 412 time(s)
Has thanked: 33 time(s)
Contribution Points: 16583
If I understand your question correctly, this should do it:
Code:
 Begin
     Macro.Pause("4000")
     begin loop("2")
          Humanly.Pause("85", "125")
          Humanly.Click at coordinate("1327", "798", "left", "no")
          Humanly.Click at coordinate("1287", "800", "left", "no")
end
          Color.Wait for color at coordinate to change("1295", "789")
          Humanly.Pause("85", "125")
          Humanly.Click at coordinate("1280", "490", "left", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("865", "848", "left", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("804", "787", "left", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("1200", "585", "right", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("1199", "690", "left", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("681", "263", "right", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("641", "363", "left", "no")
          Humanly.Pause("182", "375")
          Humanly.Click at coordinate("1079", "184", "left", "yes")
          Humanly.Pause("182", "375")
 end
If you meant for the first 2 lines to keep repeating until the color changes, you'll have to script it differently; don't think you can do it with "wait".

So something like:
get color at coordinate, save to variable, check variable...
if variable is the same (color hasn't changed), then restart macro (only does first 2 lines)

_________________
----------------------------------------Syrifina---------------------------------------------------
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Question about loop
Thanked: 0 time(s)  Unread post Posted: Fri Feb 08, 2019 11:23 am 


Thanks for the answer. One more question. I want the program to point my mouse cursor at a specific color (not always located at the same coordinate) and once the color under my mouse cursor changes I want it to start looking for the same color elsewhere. I was hoping for a "wait for color under cursor to change" type of command but there is no such thing, right?


Top
  
Reply with quote  
 Post subject: Re: Question about loop
Thanked: 1 time(s)  Unread post Posted: Fri Feb 08, 2019 10:24 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1903
Location: USA
Been thanked: 412 time(s)
Has thanked: 33 time(s)
Contribution Points: 16583
There's criteria for the color on/near the current mouse position...here: viewforum.php?f=150 Look for ones that say "mouse position".

There's criteria for the mouse on/near a particular color...here: viewforum.php?f=156

There's wait for color to change (at a specific coordinate)...here: viewtopic.php?f=162&t=300
- which you can use if you add a little bit more to your script. After the mouse moves to the color, use get mouse current position, save to variable, then use those coordinates for the above instruction.

You should be able to find something that works for you

_________________
----------------------------------------Syrifina---------------------------------------------------
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Question about loop
Thanked: 0 time(s)  Unread post Posted: Sat Feb 09, 2019 1:35 pm 
New User
New User



Joined: Wed Jan 16, 2019 2:41 pm
Posts: 2
Been thanked: 0 time(s)
Has thanked: 1 time(s)
Contribution Points: 10
Stupid me was only looking under "instructions", completely unaware that there is another full list of commands under "criteria". The "Is not above color (RGB)" is exactly what I was looking for. Thanks a lot again !!!


Top
 Profile  
Reply with quote  
 Post subject: Re: Question about loop
Thanked: 0 time(s)  Unread post Posted: Sat Feb 09, 2019 8:08 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1903
Location: USA
Been thanked: 412 time(s)
Has thanked: 33 time(s)
Contribution Points: 16583
No worries. The good news is that those are the only two lists: (documentation page): viewforum.php?f=135

We tried to organize it so that Criteria should be "what your looking for (what needs to be met)" and Instructions should be "what you want to do." Although it can be a little confusing at first since you can add "if" to an Instruction which kind of changes it to what you're looking for.

_________________
----------------------------------------Syrifina---------------------------------------------------
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 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