Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Thu Nov 21, 2024 8:12 pm

All times are UTC




Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Weapon Crafting and Sell item macro
Thanked: 2 time(s)  Unread post Posted: Tue Sep 07, 2010 7:41 am 
Lifetime VIP Contributor
Lifetime VIP Contributor



Joined: Sun Sep 05, 2010 10:13 am
Posts: 47
Been thanked: 2 time(s)
Has thanked: 3 time(s)
Contribution Points: 3417
Hello,

I'm trying to create a macro for crafting weapons and selling items in the shop. It's working in notepad, normally the coordinates should be alright also, but somehow I can't directly find how to get it working within Soma.
This is the code:
Code:
begin
     Window.Wait for window to appear("soma mythological biography", "no")
     begin loop()
          Keyboard.Wait for keys to be pressed("{<alt>}")
          if  Keyboard.Key is held down("1")
               begin
                    Mouse.Click at coordinate("100", "206", "Left")
                    Macro.Pause("350")
                    Keyboard.Type text("test")
                    begin loop("5")
                         Macro.Pause("450")
                         Mouse.Drag("106", "398", "88", "206", "Left")
                         Macro.Pause("450")
                         Keyboard.Type text("3")
                         Keyboard.Press key("<enter>")
                         Macro.Pause("450")
                         Mouse.Drag("164", "398", "88", "206", "Left")
                         Macro.Pause("250")
                         Keyboard.Press key("<enter>")
                         Macro.Pause("450")
                         Mouse.Click at coordinate("323", "255", "Left")
                         Macro.Pause("250")
                         If  Keyboard.Keys has been pressed within (ms)("{<esc>}", "5000")
                              begin
                                   Macro.Restart("Yes")
                              end
                    end
                    Macro.Pause("500")
                    Keyboard.Press key("<esc>")
               end
          if  Keyboard.Key is held down("2")
               begin loop("5")
                    Keyboard.Press key("<enter>")
                    Mouse.Click at coordinate("92", "187", "Left")
                    Macro.Pause("450")
                    Mouse.Click at coordinate("216", "243", "Left")
                    Macro.Pause("950")
                    If  Keyboard.Keys has been pressed within (ms)("{<esc>}", "5000")
                         begin
                              Macro.Restart("Yes")
                         end
               end
     end
 end


I appreciate all help! :)
Grtz

_________________
Programming is like sex, one mistake and you have to support it for the rest of your life. ~ Michael Sinz


Top
 Profile  
Reply with quote  
 Post subject: Re: Weapon Crafting and Sell item macro
Thanked: 0 time(s)  Unread post Posted: Tue Sep 07, 2010 7:50 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
I dont have Myth of Soma installed on this machine, so unfortunately I'm unable to test your code right now, however, could you explain what the problem with the macro is?

What does it do or not do?

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Weapon Crafting and Sell item macro
Thanked: 0 time(s)  Unread post Posted: Tue Sep 07, 2010 10:02 am 
Lifetime VIP Contributor
Lifetime VIP Contributor



Joined: Sun Sep 05, 2010 10:13 am
Posts: 47
Been thanked: 2 time(s)
Has thanked: 3 time(s)
Contribution Points: 3417
Well, it works when I try to test it in Notepad. But when I try to start it in Soma, it doesn't start.
The code
Code:
Keyboard.Wait for keys to be pressed("{<alt>}")
          if  Keyboard.Key is held down("1")

Means the first peace of code will start when alt+1 is pressed.
The code
Code:
if  Keyboard.Key is held down("2")

Means that the other peace of code will start when alt+2 is pressed.

The Alt+1 is for the crafting and the Alt+2 is the code for selling to the vendor.

I tried to get it working and tested it in Notepad and it started in there. I slightly changed the code, because somehow it gave an error in the log and this was the peace of "<enter>" which had to be "{<enter>}". It now gives the correct output, but somehow I can't get it working in Soma itself. I don't know if it gets stuck in this previous peace of code or in another part.

