Jump to content
AC Tool Forums
Sign in to follow this  
orlando800

Object, wObject, CreateObject.

Recommended Posts

Good afternoon. I live in Moscow and came across your program on YouTube. I found a video on finding color. I used the information and wrote scripts for social networks, having mastered this topic from the video. They help me a lot in my work. Now I really want to understand how to use the AC Tool commands: Object, wObject, CreateObject. I understand from the description of the commands that they are divided into two sections for stationary and dynamic objects. I would like to get acquainted with the scripts in the video, because it is not clear how to build the initial algorithm, but you can repeat it yourself in the video and scroll through it many times if you don't understand something. If possible, give links to videos or articles with ready-made examples of writing these commands. I will think about how to apply them and make them work for my goals. It would also be very useful to know if there are Russian-speaking AC Tool specialists in Moscow. I write through a translator. Unfortunately, I don't know much English. I hope for your support. Thank you in advance for your response. Any information is very valuable to me. I collect all the information that can be found in AC Tool. But unfortunately there is very little of it.

Alexey

Share this post


Link to post
Share on other sites

Hello @orlando800,

It is nice to see a new user of AC Tool. And Personally I did not know about any videos  on YouTube for AC Tool.

I am sorry that I, and I believe most of the Moderators, don't speak Russian. But, we will try our best to help you. As for other Russian speaking AC Tool users. I assume that there is at least one or two others here. It is just a matter that they start posting here in the forums. So, hopefully they might be able to help.

 

To help you to understand what Object is. The AC Tool Help file has a article called Object Primer, it was written by a user of AC Tool. This article talks about Object, IsObject and ObjVar. It tells you all that you need to know about what an Object is and how to create one and then use it.

You will find the article in the AC Tool Help file. Go to General Information and then Object Primer.

So, I would suggest that you go and read that article first. And create a few test scripts using what you have learned from that. If you have any questions as you create your tests scripts. Please ask here so that we can help you the best that we can.

 

Now, once you have mastered the Object, IsObject and ObjVar commands. Let me know and I'll do my best to describe to you what WObject and CreateObject are and how to use them.

Share this post


Link to post
Share on other sites

delay 1000
SetActiveWindow Drakensang Online: бесплатная онлайн-игра в стиле фэнтези - DSO
delay 5 sec
constants
Zelenyjloot = 664, 417// I'm not sure, but it seems that in the script description in your statement, the value of the constant is set with a comma
end

Procedure pervaya// two procedures to check the location of an object
Delay 1000
Keys = ~F
End

Procedure vtoraya
Delay 1000
LeftClick
End

Procedure rgb
Set Zelenyjloot = Testy// where to put it in the procedure? The algorithm itself is unclear and its design. If there was a writing pattern, it would be easier. I wrote it once and checked it out. Went, wrote more, so comes the understanding.
End
Object Zelenyjloot
  110=0,0|125=0,2|137=0,4|90=0,6|112=0,8|158=0,10|96=0,12|141=0,14|138=0,16|139=0,18|137=0,20
  125=2,0|140=2,2|143=2,4|92=2,6|150=2,8|114=2,10|116=2,12|140=2,14|140=2,16|140=2,18|137=2,20
  138=4,0|142=4,2|119=4,4|135=4,6|168=4,8|98=4,10|144=4,12|141=4,14|142=4,16|133=4,18|139=4,20
  136=6,0|138=6,2|135=6,4|157=6,6|113=6,8|119=6,10|146=6,12|143=6,14|143=6,16|142=6,18|137=6,20
  138=8,0|132=8,2|137=8,4|150=8,6|101=8,8|149=8,10|146=8,12|143=8,14|145=8,16|143=8,18|137=8,20
  133=10,0|122=10,2|127=10,4|107=10,6|155=10,8|146=10,10|147=10,12|143=10,14|143=10,16|140=10,18|132=10,20
  125=12,0|135=12,2|114=12,4|116=12,6|152=12,8|145=12,10|144=12,12|141=12,14|143=12,16|142=12,18|129=12,20
  186=14,0|111=14,2|113=14,4|155=14,6|150=14,8|142=14,10|144=14,12|142=14,14|140=14,16|125=14,18|137=14,20
  112=16,0|114=16,2|150=16,4|150=16,6|147=16,8|144=16,10|141=16,12|142=16,14|132=16,16|134=16,18|141=16,20
  116=18,0|152=18,2|150=18,4|147=18,6|144=18,8|141=18,10|138=18,12|134=18,14|136=18,16|139=18,18|145=18,20
  147=20,0|147=20,2|147=20,4|144=20,6|136=20,8|138=20,10|135=20,12|141=20,14|141=20,16|138=20,18|145=20,20
