Jump to content

ozone

Active Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by ozone

  1. I have clipboard contents that contains formatted text where some of the text is formatted as strike-through. All I want to do is remove any and all text that is formatted as such. I've been pointed in the direction of Clipboard.au3 but I can't make heads or tails of the functions in there. I don't know if it helps but here is what a corresponding VB macro looks like in Word. How would I do something equivalent in AutoIt? Sub Macro1() ' ' Macro1 Macro ' ' Selection.Find.ClearFormatting With Selection.Find.Font .StrikeThrough = True .DoubleStrikeThrough = False End With Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "*" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True End With Selection.Find.Execute Replace:=wdReplaceAll End Sub
  2. Well, generally the clipboard which copied text from MSWord/WordPad. I checked out rich edit but the functions seemed out of my league. So what do you think? Is there a way to detect whether a character in a string of text in the clipboard is underlined, strikethrough, or just normal?
  3. I am trying to copy text where some of it might be underlined or strikethrough. Is there a way to detect for this in my script?
  4. (?=[-0-9xX ]{13}$) Couldn't get that to work. Does positive lookahead not work with AutoIt's StringRegExp()? If not, is it a planned addition anytime soon?
  5. Here is an interesting question. I'm using the IsPressed function to detect when my left mousebutton is pressed down. When I press it down, I want AutoIt to send "repeated" leftclicks... then when I let up on the left mousebutton, I want AutoIt to stop sending leftclicks. The interesting problem though is AutoIt can't sense that I am holding down the left mousebutton AND send multiple left mouseclicks at the same time... or at least I think that's what the problem is. Here is my code. Global $activate AutoItSetOption ( "MouseClickDelay", 10) $letter = "^p" HotKeySet($letter, "ToggleActivate") Func ToggleActivate() $activate = NOT $activate While $activate If _IsPressed('01') = 1 Then MouseClick("left",800,600,1,0) Sleep(40);this compensates for the mouseclick delay being at 0 Wend EndFunc Func _IsPressed($hexKey) ; $hexKey must be the value of one of the keys. ; _IsPressed will return 0 if the key is not pressed, 1 if it is. Local $aR $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($aR[0],0x8000) = 0x8000 Then Return 1 Return 0 EndFunc While 1 Sleep(100);infinite loop WEnd Does anyone have a solution? Oh, and if you're confused about my problem, then think of it this way... I'm trying to build a rapid-fire script (i.e., hold down a button and the thing auto-fires until I release the button).
  6. I learn best by having a problem I want to solve. Once I have the problem, I read through functions until I find something that will do what I want. Then when I have another problem, I read some more. The AutoIt guide with all its functions is fairly short though, so it might just be worth your while to look at each function first. Though with larger languages like php, it's pretty useless to try and learn by simply reading the manual. Motivation is the key to success at anything - and motivation comes best by having a problem that you need to solve.
  7. Here is Version2 of my script. The two main hotkeys now are F1 and F2 and then you still have your pause button. F2 is the same old function in my original script. So just press F2 to enable that, and pause/unpause to turn it on/off. F1 though is really designed for long range stuff. If you are sniping or just aiming at something far away, the formula in the original program doesn't work too well. So this is where the F1 function comes into play. It samples a single pixel, then freezes all input on the keyboard and mouse, and then continues to check that same pixel for a change for the next 5 seconds. If a change is detected, it will fire three rounds and then unlock the kb+mouse. BlockInput() is required for this simply because one slight movement of the mouse will register a pixel-change and it's very hard to keep your hand still... so BlockInput() is the only way to go. The downside is obviously the 5s freeze - so if someone comes from behind you or towards you outside of the crosshair, you will likely die. Thus only use F1 for long range attacks; but it works incredible! Future changes? Two things I want to do when I get a few minutes. First, when switching between F1 and F2, the "first" time you hit pause, you must hit it twice to pause. But after that, pause must only be hit one time. Confusing to explain, but once you try it you'll see what I mean. I want to fix that later and just have one pause needed. And second, sometimes there is dust in the air on the gamescreen and it will register a pixel change if it floats past you. So I want to build some tolerances for the F1 function. Other than that, this program pushes the limits of what can be done with an aimbot and CS. Enjoy! Global $paused AutoItSetOption ( "MouseClickDelay", 10) ;capture pause key $letter = "1" Do $letter = InputBox("Choose your hotkey:", "Please enter any lowercase letter." & @CR & "The resulting hotkey will be a combination of" & @CR & "CTRL + ALT + (your lowercase letter).", "", "", 240, 200) Until IsString($letter) and StringLen($letter) = 1 and StringIsLower($letter) $letter = "!^" & $letter HotKeySet($letter, "TogglePause") ;pause function Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc ;switch1 function HotKeySet("{F1}", "Switch1") Func Switch1() $px1 = PixelGetColor($xx,$yy) BlockInput(1) $sec = @SEC $min = @MIN While $min*60+$sec+5 >= @MIN*60+@SEC If $px1 <> PixelGetColor($xx,$yy) Then MouseClick("left",$xx,$yy,3,0) BlockInput(0) ExitLoop(1) EndIf WEnd BlockInput(0) EndFunc ;switch2 function HotKeySet("{F2}","Switch2") Func Switch2() $switch2 = NOT $switch2 While $switch2 $hex = Hex(PixelGetColor($xx,$yy),6) $r = Dec(StringRight($hex,2)) $g = Dec(StringMid($hex,3,2)) $b = Dec(StringLeft($hex,2)) If $r<130 and $g<130 and $r<110 Then Select Case $r<80 and $b<80 and $g<80 and $r+20>$b and $b+10>$g and $g+10>$b and $r+13>$g and $g+5>$r MouseClick("left",$xx,$yy,3,0) Case $g>$b and $b+5>$g*.5609 and $r+5>$b and $g/$r>.95 and $r/$g<1.15 and $g-$b<=35 MouseClick("left",$xx,$yy,3,0) EndSelect EndIf WEnd EndFunc ;set resolution $res = 0 Do $res = InputBox("Choose your IN-GAME resolution:", "1 = 640x480" & @CR & "2 = 800x600" & @CR & "3 = 1024x768" & @CR & "4 = 1152x864" & @CR & "5 = 1280x960" & @CR & "6 = 1280x1024" & @CR & "7 = 1600x1200" & @CR & @CR & @CR, "", "", 200, 200) If $res = 1 Then $xx = 320 $yy = 242 ElseIf $res = 2 Then $xx = 400 $yy = 303 ElseIf $res = 3 Then $xx = 511 $yy = 387 ElseIf $res = 4 Then $xx = 575 $yy = 435 ElseIf $res = 5 Then $xx = 640 $yy = 485 ElseIf $res = 6 Then $xx = 640 $yy = 516 ElseIf $res = 7 Then $xx = 798 $yy = 605 EndIf Until $res = 1 or $res = 2 or $res = 3 or $res = 4 or $res = 5 or $res = 6 or $res = 7 ;loop While 1 WEnd Oh, and if you've been keeping up with the recent posts in the "Idea Lab" forum, you will notice I suggested a hotkey override for BlockInput(). It sure would be nice in a situation like this.
  8. Ahh, maybe I'm just having a slow day haha. The solution would be: If StringIsAlNum($data[1])=1 Then $data[1]=Number($data[1])
  9. GOAL = Convert "00,03,01,001,1,0,0,01,00,00,00,0,HELLO" to an array of either numbers or strings. $data = StringSplit("00,03,01,001,1,0,0,01,00,00,00,0,HELLO", ",") But here is the problem. Number($data[1]) returns 0 Number($data[13]) returns 0 That's a problem... Ideas in how to preserve existing strings?
  10. 1. When you posted your message your website was down. So I searched google for cache containing the term japsclan.com and found various threads saying that it was one of those sites claiming "CS cheats" but in reality installed a few nasty viruses onto your PC. Couple this with the fact that you did not post anything else with your link. Why just post a link? Maybe you are pissed off at people writing stuff like this for CS? Makes sense. Also, www.JapsClan.org is an official site, and not your site. So there were MANY very shady things behind your original post, so don't get pissy if I incorrectly assumed that your non-existant site was a virus. 2. Well what should I have called it? It does indeed auto-shoot, but it also aims; but you must have your crosshairs on the enemy. So aimbot suits this best. 3. There is no website at www.counter-script.com 4. Console scripting is limited to what is available in the program. What I have done cannot be done via console. There was an old auto-aimbot for CS writtin via the console, but that was patched; this cannot be patched and it is the only aimbot for Counterstrike Source.So, creating something external like this has several benefits: (i) valve can't patch it; (ii) valve can't detect it. @JSThePatriot Basically I just screencapped like 20 shots from various distances and angles of the counterterrorists and terrorists. I then tried to find a general range for colors, and then just wrote constraints - and those constraints took the form of that equation you see. And to increase the speed, I added "If $r < 130 and $g < 130 and $r < 110 Then" first which just skip over the heavy math if the pixel isn't within the general range. I do have a general question though. Q: is there time difference (even if microscopic) between If A/6 > 4 and B/5 < 3 Then (stuff here) EndIf Versus... If A/6 > 4 Then If B/5 < 3 Then (stuff here) EndIf EndIf
  11. Don't be a jackass. That website hijacks your browser and installs a trojan. Rot in hell moron. By the way, posting a link like that with the intent to harm my computer is a tort and as your ip is logged you could be prosecuted.
  12. Probably a controversial script, but that's irrelevant. I've only mapped the pixelsearch algorithm for the basic two outfits in source (CT and T) so if you use this with regular counterstrike it won't work on the other models. Basic concept is that it scans a single pixel and compares it using an algorithm to what a typical pixel color of an enemy uniform looks like. If it gets a match, it will fire 3 shots. Because this script needs a fast response time, it can only scan a single pixel, and that pixel happens to be dead center in the crosshairs. How well does it work? Pretty darn well. It does mess up though in the tunnel areas because they are so dark, like the enemy outfits; and for this reason I have implimented a hot-key to pause/unpause it. When you select your hotkey at the start of the program, map that key to the middle mouse button using the intellimouse 4.0 keymapper. I find this works best because you'll want to pause/unpause at split second notice. Feedback (not flames) appreciated. Global $paused AutoItSetOption ( "MouseClickDelay", 10) ;capture pause key $letter = "1" Do $letter = InputBox("Choose your hotkey:", "Please enter any lowercase letter." & @CR & "The resulting hotkey will be a combination of" & @CR & "CTRL + ALT + (your lowercase letter).", "", "", 240, 200) Until IsString($letter) and StringLen($letter) = 1 and StringIsLower($letter) $letter = "!^" & $letter HotKeySet($letter, "TogglePause") ;pause function Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc ;set resolution $res = 0 Do $res = InputBox("Choose your IN-GAME resolution:", "1 = 640x480" & @CR & "2 = 800x600" & @CR & "3 = 1024x768" & @CR & "4 = 1152x864" & @CR & "5 = 1280x960" & @CR & "6 = 1280x1024" & @CR & "7 = 1600x1200" & @CR & @CR & @CR, "", "", 200, 200) If $res = 1 Then $xx = 320 $yy = 242 ElseIf $res = 2 Then $xx = 400 $yy = 303 ElseIf $res = 3 Then $xx = 511 $yy = 387 ElseIf $res = 4 Then $xx = 575 $yy = 435 ElseIf $res = 5 Then $xx = 640 $yy = 485 ElseIf $res = 6 Then $xx = 640 $yy = 516 ElseIf $res = 7 Then $xx = 798 $yy = 605 EndIf Until $res = 1 or $res = 2 or $res = 3 or $res = 4 or $res = 5 or $res = 6 or $res = 7 ;loop While 1 $hex = Hex(PixelGetColor($xx,$yy), 6) $r = Dec(StringRight($hex, 2)) $g = Dec(StringMid($hex, 3,2)) $b = Dec(StringLeft($hex, 2)) If $r < 130 and $g < 130 and $r < 110 Then Select Case $r < 80 and $b < 80 and $g < 80 and $r + 20 > $b and $b + 10 > $g and $g + 10 > $b and $r + 13 > $g and $g + 5 > $r MouseClick("left", $xx,$yy, 3, 0) Case $g > $b and $b + 5 > $g * .5609 and $r + 5 > $b and $g / $r > .95 and $r / $g < 1.15 and $g - $b <= 35 MouseClick("left", $xx,$yy, 3, 0) EndSelect EndIf WEnd
  13. Ever had a row in an array you wanted deleted? Well here is the script for you. Func Name = delete_array_row Variables: $array = name of your array $dimcount = dimensions of array (can be either 1 or 2) $row = row # you want deleted Dim $array[10][2] For $i = 0 to UBound($array, 1) - 1 If $i = 4 Then delete_array_row($array, 2, 5);line which deletes a row MsgBox(1,"", $array[$i][1]) If $i = UBound($array, 1) - 1 Then ExitLoop(1);exists loop if new end bounds is reached Next Func delete_array_row(ByRef $array, $dimcount, $row) If $dimcount = 2 Then Dim $temp[UBound($array,1)-1][UBound($array,2)] For $a = 0 to $row-1 For $b = 0 to UBound($array,2) - 1 $temp[$a][$b] = $array[$a][$b] Next Next For $a = $row+1 to UBound($array,1) - 1 For $b = 0 to UBound($array,2) - 1 $temp[$a-1][$b] = $array[$a][$b] Next Next $array = $temp Return Else Dim $temp[UBound($array,1) - 1] For $a = 0 to $row-1 $temp[$a] = $array[$a] Next For $a = $row+1 to UBound($array,1) - 1 $temp[$a-1] = $array[$a] Next $array = $temp Return EndIf EndFunc Don't forget the "If $i = UBound($array, 1) - 1 Then ExitLoop(1)" line, because if you set the end of the For loop to the UBound of the array, that value is not "re-calculated" when you delete a row. So this line will factor that in. Suggestions welcome.
  14. Then let me end on a question... Q: If EVERY text sorting algorithm uses > or < with strings, then explain this peice of code. If you can do that, I'll mail you $100. If "2" < "10" Then MsgBox(1, "", "DOES NOT APPEAR") EndIfThus, the > and < operators serves ZERO purpose in AutoIt in regards to strings, so someone should put them to good use darnit!! P.S. When they are put to good use, apply "logical logic" - i.e., make comparison of numeric strings possible in regards to the number size; NOT string-length which we already have a function for... i.e., stringlen()
  15. I understand that, but re-read my edited-beyond-words post. The instruction manual says if two strings which are numbers are multiplied, they will return the correct mathematical result. So it follows from THAT logic that if two strings which are numbers are compared using > or < the correct mathmatical operation should result. In a nut-shell, what I'm saying is if AutoIt is not going to allow comparison of strings, then it equally should not allow multiplication of strings. i.e.: (this is the current status of AutoIt) "2" < "10" returns false but "2" * "10" returns 20 Therefore, the way numeric strings are treated is inconsistent.
  16. @this-is-me (EDIT2) I had to re-edit this post because after re-reading the auto-it documentation, I don't believe you So no, I don't believe StringSplit() returns a string. It returns a Variant, and thus it should correctly be called "VariantSplit()". What's "inside" of the Variant is what you are thinking about - i.e., either a string or an int. Now, look at those examples quoted from the AutoIt instruction manual. It clearly shows two strings "10" and "20" multiplied together to return a valid 200. Therefore, the bug is with the greater-than/less-than operators. Again, if you re-read that quote from the instruction manual, it says "[AutoIt] decides how to use the data depending on the situation it is being used in." Therefore according to the logic of the manual, if two strings (10 & 20) can be multiplied and return the correct result, then it follows that if two strings (10 & 20) are compared using > or < a correct numerical comparison should result. And if we think logically about this, why shouldn't it? The > and < operators serve absolutely ZERO purpose in regards to strings. Thus the conclusion is: this is a BUG in AutoIt.
  17. Took a HECK of a long time to narrow it down to this problem. I had this huge slab of code and had to just delete line after line until I got down to this and finally realized the issue... So here's the problem. $a = StringSplit("10,5,1",",") If $a[2] > $a[1] Then MsgBox(1, "", "APPEARS") EndIf If $a[2] * 1 > $a[1] * 1 Then MsgBox(1, "", "DOES NOT APPEAR") EndIf In a nutshell, it's very easy to use stringsplit() to make an array out of a list of data. But if the data is numbers, until I perform a math operation on each array value, the value is deemed a "non" number... So, 1. Is this a bug? 2. If it's not a bug, is there an equiv of StringSplit() but for numbers because it's a hassle to perform a math operation on each string for it to be recognized as a number, but I like the ease of use in creating an array with StringSplit().
  18. The world is full of wonderful people. And these wonderful people can do either legal or illegal things... so long as bot-selling is legal, then moral "values" should not be argued.
  19. Possibly a sensitive question. I don't know current C++ enough to program, but I know autoit very well. I've made an application I want to sell, and I made it using autoit. When I say "application" I mean I made a .au3 file that does some useful stuff and now want to sell the compiled exe. So here is the question. Is there a way to remove the copyright notice and all the other info when you click on properties for the .exe file? If the authors of autoit don't want to allow that, then I won't argue. But I want to know if it's possible and if it's okay...
  20. Figured it out. I was just looking at the problem the wrong way. The simple solution is to array it: ; --------------------------- USER CONFIG --------------------------------- Dim $id[30], $data[30] $id[1] = "01. selection 1" $data[1] = "c:\test1.txt" $id[2] = "02. selection 2" $data[2] = "c:\test2.txt" ; ------------------------------ BEGIN --------------------------------- $selection_number = InputBox("What to Update?", $id[1] & @CRLF & $id[2], "selection number", "") .... Send($data[$selection_number]) .... Exit
  21. Maybe I'm having one of those days (you know, when you look for the bread in the pantry, and it's right in front of your face but you never see it), well anyway, here is what I'm trying to do: ; --------------------------- USER CONFIG --------------------------------- $id_1 = "01. selection 1" $data_1 = "c:\test1.txt" $id_2 = "02. selection 2" $data_2 = "c:\test2.txt" ; ------------------------------ BEGIN --------------------------------- $selection_number = InputBox("What to Update?", $id_01 & @CRLF & $id_02, "selection number", "") $chosen_id = $data_ & $selection_number Exit I know the $chosen_id part is incorrect, but do you see what I'm trying to do? I want a user to choose a selection, in this case either 1 or 2, then that selection will determine which $data_x will be used? Maybe I can't see the solution today, or maybe this is totally the incorrect method to approach the problem, but I can't figure out how to use a variable to help determine another variable. Help is more than welcome EDIT: Just to make what I want a little more clear, later in the program I want to open the text file the user chose, so my future send command will look like this: Run("notepad.exe") WinWaitActive("Untitled") Send("^O") WinWaitActive("Open") Send($chosen_id & "{ENTER}") So the question is, how do I write my above $chosen_id declaration so that is is equal to the correct $data_x value?
×
×
  • Create New...