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

Oort

Members
  • Content Count

    39
  • Joined

  • Last visited

Community Reputation

10 Good

About Oort

  • Rank
    Member
  1. Thanks man. Turns out it was a stupid bit of bad coding causing it. I was looking for ' slot' as an indicator for an empty formation slot, but I had also default all the slots to 'Empty' at start up. Long story short I was doing things right with the arrays, and your help made me realize that it should have worked which got me to finally stumble onto the real problem. I knew it was gonna be something stupid
  2. I have several list boxes created that each represent a slot in a formation to hold a hero. Pull down the list, select the hero, once the formation is filled out, hit the "play" button and go back to the game script. My problem is getting the list of heroes that were selected transferred back to the main program. I've tried creating a TStrArray and then going through each ComboBox.text and pulling out the hero that may be placed there and copying it to the TStrArray, however I keep getting an Out of Range crash so I know I'm missing something here. To start I have my Dropdown box where the names are in the text field, and the array I want to save them to. varHeroSlot: array[1..24] of TComboBox;HeroList : TStrArray After all the formation slots that can be used are filled the Play button becomes active and I call this routine when it is pressed (this is located in the form portion): Function TotalHeroes(FormationSlots:integer):integer; begin Case FormationSlots of 1: Result := 10; 2: Result := 9; 3: Result := 13; 4: Result := 11; 5: Result := 12; 6: Result := 14; end; end;Procedure SaveHeroes(Sender: TObject);var count,count2 : integer; Begin count2 := 0; SetArrayLength(Herolist,totalheroes(formation)); // <-- This sets the Array Length to how many For count := 1 to 24 do // slots are used in a formation begin If heroslot[count].text <> ' slot' then // <-- This identifies slots that are empty begin herolist[count2] := heroslot[count].text; // <-- Here is where the program always crashes count2 := count2 + 1; end; end; end; Been trying to figure this one out for a few days now and just not having any luck. What obvious mistake am I making this time?
  3. Aha! I think I got it. Just had to get the right parameters set up in the right order, but my initial procedure are working out fine and are a fraction the size of those long winded things I was writing. Thanks Wanted. I knew it was just a matter of having an example that directly applied to what I was trying to do and you got me looking in the right direction. Appreciate it.
  4. I think I'm not preparing something correctly as I keep getting a scar crash when I do anything using the new array code. The compile button says its ok and it loads up the menu, but soon as I click on the Diamon Formation radio button it crashes. Here is an image of what the menu looks like for reference (Hope I did that right ) Using the example chunk I posted above, I modified it to this : type TForm1 = record Form1: TForm; Bevel3: TBevel; Bevel4: TBevel; . . etc etc . NxRadioButton22: TNxRadioButton; NxRadioButton23: TNxRadioButton; NxRadioButton24: TNxRadioButton; end;var Form1: TForm1; formation : integer; HeroSlot: array[1..24] of TnXRadioButton;// I have 6 RadioButtons that each represent a formation shape. Below that are 24 NxRadioButtons that represent each// of possible slots a formation could use. Those not being used have their visible setting set to false.Procedure ResetFormation; //<-- Resets the formation slots to all be empty and invisiblevar count:LongInt; Begin For count := 1 to 24 do begin HeroSlot[count].visible := false; HeroSlot[count].caption := 'Empty'; end; end;Procedure MakeHeroSlot(Sender: TObject); Begin // Will assign the Caption of the NxRadiobuttons to be the name of the Hero placed there. end;Procedure Diamond(Sender: TObject); //This is RadioButton2var Count:Integer; Begin ResetFormation; form1.RadioButton2.checked := true; // Checkmarks the Formation being used HeroSlot[2].checked := true; // Just sets the first Hero Slot as checked to modify For Count := 1 to 24 do Begin case count of // These are each of the NxRadioButtons being used for this formation 2,5,6,9,10,11,13,14,18 : MakeHeroSlot(count) // <-- Currently nothing there till I figure out how to get the arrays working properly end; end; end; - - - Updated - - - I should add, that working correctly, whenever one of the Formations is selected all the Hero Slots (NxRadioButtons) have their visible flag set to false and the caption set to "Empty". Then it uses the case statement to know which slots to make visible so they are the only ones that are seen and active. Arrow gives an Arrow shape, Diamond gives a diamond shape, etc. That's all I'm trying to accomplish at this point to determine the correct syntax of how to write it and I can then use that as a basis to finish out the other Formations and do other tasks I have planned.
  5. Thanks Wanted! Looks like a lot of good stuff for me to go over
  6. Oort

    Basic Aimbot

    If you are not familiar with Ctrl-Space, it opens up a list of all possible procedures and functions available to you. When you open it and start typing in the name of the function you want to call it will reduce the list as more and more of the letters are typed. You can use arrows or mouse to scroll through the list as it displays and a click, space or enter on the highlighted command you want appears. This is just to ensure the command you want still exists in the current version. It will also give a description of what the format of the command requires. I am thinking that the FindColorSpiralTol method you are using is for an older version as the version I have has a few more parameters. I'm not entirely sure what you are trying to do, but I did modify your code so that the FindColorSpiralTol worked. It ended up in an endless loop for me, but I'm guessing you have a specific environment you will run it in. program BasicAimbot;var clientWidth, clientHeight: Integer; targetColor: Integer; x,y,StartPointX,StartPointY,StartX,StartY,EndX,EndY,Tolerance: Integer; procedure GetClientDimensions(var Width, Height: Integer); begin GetBoxSize(GetClient.ImageArea, clientWidth, clientHeight); end; begin ClearDebug; GetClient.Activate; GetClientDimensions(clientWidth, clientHeight); targetColor := 1386178; startx := 0; //<-- Starting X point of your search area starty := 0; //<-- Starting Y point of your search area EndX := clientwidth; //<-- Ending X point of your search area EndY := clientwidth; //<-- Ending Y point of your search area StartPointX := clientwidth div 2; //<-- X coordinate of where you want spiral to start StartPointY := clientheight div 2;//<-- Y coordinate of where you want spiral to start Tolerance := 5; repeat if FindColorSpiralTol(x,y,StartPointX,StartPointY,targetColor,StartX,StartY,EndX,EndY,Tolerance) then ClickMouse(X, Y, mbLeft); until False; end. First two parameters (x,y) are the coord the function returns, the second two (StartPointX and StartPointY) are the coordinates where you want the spiral to start, the next 4 (startx,starty,endx,endy) is the area that you want to spiral search in, and last is the tolerance. I'm not any kind of expert on Scar, but I did get it to run without the error and maybe it will be enough for you to work with until one of the true experts looks in on the forums.
  7. Currently working on a script that has a form menu to select various things. One particular portion of it requires checking and comparing quite a few radio button objects and GroupBox and text. Basically I have a series of fighting formation. Each formation holds 9 to 24 "Hero Slots". There are about 40 heroes with various abilities to choose from. My knowledge is limited to only individual object checks. As it is now I have to write out any changes by looking at each button, textbox or label individually. Procedure Diamond(Sender: TObject); Begin ResetFormation; Form1.RadioButton2.checked := true; Form1.NxRadioButton2.Checked := True; Form1.NxRadioButton1.visible := True; Form1.NxRadioButton1.Caption := 'Slot 1'; Form1.NxRadioButton2.visible := True; Form1.NxRadioButton2.Caption := 'Slot 2'; Form1.NxRadioButton3.visible := True; Form1.NxRadioButton3.Caption := 'Slot 3';//etc till NxRadioButton24 end; What I'd LOVE to be able to do is just run a simple loop that would that would look something like : For count := 1 to 24 do Begin NxRadioButton+IntToStr(count).visible := True; NxRadioButton+IntToStr(count).Caption := 'Slot '+IntToStr(count) end; But I'm not sure what format to use. Plus I wouldn't have pages of these lists to scroll through as they would be broken down into very much smaller chunks that does the same thing. And if possible, how to do a case call where I could easily write out a routine to scan through a series of objects, like NxRadioButton, to find one with the name of a specific hero to erase from it. Procedure FindHero(HeroName:string) Case form1.NxRadioButton of 'Dragon' : Begin .Caption := "EMPTY"; end; 'Werewolf': Begin .Caption := "Empty": end; etc end; With the above method I would only need to code it 1 time and use it for all hero searches, but as it stands I only know how to scan through the buttons singly and search them all for each hero - so ending up with over 960 procedure calls! Hoping that there is a solution for this or a source in which I can look to find the solution (a source a little more focused than the entire internet through google, lol)
  8. Very Cool! And congrats!
  9. I haven't seen any mentions of this by anyone else, so am assuming its probably my own system causing the problem. Before updating to the 3.39 version my previous version ran very smoothly. The menus and windows within SCAR quickly and cleanly open/closed/moved. But after upgrading to 3.39 I noticed they got very choppy. Subsequent updates (up to 3.41 right now) haven't solved this. This only happens within the Scar editor itself. Forms I create with various menu elements have worked smoothly. Am wondering if there are some dll's or other things that I can look into updating that might fix this? I'm running on an older computer with win xp.
  10. Managed a time intensive work around. Took a whole lot of screen shots and compared the numbers I found anywhere on the image to the bmp mask. If any pixes in the mask were not covered by a mask created from the screen shot I removed them. After a bit I'm left with a very choppy looking .bmp mask, but it fits in just about every image of that digit created. Example. If my main mask was 0111110 (where 0 is black and 1 is white) and I took a screenshot of that mask digit from the screen and compared the 2 I would zero out any pixels that didn't exist in the screenshot mask. So I'd SS a digit that would end up being 0011110 I would remove that first 1 from the original digits mask. Lots of trial and error with screenshots. The masks wouldn't exactly match, but enough would to recognize specific digits. Now this is where Bixby will come on and say "Hey idiot, if you'd done it this other way it would have been much faster and you'd not have to do all that"
  11. Looking at as many posts as I can find on this and found one with some good information (ironically one that looks like you too were having trouble in getting all this to work - http://forums.scar-divi.com/showthread.php?t=1734&highlight=creating+font). I think I'm completely butchering the usage of 'chars' in the GetTextAtEx call ... I assumed it was asking maximum number of expected characters, but now understand it is meant to represent what character set is loaded. Probably why I'm getting the access violation. I'm guessing that I need to now figure out how to load the digits character set and then use the 'chars' value to point to them ... Back to digging for info! (Another Update) Nailed it! Wow. What a PITA to figure out. Ok. That post I linked to above that you were involved in, Bixby, turned out to be invaluable. What I really struggled with was that there is absolutely no give if you are even a pixel off where it expects to find the text to read. Once I recaptured the digit images to confirm they matched with what was on the screen I reset the x,y coordinates to exactly match the upper left corner of the digit's space. Once I did that I got full matches. The problem with this whole process is there are so many little tiny details you have to be aware of that aren't well documented anywhere. Most of the dialog that takes place on it assumes the reader is aware of various things or understands various setting meanings. I knew that I was struggling with that before which is why I had opted to try a slower array method. But I'm thankful that you pointed back in this direction Bixby! Here is my final bit of test code that worked : Program Find_Digits; var digit:string; fontset:integer; begin fontset := LoadChars2('C:\Games\SCAR Divi\Work Dir\Fonts\ClickerHeroFont\') digit := gettextatex(155,278,0,fontset,false,false,0,0,-1,3,false,tr_Digits); writeln('digit = '+digit); setmousepos(155,278); //Just to visually see where its looking at end. Thanks for taking the time to respond! - - - Updated - - - Sigh. Back to the drawing board. It seems that all the characters are written with some kind of anti-aliasing going on so even the same characters have slight pixel differences/shading. Changing the tolerance isn't seeming to really help out. I'll keep messing around with this, but Blah.
  12. Thanks Bixby. I knew that I was mucking up the assignments. It was my first go at it and I couldn't track down relevant information to the process. Or in the very least, understand what I was reading enough to implement it correctly. So I broke down my .bmp file into individual digits 0 through 9 (using only black and white) and named them according to their Ascii values (ie. 0 is named 48.bmp, 1 is named 49.bmp, etc). I created a directory off the Scar Divi/Work Dir/Font dir named "ClickerHeroFont" (/Scar Divi/Work Dir/Font/ClickHeroFont) and saved those .bmp files to it. Wrote up a quick script to see if it would find a single digit (zero) located on the game screen. Using gettextatex i pointed it to the upper left corner of where the digit is on the screen. Just my assumption of where to point it at, not really sure. When I try and run the script I get an error code "Runtime Error Line 7 Access Violation at address 00F250D8 in module 'scar.exe'. Read of address is 00000014". Here is the test script : Program Find_Digits; var digit:string; begin digit := gettextatex(154,278,0,1,false,false,0,2,clWhite,13,false,tr_AlphaNumericChars); writeln('digit = '+digit); end. I've actually gotten this far before, but never further (although I hadn't created a font dir and put .bmp files in it before) so just don't know what I'm doing wrong. I've tried both "tr_AlphaNumericChars" and "tr_Digits". Am I overlooking something that needs to point to those .bmp files? Or missing something else obvious?
  13. I've avoided using arrays, but I think the times come to start getting a handle on them. What I've done is make screen captures in order to get all the digits on a game. I then created individual images of each digit, keeping a single color and making it white and turning all the rest of the pixels black. The idea is to store those in an array and then use them as a mask to identify various values in a screen grab. Here is my failed attempt : var count: integer; Digit: array of TSCARBitmap; Function LoadDigit(num:integer):string; begin case num of 0 : Result := TSCARBitmap.Create('deNrjZuBlgIP/qIABFfzHAfDLYiog0kBiFO' + 'BSQ0UFaILEK6Cuv+DiADgyHAs='); 1 : Result := TSCARBitmap.Create('deNpjZ+BhQAb/YQCNCxf8TxyAqMRq5qASBACEeYmK'); 2 : Result := TSCARBitmap.Create('deNrjYuBhgID/GICBAacUXMF/3ABZFtMoBm' + 'wAjyxWh5Ethcun+KXw+5cgAADBN905'); 3 : Result := TSCARBitmap.Create('deNrjYuBlgID/GICBAacUXMF/3IABGyBDFr' + '+xJFlKjALivU9SgBB0MADXeOYx'); 4 : Result := TSCARBitmap.Create('deNrjZuBhQAP///9HY6DJIgNSFfzHAFhlk' + 'bmYCvBzcSnAJYupgGyAJzQYcANkBQAFOMJV'); 5 : Result := TSCARBitmap.Create('deNrjYuBlgIP/GACXOBmyDNgAkbKYxhK0F4' + '9RBF1CpEVYrSboKlxSAElp7yg='); 6 : Result := TSCARBitmap.Create('deNrjYuBlQAP/YQCXOKYUHl34NRIphQaIl8Vv' + 'Gn7riHEJpnr8snh8DQA4ReYx'); 7 : Result := TSCARBitmap.Create('deNrjYuBhgID///9DSDiAi5MNGDAAHin8spRr' + 'JNVYqmsEAO8opHI='); 8 : Result := TSCARBitmap.Create('deNrjZOBlAIL/GICBAbs4VoBLMQMMECOFyz' + 'pchmAKkmoCfimSAB4XAgA0tAob'); 9 : Result := TSCARBitmap.Create('deNrjZuBhgIP/qICBAacUpjLiFRA0E6sC/C' + 'YQ6QZiLMVlO0myZGsHANmE5jE='); end; end; begin For Count := 0 to 9 do Digit[count] := LoadDigit(count); for count := 0 to 5 do writeln(Digit[count]); end. Unfortunately this keeps giving me a "type mismatch" error. Here is an image to text grab as an example of what I'm going to use it on : capture := TSCARBitmap.Create('deNrFmDFr40oQx+9L3Ld63+K44hBXPISLY3ETlh' + 'RBXBFEiiBSBOzC4BQGpwg4TUApAnZhUIqAXKRQ8QoXr3CRwu83Gnm9Xik5w4O7' + 'ZTHy7mp3/jPzn5nVX58+f1o/J7+vvwQ9fbevuvum6dlBf/1F/5MY9+MdMKtlUj' + '4lxaN0Hqplg91hXK+y6jktF2n5lBZPablM+btefYSRPYsHm0/M+Mpk5zG/PDOy' + 'Xh4lf7Wwxb2d3ZjBZUyfjcz83laLjpXlImFqOjLZRSwHXZv81oJi/dyg43k2se' + 'nPOPoeffn6hR7/HfF3dmPBu9NAOr9PBpfG9qPo237NdGjnDwlgOzGWTxZcuj76' + 'FrE/zwjA+DEYAcgRKpL25DSe3x28q2ocXJmd5DEH8Yt405FlFuGLhwTgOptepO' + 'PReDAc8KCvpGfsKZZFsOaUn8n4Zswv3fyQQfMjym/ZqgMjQjI7vZ1u37baeNee' + 'RGLKIzBiQfZf/7PW1zebDVqaDo1zA2yaTyxqF1Ev0vKl3O5adpklZzHmo2NcFg' + 'yuB9ugvW3nT3OB0I9Umel5Wr1WwapyVYLU9mO8t40Rz+TF2d3MrUeHjOBXx2Ac' + 'X8m5m3837nUwYhHFiI1wSNOLgiO0gUgPwkV54NztOy1/yBuDnqfvrSmeCzllYt' + 'sY1RD5Y74/elgffQetrAgwargGlfJbw7iQ91oGxclr7jg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+ 'upG7oXSUAHAGZZl3fyRFonMpLXoRBKR+kzWL1Af4u78D/OLTh/dB4Ln+DrDYfQ' + 'dYyLW34xvIi9z9wQuu3YKOrx9/EuPxX3hW/+sLz3+UeNlo'); To be honest, I'm not even sure the digit images I made are usable in this manner. So I'm hoping someone can help me out a bit here to get me going in the right direction.
  14. I have no experience with that so can't help you there. Sorry.
  15. This is the method I use. I put information I want to write into the Report string. Then I write it to the debug box with writeln(Report) and write it to the Report File with UpdateReport(Report). If you want to keep adding information to it every time you run your program then just remove the Rewrite file call that is run when the file is detected. Program program_name; var Report : String; Done : Boolean; count: integer; const ReportPath = 'C:\{dir path you are using}\Report.txt'; Procedure InitReportFile; var file:integer; begin if not FileExists(ReportPath) then begin // Create the Report File if not there file := Rewritefile(ReportPath, False) closeFile(file); end else // Remove this section begin // Clear the Report File for New Session. // if you want to continue file := Rewritefile(ReportPath, False); // to add to the file each closefile(file); // you run your program end; end; Procedure UpdateReport(str:string); var file:integer; begin //Writes the string sent to it in the Report File with carriage return file := Appendfile(ReportPath, False); WriteFileString(file, str); writeFilestring(file,#13#10); //Starts text on next line (carriage return) CloseFile(file); writeln(str); // Adds Update to Debug window end; begin InitReportFile; ClearDebug; UpdateReport('-----------Begin Session-------------'); UpdateReport(DateToStr(Date)+' '+TimeToStr(Time)); UpdateReport('----------- Version 7 -------------'); count := 0; Repeat Report := 'Count has reached '+inttostr(count); UpdateReport(report) count := count + 1; if count > 15 then Done := True; until Done; end.
×
×
  • Create New...