End


IsObject Zelenyjloot at 664, 417
call vtoraya 
Else
call pervaya 
End

Loop 1000
call rgb
End

// It is not clear how to measure the size of TestObject by x and y coordinates. Is it possible to do this in Photoshop?
                XCoord =          // Coord for X axis.
                YCoord =          // Coord for Y axis.
                XSize =           // Size of the object, along the X axis.
                YSize =           // Size of the object, along the Y axis.
                MinRed = 0        // Minimum value for Red.
                MaxRed = 255      // Maximum value for Red.
                MinGreen = 0      // Minimum value for Green.
                MaxGreen = 255    // Maximum value for Green.
                MinBlue = 0       // Minimum value for Blue.
                MaxBlue = 255     // Maximum value for Blue.
                Sample =          // All = Every Pixel, Half = Every Other Pixel.
                FileName =        // Name of file to place the object definition.
                // The following are not required settings.
                // So they do not need to be included in the list
                // In other words, if you do not wish to use them.
                // You can completely delete the following options.
                Black =           // Include true black pixels?  Yes, No
                SaveBMP =         // Save a BMP of the object?  Yes, No
                UseObject =       //  After getting the object, do you want to use it?  Yes, No
                //  NOTE: if you use the UseObject option.
                //  The new object will not be saved to file.
                //  But, it is immediately available for use,
                //  from with in this same script/macro file.
              End
//How do I collect this data? From photoshop?I really need to see how such scripts are designed with such objects. At least a few examples.

Edited by orlando800

Share this post


Link to post
Share on other sites

** English **

Okay, you test script is a complete mess. So, I'll try to help you the best that I can.

But, the first thing you need to do. Is you need to forget all about WObject and CreateObject, for now. I need you to understand what an Object is and how to create it and how to use it. Once that is done, then I'll help you to learn all about WObject and CreateObject.

From what it looks like. You were able to learn how to create the Object. I assume this is because of what you had learned from the Object Primer article. That is good.

But, let's briefly go over it here:

1. Get a screen shot by pressing the Print Screen button on your keyboard.
2. With AC Tool running. Go to an empty line at the bottom of your current script.
3. In the right panel, expand Object Commands and double click on Object .. End.
4. Click on the Paste button.
5. Change ObjectName to what you want to Object name to be.
6. In the image scroll, if necessary, until you find the part of the image that you would like to create an image of.
7. Click on the image at the point that is the upper left corner for the object. This will update the Coordinates {X, Y} with the coordinates for the object.
8. Change the values in Object Width and Object Height to match the width and height of the Object.
9. Just below the Object Width and Object Height will be a image showing the portion of the image that will be made into an Object.
10. Using the image of the object. Adjust the coordinates and width and height of the object. Until you get what you want the object to be.
11. Click on the OK button.
12. After this AC Tool will place the Object definition in the source code. Starting at the empty line that you had the cursor at.

Below you will find a test script that uses the Object from your test script and the the SetActiveWindow is for the game or program you have used.

I hope that this helps you to better understand Objects and how to use them. And what is in the Object Primer about Object, IsObject and ObjVar.

 

