smstroble
Active Members-
Posts
190 -
Joined
-
Last visited
Profile Information
-
Location
Earth
smstroble's Achievements
Prodigy (4/7)
0
Reputation
-
Closing Random Windows / Documents
smstroble replied to sgebbie's topic in AutoIt General Help and Support
I agree, many things could go wrong. But if you are still determined you should look into WinList. -
I have an idea. Ive been to sites before with rapidshare links that are behind links so you cannot just copy them into RadpidQueuer. Mayhaps you could make it so that we can copy a web address and RadpidQueuer will grab the source of that page and get all of the rapidshare links off of it, perhaps this could come with a dialog box to deselect undisired links.
-
Your entire statement is flawed. That script is not the most annoying script I could come up with (or that has been posted in the past) nor does it work on every computer. I built my computer and purposely left the system speaker unplugged to avoid beeping noises. As for a more irritating script, for the sake of any poor sap who has to be anywhere near you, I will not elaborate. P.S. its also not my god and you spelled amazingly wrong.
-
ops, yea those were just for testing. I thought I had removed all the msgboxes when I was done with them, I guess I missed a couple.
-
Nice graphics! Though its kinda a pain to enter data quickly into because pressing tab jumps around out of order. Try changing the order which you create the input boxes. Also it still suffers from the sidea = 1 sideb = 2 aangle = 30 bangle = 60 cangle = 90 glitch. I fixed that and posted the correction in the old thread if your intrested.
-
Fixed ; Triangle solver, solves every solveable standard triangle ; Author: monoceres ; Thanks to: eviltoaster, weaponx and The Kandie Man for help about degrees and radians ; Triangle laws I used:: ; Law of Cosines: a^2=b^2+c^2 -2bcCos(A) ; Law of Sines: a/Sin(A) = b/Sin(B) = c/Sin© ; A+B+C = 180 ; Includes, beta safe! #include <Math.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <Misc.au3> Opt("GUIOnEventMode", 1) Opt("MouseCoordMode", 2) $Form1 = GUICreate("Triangle Solver", 501, 339, -1, -1) $menu=GUICtrlCreateMenu("?") GUICtrlCreateMenuItem("Help!",$menu) GUICtrlSetOnEvent(-1,"help") $Pic1 = GUICtrlCreatePic("triangle.gif", 8, 8, 480, 180, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS)) GUICtrlSetOnEvent(-1, "_ProcessTriangle") $Group1 = GUICtrlCreateGroup("Sides", 8, 200, 237, 113) $Label1 = GUICtrlCreateLabel("a", 24, 216, 10, 17) $cla = GUICtrlCreateInput("", 48, 216, 121, 21) $Label2 = GUICtrlCreateLabel("b", 24, 248, 10, 17) $clb = GUICtrlCreateInput("", 48, 248, 121, 21) $Label3 = GUICtrlCreateLabel("c", 24, 280, 10, 17) $clc = GUICtrlCreateInput("", 48, 280, 121, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Angles", 256, 200, 237, 113) $Label4 = GUICtrlCreateLabel("A", 272, 216, 11, 17) $Label5 = GUICtrlCreateLabel("B", 272, 248, 11, 17) $Label6 = GUICtrlCreateLabel("C", 272, 280, 11, 17) $cl_a = GUICtrlCreateInput("", 296, 216, 121, 21) $cl_b = GUICtrlCreateInput("", 296, 248, 121, 21) $cl_c = GUICtrlCreateInput("", 296, 280, 121, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetOnEvent(-3, "close") GUISetState(@SW_SHOW) TrayTip("Tip", "Left click the triangle to solve it." & @CRLF & "Right click to reset all fields.", 8) While 1 Sleep(100) If _IsPressed("02") Then ; Reset fields if mouse button 2 is pressed $mouse = MouseGetPos() If $mouse[0] >= 8 And $mouse[0] <= 488 And $mouse[1] >= 8 And $mouse[1] <= 188 Then GUICtrlSetData($cla, "") GUICtrlSetData($clb, "") GUICtrlSetData($clc, "") GUICtrlSetData($cl_a, "") GUICtrlSetData($cl_b, "") GUICtrlSetData($cl_c, "") Sleep(500) EndIf EndIf WEnd Func _ProcessTriangle() Local $ifsum, $ifsum2, $bool = False $aangle = GUICtrlRead($cl_a) $bangle = GUICtrlRead($cl_b) $cangle = GUICtrlRead($cl_c) $sidea = GUICtrlRead($cla) $sideb = GUICtrlRead($clb) $sidec = GUICtrlRead($clc) If StringRight($aangle,1)=Chr(176) Then $aangle=StringTrimRight($aangle,1) If StringRight($bangle,1)=Chr(176) Then $bangle=StringTrimRight($bangle,1) If StringRight($cangle,1)=Chr(176) Then $cangle=StringTrimRight($cangle,1) ; Info is gathered to see how many things are known If $aangle <> "" Then $ifsum += 1 If $bangle <> "" Then $ifsum += 1 If $cangle <> "" Then $ifsum += 1 If $sidea <> "" Then $ifsum2 += 1 If $sideb <> "" Then $ifsum2 += 1 If $sidec <> "" Then $ifsum2 += 1 If ($ifsum < 2 And $ifsum2 < 2) Or $ifsum2 < 1 Then ; 1 angle + 2 sides or 2 angles + 1 side is required to solve triangle or all sides MsgBox(16, "Error", "Not enough information entered to solve this triangle") Return EndIf If $ifsum = 2 And $aangle + $cangle + $bangle < 180 Then If $aangle = "" Then $aangle = 180 - $bangle - $cangle ElseIf $bangle = "" Then $bangle = 180 - $aangle - $cangle Else $cangle = 180 - $aangle - $bangle EndIf $ifsum += 1 EndIf If ($aangle + $bangle + $cangle > 180) Or ($ifsum = 3 And $aangle + $bangle + $cangle < 180) Then ; User tried inputting invalid triangle (Angles not add up to 180) MsgBox(16, "Triangle error", "Total sum of the angles must be 180°") Return EndIf If $sidea <> "" And $sideb <> "" And $sidec <> "" And $ifsum <> 3 Then ; If all sides are know, lets calculate angles MsgBox(0, "", "2") $aangle = Round(_Degree(ACos(($sideb ^ 2 + $sidec ^ 2 - $sidea ^ 2) / (2 * $sidec * $sideb))), 2) ; Law of Cosines $bangle = Round(_Degree(ACos(($sidea ^ 2 + $sidec ^ 2 - $sideb ^ 2) / (2 * $sidec * $sidea))), 2) ; Law of Cosines $cangle = 180 - $bangle - $aangle ElseIf $ifsum > 1 and $ifsum2 = 1 Then ; If we know more than one angle MsgBox(0, "", "1") If $sidea <> "" Then $sideb = ($sidea / Sin(_Radian($aangle))) * Sin(_Radian($bangle)) ; Law of Sines $sidec = ($sidea / Sin(_Radian($aangle))) * Sin(_Radian($cangle)) ; Law of Sines ElseIf $sideb <> "" Then $sidea = ($sideb / Sin(_Radian($bangle))) * Sin(_Radian($aangle)) ; Law of Sines $sidec = ($sideb / Sin(_Radian($bangle))) * Sin(_Radian($cangle)) ; Law of Sines ElseIf $sidec <> "" Then $sidea = ($sidec / Sin(_Radian($cangle))) * Sin(_Radian($aangle)) ; Law of Sines $sideb = ($sidec / Sin(_Radian($cangle))) * Sin(_Radian($bangle)) ; Law of Sines EndIf ElseIf $ifsum2 = 2 and $ifsum <> 3 Then ; We know more than one side If $sidea <> "" And $aangle <> "" Then If $sideb <> "" Then $bangle = _Degree(ASin($sideb / ($sidea / Sin(_Radian($aangle))))) ; Law of Sines $cangle = 180 - $bangle - $aangle $sidec = ($sidea / Sin(_Radian($aangle))) * Sin(_Radian($cangle)) ; Law of Sines ElseIf $sidec <> "" Then $bangle = _Degree(ASin($sidec / ($sidea / Sin(_Radian($aangle))))) ; Law of Sines $bangle = 180 - $cangle - $aangle $sideb = ($sidea / Sin(_Radian($aangle))) * Sin(_Radian($bangle)) ; Law of Sines EndIf ElseIf $sidec <> "" And $cangle <> "" Then If $sideb <> "" Then $bangle = _Degree(ASin($sideb / ($sidec / Sin(_Radian($cangle))))) ; Law of Sines $aangle = 180 - $bangle - $cangle $sidea = ($sidec / Sin(_Radian($cangle))) * Sin(_Radian($aangle)) ; Law of Sines ElseIf $sidea <> "" Then $aangle = _Degree(ASin($sidea / ($sidec / Sin(_Radian($cangle))))) ; Law of Sines $bangle = 180 - $aangle - $cangle $sideb = ($sidec / Sin(_Radian($cangle))) * Sin(_Radian($bangle)) ; Law of Sines EndIf ElseIf $sideb <> "" And $bangle <> "" Then If $sidea <> "" Then $aangle = _Degree(ASin($sidea / ($sideb / Sin(_Radian($bangle))))) ; Law of Sines $cangle = 180 - $bangle - $aangle $sidec = ($sideb / Sin(_Radian($bangle))) * Sin(_Radian($cangle)) ; Law of Sines ElseIf $sidec <> "" Then $cangle = _Degree(ASin($sidec / ($sideb / Sin(_Radian($bangle))))) ; Law of Sines $aangle = 180 - $bangle - $cangle $sidea = ($sideb / Sin(_Radian($bangle))) * Sin(_Radian($aangle)) ; Law of Sines EndIf Else ; No angle and side match, have to do some extra work If $sidea = "" Then $sidea = Sqrt(-2 * $sideb * $sidec * Cos(_Radian($aangle)) + $sideb ^ 2 + $sidec ^ 2) ; Law of Cosines ElseIf $sideb = "" Then $sideb = Sqrt(-2 * $sidea * $sidec * Cos(_Radian($bangle)) + $sidea ^ 2 + $sidec ^ 2) ; Law of Cosines ElseIf $sidec = "" Then $sidec = Sqrt(-2 * $sidea * $sideb * Cos(_Radian($cangle)) + $sidea ^ 2 + $sideb ^ 2) ; Law of Cosines EndIf $aangle = Round(_Degree(ACos(($sideb ^ 2 + $sidec ^ 2 - $sidea ^ 2) / (2 * $sidec * $sideb))), 2) ; Law of Cosines $bangle = Round(_Degree(ACos(($sidea ^ 2 + $sidec ^ 2 - $sideb ^ 2) / (2 * $sidec * $sidea))), 2) ; Law of Cosines $cangle = 180 - $bangle - $aangle EndIf Else ;triangle is over defined If $sidea = "" Then $sidea = Sqrt(-2 * $sideb * $sidec * Cos(_Radian($aangle)) + $sideb ^ 2 + $sidec ^ 2) ; Law of Cosines If $sideb = "" Then $sideb = Sqrt(-2 * $sidea * $sidec * Cos(_Radian($bangle)) + $sidea ^ 2 + $sidec ^ 2) ; Law of Cosines If $sidec = "" Then $sidec = Sqrt(-2 * $sidea * $sideb * Cos(_Radian($cangle)) + $sidea ^ 2 + $sideb ^ 2) ; Law of Cosines If $aangle = "" AND $bangle <> "" AND $cangle <> "" Then $aangle = 180-$bangle-$cangle If $aangle <> "" AND $bangle = "" AND $cangle <> "" Then $bangle = 180-$aangle-$cangle If $aangle <> "" AND $bangle <> "" AND $cangle = "" Then $cangle = 180-$aangle-$bangle EndIf ; Set calculated values! GUICtrlSetData($cla, $sidea) GUICtrlSetData($clb, $sideb) GUICtrlSetData($clc, $sidec) GUICtrlSetData($cl_a, $aangle&Chr(176)) GUICtrlSetData($cl_b, $bangle&Chr(176)) GUICtrlSetData($cl_c, $cangle&Chr(176)) EndFunc ;==>_ProcessTriangle Func close() Exit EndFunc ;==>close Func help() MsgBox(64,"Help for Triangle Solver","Left click the triangle when you have entered desired values to solve it."&@CRLF&"Right click it to reset all fields"&@CRLF&"The program will not warn you for everything, remember for example that one side cannot be greater than the sum of the others") EndFunc I don't have the code that assumes 90 deg in here and there seems to be some rounding error problems but this should work with any solvable triangle.
-
MegaUpload PremiumLinKer + Link List - downloader !
smstroble replied to FireFox's topic in AutoIt Example Scripts
Premium Linker is throwing an error for me: "Erreur: La clé 'Your Premium Links: <br>' n'a pas été trouveé" Which google translates to: Error: The key 'Your Premium Links: <br>' was not found -
Try using arrays so that instead of: GUICtrlSetState($checkCN1,$GUI_DISABLE) GUICtrlSetState($checkCN2,$GUI_DISABLE) GUICtrlSetState($checkCN3,$GUI_DISABLE) GUICtrlSetState($checkCN4,$GUI_DISABLE) GUICtrlSetState($checkCN5,$GUI_DISABLE)oÝ÷ Ù.Â¥v¯y«¢+Ù½ÈÀÌØí¤ôÄѼÔ(U% ÑɱMÑMÑÑ ÀÌØí¡ 9lÀÌØí¥t°ÀÌØíU%}%M 1¤)¹áÐ You need to change those variables to their array equivalent throughout your script and define the array with Dim $checkCN[n] where n is the max number or elements you will put in the array. Also note that arrays count from 0 up so: Dim $checkCN[2] would only allow you to use $checkCN[0] and $checkCN[1]
-
I agree with some kind of simple encryption, or if you want you can use _Stringencrypt to do it well but then you will either have to have a common pass or hardcode the pass. Since you are probably going to end up doing some kind of hardcoded pass word anyway here are a couple fun (not very strong) encryption ideas that will simply ward off wandering eyes. Also A "boss" key or in this case a teacher key that hides and unhides the windows would be handy. Nice script. Decoder Ring style: $letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" $codedletters="kwdTUhvPQaqAstbpHIRjoSNyOKEBuVCclmMDWgxiFGnrJXYefzLZ" MsgBox(0, _decode(_encode("This is encrypted!")), _encode("This is encrypted!")) Func _encode($string) $encoded="" For $i = 1 to StringLen($string) $character = StringMid($string, $i, 1) If AscW($character) >= 65 AND AscW($character) <= 90 OR AscW($character) >= 97 AND AscW($character) <= 122 Then $encoded &= StringMid($codedletters, StringInStr($letters, $character, 1), 1) Else $encoded &= $character EndIf Next Return $encoded EndFunc Func _decode($string) $decoded="" For $i = 1 to StringLen($string) $character = StringMid($string, $i, 1) If AscW($character) >= 65 AND AscW($character) <= 90 OR AscW($character) >= 97 AND AscW($character) <= 122 Then $decoded &= StringMid($letters, StringInStr($codedletters, $character, 1), 1) Else $decoded &= $character EndIf Next Return $decoded EndFuncoÝ÷ Ø Ýi×bµ¶ay§,)î·«¶§r^jwmê)¦"µëhuç(u殶sd×6t&÷ÂöFV6öFRöVæ6öFRgV÷CµF22Væ7'FVBb333²gV÷C²ÂöVæ6öFRgV÷CµF22Væ7'FVBb333²gV÷C² ¤gVæ2öVæ6öFRb33c·7G&ær¢b33c¶Væ6öFVCÒgV÷C²gV÷C°¢f÷"b33c¶ÒFò7G&ætÆVâb33c·7G&ær¢b33c¶6&7FW"Ò7G&ætÖBb33c·7G&ærÂb33c¶Â¢b33c¶Væ6öFVBf׳Ò6%r65rb33c¶6&7FW"³¢æW@¢&WGW&âb33c¶Væ6öFV@¤VæDgVæ0 ¤gVæ2öFV6öFRb33c·7G&ær¢b33c¶FV6öFVCÒgV÷C²gV÷C°¢f÷"b33c¶ÒFò7G&ætÆVâb33c·7G&ær¢b33c¶6&7FW"Ò7G&ætÖBb33c·7G&ærÂb33c¶Â¢b33c¶FV6öFVBf׳Ò6%r65rb33c¶6&7FW"Ó¢æW@¢&WGW&âb33c¶FV6öFV@¤VæDgVæ0
-
Hooray for SPAM!!! Anyway, the download link on the front page is not working for me.
-
Some Graphical Examples using GDI+ Vol. I
smstroble replied to UEZ's topic in AutoIt Example Scripts
Wow, no kidding about recursive being SLOW. Results from that bench test: 75025 75025 Iterative: 0.8227 ms Recursive: 943.8691 ms Diff: 943.0464 ms ! Iterative is over 1000x faster than recursive. Edit: Hmm thinking about this its not entirely autoits fault that the recursive method is slow. If you draw out the recursive tree it doubles the number of functions that are called for each increase of n so that auto it calls the recursive function about 2^n times where as the iterative method only adds a single iteration per increase of n the the work load is n. -
Alright confirmed it was due to my version of auto it. Works fine now. They must have changed something between 3.2.10 and 3.2.12 that caused it.
-
I'm 100% sure thats what was causing my error. Possibly because my version of autoit is out of date, but what is happening is 1-3 empty lines are somehow getting at the start of the file and loaded into the array which then fails when $DownloadLinkList[0] = "" I checked this with Msgbox(0, $DownloadLinkList[$x], @error) right after the line $SubmitRequest = _INetGetSourcePost($DownloadLinkList[$x], "dummy") came up with a title of "" and message of 1. Looked up the 1 msg in the _INetGetSourcePost function and its If $sURL = '' Or $sPost = '' Then Return SetError(1, 0, 0) I'm not sure what is causing it. Perhaps its _arrayadd to an empty array cases it to fill $array[1] instead of $array[0]. Like I said my version of autoit is not current and might be the problem. Give me a few and I will see.
-
I got this too, for some reason the script was adding a blank line to the start of the link list which it would then try to get the source from "" and fail. I just added If NOT @error Then all the rest of the code in that for loop endif works fine now.
-
Script Joy v0.6.0 New: Main GUI 99% Complete Options GUI 90% Complete -Axis view -Buttons pressed -Deadzone Bind keys to joy buttons Bind key to POV directions ToDo: Ctrl-Alt-Shift-Win Modifiers on POV Bind mouse to Axis mousespeed adjust binds Minimize to tray Program specific settings Device specific settings Multiple joysticks at same time Improve GUI eyecandy Global Sensitivity (Possible?) Global Range (Possible?) Global deadzone (Possible?) Detect device info Multi key combination <Something else here> Known Bugs: Does not work with some maximized games (eg MAME) [Anyone know how to fix this?] Credit someone for joy.au3, ill edit when i find the post. [autoit]#include <GUIConstants.au3> Dim $checkbox[14];init checkbox array Dim $Dot[3];init dot array Dim $Button[14] Dim $ctrlcheck[14] Dim $altcheck[14] Dim $shiftcheck[14] Dim $wincheck[14] Dim $axis[6] dim $POV[4] Dim $buttonhold[20] $deadzone = 0 $POVprev = 0 $DefaultDeadzone = 3000 ;Distance from center which is considered centered 0 = No deadzone, 32767 = All deadzone [Default] $diag = 0 ;raw joy input window switch (0 = off, 1 = on) $joy = _JoyInit() If $diag Then ;Diag GUI init $diaggui = GUICreate("Joystick Test", 100, 150, 900) $h = GUICtrlCreateLabel("", 10, 10, 290, 290) GUISetState() EndIf #region Main $main = GUIcreate("Script Joy v0.6.0", 470, 386) $Device = GUICtrlCreateCombo("Select Device", 160+150, 8+16, 145, 25) ;device specific commands (maby later) GUICtrlSetState(-1, @SW_DISABLE) $Profile = GUICtrlCreateCombo("Select Profile", 160+150, 32+16, 145, 25) $Startprog = GUICtrlCreateButton("Start Program", 160+150, 56+16, 137, 25, 0) $Axis[0] = GUICtrlCreateCombo("X Axis", 160+150, 144-24, 145, 25) ;Axis combo drop boxes $Axis[1] = GUICtrlCreateCombo("Y Axis", 160+150, 168-24, 145, 25) $Axis[2] = GUICtrlCreateCombo("Z Axis", 160+150, 192-24, 145, 25) $Axis[3] = GUICtrlCreateCombo("R Axis", 160+150, 216-24, 145, 25) $Axis[4] = GUICtrlCreateCombo("U Axis", 160+150, 240-24, 145, 25) $Axis[5] = GUICtrlCreateCombo("V Axis", 160+150, 264-24, 145, 25) For $i = 0 to 13;Buttons $ctrlcheck[$i] = GUICtrlCreateCheckbox("Ctrl", 8, 24*($i+1)-2) ;ctrl check box $altcheck[$i] = GUICtrlCreateCheckbox("Alt", 44, 24*($i+1)-2) ;alt check box $shiftcheck[$i] = GUICtrlCreateCheckbox("Shift", 77, 24*($i+1)-2) ;shift check box $wincheck[$i] = GUICtrlCreateCheckbox("Win", 118, 24*($i+1)-2) ;win check box $Button[$i] = GUICtrlCreateCombo("Button " & $i+1, 8+150, 24*($i+1), 137, 25, $CBS_DROPDOWNLIST + $CBS_AUTOHSCROLL + $WS_VSCROLL);combo drop box Next ;POV drop boxes $POV[0] = GUICtrlCreateCombo("POV Up", 160+150+36, 264+20, 71, 25) $POV[3] = GUICtrlCreateCombo("POV Left", 160+150, 264+44, 71, 25) $POV[1] = GUICtrlCreateCombo("POV Right", 160+150+73, 264+44, 73, 25) $POV[2] = GUICtrlCreateCombo("POV Down", 160+150+36, 264+67, 71, 25) initcomboboxs() $Label1 = GUICtrlCreateLabel("Buttons:", 8, 8, 43, 15) $Label2 = GUICtrlCreateLabel("Axis:", 160+150, 128-28, 26, 15) $Label3 = GUICtrlCreateLabel("POV:", 160+150, 264, 26, 15) $Filemenu = GUICtrlCreateMenu("&File") $joyselect = GUICtrlCreateMenuItem("Joystick", $Filemenu) GUICtrlSetState(-1, $GUI_DISABLE) $mItemOptions = GUICtrlCreateMenuItem("Options", $Filemenu) $mItemExit = GUICtrlCreateMenuItem("Exit", $Filemenu) GUISetState() While 1 $mmsg = GUIGetMsg() If $mmsg = $GUI_EVENT_CLOSE Or $mmsg = $mItemExit Then Exit ElseIf $mmsg = $mItemOptions Then GUISetState(@SW_DISABLE, $main) options() EndIf For $i = 0 to 5 ;Axis If $mmsg = $axis[$i] Then IniWrite("binds.ini", "Joy0", "axis" & $i, Convert(GUICtrlRead($Axis[$i]))) EndIf Next For $i = 0 to 13 ;Buttons If $mmsg = $Button[$i] or $mmsg = $ctrlcheck[$i] or $mmsg = $altcheck[$i] or $mmsg = $shiftcheck[$i] or $mmsg = $wincheck[$i] Then $key = "" If Guictrlread($ctrlcheck[$i]) = $GUI_CHECKED Then $key = $key & "^" EndIf If Guictrlread($altcheck[$i]) = $GUI_CHECKED Then $key = $key & "!" EndIf If Guictrlread($shiftcheck[$i]) = $GUI_CHECKED Then $key = $key & "+" EndIf If Guictrlread($wincheck[$i]) = $GUI_CHECKED Then $key = $key & "#" EndIf $key = $key & convert(GUICtrlRead($Button[$i])) ;MsgBox(0, "", GUICtrlRead($Button[$i])) IniWrite("binds.ini", "Joy0", "Button" & $i, $key) EndIf Next For $i = 0 to 3 ;POV If $mmsg = $POV[$i] Then ;Todo: ;$key = "" ;If Guictrlread($ctrlcheck[$i]) = $GUI_CHECKED Then ; $key = $key & "^" ;EndIf ;If Guictrlread($altcheck[$i]) = $GUI_CHECKED Then ; $key = $key & "!" ;EndIf ;If Guictrlread($shiftcheck[$i]) = $GUI_CHECKED Then ; $key = $key & "+" ;EndIf ;If Guictrlread($wincheck[$i]) = $GUI_CHECKED Then ; $key = $key & "#" ;EndIf ;$key = $key & convert(GUICtrlRead($Axis[$i]))) IniWrite("binds.ini", "Joy0", "POV" & $i, convert(GUICtrlRead($POV[$i]))) EndIf Next Binds() WEnd Func Binds() $joy0 = _GetJoy($joy, 0) For $i = 0 To 13 ;Check 14 buttons (Increase if you add more buttons!) If BitAND(2 ^ $i, $joy0[7]) And BitAND(2 ^ $i, $buttonhold[$i]) = 0 Then ;If button is being pressed, but was not on last check (for efficiency) $key = "" If Guictrlread($ctrlcheck[$i]) = $GUI_CHECKED Then $key = $key & "^" EndIf If Guictrlread($altcheck[$i]) = $GUI_CHECKED Then $key = $key & "!" EndIf If Guictrlread($shiftcheck[$i]) = $GUI_CHECKED Then $key = $key & "+" EndIf If Guictrlread($wincheck[$i]) = $GUI_CHECKED Then $key = $key & "#" EndIf If GUICtrlRead($Button[$i]) <> "Button " & ($i+1) Then $key = $key & convert(GUICtrlRead($Button[$i])) EndIf ;MsgBox(0, "", $key) Send($key) $buttonhold[$i] = BitXOR(2 ^ $i, $buttonhold[$i]) ;Add button to held buttons list ElseIf BitAND(2 ^ $i, $joy0[7]) = 0 And BitAND(2 ^ $i, $buttonhold[$i]) Then ;If button is not being pressed, but was on last check (for efficiency) $buttonhold[$i] = BitXOR(2 ^ $i, $buttonhold[$i]) ;Remove button to held buttons list EndIf Next For $i = 0 To 3 ;Check 4 POV dirs If 9000*$i = $joy0[6] And BitAND(2 ^ $i, $buttonhold[$i+13]) = 0 Then ;If button is being pressed, but was not on last check (for efficiency) $key = "" If Guictrlread($ctrlcheck[$i]) = $GUI_CHECKED Then $key = $key & "^" EndIf If Guictrlread($altcheck[$i]) = $GUI_CHECKED Then $key = $key & "!" EndIf If Guictrlread($shiftcheck[$i]) = $GUI_CHECKED Then $key = $key & "+" EndIf If Guictrlread($wincheck[$i]) = $GUI_CHECKED Then $key = $key & "#" EndIf If GUICtrlRead($Button[$i]) <> "Button " & ($i+1) Then $key = $key & convert(GUICtrlRead($POV[$i])) EndIf ;MsgBox(0, "", $key) Send($key) $buttonhold[$i+13] = BitXOR(2 ^ $i, $buttonhold[$i+13]) ;Add button to held buttons list ElseIf 9000*$i <> $joy0[6] And BitAND(2 ^ $i, $buttonhold[$i+13]) Then ;If button is not being pressed, but was on last check (for efficiency) $buttonhold[$i+13] = BitXOR(2 ^ $i, $buttonhold[$i+13]) ;Remove button to held buttons list EndIf Next EndFunc Func convert($value) $value = StringReplace($value, "}", "{}}") $value = StringReplace($value, "{", "{{}") $value = StringReplace($value, "Left Shift", "{LSHIFT}") $value = StringReplace($value, "Right Shift", "{RSHIFT}") $value = StringReplace($value, "Left CTRL", "{LCTRL}") $value = StringReplace($value, "Right CTRL", "{RCTRL}") $value = StringReplace($value, "Left ALT", "{LALT}") $value = StringReplace($value, "Right ALT", "{RALT}") $value = StringReplace($value, "Left WIN", "{LWIN}") $value = StringReplace($value, "Right WIN", "{RWIN}") $value = StringReplace($value, "^", "{^}") $value = StringReplace($value, "!", "{!}") $value = StringReplace($value, "+", "{+}") $value = StringReplace($value, "#", "{#}") $value = StringReplace($value, "Up", "{Up}") $value = StringReplace($value, "Down", "{Down}") $value = StringReplace($value, "Left", "{Left}") $value = StringReplace($value, "Right", "{Right}") $value = StringReplace($value, "Enter", "{Enter}") $value = StringReplace($value, "Space", "{Space}") $value = StringReplace($value, "Tab", "{TAB}") $value = StringReplace($value, "Backspace", "{Backspace}") $value = StringReplace($value, "Prnt Scrn", "{PRINTSCREEN}") $value = StringReplace($value, "Pause", "{Pause}") $value = StringReplace($value, "Insert", "{Insert}") $value = StringReplace($value, "Delete", "{Delete}") $value = StringReplace($value, "Home", "{Home}") $value = StringReplace($value, "End", "{End}") $value = StringReplace($value, "Page Up", "{PGUP}") $value = StringReplace($value, "Page Dn", "{PGDN}") $value = StringReplace($value, "Play", "{MEDIA_PLAY_PAUSE}") $value = StringReplace($value, "Next", "{MEDIA_NEXT}") $value = StringReplace($value, "Prev", "{MEDIA_PREV}") $value = StringReplace($value, "Stop", "{MEDIA_stop}") $value = StringReplace($value, "Mute", "{VOLUME_MUTE}") $value = StringReplace($value, "Vol Up", "{VOLUME_UP}") $value = StringReplace($value, "Vol Dn", "{VOLUME_DOWN}") return $value EndFunc Func unconvert($value) $value = StringReplace($value, "{}}", "}") $value = StringReplace($value, "{{}", "{") $value = StringReplace($value, "{LSHIFT}", "Left Shift") $value = StringReplace($value, "{RSHIFT}", "Right Shift") $value = StringReplace($value, "{LCTRL}", "Left CTRL") $value = StringReplace($value, "{RCTRL}", "Right CTRL") $value = StringReplace($value, "{LALT}", "Left ALT") $value = StringReplace($value, "{RALT}", "Right ALT") $value = StringReplace($value, "{LWIN}", "Left WIN") $value = StringReplace($value, "{RWIN}", "Right WIN") $value = StringReplace($value, "{^}", "^") $value = StringReplace($value, "{!}", "!") $value = StringReplace($value, "{+}", "+") $value = StringReplace($value, "{#}", "#") $value = StringReplace($value, "{Up}", "Up") $value = StringReplace($value, "{Down}", "Down") $value = StringReplace($value, "{Left}", "Left") $value = StringReplace($value, "{Right}", "Right") $value = StringReplace($value, "{Enter}", "Enter") $value = StringReplace($value, "{Space}", "Space") $value = StringReplace($value, "{TAB}", "Tab") $value = StringReplace($value, "{Backspace}", "Backspace") $value = StringReplace($value, "{PRINTSCREEN}", "Prnt Scrn") $value = StringReplace($value, "{Pause}", "Pause") $value = StringReplace($value, "{Insert}", "Insert") $value = StringReplace($value, "{Delete}", "Delete") $value = StringReplace($value, "{Home}", "Home") $value = StringReplace($value, "{End}", "End") $value = StringReplace($value, "{PGUP}", "Page Up") $value = StringReplace($value, "{PGDN}", "Page Dn") $value = StringReplace($value, "{MEDIA_PLAY_PAUSE}", "Play") $value = StringReplace($value, "{MEDIA_NEXT}", "Next") $value = StringReplace($value, "{MEDIA_PREV}", "Prev") $value = StringReplace($value, "{MEDIA_stop}", "Stop") $value = StringReplace($value, "{VOLUME_MUTE}", "Mute") $value = StringReplace($value, "{VOLUME_UP}", "Vol Up") $value = StringReplace($value, "{VOLUME_DOWN}", "Vol Dn") Dim $out[5] $value = StringReplace($value, "^", "") $out[1] = @extended ;ctrl $value = StringReplace($value, "!", "") $out[2] = @extended ;alt $value = StringReplace($value, "+", "") $out[3] = @extended ;Sift $value = StringReplace($value, "#", "") $out[4] = @extended ;Win $out[0] = $value return $out EndFunc func initcomboboxs();Fill List boxes $list = "" $list = $list & "Up" & "|" $list = $list & "Down" & "|" $list = $list & "Left" & "|" $list = $list & "Right" & "|" $list = $list & "Enter" & "|" $list = $list & "Space" & "|" $list = $list & "Tab" & "|" $list = $list & "Backspace" & "|" $list = $list & "Prnt Scrn" & "|" $list = $list & "Pause" & "|" $list = $list & "Insert" & "|" $list = $list & "Delete" & "|" $list = $list & "Home" & "|" $list = $list & "End" & "|" $list = $list & "Page Up" & "|" $list = $list & "Page Dn" & "|" $list = $list & "Play" & "|" $list = $list & "Next" & "|" $list = $list & "Prev" & "|" $list = $list & "Stop" & "|" $list = $list & "Mute" & "|" $list = $list & "Vol Up" & "|" $list = $list & "Vol Dn" & "|" $list = $list & "Left Shift" & "|" $list = $list & "Right Shift" & "|" $list = $list & "Left CTRL" & "|" $list = $list & "Right CTRL" & "|" $list = $list & "Left ALT" & "|" $list = $list & "Right ALT" & "|" $list = $list & "Left WIN" & "|" $list = $list & "Right WIN" & "|" For $q = 44 to 57 $list = $list & Chr($q) & "|" Next $list = $list & Chr(59) & "|" $list = $list & Chr(61) & "|" $list = $list & Chr(91) & "|" $list = $list & Chr(92) & "|" $list = $list & Chr(93) & "|" $list = $list & Chr(94) & "|" For $q = 96 to 122 $list = $list & Chr($q) & "|" Next $list = $list & Chr(126) for $i = 0 to 13 $Default = unconvert(IniRead("binds.ini", "Joy0", "Button"&$i, "Button " & $i)) GUICtrlSetData($Button[$i], $list, $Default[0]) ;MsgBox(0, $Default[0], "") If $Default[1] Then GUICtrlSetState($ctrlcheck[$i], $GUI_CHECKED) If $Default[2] Then GUICtrlSetState($altcheck[$i], $GUI_CHECKED) If $Default[3] Then GUICtrlSetState($shiftcheck[$i], $GUI_CHECKED) If $Default[4] Then GUICtrlSetState($wincheck[$i], $GUI_CHECKED) Next For $i = 0 to 3 $Default = unconvert(IniRead("binds.ini", "Joy0", "POV"&$i, "POV")) StringReplace($Default[0], "POV", "") If @extended Then ;If a replacement was made GUICtrlSetData($POV[$i], $list) Else GUICtrlSetData($POV[$i], $list, $Default[0]) EndIf Next EndFunc #endregion #region Options GUI Func Options() $Options = GUICreate("ScriptJoy - Options", 450, 300) ;Close button $OKButton = Guictrlcreatebutton("OK", 340, 240, 100, 50) ;Deadzone Slider $deadzone = GUICtrlCreateSlider (200,40,200,20, $TBS_NOTICKS) GUICtrlSetLimit(-1,32767,0) GUICtrlCreateLabel("0% (0)", 200, 60) GUICtrlCreateLabel("100% (62767)", 380, 60) $deadzoneread = GUICtrlCreateLabel("Deadzone: " & $DefaultDeadzone, 200, 25, -1, 14) ;Joy Button Status Check Boxes For $i = 0 to 13 $checkbox[$i] = GUICtrlCreateCheckbox("Button " & $i+1, 8, 16+(20*$i)) GUICtrlSetState(-1, $GUI_DISABLE) Next ;Axis XY $Group1 = GUICtrlCreateGroup("", 112, 26, 68, 75) ;Cool looking box (X-Y Axis) GUICtrlSetBkColor(-1, 0xFFFFFF) ;Change color in box $Dot[0] = GUICtrlCreateLabel("|", 200, 25, 4, 4) ;The DOT! GUIctrlsetfont(-1, -1, 800);BOLD! GUICtrlCreateLabel("|", 112+32, 32+32, 4, 4);Center Dot GUIctrlsetfont(-1, -1, 800);BOLD! Guictrlsetcolor(-1, dec("FF0000"));RED! GUICtrlCreateLabel("X Y Axis", 112, 16, 43, 15) ;So you know what your looking at :-) ;Axis ZR $Group2 = GUICtrlCreateGroup("", 112, 119, 68, 75) GUICtrlSetBkColor(-1, 0xFFFFFF) $Dot[1] = GUICtrlCreateLabel("|", 200, 25, 4, 4) GUIctrlsetfont(-1, -1, 800) GUICtrlCreateLabel("|", 112+32, 125+32, 4, 4) GUIctrlsetfont(-1, -1, 800) Guictrlsetcolor(-1, dec("FF0000")) GUICtrlCreateLabel("Z R Axis", 113, 110, 44, 15) ;Axis UV (Talk about a bad ass controler 3 analog sticks) $Group3 = GUICtrlCreateGroup("", 112, 216, 68, 75) GUICtrlSetBkColor(-1, 0xFFFFFF) $Dot[2] = GUICtrlCreateLabel("|", 200, 25, 4, 4) GUIctrlsetfont(-1, -1, 800) GUICtrlCreateLabel("|", 112+32, 222+32, 4, 4) GUIctrlsetfont(-1, -1, 800) Guictrlsetcolor(-1, dec("FF0000")) GUICtrlCreateLabel("U V Axis", 112, 207, 44, 15) ;POV Hat or D-Pad $Label18 = GUICtrlCreateLabel("POV Hat:", 200, 90, 46, 15) $povdir = GUICtrlCreateLabel("l", 200+46+5, 90, 16, 16) GUIctrlsetfont(-1, -1, -1, -1, "Wingdings") GUISetState(@SW_SHOW) GUICtrlSetData($Deadzone, $DefaultDeadzone);Set deadzone slider $buttonhold = 0 ;Define and clear buttons held (binary format eg 1[2^0] = first button on, 2[2^1] = 2nd button on, 4[2^2] = 3rd, 3[2^0 + 2^1] = 1st and 2nd etc.) $deadzoneprev = $DefaultDeadzone ;Used to see if deadzone slider moved $POVprev = 65535 ;Used to see if POV direction changed While 1 $nMsg = GUIGetMsg(0) ;Get message of GUI messge Query $joy0 = _GetJoy ($joy, 0) ;Query joystick 0 If $GUI_EVENT_CLOSE = $nmsg And $diag = 0 or $nmsg = $OKButton Then GUIDelete($options) ;Someone clicked the red X, tisk tisk GUISetState(@SW_ENABLE, $Main) ;reemable main return Elseif $GUI_Event_CLOSE = $nmsg Then ;Clicked X with diag window open GUIDelete($diaggui) ;Delete diag window $diag = 0 ;Disable diag loop EndIf If GUICtrlRead($deadzone) <> $deadzoneprev Then ;If slider moved GUICtrlSetData($deadzoneread, "Deadzone: " & GUICtrlRead($deadzone)) ;Update readout label $deadzoneprev = GUICtrlRead($deadzone) ;Update check variable EndIf For $i = 0 To 14 ;Check 14 buttons (Increase if you add more buttons!) If BitAND(2 ^ $i, $joy0[7]) And BitAND(2 ^ $i, $buttonhold) = 0 Then ;If button is being pressed, but was not on last check (for efficiency) GUICtrlSetState($checkbox[$i], $GUI_CHECKED) ;toggle check box $buttonhold = BitXOR(2 ^ $i, $buttonhold) ;Add button to held buttons list ElseIf BitAND(2 ^ $i, $joy0[7]) = 0 And BitAND(2 ^ $i, $buttonhold) Then ;If button is not being pressed, but was on last check (for efficiency) GUICtrlSetState($checkbox[$i], $GUI_UNCHECKED) ;toggle Check box $buttonhold = BitXOR(2 ^ $i, $buttonhold) ;Remove button to held buttons list EndIf Next Axis($joy0);update axis dots POV($joy0, $povdir);Update Hat position If $diag Then Diagloop($joy0) ;Diag window loop WEnd EndFunc Func Axis($coor) ;Moves dot for Analog Stick X and Y axis For $i = 0 to 4 step 2;3 axis $xpos = $coor[$i]/65535*64 ;X Position in XY box if $coor[$i] >= 32767-GUICtrlRead($deadzone) And $coor[$i] <= 32767+GUICtrlRead($deadzone) Then $xpos = 32 ;Dead Zone (X) $ypos = $coor[$i+1]/65535*64 ;Y Position in XY box if $coor[$i+1] >= 32767-GUICtrlRead($deadzone) And $coor[$i+1] <= 32767+GUICtrlRead($deadzone) Then $ypos = 32 ;Dead Zone (Y) If $i = 0 Then Guictrlsetpos($Dot[0], 112+$xpos, 32+$ypos);XY axis dot adjustment Elseif $i = 2 Then Guictrlsetpos($Dot[1], 112+$xpos, 125+$ypos);ZR axis dot adjustment Else Guictrlsetpos($Dot[2], 112+$xpos, 222+$ypos);UV axis dot adjustment EndIf next EndFunc Func POV($dir, $povdir) If $dir[6] <> $POVprev Then ;I dislike flickering.. :-) $POVprev = $dir[6] Switch $dir[6] Case 65535 GUICtrlSetData($povdir, "l");Center Case 27000 GUICtrlSetData($povdir, "