The new code is now:
Code:
 begin
     Window.Wait for window to appear("soma mythological biography", "no")
     begin loop()
          Keyboard.Wait for keys to be pressed("{<alt>}")
          if  Keyboard.Key is held down("1")
               begin
                    Mouse.Click at coordinate("100", "206", "Left")
                    Macro.Pause("350")
                    Keyboard.Type text("test")
                    Keyboard.Press key("{<enter>}")
                    begin loop("5")
                         Macro.Pause("450")
                         Mouse.Drag("106", "398", "88", "206", "Left")
                         Macro.Pause("450")
                         Keyboard.Type text("3")
                         Keyboard.Press key("{<enter>}")
                         Macro.Pause("450")
                         Mouse.Drag("164", "398", "88", "206", "Left")
                         Macro.Pause("250")
                         Keyboard.Press key("{<enter>}")
                         Macro.Pause("450")
                         Mouse.Click at coordinate("323", "255", "Left")
                         Macro.Pause("250")
                         If  Keyboard.Keys has been pressed within (ms)("{<esc>}", "5000")
                              begin
                                   Macro.Restart("Yes")
                              end
                    end
                    Macro.Pause("500")
                    Keyboard.Press key("{<esc>}")
               end
          if  Keyboard.Key is held down("2")
               begin loop("5")
                    Keyboard.Press key("{<enter>}")
                    Mouse.Click at coordinate("92", "187", "Left")
                    Macro.Pause("450")
                    Mouse.Click at coordinate("216", "243", "Left")
                    Macro.Pause("950")
                    If  Keyboard.Keys has been pressed within (ms)("{<esc>}", "5000")
                         begin
                              Macro.Restart("Yes")
                         end
               end
     end
 end


Top
 Profile  
Reply with quote  
 Post subject: Re: Weapon Crafting and Sell item macro
Thanked: 0 time(s)  Unread post Posted: Tue Sep 07, 2010 10:24 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
Please try running it inside soma, and then afterwards open the macro log, and post it here.

Does the keyboard instructions work inside Soma, and just not the mouse ones? or does it do nothing at all?

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Weapon Crafting and Sell item macro
Thanked: 0 time(s)  Unread post Posted: Tue Sep 07, 2010 10:38 am 
Lifetime VIP Contributor
Lifetime VIP Contributor



Joined: Sun Sep 05, 2010 10:13 am
Posts: 47
Been thanked: 2 time(s)
Has thanked: 3 time(s)
Contribution Points: 3417
Gigus wrote:
Please try running it inside soma, and then afterwards open the macro log, and post it here.

Does the keyboard instructions work inside Soma, and just not the mouse ones? or does it do nothing at all?

I think the keyboard works as i keep getting the chat bar on and off. I think somehow the mouse buttons aren't reacting well. When I select an item, and run the script, the item gets unselected.

This is the log:

Code:
Started
Executing: Window.Wait for window to appear(Window Title: soma mythological biography, Exact match: no)
Executing: Keyboard.Wait for keys to be pressed(Keys: {<alt>})
Checking if: Keyboard.Key is held down(Key: 1)
Result: No
Checking if: Keyboard.Key is held down(Key: 2)
Result: No
Executing: Keyboard.Wait for keys to be pressed(Keys: {<alt>})
Checking if: Keyboard.Key is held down(Key: 1)
Result: No
Checking if: Keyboard.Key is held down(Key: 2)
Result: Yes
Executing: Keyboard.Press key(Key: {<enter>})
Executing: Mouse.Move to coordinate(X Coordinate: 92, Y Coordinate: 187)
Executing: Mouse.Double click(Mouse Button: Left)
Executing: Macro.Pause(Duration: 500)
Executing: Mouse.Move to coordinate(X Coordinate: 216, Y Coordinate: 243)
Executing: Mouse.Double click(Mouse Button: Left)
Executing: Macro.Pause(Duration: 750)
Checking if: Keyboard.Keys has been pressed within (ms)(Text: {<esc>}, Timespan: 5000)
Result: No
Executing: Keyboard.Press key(Key: {<enter>})
Executing: Mouse.Move to coordinate(X Coordinate: 92, Y Coordinate: 187)
Executing: Mouse.Double click(Mouse Button: Left)
Executing: Macro.Pause(Duration: 500)
Executing: Mouse.Move to coordinate(X Coordinate: 216, Y Coordinate: 243)
Executing: Mouse.Double click(Mouse Button: Left)
Executing: Macro.Pause(Duration: 750)
Checking if: Keyboard.Keys has been pressed within (ms)(Text: {<esc>}, Timespan: 5000)
Result: No
Executing: Keyboard.Press key(Key: {<enter>})
Executing: Mouse.Move to coordinate(X Coordinate: 92, Y Coordinate: 187)
Executing: Mouse.Double click(Mouse Button: Left)
Executing: Macro.Pause(Duration: 500)
Executing: Mouse.Move to coordinate(X Coordinate: 216, Y Coordinate: 243)
Executing: Mouse.Double click(Mouse Button: Left)
Executing: Macro.Pause(Duration: 750)
Checking if: Keyboard.Keys has been pressed within (ms)(Text: {<esc>}, Timespan: 5000)
Result: No
Executing: Keyboard.Press key(Key: {<enter>})
Executing: Mouse.Move to coordinate(X Coordinate: 92, Y Coordinate: 187)
Executing: Mouse.Double click(Mouse Button: Left)
Executing: Macro.Pause(Duration: 500)
Executing: Mouse.Move to coordinate(X Coordinate: 216, Y Coordinate: 243)
Executing: Mouse.Double click(Mouse Button: Left)
Executing: Macro.Pause(Duration: 750)
Checking if: Keyboard.Keys has been pressed within (ms)(Text: {<esc>}, Timespan: 5000)
Result: No
Executing: Keyboard.Press key(Key: {<enter>})
Executing: Mouse.Move to coordinate(X Coordinate: 92, Y Coordinate: 187)
Executing: Mouse.Double click(Mouse Button: Left)
Executing: Macro.Pause(Duration: 500)
Executing: Mouse.Move to coordinate(X Coordinate: 216, Y Coordinate: 243)
Executing: Mouse.Double click(Mouse Button: Left)
Executing: Macro.Pause(Duration: 750)
Checking if: Keyboard.Keys has been pressed within (ms)(Text: {<esc>}, Timespan: 5000)
Result: No
Executing: Keyboard.Wait for keys to be pressed(Keys: {<alt>})
Checking if: Keyboard.Key is held down(Key: 1)
Result: No
Checking if: Keyboard.Key is held down(Key: 2)
Result: No
Executing: Keyboard.Wait for keys to be pressed(Keys: {<alt>})
Aborted