** Русский **- машинный перевод, поэтому следующее не имеет смысла. Я надеюсь, что вы понимаете, о чем идет речь.

Хорошо, у вас тестовый сценарий - полный беспорядок. Итак, я постараюсь помочь вам как можно лучше.

Но, первое, что вам нужно сделать. Вам нужно пока забыть о WObject и CreateObject. Мне нужно, чтобы вы понимали, что такое объект, как его создать и как его использовать. Как только это будет сделано, я помогу вам узнать все о WObject и CreateObject.

Как это выглядит. Вы смогли узнать, как создать объект. Я предполагаю, что это связано с тем, что вы узнали из статьи Object Primer. Это хорошо.

Но давайте кратко рассмотрим это здесь:

1. Сделайте снимок экрана, нажав кнопку Print Screen на клавиатуре.
2. При запущенном AC Tool. Перейдите к пустой строке внизу вашего текущего скрипта.
3. На правой панели разверните Object Commands и дважды щелкните Object .. End.
4. Щелкните кнопку Paste.
5. Измените ObjectName на то, что вы хотите для Object name.
6. При необходимости прокрутите изображение до тех пор, пока не найдете ту часть изображения, для которой хотите создать изображение.
7. Щелкните изображение в точке, которая является левым верхним углом объекта. Это обновит Coordinates {X, Y} координатами объекта.
8. Измените значения в Object Width и Object Height, чтобы они соответствовали ширине и высоте объекта.
9. Чуть ниже Object Width и Object Height будет изображение, показывающее часть изображения, которая будет преобразована в объект.
10. Использование изображения объекта. Отрегулируйте координаты, ширину и высоту объекта. Пока вы не получите то, что хотите, чтобы объект был.
11. Щелкните кнопку OK.
12. После этого AC Tool поместит определение объекта в исходный код. Начиная с пустой строки, на которой был установлен курсор.

Ниже вы найдете тестовый сценарий, который использует Object из вашего тестового сценария, а SetActiveWindow предназначен для игры или программы, которую вы использовали.

Я надеюсь, что это поможет вам лучше понять объекты и способы их использования. И что в Object Primer об объектах, IsObject и ObjVar.

 

constants
  i=
end

delay 1000
SetActiveWindow Drakensang Online: бесплатная онлайн-игра в стиле фэнтези - DSO
delay 5 sec

objvar 10

// IsObject is used to check for the object. 
// You give the name of the Object to check for.
// And you give the X, Y coordinates (the top
// left corner of the object) to test for the Object.

// IsObject используется для проверки объекта.
// Вы даете имя Object для проверки. И вы даете
// координаты X, Y (верхний левый угол Object)
// для проверки Object.
IsObject Zelenyjloot at 664, 417
  // Code that is here is executed if the Object has been found.
  // Код, представленный здесь, выполняется, если объект был найден.

  //ShowMessage i = Information, OK, The Object was found.
  ShowMessage i = Information, OK, Объект был найден.
Else
  // Code that is here is executed if the Object has not been found.
  // Код, представленный здесь, выполняется, если объект не был найден.

  //ShowMessage i = Information, OK, The Object was not found.
  ShowMessage i = Information, OK, Объект не найден.
End

                    // Test for this Object at 664, 417
