Jump to content
AC Tool Forums

The WABBIT

Moderators
  • Content Count

    555
  • Joined

  • Last visited

Everything posted by The WABBIT

  1. 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.
  2. Have you attempted to try to create a script to do this? But to answer you question. Yes, you can do this. So, I would suggest that you attempt to actually create the script to perform this. Then ask questions when you get stuck.
  3. @Lots of sand Obviously, the example is not complete and will not work for what it was attended for.
  4. Glad I was able to help. On my end the Window Titles for all Sandboxed programs has the [#} prior to, and after, the program's default title. That is why I gave my examples. But, there is another way and it might be better, depending on your situation. To Use SetActiveWindow to do a partial match of the window title. In AC Tool can be used in the following was: SetActiveWindow FullWindowTitle SetActiveWindow PID SetActiveWindow PartialWindowTitle SetActiveWindow 1. Requires that you give the full window title. Just as move people do, because that is how its use is shown in the help file. SetActiveWindow [#] LaunchNet7 v2.2.0 [#] 2. Requires that you give the Windows' PID number. Which can be obtained from Windows Task Manager or the the Window List, from AC Tool menu under Tools . Which means that the program/game has to be running prior to use running the script. In order for you to get its PID number. SetActiveWindow 10960 3. With this version of SetActiveWindow, As long as the Window title's has the portion of text that you are using. Then that window will match and will be made the active window. This is a problem with this. Multiple of windows that contains the same portion of the window title. At which point the very first window that matches. Is the one that is set as the active window. Whether or not it is the window that you want as the active window. In order to use the partial Window title search. Give the portion of the title that you are looking for, with an asterisk/star at the end. SetActiveWindow LaunchNet7* 4. This does not have a Window Title or PID. And when executed will open the Window List window. Select the window title and then click on the OK button. This causes SetActiveWindow to use the PID for the window. NOTE: The use of the PID is for this particular SetActiveWindow instance. If you need to call SetActiveWindow at anytime after this one. Then you give the Window's PID number, or the Window's title full/partial. SetActiveWindow
  5. Well, you didn't give any details as to what you are experiencing. Even though I don't have ACE Online, I did download sandboxie and gave it a try with LaunchNet7 and E&B. And I did not have any problems with AC Tool v5.4.0/5.4.0.5/5.5.1, or Divide, using SetActiveWindow to make them the active window. Below is the SetActiveWindow commands that I used in AC Tool and then again in Divide. And since you did not specify how you started the game. I don't know if the way I started LaunchNet7, and then E&B, is different and if it may have any bearings on what you are experiencing. So I'll tell you how I started LaunchNet7, and then through it E&B. Start > Sandboxie > Sandboxie Start Menu DeskTop > LaunchNet7 and Start > Sandboxie > SandBoxie Start Menu Programs > Net-7 Entertainment > EnB Emulator > LaunchNet7 AC Tool: SetActiveWindow [#] LaunchNet7 v2.2.0 [#] SetActiveWindow [#] Earth & Beyond [#] Divide: SetActiveWindow('[#] LaunchNet7 v2.2.0 [#]'); SetActiveWindow('[#] Earth & Beyond [#]');
  6. @minimx Ok, I not sure as to why your DivObject definition, that you had created from the AC Tool Object definition, is not working. I don't know if it is because of the coordinates being used. Or if values that is being used for the test. But, I can say that after looking at a screen shot in Object Mapper 2. I was not able to find any of the values, in the exact same series, that you have in your test script for any portion of the Icon for Divide. So, from that point of view. You'll have to recreate the DivObject definition to look for Divide's Icon. So, plz check your PM as I sent you one.
  7. I have one question. What Windows are you running it on? And are you using the Classic Windows theme?
  8. are those test being done with Divide's window being smaller than the full screen? And is the image from the d_screen.bmp or from a screen capture of the window only, from another program?
  9. Okay, try this. with Divide opened and not Maximized. resize the window so that it is not full screen. The redo the test and see if you can see a difference. And go ahead and post the full image here.
  10. If you compare what you see in the image. Is it the same as what you actually see on the desktop with Divide's window?
  11. Update: Okay after testing v0.4.2 and trying to find Divide's own icon. I had found a few issues. I fixed the issue of using SetActiveWindow causing Divide's Maximized window, and quite possibly others, to return to Normal window state. I fixed a problem/error with the CreateObject that I had fond. And in the process made it better with code that I was working on for the next version. And I think that I found what the problem is with the IsObject. And I have corrected it. Well, I think I did anyways. Now, I have to ask you do some for me. I need you to run your test code, from before, for a test. (Actually, I need to do two tests.) And yes, I do need you to perform the tests in the version of Divide that you have. The first test: Once Divide is running, load in, or type in, the script from before. From the menu select Script > Test Mode and click on Save Bitmaps from Color Commands. If you were to look at this option again, it should be checked. Run your script as it. Don't worry if Divide is not Maximized. Go to the directory that you have Divide installed in. In this directory, there should be a bmp file with the name of d_screen.bmp (or d_screen if you can't see file extensions). I need you to look at this image. In Windows 7 you can view the image by Right-clicking on it, and selecting Preview. I am not sure on how to do it in Windows 8.x or 10. Examine Divide's window in the image. Does the window look okay? Do you see everything for the window? Including it's borders around the window? Jot down what problems, if any, that you see. The second test: Keeping the window with the d_screen.bmp image open. Maximize Divide's window. Run your script again. Return Divide's window to normal. Bring the window showing d_screen.bmp. Examine Divide's window in the image. Does the window look okay? Do you see everything for the window? Including it's borders around the window? At this point, I need you to tell me what problems, if any, that you have seen in the image for both tests. You do not need to post the image. Just describe to me what you see. It shouldn't take you more than a few minutes to do this. I'll be logged into the forums until about 1AM MTD (UTC -6) tonite. So, I'll be available until then.
  12. Alright, I don't what's going with the IsObject and CreateObject. But, I am working on them right now.
  13. okay. Now the object that you are looking for in the script above. Is it in the game itself? Or is it someplace on the web browser?
  14. Okay, I have to ask. what game is this for? And what exactly are you trying to find? Are you trying to find it in the game? or in something else?
  15. First of all, the test coordinates are not the same as what you had in your original code that you posted. There you had: if IsObject('d', 1041, 123) then And Second, in AC Tool, unless you are checking for an object that is on your desktop. You have to set the window for the Application/Game as the active window. Before you check for any objects. It is the same for Divide. Unless you are checking for something on your Windows Desktop. You have to set the Application's/Game's window as the active window. Then you check for the object. Example: Uses Classes, Divide; var MyObject: TDivObject procedure initMyObject; begin // code to initialize the object goes here. end; begin { Initialize the object } MyObject; { set the window as the active window } SetActiveWindow('Window Name/Title'); { Delay for 2 seconds to allow the window to become the active window. This delay is necessary, because even on the same system. It can take from a fraction of a second to 2 seconds for the window to be brought forward and become the active window. And the amount of time is different each time. } Delay(2, 'sec'); { No we test for the object } if IsObject(SomeObject, 0, 0) then TimeStamp('Object found.') else TimeStamp('Object not found'); end;
  16. To help show you the proper coding style. I edited your script to the following: uses Classes, Divide; var d: TDivObject; procedure dd begin d := TDivObject.Create; with d do begin Def.Add('128=0,0|128=0,2|128=0,4'); Def.Add('212=2,0|212=2,2|212=2,4'); Def.Add('128=4,0|128=4,2|128=4,4'); end; end; begin dd; if IsObject(d, 1041, 123) then begin timestamp ('cave'); delay (3000); end else begin timestamp ('notcave'); delay (3000); end; end; Other than that, I don't see anything wrong. And since you said it works. I didn't bother to do more than a glance at it.
  17. @minimxWell, I hope that the new information will help you.
  18. There is a couple of problems with the code. And both problems are because of the information given in the help file. Problem 1: Even though the information to declare and initialize the DivObject is present. You had failed to initialize the DivObject. Solve 1: See Objects in Divide in the Help file. The information given here is not complete. But, it does give you the information to properly initialize the DivObject. Problem 2: The syntax given in the Help file for the IsObject function is wrong. And the code given in the Example should be better than what's there. Solve 2: I have been working on the Help file for that last several weeks. Trying to catch problems like this. And to make it better by giving better examples. Examples that actually work if you copy and paste the code into Divide. Although I had not gotten to redoing the IsObject page in the Help file. I went ahead and done so, so that I can post the proper information here for you. IsObject: IsObject Description: IsObject is a function that will check to see if a object, defined in a DivObject, is present on the screen. Then it will return a value of True or False as to whether or not the object was found. More information on how to use Object in Divide. See Objects In Divide Syntax: IsObject(objectName: TDivObject, XCoord: Integer, YCoord: Integer):ReturnValue; Parameters: Parameter Description ObjectName The name of the TDivObject to search for. X Is the X coordinate to start searching for the DivObject at. Y Is the Y coordinate to start searching for the DivObject at. Return value: Value Description Boolean True = the DivObject was found. False = the DivObject was not found. Examples: Example 1 uses Classes, Divide; var objMyTestObject: TDivObject; //declaration of the TDivObject { the procedure to initialize the object that we will be using. } procedure InitMyTestObject; begin objMyTestObject := TDivObject.Create; with objMyTestObject do begin Def.Add('128=0,0|128=0,2|128=0,4'); Def.Add('212=2,0|212=2,2|212=2,4'); Def.Add('128=4,0|128=4,2|128=4,4'); end; end; begin { call the InitMyTestObject procedure to initialize the objMyTestObject so that we can use it. } InitMyTestObject; { Now lets check to see if we can find the object. } if IsObject(objMyTestObject, 583, 256) then TimeStamp('The Object was found.') else TimeStamp('The Object was not found.'); end; Although the example code is complete, proper and will run without any errors. You will not see the TimeStamp in the True block of the if statement. That is because the values used in the definition of the DivObject was just thrown together. But, it is code that you can look at and see the proper way of doing things.
  19. Although I checked the forums multiple of times yesterday. I just now seen your post. So my response is... Okay, after just looking at the code I can see what the problem is. But, running the script verified my findings. And it gave me the chance to post what the error message you should have been getting. And to explain it. When you ran the script above. You should have been getting the RunTime Error shown in the image below: This is one of the Standard RunTime Error messages. As you can see it has a lot of information. But the information that you will need from this error message, is the file/library name, the method/command, and where in the source code to find the problem code. These three things can be found in the following: The file/library name can be found on the second line after 'File Library'. The method/command can be found on the fourth line, It is toward the end of the line surrounded by single quotes (') just before the closing parentheses. And you get the placement in the source code, by looking at the sixth line "Source position". This has the line number and character position of the code causing the problem within the file/library named in the second line. And line five can give you a hint as to what is wrong. And sometimes it doesn't make sense. So, with the above information. We can try to figure out the problem with your script. Okay, so have have a problem with IsObject command/method on line #23 of the Unit1 file/library. And from what it looks like from line five. A parameter being used in IsObject is empty (Null, or nil). And sure enough looking at the code that you have posted. You are passing a wrong parameter to IsObject. But, the problem isn't because of a mistake on your part. It is a mistake on my part. Because after looking at the Help file. For what I have for the IsObject function. I have found that I had given the wrong information. This one is on me. So, I'll post the information in the next post.
  20. @EgoYou might want to read the OP and the rest of the thread again.
  21. Okay, You did great with the formatting. And it is good that you finally got the script to work. But, your formatting can use a tiny bit more work. So, look at the following of your last script: uses divide; begin if 10 > 11 then begin delay(1000); MousePos(646, 359); delay(5000); end else begin bell; if 5 > 6 then begin MousePos(1081, 396); delay(1000); end else begin if 8 > 6 then begin MousePos(28, 411); delay(5000); end else begin delay(1000); end; end; end; delay(1000); MousePos(325, 553); end; Now it you compare this script with yours, you should see the differences. But if not, then here are the differences: I removed the Line comments. And I removed the semi-colon (';') from the end of the end statements that are on the lines before the else statements. This follows the rules for IF statements as laid out in Pascal, and in Divide. You had Delay commands with extra spaces in the command. You placed extra spaces before the ( and after the ). As examples: Delay (1000); Delay (5000) ; You do not need to put extra spaces in like that. And I have properly indented the code to reflect the four different levels. If you can't tell the 4 levels of indentation, then see the following: So You need to start formatting your code like this. And don't forget about the rules for IF statements, as I had already told you in my previous post.
  22. Now the second part of what's wrong with your IF statements. As I mentioned in the previous post. You need to place the keywords begin and end around a block of code that belongs to a IF statement. But in your IF statements, you begin each IF statement code block with a begin. But, you never end the code blocks with an end. That is why you are getting the error message. Divide's script engine is expecting to find an end before it finds an else, just like in Pascal. Now in Pascal, and in Divide, IF statements can be written in several different ways. The first way of writing a IF statement. Is an IF statement that has code that is only executed if the conditional expression is TRUE. Example 1: If HP <= 43 then begin TimeStamp('We need to heal.'); MousePos(65, 258); end; Now, we will look at a IF statement that will execute code if its conditional expression is TRUE and if it is FALSE. Example 2: if HP <= 43 then begin TimeStamp('We need to heal.'); MousePos(65, 258); end else begin TimeStamp('We do not need to heal.'); Delay(500); end; Here we will look at at IF statement that will execute code only if its conditional expression is TRUE. But it only has one statement. Example 3: if HP = 0 then TimeStamp('I'm sorry, but we are dead.'); And here we will look at a IF statement that will execute code if its conditional expression is TRUE and if it is FALSE. But, it only has one statement in both the TRUE block and the FALSE block. Example 4: if IsObject(TestObject, 34, 185) then TimeStamp('The object was found.') else TimeStamp('The object was not found.'); Now in Pascal, as well as Divide, the statement right before an else, within a IF statement, does not end with a semi-colon (';'). And as you can see from Example 2 and Example 4. The statement just before the else does not end with a semi-colon. In Example 2 the statement just before the else is the end. And in Example 4, the line before the else is the TimeStamp('The object was found.'). Guess what? You can mix IF statements with single statements and a block of statements. Example 5: for HP <= 43 then begin TimeStamp('We need to heal.'); MousePos(65, 258); end else TimeStamp('We do not need to heal.'); Example 6: if HP = 0 then TimeStamp('I'm sorry we are dead!') else begin TimeStamp('Do we need to heal?'); CheckHeal; end; And of course, you can nest a IF statement within a IF statement's TRUE and/or FALSE block. if conditional_expression then begin if conditional_express then begin // TRUE code block end; end else begin // FALSE code block. end; As you can see. There is lots of ways to write a IF statement. You can use any one of, or any combination, of the examples above to create your if statement(s). As long as you follow the rules about using begin and end. And that you also follow the rules about the statement just before the else. Otherwise you will get a
  23. Now, for the issues with the IF statements in your script. There is two things wrong with your IF statements. I'll talk about the first one here: The first issue is the conditional expression being used for each IF statement. With the conditional expression for the first IF statement. The second IF statement will never be executed. Then if by some miracle the second IF statement is evaluated. Then MousePos(1081, 396) statement will never be executed. And with the third statement. The delay(1) statement will never be executed. That is if I have read that portion of your code correctly. It is so hard to read that section of the script because of the formatting. That is why I suggested that you go and reformat the script in Divide. To make it more readable for others. What I would suggest is that when you start a IF statement. That you first do the if and its conditional expression. Then open the code block with the begin on the very next line. And then immediately put the closing end on the next line. Then after your open and close the code block. Add in the code that is to be executed in that code block.
  24. Now, I'll talk about code blocks. In Pascal, and Divide, code blocks are blocks of code that belong to a Procedure/Function or to a statement. These code blocks start with the begin key word. And they end with the end keyword. Example: Procedure and Function - procedure SomeProcedure begin // Code block end; function SomeFunction begin // Code block end; Example: FOR statement - for i := 0 to 5 do begin // code block b := 13 * i; TimeStamp('b: '+IntToStr(b)); end; Example: WHILE statement - while i < 32 do begin // code block end; Example: IF statement - if myString = 'This is a test' then begin // code block end; Now, there are certain statements (like repeat...until, case statements, etc) where you do not use a begin, or a end, or both a begin and a end, statement. There is also one exception to beginning and ending a block of code with the begin and end keywords. The exception to this, is when the code in the cold block is a single statement. Then you do not have to use the begin and end keywords. Example: FOR statement - for i := 1 to 15 do TimeStamp('i: '+IntToStr(i));
×
×
  • Create New...

Important Information

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