_________________
Programming is like sex, one mistake and you have to support it for the rest of your life. ~ Michael Sinz


Top
 Profile  
Reply with quote  
 Post subject: Re: Weapon Crafting and Sell item macro
Thanked: 0 time(s)  Unread post Posted: Tue Sep 07, 2010 10:39 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
Try turning on "Compatibility mode" for the mouse in Blue Eye Settings, that will probably solve your problem, as I think what is going on is that the mouse buttons are working fine, but when trying to set the coordinates soma misinterprets them, and as a result your mouse is moved all the way to the upper left corner.

However as soon as the virtual drivers are implemented in the next version of Blue Eye, I suggest you use those instead of compatibility mode.

Note though:
There is nothing bad about the compatibility mode, its just a way to make blue use absolute mouse positioning instead of relative, which means each coordinate will be calculated based on the resolution of the game, in case the game does not take care of it itself.

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Weapon Crafting and Sell item macro
Thanked: 0 time(s)  Unread post Posted: Tue Sep 07, 2010 10:50 am 
Lifetime VIP Contributor
Lifetime VIP Contributor



Joined: Sun Sep 05, 2010 10:13 am
Posts: 47
Been thanked: 2 time(s)
Has thanked: 3 time(s)
Contribution Points: 3417
I tried to put on Stealth mode, then Compatibility mode, then without Stealth mode with Compatibility mode and without it. When Compatibility mode is on, then my mouse goes to the upper left corner of the screen.

_________________
Programming is like sex, one mistake and you have to support it for the rest of your life. ~ Michael Sinz


Top
 Profile  
Reply with quote  
 Post subject: Re: Weapon Crafting and Sell item macro
Thanked: 0 time(s)  Unread post Posted: Tue Sep 07, 2010 11:03 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
Stealth mode should not make any difference, however there might be a problem with sending the mouse coordinates despite the compatibility mode which should take care of it (it will all be fixed with the virtual drivers).

However Id like to test it out for myself, which server do you play and where can I download the client? (pm me if you like)
and ill give it a shot.

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Weapon Crafting and Sell item macro
Thanked: 0 time(s)  Unread post Posted: Tue Sep 07, 2010 11:10 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
Thank you for the pm, ill check it out later, and report back :)

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Weapon Crafting and Sell item macro
Thanked: 0 time(s)  Unread post Posted: Tue Sep 07, 2010 6:06 pm 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
Ok i did some testing, and I found that even with compatibility mode, the coordinates aren't correct - I will find out why, and try to do something about that :)

However - when activating window mode, and just moving the window to the upper left corner of your screen, then the macro works fine, even with compatibility mode turned off.

Oh and by the way, you probably want to replace:
Code:
Keyboard.Wait for keys to be pressed("{<alt>}")

with:
Code:
Keyboard.Wait for keys to be held down("{<alt>}")


Because in order for a key to be "pressed" it has to go down/up.
however it only has to be down, to be "held down".

Which means you wont have to hold down 1 or 2 before pressing the alt-key, now the order doesn't matter, as long as alt + 1 or 2 is held down at the same time.

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3, 4  Next

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