Object Zelenyjloot  // Тест для этого Object на 664, 417
  110=0,0|125=0,2|137=0,4|90=0,6|112=0,8|158=0,10|96=0,12|141=0,14|138=0,16|139=0,18|137=0,20
  125=2,0|140=2,2|143=2,4|92=2,6|150=2,8|114=2,10|116=2,12|140=2,14|140=2,16|140=2,18|137=2,20
  138=4,0|142=4,2|119=4,4|135=4,6|168=4,8|98=4,10|144=4,12|141=4,14|142=4,16|133=4,18|139=4,20
  136=6,0|138=6,2|135=6,4|157=6,6|113=6,8|119=6,10|146=6,12|143=6,14|143=6,16|142=6,18|137=6,20
  138=8,0|132=8,2|137=8,4|150=8,6|101=8,8|149=8,10|146=8,12|143=8,14|145=8,16|143=8,18|137=8,20
  133=10,0|122=10,2|127=10,4|107=10,6|155=10,8|146=10,10|147=10,12|143=10,14|143=10,16|140=10,18|132=10,20
  125=12,0|135=12,2|114=12,4|116=12,6|152=12,8|145=12,10|144=12,12|141=12,14|143=12,16|142=12,18|129=12,20
  186=14,0|111=14,2|113=14,4|155=14,6|150=14,8|142=14,10|144=14,12|142=14,14|140=14,16|125=14,18|137=14,20
  112=16,0|114=16,2|150=16,4|150=16,6|147=16,8|144=16,10|141=16,12|142=16,14|132=16,16|134=16,18|141=16,20
  116=18,0|152=18,2|150=18,4|147=18,6|144=18,8|141=18,10|138=18,12|134=18,14|136=18,16|139=18,18|145=18,20
  147=20,0|147=20,2|147=20,4|144=20,6|136=20,8|138=20,10|135=20,12|141=20,14|141=20,16|138=20,18|145=20,20
End

 

 

Share this post


Link to post
Share on other sites

This is very strong! This function is great, but only for working with stationary objects. What do I need to learn about moving objects? On the playing field of the game or in the desired program, where the location of the object changes?
I wrote a script it works.
SetActiveWindow Роман Богатырев - Opera
delay 5 sec
constants
i=DruziyaVK
End
objvar 10
IsObject DruziyaVK at 394, 432
Delay 1000
MousePos 387, 432
Delay 1000
LeftClick
Else
Delay 1000
MousePos 323, 746
Delay 1000
Pause
End
Object DruziyaVK
  184=0,0|184=0,2|184=0,4|184=0,6|184=0,8|184=0,10|184=0,12|184=0,14|184=0,16|184=0,18|184=0,20
  184=2,0|184=2,2|184=2,4|184=2,6|184=2,8|184=2,10|184=2,12|184=2,14|184=2,16|184=2,18|184=2,20
  184=4,0|184=4,2|184=4,4|184=4,6|184=4,8|193=4,10|255=4,12|184=4,14|184=4,16|184=4,18|184=4,20
  184=6,0|184=6,2|244=6,4|251=6,6|255=6,8|255=6,10|184=6,12|184=6,14|184=6,16|184=6,18|184=6,20
  184=8,0|184=8,2|184=8,4|184=8,6|184=8,8|184=8,10|184=8,12|184=8,14|184=8,16|184=8,18|184=8,20
  184=10,0|184=10,2|227=10,4|227=10,6|227=10,8|227=10,10|184=10,12|184=10,14|184=10,16|184=10,18|184=10,20
  184=12,0|184=12,2|210=12,4|210=12,6|210=12,8|210=12,10|255=12,12|184=12,14|184=12,16|184=12,18|184=12,20
  184=14,0|184=14,2|184=14,4|253=14,6|255=14,8|253=14,10|184=14,12|184=14,14|184=14,16|184=14,18|184=14,20
  184=16,0|184=16,2|184=16,4|193=16,6|184=16,8|193=16,10|184=16,12|184=16,14|184=16,16|184=16,18|184=16,20
  184=18,0|184=18,2|184=18,4|253=18,6|227=18,8|253=18,10|184=18,12|184=18,14|184=18,16|184=18,18|184=18,20
  184=20,0|184=20,2|184=20,4|214=20,6|216=20,8|184=20,10|184=20,12|184=20,14|184=20,16|184=20,18|184=20,20
