Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal


  • Content Count

  • Joined

  • Last visited

Everything posted by lovromirnik

  1. Genious, I made a 100ms empty .wav file and called it at the ScriptTerminate procedure like you suggested. Works like a charm!
  2. Well FindBitmap is still in there but I feel ya man, absolutely no resource aside from the old manual which is severely outdated and the poor wiki which lacks content...
  3. Basically what you need to do since its a really simple script is rewrite this completely because who knows what still works and what doesn't...
  4. Hey, I can use PlaySound to play any .wav file, however I noticed that even after the script is terminated, if the sound has a remaining duration it will continue to play, until it either reaches the end of the sound file or SCAR is closed... Any ways to make a sound stop when terminating a script?
  5. You can always try raising the Tolerance with FindBitmapTol until your image is found... If you are sure that an option should pop up in the Right Click Menu then you can try using: repeat Wait(100); until FindBitmapTol(X, Y, Bitmap, 0, 0, 400, 400, 10); Or use something like a five second checking: repeat if FindBitmapTol(X, Y, Bitmap, 0, 0, 400, 400, 10) then begin //Go and click this ImageFound := True; end else begin Wait(100); Tries := Tries + 1; end; until (ImageFound = True) or (Tries >= 50); This way the program will search for the image for 5 seconds (50 x 100 milliseconds) and then call it quits if the image is not found, or break out of the loop at the moment the ImageFound boolean is set to True...Meaning the image has been found and the menu clicked. This is very useful if lag for example makes the Right Click Menu open after a different time every run. If you'd set the wait simply to 5000 milliseconds and the menu would open after one second you're losing 4 seconds each alliteration. Hope this helps in any way
  6. From your code I can't tell any problem that would cause the Bitmaps to not be found, except if the Right Click menu takes longer than 2.5 seconds to open... Does the program count properly? Would it run 60 times if left running?
  7. Hello I've been hand calculating my Workout routines for far too long so today I decided to make a Workout Generator. Named it WorkGen. I decided to share it with you because I believe that we can all learn from each others' code. In no way is this perfect, I know I should use ShowModal instead of just showing the Form but #care? Also you will have to install the attached Font to make it work.
  8. Hey, For number two the fix is easy, after moving the mouse to a random spot check for the location of the mouse before clicking. That way use GetMouseLoc(X, Y) and only then MouseClick(X, Y, mbRight) For number three use the Bitmaps like you described but remember that SCAR finds the Bitmap at the beginning coordinates. So when you'd move your mouse on the button it would move it to the top left edge of the button. Use some offsets. I made a picture for that: - - - Updated - - - Also this is how I'd go on making the first part of your program. There is no way of testing this myself because I do not know your game, or play any games really but maybe it will be helpful program PrayClick; var Menu : TSCARBitmap; X : Integer; Y : Integer; procedure ClickPray; begin Menu := TSCARBitmap.Create('deNoBNADL/wQABADkfX7va2z/gYH+dnbiVFX7iYn9dHSoY2PfTE39h4f8cXFXS0vbV1j1e3v7bm6bVVXBDBtj'); if (FindBitmapTol(X, Y, Menu, 740, 295, 1300, 720, 10) then begin MoveMouseBoxEx(X, Y, X + 12, Y + 5, 15); GetMousePos(X, Y); ClickMouse(X, Y, mbLeft) end else begin Writeln('Error'); end; end; begin ClickPray; end.
  9. Excelent man I'm really happy that still some work goes into SCAR, it really is my favourite program and language. I reckon I could learn to love any language if I knew it as well as I do SCAR but then again why? Also Freddy I've noticed that trying to update SCAR from the program itself does nothing... At first it asks if you'd like to download a newer version and if you do it will download it successfully, but after that it just asks you to save your work and close SCAR. When clicking OK on the prompt you're just left inside SCAR to do whatever. If you then close SCAR as recommended nothing will happen. Hmm, perhaps it is just me
  10. How's the development going on this? I noticed that the last update was on 3rd of June, 2014 and I'm just wondering...
  11. Hello, do you still need this done? I realise it is a bit late, but give me a reply and I'll see what I can do.
  12. Hey Freddy I was hoping you could tell me something... with SimulationImage do begin Parent := SimulationWindow; Left := 0; Top := 0; Picture := ??? end; Does the Picture option work yet? And if it does, what kind of specifier should I use?
  13. tom99, you should be using the TSCARBitmap instead of Integer when assigning the Variable. Correct would then be... EnterBattle : TSCARBitmap; And yes, Puff is right, it is now FindBitmapTol. Also remember:
  14. Sweet, I should start using the Search button
  15. Hello, I was hoping someone would be able to quickly explain the difference and the specific usage scenarios where these types should be used. Thanks, SCAR is a lot of fun.
  16. Hello Freddy, thanks for clarifying that up, I understand. Also thanks for the answer!
  17. Hello, does SCAR have a OnDeinit() function or something simmilar? I've been experimenting with Forms and since I'm still new to the area I often need to Ctrl + Alt + S to Stop the Script, which unfortunately leaves my Form open. In order to close it then I am forced to reopen SCAR. Thanks in advance, Lovro Mirnik
  18. VKeyDown(VK_ESCAPE); And don't forget to use VKeyUp afterwards also
  19. Awesome man, this fixed it. Thanks a bunch!
  20. Hello, I am trying to get separate parts of a random number, example, 12345, and then send it into an external input window via KeyDown and KeyUp, one char at a time. I'm having some difficulties with it. Please take a look at the Code below: program GetPartsOfString; var Number : Integer; ConvertedToString : String; LengthOfString : Integer; CountFrom : Integer; CurrentChar : Char; begin Number := 12345; ConvertedToString := IntToStr(Number); LengthOfString := Length(ConvertedToString); for CountFrom := 1 to LengthOfString do begin CurrentChar := StrGet(ConvertedToString, CountFrom); Write(CountFrom); Write(': '); Writeln(CurrentChar); end; end. This is the outcome: Successfully compiled (45.2964 ms) 1: 1 2: 3: 2 4: 5: 3 Successfully executed (201.781 ms) Why is every second number ignored and then recognized the next time? And more importantly, how do I fix this? Any help is much appreciated!
  21. Just to give a little heads up, neither .\Include.scar or ScriptPath + Include.scar work.. - - - Updated - - - program Name; {.include ScriptPath + Include.scar} begin Include; PlaySound(ScriptPath + 'RandomSound.wav'); end. Including it that way returns an error that an Include has not been found at the specified path. If I remove the Include files the Sound gets played without problem. What am I doing wrong? Edit: Of course giving it the whole path works like a charm. See above problem why this isn't optimal for me. - - - Updated - - - Hello again, I've found that I've been wrong for not actually saving the Script into the same folder as the Include. After having it in the same folders I can call an include with either {.include Include.scar} and {$I Include.scar}. I reckon they do the same thing.
  22. Hello, how would I specify SCAR to load includes from the same folder as the Main Script is in, regardless of the location? Right now I had trouble transporting scripts from one computer to another because I had to change all the paths! Thanks a lot! Lovro Mirnik
  23. Hello fellow SCARians, I've been lurking these forum for quite some time now, and I've managed to create quite an exstensive array of macros using your suggestions and tutorials. But one thing evades me, and that is how to draw anything on the screen. Right now I am working on a program that will organize your stuff, be it pictures, videos, documents, and so forth into user specified folders automatically, right from the desktop. The program works fine and I've no problem with it as is. Currently there is an area, that SCAR periodically checks on my desktop for new items. It then recognizes these items and sorts them out. This little area is invisible to the naked eye, and known only to my mind. I would like SCAR to draw the outline of this area, so I will always be sure where to place the items. Now, I would love it, if you could provide an example on how to color a single pixel in any client window. Please, disregard the above described program and just give me a code, that I can copy and paste into SCAR, compile, and notice a small pixel on screen that is of a different color. Or is asking for such a thing too much? Best wishes and thanks to those taking the time in advance! Lovro Mirnik
  • Create New...