End
The delay was because I couldn't understand the function of the ShowMessage I command. This is a test framework that talks about the functionality of the team. This is very convenient. And I don't want to bore you. I'm really embarrassed because I know I'm annoying you with stupid questions. Now it is very simple and clear. I really want to know how to work with dynamic objects without being tied to a specific place on the screen? For example, game mobs in games.
What steps do I need to take?

Share this post


Link to post
Share on other sites
On 12/6/2020 at 5:08 AM, orlando800 said:

The delay was because I couldn't understand the function of the ShowMessage I command.

Okay, the actual command is ShowMessage not ShowMessage I. What it does is it displays a window to the user. That has a custom message for the user and allows the user to respond to the message by clicking on a button in the window. You really need to read, machine translate, the Help file to understand the various commands.

On 12/6/2020 at 5:08 AM, orlando800 said:

And I don't want to bore you. I'm really embarrassed because I know I'm annoying you with stupid questions. Now it is very simple and clear.

No, you are not causing me to be bored. And you are not annoying me at all. And I was raised to believe that there is no such thing as a stupid question.

And I am glad that you now fully understand Objects.

On 12/6/2020 at 5:08 AM, orlando800 said:

I really want to know how to work with dynamic objects without being tied to a specific place on the screen? For example, game mobs in games.
What steps do I need to take?

Although Object are best used for Static parts of a game. They can also be used to Dynamically search for MOBs that move withing a game. All you need to do is place the IsObject command block within a loop. And as you change the X, Y coordinates to search for the Object of the MOB through out the screen.

Basically you are scouring the screen looking for the MOB.

 

But, when dealing with MOBs that moves but does not move in a set pattern. This can take quite a bit of time to find a single MOB on the screen.

So, it might be better to use any of the GetRed, GetGreen, GetBlue, IsBlack, IsBlue, IsGreen, IsGrey, IsRed, IsWhite, LoadRGB commands to search for MOBs that don't move in a set pattern. I really don't know too much on how to do this. As I have not done this. So, I would suggest that @Ego chime in here. Because I believe he has done this several times before.

 

Share this post


Link to post
Share on other sites

Thank you for your answer, machine translation is fine with me. If something is not clear, you can think and understand later. I have translated all your instructions in the AC Tool help in machine translation. All that is. Another thing is that after I sit and try to understand the meaning of what is written for a long time.

About the cyclical nature of the script. Here is a creak about the search for a mob I tried to start in a loop. He wants if

Delay 5000
SetActiveWindow Drakensang Online: áåñïëàòíàÿ îíëàéí-èãðà â ñòèëå ôýíòåçè - DSO

constants
b=Golubyeglaza
End
objvar 10
Procedure Gipnoz
IsObject Golubyeglaza at 1116, 266
call First
Else
call Two
Object Golubyeglaza
  192=0,0|198=0,2|198=0,4|198=0,6|178=0,8|136=0,10|94=0,12|74=0,14|60=0,16|59=0,18|66=0,20
  194=2,0|198=2,2|198=2,4|198=2,6|194=2,8|163=2,10|119=2,12|87=2,14|69=2,16|65=2,18|69=2,20
  197=4,0|197=4,2|197=4,4|198=4,6|198=4,8|180=4,10|138=4,12|100=4,14|85=4,16|77=4,18|74=4,20
  194=6,0|197=6,2|197=6,4|197=6,6|198=6,8|198=6,10|155=6,12|124=6,14|92=6,16|88=6,18|81=6,20
  197=8,0|197=8,2|197=8,4|197=8,6|197=8,8|198=8,10|178=8,12|139=8,14|108=8,16|94=8,18|87=8,20
  196=10,0|197=10,2|197=10,4|197=10,6|197=10,8|197=10,10|195=10,12|152=10,14|124=10,16|100=10,18|95=10,20
  196=12,0|196=12,2|197=12,4|197=12,6|197=12,8|197=12,10|197=12,12|160=12,14|132=12,16|108=12,18|102=12,20
  196=14,0|196=14,2|196=14,4|197=14,6|197=14,8|197=14,10|197=14,12|168=14,14|133=14,16|115=14,18|109=14,20
  194=16,0|196=16,2|196=16,4|196=16,6|197=16,8|197=16,10|197=16,12|169=16,14|138=16,16|121=16,18|117=16,20
  189=18,0|196=18,2|196=18,4|196=18,6|196=18,8|197=18,10|190=18,12|168=18,14|136=18,16|128=18,18|122=18,20
  179=20,0|196=20,2|196=20,4|196=20,6|196=20,8|196=20,10|183=20,12|161=20,14|142=20,16|134=20,18|130=20,20
End

Procedure First
  Delay 1000
Keys ~B
Delay 1000
RughtClick
Delay 1000
RughtClick
End

Procedure Two
Delay 1000
Keys ~N
Delay 1000
End
End

Loop 10
call Gipnoz
End
The script doesn't want to give up. I sent the error in the screenshot.

Error.png

Edited by orlando800

Share this post


Link to post
Share on other sites

Okay, the problem with your script is that you structured your script wrong. As a rule of thumb for AC Tool. When creating your scripts you need to understand and follow a few things.

(Question: Have you worked with the Java programming language? Well, if you haven't work with Java. Then I tell you this.) In Java there is what is called a Main procedure called main . (A procedure is a block of code that will be executed when the procedure is called.)  But, in Java the code in the Main procedure is always executed when you run the Java program/app. In that Main procedure you will have various commands to perform what ever action you need. This include the calling of other procedures and/or functions.

 

In AC Tool, you have something similar. You don't have an actual procedure called main. Instead you have what is called the Main Code Block. What is the Main Code Block. It is code, or commands, that it not in a procedure. All main code is grouped together in one place. And when you run your script in AC Tool. The Main Code Block is what is run. In the Main Code Block you will have calls to execute certain procedures. But, these procedures are not a part of the Main Code Block.

For AC Tool scripts, the community has routinely structured their scripts as the following:

Structure Style 1:

  1. Constants: Define your constants as the first thing in your single file script.
  2. Main Code Block: add the code that you want executed when you run the script.
  3. Procedures: Add any procedures you define after the Main Code Block.
  4. Objects: Place any Object definitions last.

Structure Style 2:

  1. Constants: Define your constants as the first thing in your single file script.
  2. Procedures: Add any procedures you define after defining your constants.
  3. Main Code Block: add the code that you want executed after all the procedures you have defined.
  4. Objects: Place any object definitions last.

In your script, you have procedures and objects mixed with in you Main Code Block. Also, in AC Tool you need to end certain blocks of code with an end statement. For which you did not do for certain things. The following list of commands has to have a end statement at then end of the block:

  • procedure:
    procedure procedurename
      // code goes here
    end
  • if:
    if conditionalexpression
      // code goes here
    end
  • if ... else:
    if conditionalexpression
      // code goes here
    else
      // code goes here
    end
  • isobject:
    isobject objectname at X, Y
      // code goes here
    end
  • isobject ... else:
    isobject objectname at X, Y
      // code goes here
    else
      //code goes here
    end
  • case:
    case
      // code goes here
    end
  • loop:
    loop
      // code goes here
    end
  • while:
    while conditionalexpression
      // code goes here
    end
  • object:
    object objectname
      // object definition
    end

One last thing to mention. You can not place a procedure with in a IF/IF... ELSE/ISOBJECT/ISOBJECT ... ELSE/While/Object blocks. AC Tool will give you an error, like the one you have already gotten, when you run the script.

Now, below I will show you what each of the Structure Styles look like with actual code:

 

Structure Style 1:

//
// define constants
//
constants
  b=Golubyeglaza
end

//
// this is the Main Code Block
//
SetActiveWindow Drakensang Online: бесплатная онлайн-игра в стиле фэнтези - DSO
Delay 5000

objvar 10

loop 10
  call Gipnoz
end

//
// add procedures here
//
procedure Gipnoz
  // the code that you want to execute goes here
end;

procedure first
  // the code that you want to execute goes here
end

procedure two
  // the code that you want to execute goes here
end

//
// add Object definitions here
//
object Golubyeglaza
  // object definition goes here
end

 

Structure Style 2:

//
// define constants
//
constants
  b=Golubyeglaza
end

//
// add procedure here
//
procedure Gipnoz
  // the code that you want to execute goes here
end;

procedure first
  // the code that you want to execute goes here
end

procedure two
  // the code that you want to execute goes here
end

//
// this is the Main Code Block
//
SetActiveWindow Drakensang Online: бесплатная онлайн-игра в стиле фэнтези - DSO
Delay 5000

objvar 10

loop 10
  call Gipnoz
end

//
// add Object definitions
//
object Golubyeglaza
  // object definition goes here
end

 

Share this post


Link to post
Share on other sites

Now as you can see from my previous post. You need to rewrite your script to follow one of the two Structure Styles mentions. And to make sure that you have a end statements where they belong.

 

I would recommend that you use the Structure Style 1.

 

And from what I can see of your script. You do not need procedures to do what you are currently trying to do. The code in the Gipnoz should be placed in the Main Code Block inside the loop. And the code other two procedures needs to be placed in the IsObject ... End block.

Below is your script rewritten to follow the Structure Style 1 structure:
 

Spoiler

constants
  b=Golubyeglaza
end

SetActiveWindow Drakensang Online: бесплатная онлайн-игра в стиле фэнтези - DSO
Delay 5000

objvar 10

loop 10
  call Gipnoz
end

procedure Gipnoz
  IsObject Golubyeglaza at 1116, 266
    call First
  else
    call Two
  end
end;

procedure first
  Delay 1000
  keys ~B
  Delay 1000
  RightClick
  Delay 1000
  RightClick
end

procedure two
  Delay 1000
  Keys ~N
  Delay 1000
end

object Golubyeglaza
  192=0,0|198=0,2|198=0,4|198=0,6|178=0,8|136=0,10|94=0,12|74=0,14|60=0,16|59=0,18|66=0,20
  194=2,0|198=2,2|198=2,4|198=2,6|194=2,8|163=2,10|119=2,12|87=2,14|69=2,16|65=2,18|69=2,20
  197=4,0|197=4,2|197=4,4|198=4,6|198=4,8|180=4,10|138=4,12|100=4,14|85=4,16|77=4,18|74=4,20
  194=6,0|197=6,2|197=6,4|197=6,6|198=6,8|198=6,10|155=6,12|124=6,14|92=6,16|88=6,18|81=6,20
  197=8,0|197=8,2|197=8,4|197=8,6|197=8,8|198=8,10|178=8,12|139=8,14|108=8,16|94=8,18|87=8,20
  196=10,0|197=10,2|197=10,4|197=10,6|197=10,8|197=10,10|195=10,12|152=10,14|124=10,16|100=10,18|95=10,20
  196=12,0|196=12,2|197=12,4|197=12,6|197=12,8|197=12,10|197=12,12|160=12,14|132=12,16|108=12,18|102=12,20
  196=14,0|196=14,2|196=14,4|197=14,6|197=14,8|197=14,10|197=14,12|168=14,14|133=14,16|115=14,18|109=14,20
  194=16,0|196=16,2|196=16,4|196=16,6|197=16,8|197=16,10|197=16,12|169=16,14|138=16,16|121=16,18|117=16,20
  189=18,0|196=18,2|196=18,4|196=18,6|196=18,8|197=18,10|190=18,12|168=18,14|136=18,16|128=18,18|122=18,20
  179=20,0|196=20,2|196=20,4|196=20,6|196=20,8|196=20,10|183=20,12|161=20,14|142=20,16|134=20,18|130=20,20
end

 

 

And here you will find a much simpler version of your script. It follows the Structure Style 1, but it does not use procedures:

Spoiler

constants
  b=Golubyeglaza
end

SetActiveWindow Drakensang Online: бесплатная онлайн-игра в стиле фэнтези - DSO
Delay 5000

objvar 10

loop 10
  IsObject Golubyeglaza at 1116, 266
    Delay 1000
    keys ~B
    Delay 1000
    RightClick
    Delay 1000
    RightClick
  else
    Delay 1000
    Keys ~N
    Delay 1000
  end
end

object Golubyeglaza
  192=0,0|198=0,2|198=0,4|198=0,6|178=0,8|136=0,10|94=0,12|74=0,14|60=0,16|59=0,18|66=0,20
  194=2,0|198=2,2|198=2,4|198=2,6|194=2,8|163=2,10|119=2,12|87=2,14|69=2,16|65=2,18|69=2,20
  197=4,0|197=4,2|197=4,4|198=4,6|198=4,8|180=4,10|138=4,12|100=4,14|85=4,16|77=4,18|74=4,20
  194=6,0|197=6,2|197=6,4|197=6,6|198=6,8|198=6,10|155=6,12|124=6,14|92=6,16|88=6,18|81=6,20
  197=8,0|197=8,2|197=8,4|197=8,6|197=8,8|198=8,10|178=8,12|139=8,14|108=8,16|94=8,18|87=8,20
  196=10,0|197=10,2|197=10,4|197=10,6|197=10,8|197=10,10|195=10,12|152=10,14|124=10,16|100=10,18|95=10,20
  196=12,0|196=12,2|197=12,4|197=12,6|197=12,8|197=12,10|197=12,12|160=12,14|132=12,16|108=12,18|102=12,20
  196=14,0|196=14,2|196=14,4|197=14,6|197=14,8|197=14,10|197=14,12|168=14,14|133=14,16|115=14,18|109=14,20
  194=16,0|196=16,2|196=16,4|196=16,6|197=16,8|197=16,10|197=16,12|169=16,14|138=16,16|121=16,18|117=16,20
  189=18,0|196=18,2|196=18,4|196=18,6|196=18,8|197=18,10|190=18,12|168=18,14|136=18,16|128=18,18|122=18,20
  179=20,0|196=20,2|196=20,4|196=20,6|196=20,8|196=20,10|183=20,12|161=20,14|142=20,16|134=20,18|130=20,20
end

 

 

Share this post


Link to post
Share on other sites

Check your spelling in the script, eg, rightclick.

 

I have not looked at searching the screen for a mob, I look at places where the mob might go, then use an object to detect if it is there, then do something.

The other way I use is, looking at a spot on the screen to use (using iscolor), and trigger an event. So if the mob goes over a spot on screen it triggers a reaction,

BUT because the screen is dynamic it is very hard if a lot of things are happening. (False Positives) I'm at this spot now in a game I am playing, trying to figure a way around it.

 

I tried to do a search for a mob but the program took to long, and as DaMob has mentioned, even he could not wait for the screen to be searched.

Share this post


Link to post
Share on other sites

Thank you for your answer, I need some time to think. Amazing. You just reversed what I wrote and it worked. 
In continuation, according to the logic of the conversation direction. If the script finds an object, it means that it can click on it. The machine does this in a fraction of seconds, so the mob will not go far in the game mode, there will be no displacement in most cases of the coordinates of the location. Whether there is such a command for the subsequent click on the found object. With subsequent execution of the procedure? In this case, the creak States the fact of finding, without further action. Is there a command that continues the logic of the script working with the object?
Further action of the script algorithm.
It finds the object.
Then moves the cursor to the desired coordinates.
Performs the procedure that was assigned to it for further actions.

In other words, I want it to calculate the coordinates of the object, enter them in the buffer and work with the coordinates of the object automatically. Performing the specified procedures.

Edited by orlando800

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and to our Privacy Policy.