XKahn
Active Members-
Posts
45 -
Joined
-
Last visited
About XKahn
- Birthday 01/07/1966
Recent Profile Visitors
284 profile views
XKahn's Achievements
Seeker (1/7)
0
Reputation
-
You know this is one of my biggest issues with this forum. It irks me that I see the moderator, or whoever shout HACKER at the top of their lungs every single time someone wants some simple INPUT/OUTPUT command. This is not someone who jumped in and said, "Hey guys I'm a dirty hacker who wants to f*ck up other peoples computers.". This is disgusting me beyond what I can verbalize here... Anyways I really don't care what the end motive is, knowledge is power, and if StungStang doesn't abuse it, maybe someone else will. Here is my hunk of code for a game I wrote; <Removed> This is from a fully functional game in the vain of Final Fantasy I developed using AutoIt3. Maybe some day I will return. At the moment, I feel like I am going to go away for awhile. I really don't feel like being here. Maybe some day I will return when you have developed people skills. Later.
-
Send a raw file to a printer?
XKahn replied to emendelson's topic in AutoIt General Help and Support
Back in the DOS days, you could send a text file to the default printer with the command: copy [path]\[filename] > PRN example: copy c:\Documents and Settings\Owner\My Documents\2010 Documents\store.txt > PRN I think this should work for you using the hidden command shell. -
That works for the left and right mouse buttons but they asked for left and right keys.
-
Let's not jump to conclusions, shall we? Yes, I am all for teaching a man to fish. But I hope they take the time to learn from the code. Here is what you asked for with notes; ;Count is the number of loops For $count = 1 to 50 $begin = TimerInit() ;This commands sends the value of the clock timer to $begin $end = 0 ;This is our prime feed of the $end value ;Sending a right keypress until our timer runs out. While $end < 15000 Send ("{right}") $end = TimerDiff($begin) WEnd $begin = TimerInit() ;Read the clock timer again $end = 0 ;Feed $end value ;Sending a left keypress until our timer runs out. While $end < 15000 Send ("{left}") $end = TimerDiff($begin) WEnd Next #comments-start Place your cursor in this area and run with F5 to see how it functions. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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elay and you can and should research those on your own. I feel this one should get you started discovering how the scripts works. Post your code, don't go making game bots (they don't allow that here) and have fun learning the scripting language.
-
I think you have a couple of choices here. You could convert the icons into bitmap or jpeg format with just enough of the background to suffice. Another idea using example #3 as mentioned by wakillon above, then using a combination of MouseGetPos and _IsPressed you could create "hot spots" on your GUI. The icons of course would serve no purpose other than guiding the user to the hot spot. If I were very determined about using the png's and making them "clickable" I would go the extra mile and find an open source png dll to use. For example, the Portable Network Graphics Homepage could prove helpful in this area.
-
I suppose you could say yes. Any DLL (dynamic linked library) can be summoned for use by the script. You should search for what you need in the Example Scripts. I have no idea as to what your specific need is but if you were looking for a good 3D graphics add-on you should download "Au3IrrLicht 2.0" found in the examples thread.
-
Hmm, well you should take a look at my script GTCard here. What you want to examine is how to load a jpg imagine using; ;Assumes image.jpg is 200 x 200 pixels. $my_click_image = GUICtrlCreatePic("image.jpg", 0, 0, 200, 200) Then in your GUI loop you need to use either case or if statement; GuiSetState() $msg = GUIGetMsg() While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $my_click_image ;Do something neat Case $msg = $another_image ;Do something else EndSelect ;This is the if version you won't need both examples If $msg = $my_click_image Then ;Do something neat EndIf WEnd The "cards" in my program are just clickable jpegs. You will need to download the images and other files to make the script work. Hope that helps.
-
@jaberwocky6669; I think you really should apologize to that poor child in your avatar first. Then I will chime in to agree with cameronsdad that the pixel searching is a poor method at best. I have never found any use for it. Windows shortcut keys can do many of the things you listed. So many users of AutoIt (not just the game botting crowd) seem to think with the mouse because your generation is so dependent on the "point and click". Send("{LWIN}I{Enter}") ;Should open the internet if your IE is listed in the start menu listing. Run ("iexplore.exe") ;This method is simple and direct. Not everyone's icons will be located in the same place. You would be further ahead to make a routine that scans and catalogs the location and function of all the desktop icons. The people taking the time to learn this scripting language (regardless of their reasons) need to learn to think with the keyboard and ignore the flaky mouse and pixel search functions. Jaber and other users are just so used to seeing new users trying to use pixel search to bot games, which is also a poor way to accomplish that task as well. Whatever your goal take time to think about how your task works without the mouse. Think outside the box.
-
Instead of DirMove () - Moving the contents of the sub directory and deleting the old folder you could use; RunWait (@ComSpec & " /c rename " & $old_name & " " & $new_name, "", @SW_HIDE) This drops to the cmd prompt level and uses rename to simply rename the folder, the contents remain unchanged. That should help cut down a lot of the bulk in your script.
-
My Script seems to use too much processor while idle
XKahn replied to happy2help's topic in AutoIt General Help and Support
I just tested it and I don't see it hogging the CPU either. Memory values of about 8 to 9.5 MB of RAM and 6 to 7 of VM. Pretty standard for any executable made with AutoIt. Zero to 1% of CPU on my duel core machine. However there is a method to set the priority (as you can in the task manager) of your process. ProcessSetPriority ("myprocess.exe", 0) will lower the process to Low(Idle), even the application itself. The range is 0 to 5 (5 is Realtime) so be careful! -
I did some digging around and found this script for both midi input and output posted on Autohotkey.com (another scripting tool) similar to, if not a branch of AutoIt. REMINDER: This is not an AutoIt script but very close. It is very lengthy and complexed, so your choices at this point would be; study the code and convert only what you need into AutoIt format, convert the complete code, or download the other program and use it.
-
kaotkbliss, have you seen the AutoIt program called RUN! by any chance? The author hasn't made changes since 2005, you can get the source code when you run it. Type !source in the run box and the program decompiles itself. I believe the code may help you on making additional features to yours. I have attached RUN! to this post. Website is; http://crimsonfan.altervista.org/ run.zip
-
Good I'm glad someone has some midi equipment to test on. I don't have a thing here or at home. These are some of the midi functions inside the winmm.dll; midiConnect midiDisconnect midiInAddBuffer midiInClose midiInGetDevCapsA midiInGetDevCapsW midiInGetErrorTextA midiInGetErrorTextW midiInGetID midiInGetNumDevs midiInOpen midiInPrepareHeader midiInReset midiInStart midiInStop midiInUnprepareHeader midiOutCacheDrumPatches midiOutCachePatches midiOutClose midiOutGetDevCapsA midiOutGetDevCapsW midiOutGetErrorTextA midiOutGetErrorTextW midiOutGetID midiOutGetNumDevs midiOutGetVolume midiOutLongMsg midiOutOpen midiOutPrepareHeader midiOutReset midiOutSetVolume midiOutShortMsg midiOutUnprepareHeader midiStreamClose midiStreamOpen midiStreamOut midiStreamPause midiStreamPosition midiStreamProperty midiStreamRestart midiStreamStop I dug up some code on midi input, but most of it is written in VB, C++, or some other languages. But thankfully DLLCALL structure doesn't vary much. So the first code I am looking at is; $x = DllCall ("winmm.dll", "int", "midiInGetNumDevs") If $x > -1 Then ConsoleWrite ("Number of devices detected = " & $x & @crlf) Else ConsoleWrite ("No devices are detected.") Exit EndIf For $i = 1 to $x $port = DllCall("winmm.dll", "UInt", "midiInGetDevCapsA" ,"UInt","A_Index"-1, "UInt","MidiInCaps", "UInt",50) ConsoleWrite ( $port & @crlf) Next Hopefully this code will return the number of midi devices on your system, then list the ports. It shouldn't hurt to try since we are just reading information. If you can ID your port then the next step is to open it for reading using midiInOpen function. Once successfully opened you should be able to read from the device using midiInAddBuffer depending on the data. Dynamic Linked Libraries or DLL is just a collection of Windows functions we can access to send and receive data. Winmm.dll contains all the Multimedia function calls. I don't know much about midi or how the winmm.dll access works. A lot is based on researching the other languages such as C++ and VB to see how they access it then apply it here to AutoIt.
-
You might need to look into the windows API calls of "winmm.dll" to seek your answers mciGetDeviceID. After you place the multimedia control into your script, the first step is accessing the MCI device. To do this, you set a number of properties. On of these properties will no doubt be your DeviceType = "Sequencer". At the moment I am getting ready for work, if I have any free time today, I will pop back in and add some code for you.
-
Binaries and supporting files for this script can be downloaded here. OK my son says this is tough to beat and also suggested I add sounds for the different cards. However I am already burnt making the images for the cards. So here is the full source for GTCARD it is also included with the download above. Enjoy! #include <Array.au3> #include <GuiConstantsEx.au3> #include <Sound.au3> #comments-start This script is public domain for you to use and learn from as you see fit. The orginal script was uploaded on 9-1-2010 in the public forum for AutoIt3 scripts: http://www.autoitscript.com/forum/ by user XKahn. This script has been compiled and the original binaries can be found at: www.filefront.com/user/xkahn This is a generic "Trading Card Game" in the same venue as Magic the Gathering or others. If you make changes to this script please redistribute with additional comments so other may learn from you as well. #comments-end ;Global variables needed for program Global $hp[2] Global $str[2] Global $int[2] Global $wis[2] Global $dex[2] Global $dmg[2] Global $hand[8] Global $cava[8] Global $deck1[80] Global $deck2[80] Global $ps1 Global $ps2 Global $phase_stat Global $d1 Global $d2 ;get the screen size $dtx = @DesktopWidth $dty = @DesktopHeight $dth = ($dtx / 2) -1 $dtv = ($dty / 2) -1 $card1 = 8 $card2 = 8 $phase = 0 $hp[0] = 100 $str[0] = 0 $int[0] = 0 $wis[0] = 0 $dex[0] = 0 $dmg[0] = 0 $hp[1] = 100 $str[1] = 0 $int[1] = 0 $wis[1] = 0 $dex[1] = 0 $dmg[1] = 0 GuiCreate("CARD ARENA",800,600,0,0,0x01000000) GUISetBkColor(0x000000) Display_stats () If FileExists ("deck.ini") Then Load_Decks () Else MsgBox (0,"BIG STINKING ERROR","You MUST have a deck.ini file"&@CRLF&"in the working folder"&@CRLF&"for this to function!") Exit EndIf Display_Helps () ;Set up Card Areas $hand[0] = GUICtrlCreatePic("cards\backcard.jpg", 10, $dty - 500, 150, 200) $hand[1] = GUICtrlCreatePic("cards\backcard.jpg", 210, $dty - 500, 150, 200) $hand[2] = GUICtrlCreatePic("cards\backcard.jpg", 410, $dty- 500, 150, 200) $hand[3] = GUICtrlCreatePic("cards\backcard.jpg", 610, $dty - 500, 150, 200) $hand[4] = GUICtrlCreatePic("cards\backcard.jpg", 10, $dty - 250, 150, 200) $hand[5] = GUICtrlCreatePic("cards\backcard.jpg", 210, $dty - 250, 150, 200) $hand[6] = GUICtrlCreatePic("cards\backcard.jpg", 410, $dty - 250, 150, 200) $hand[7] = GUICtrlCreatePic("cards\backcard.jpg", 610, $dty - 250, 150, 200) $drawn = GUICtrlCreatePic("cards\backcard.jpg", 810, $dty - 350, 150, 200) $discard = GUICtrlCreatePic("cards\backcard.jpg", 810, $dty - 600, 150, 200) $played = "" Deal_Cards () Update_Phase ("DRAW PHASE") Refresh_Stats () ;Optional background music, some sound effects would be nice too. $sound = "off" If FileExists ("Music.mp3") Then $sound = _SoundOpen ("Music.mp3") EndIf GuiSetState() $msg = GUIGetMsg() While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select ;Play/Discard Phase = 1 Case $msg = $drawn and $phase = 1 $played = $deck1[$card1] GUICtrlSetImage ($drawn,"cards/backcard.jpg") $card1 += 1 If $card1 = 80 Then $card1 = 8 EndIf Sleep (250) $phase = 2 Update_Phase ("PLAY PHASE") ;Draw Phase = 0 Case $msg = $drawn and $phase = 0 $i = StringSplit ($deck1[$card1],",") GUICtrlSetImage ($drawn,"cards/"&$i[8]) $phase = 1 Update_Phase ("PLAY PHASE") Sleep (250) Case $msg = $hand[0] and $phase = 1 Play_Card (0) Case $msg = $hand[1] and $phase = 1 Play_Card (1) Case $msg = $hand[2] and $phase = 1 Play_Card (2) Case $msg = $hand[3] and $phase = 1 Play_Card (3) Case $msg = $hand[4] and $phase = 1 Play_Card (4) Case $msg = $hand[5] and $phase = 1 Play_Card (5) Case $msg = $hand[6] and $phase = 1 Play_Card (6) Case $msg = $hand[7] and $phase = 1 Play_Card (7) ;What Effects if any Case $phase = 2 Card_Effect () EndSelect ;This routine will loop an MP3 as background music if the file is present. If $sound <> "off" Then If _SoundStatus($sound) = "stopped" Then _SoundPlay($sound) Sleep (1500) EndIf EndIf WEnd ;Read setup.ini file Func Load_Decks () $db = GUICtrlCreateButton ("OK",$dth - 150, $dtv + 155,300,30) $dc = GUICtrlCreateList("", $dth - 150, $dtv - 150, 300, 300) $d1 = "" $d2 = "" $setup = FileOpen ("deck.ini",0) $line = FileReadLine($setup) While Not @error = -1 if StringInStr($line, ":") <> 0 Then $n = StringInStr($line, ":") $d1 &= StringTrimLeft($line,$n) & "|" EndIf $line = FileReadLine($setup) WEnd FileClose($setup) $d1 = StringTrimRight ($d1,1) ;Choose a Random deck for opponent $m = StringSplit ($d1,"|") $d2 = $m[Random(1,$m[0],1)] If $m[0] = 0 Then MsgBox (0,"STINKY ERROR #2", "There are no decks found in your deck.ini file.") Exit EndIf ;Get Player deck name GuiCtrlSetData($dc, $d1 ,$m[1]) GuiSetState() $d1 = $m[1] $mesg = 0 While $mesg <> $GUI_EVENT_CLOSE $mesg = GUIGetMsg() Select Case $mesg = $dc $d1 = GUICtrlRead($dc) Case $mesg = $db ExitLoop EndSelect WEnd Sleep (250) GUICtrlDelete ($db) GUICtrlDelete ($dc) ;Load the 2 decks into 2 arrays. Reopens the deck.ini seeking deck information. ;If the deck is not 80 cards it will grab from the next deck or get stuck in a loop. ;If the deck is over 80 cards it will ignore extras at the end. $setup = FileOpen ("deck.ini",0) $line = FileReadLine($setup) While Not @error = -1 if StringInStr($line, ":" & $d1) <> 0 Then $i = 0 Do $line = FileReadLine($setup) $n = StringInStr($line, ",") $v = StringLeft($line, $n-1) For $j = 1 to $v $deck1[$i] = $line $i += 1 Next Until $i = 80 EndIf $line = FileReadLine($setup) WEnd FileClose($setup) $setup = FileOpen ("deck.ini",0) $line = FileReadLine($setup) While Not @error = -1 if StringInStr($line, ":" & $d2) <> 0 Then $i = 0 Do $line = FileReadLine($setup) $n = StringInStr($line, ",") $v = StringLeft($line, $n-1) For $j = 1 to $v $deck2[$i] = $line $i += 1 Next Until $i = 80 EndIf $line = FileReadLine($setup) WEnd FileClose($setup) EndFunc Func Play_Card ($q) $played = $deck1[$q] $deck1[$q] = $deck1[$card1] $i = StringSplit ($deck1[$card1],",") GUICtrlSetImage ($hand[$q],"cards/"&$i[8]) GUICtrlSetImage ($drawn,"cards/backcard.jpg") $deck1[$card1] = $played $card1 += 1 If $card1 = 80 Then Reshuffle () $card1 = 8 EndIf Sleep (250) $phase = 2 EndFunc Func Card_Effect () $i = StringSplit ($played,",") $ts = 0 Select Case $i[3] = "E" If $i[2] <= $str[0] Then $ts = 1 EndIf Case $i[3] = "W" If $i[2] <= $int[0] Then $ts = 1 EndIf Case $i[3] = "A" If $i[2] <= $dex[0] Then $ts = 1 EndIf Case $i[3] = "F" If $i[2] <= $wis[0] Then $ts = 1 EndIf EndSelect If $ts > 0 Then If $i[5] = "STR" Then $str[0] = Add_Check ($str[0],$i[4]) EndIf If $i[5] = "INT" Then $int[0] = Add_Check ($int[0],$i[4]) EndIf If $i[5] = "WIS" Then $wis[0] = Add_Check ($wis[0],$i[4]) EndIf If $i[5] = "DEX" Then $dex[0] = Add_Check ($dex[0],$i[4]) EndIf If $i[5] = "HP" Then $hp[0] = Add_Check ($hp[0],$i[4]) If $hp[0] > 100 Then $hp[0] = 100 EndIf EndIf If $i[5] = "DM" Then $dmg[0] += $i[4] EndIf If $i[7] = "STR" Then $str[1] = Add_Check ($str[1],$i[6]) EndIf If $i[7] = "INT" Then $int[1] = Add_Check ($int[1],$i[6]) EndIf If $i[7] = "WIS" Then $wis[1] = Add_Check ($wis[1],$i[6]) EndIf If $i[7] = "DEX" Then $dex[1] = Add_Check ($dex[1],$i[6]) EndIf If $i[7] = "HP" Then $i[6] -= $dmg[0] If $i[6] > 0 Then $i[6] = 0 EndIf $dmg[0] = 0 $hp[1] += $i[6] If $hp[1] < 0 Then $hp[1] = 0 Win_Game () EndIf EndIf If $i[7] = "DM" Then $dmg[1] += $i[6] EndIf EndIf Refresh_Stats () $phase = 3 Update_Phase ("PLAYER 2") Player_2 () EndFunc ;Certain values never get reduce less than zero Func Add_Check ($i,$j) $i += $j If $i < 0 Then $i = 0 EndIf Return $i EndFunc ;Reshuffle the deck Func Reshuffle () For $i = 8 to 79 $j = Random (8,79,1) $a = $deck1[$i] $deck1[$i] = $deck1[$j] $deck1[$j] = $a Next EndFunc ;Shuffle and deal hands Func Deal_Cards () For $i = 0 to 79 $j = Random (0,79,1) $a = $deck1[$i] $deck1[$i] = $deck1[$j] $deck1[$j] = $a $k = Random (0,79,1) $a = $deck2[$i] $deck2[$i] = $deck2[$k] $deck2[$k] = $a Next $a = StringSplit ($deck1[0],",") GUICtrlSetImage ($hand[0],"cards/"&$a[8]) $a = StringSplit ($deck1[1],",") GUICtrlSetImage ($hand[1],"cards/"&$a[8]) $a = StringSplit ($deck1[2],",") GUICtrlSetImage ($hand[2],"cards/"&$a[8]) $a = StringSplit ($deck1[3],",") GUICtrlSetImage ($hand[3],"cards/"&$a[8]) $a = StringSplit ($deck1[4],",") GUICtrlSetImage ($hand[4],"cards/"&$a[8]) $a = StringSplit ($deck1[5],",") GUICtrlSetImage ($hand[5],"cards/"&$a[8]) $a = StringSplit ($deck1[6],",") GUICtrlSetImage ($hand[6],"cards/"&$a[8]) $a = StringSplit ($deck1[7],",") GUICtrlSetImage ($hand[7],"cards/"&$a[8]) EndFunc ;Creates Labels Func Display_stats () $ts = " PLAYER 1: " & @CRLF & " HP: " & $hp[0] & @CRLF & " STR: " & $str[0] & @CRLF & " INT: " & $int[0] & @CRLF & " WIS: " & $wis[0] & @CRLF & " DEX: " & $dex[0] $ps1 = GUICtrlCreateLabel ($ts,10,10,$dth-20,140) GUICtrlSetBkColor(-1, -2) GUICtrlSetColor(-1, 0xffffff) GUICtrlSetFont (-1, 15,400,0,"Arial") $ts = " PLAYER 2: " & @CRLF & " HP: " & $hp[1] & @CRLF & " STR: " & $str[1] & @CRLF & " INT: " & $int[1] & @CRLF & " WIS: " & $wis[1] & @CRLF & " DEX: " & $dex[1] $ps2 = GUICtrlCreateLabel ($ts ,$dth+1,10,$dth-20,140) GUICtrlSetBkColor(-1, -2) GUICtrlSetColor(-1, 0xffffff) GUICtrlSetFont (-1, 15,400,0,"Arial") $phase_stat = GUICtrlCreateLabel ("CHOOSE A DECK",810, $dty - 125,200,50) GUICtrlSetBkColor(-1, -2) GUICtrlSetColor(-1, 0xffff00) GUICtrlSetFont (-1, 15,400,0,"Arial Black") EndFunc ;Display Card Helps Func Display_Helps () $cava[0] = GUICtrlCreateLabel ("",10, $dty - 525,200,50) GUICtrlSetBkColor(-1, -2) GUICtrlSetColor(-1, 0xffff00) GUICtrlSetFont (-1, 12,400,0,"Arial Narrow") $cava[1] = GUICtrlCreateLabel ("",210, $dty - 525,200,50) GUICtrlSetBkColor(-1, -2) GUICtrlSetColor(-1, 0xffff00) GUICtrlSetFont (-1, 12,400,0,"Arial Narrow") $cava[2] = GUICtrlCreateLabel ("",410, $dty - 525,200,50) GUICtrlSetBkColor(-1, -2) GUICtrlSetColor(-1, 0xffff00) GUICtrlSetFont (-1, 12,400,0,"Arial Narrow") $cava[3] = GUICtrlCreateLabel ("",610, $dty - 525,200,50) GUICtrlSetBkColor(-1, -2) GUICtrlSetColor(-1, 0xffff00) GUICtrlSetFont (-1, 12,400,0,"Arial Narrow") $cava[4] = GUICtrlCreateLabel ("",10, $dty - 275,200,50) GUICtrlSetBkColor(-1, -2) GUICtrlSetColor(-1, 0xffff00) GUICtrlSetFont (-1, 12,400,0,"Arial Narrow") $cava[5] = GUICtrlCreateLabel ("",210, $dty - 275,200,50) GUICtrlSetBkColor(-1, -2) GUICtrlSetColor(-1, 0xffff00) GUICtrlSetFont (-1, 12,400,0,"Arial Narrow") $cava[6] = GUICtrlCreateLabel ("",410, $dty - 275,200,50) GUICtrlSetBkColor(-1, -2) GUICtrlSetColor(-1, 0xffff00) GUICtrlSetFont (-1, 12,400,0,"Arial Narrow") $cava[7] = GUICtrlCreateLabel ("",610, $dty - 275,200,50) GUICtrlSetBkColor(-1, -2) GUICtrlSetColor(-1, 0xffff00) GUICtrlSetFont (-1, 12,400,0,"Arial Narrow") EndFunc ;Set phase to string Func Update_Phase ($ts) GUICtrlSetData ($phase_stat, $ts) EndFunc Func Refresh_Stats () $ts = " PLAYER 1: "& $d1 & @CRLF & " HP: " & $hp[0] & @CRLF & " STR: " & $str[0] & @CRLF & " INT: " & $int[0] & @CRLF & " WIS: " & $wis[0] & @CRLF & " DEX: " & $dex[0] GUICtrlSetData ($ps1, $ts) $ts = " PLAYER 2: "& $d2 & @CRLF & " HP: " & $hp[1] & @CRLF & " STR: " & $str[1] & @CRLF & " INT: " & $int[1] & @CRLF & " WIS: " & $wis[1] & @CRLF & " DEX: " & $dex[1] GUICtrlSetData ($ps2, $ts) For $n = 0 to 7 $i = StringSplit ($deck1[$n],",") $ts = "Cost:"&$i[2] Select Case $i[3] = "E" $ts &= " STR ("&$i[4]&$i[5]&"/"&$i[6]&$i[7]&")" Case $i[3] = "W" $ts &= " INT ("&$i[4]&$i[5]&"/"&$i[6]&$i[7]&")" Case $i[3] = "A" $ts &= " DEX ("&$i[4]&$i[5]&"/"&$i[6]&$i[7]&")" Case $i[3] = "F" $ts &= " WIS ("&$i[4]&$i[5]&"/"&$i[6]&$i[7]&")" EndSelect GUICtrlSetData ($cava[$n], $ts) Next EndFunc ;Player 2 Turn Func Player_2 () $ts = 0 If $hp < 81 Then For $j = 0 to 8 $i = StringSplit ($deck2[$j],",") Select Case $i[3] = "E" and $i[2] <= $str[1] and $i[5] = "HP" $ts = 1 $k = $j Case $i[3] = "W" and $i[2] <= $int[1] and $i[5] = "HP" $ts = 1 $k = $j Case $i[3] = "A" and $i[2] <= $dex[1] and $i[5] = "HP" $ts = 1 $k = $j Case $i[3] = "F" and $i[2] <= $wis[1] and $i[5] = "HP" $ts = 1 $k = $j EndSelect Next EndIf ;Seek a weapon if cure not found or needed If $ts = 0 Then For $j = 0 to 8 $i = StringSplit ($deck2[$j],",") Select Case $i[3] = "E" and $i[2] <= $str[1] and Abs($i[6]) > 0 $ts = 1 $k = $j Case $i[3] = "W" and $i[2] <= $int[1] and Abs($i[6]) > 0 $ts = 1 $k = $j Case $i[3] = "A" and $i[2] <= $dex[1] and Abs($i[6]) > 0 $ts = 1 $k = $j Case $i[3] = "F" and $i[2] <= $wis[1] and Abs($i[6]) > 0 $ts = 1 $k = $j EndSelect Next EndIf ;Seek defense if no card yet If $ts = 0 Then For $j = 0 to 8 $i = StringSplit ($deck2[$j],",") Select Case $i[3] = "E" and $i[2] <= $str[1] and Abs($i[4]) > 0 $ts = 1 $k = $j Case $i[3] = "W" and $i[2] <= $int[1] and Abs($i[4]) > 0 $ts = 1 $k = $j Case $i[3] = "A" and $i[2] <= $dex[1] and Abs($i[4]) > 0 $ts = 1 $k = $j Case $i[3] = "F" and $i[2] <= $wis[1] and Abs($i[4]) > 0 $ts = 1 $k = $j EndSelect Next EndIf ;Discard or Play If $ts = 0 Then $k = Random (0,8,1) Else $i = StringSplit ($deck2[$k],",") If $i[5] = "STR" Then $str[1] = Add_Check ($str[1],$i[4]) EndIf If $i[5] = "INT" Then $int[1] = Add_Check ($int[1],$i[4]) EndIf If $i[5] = "WIS" Then $wis[1] = Add_Check ($wis[1],$i[4]) EndIf If $i[5] = "DEX" Then $dex[1] = Add_Check ($dex[1],$i[4]) EndIf If $i[5] = "HP" Then $hp[1] = Add_Check ($hp[1],$i[4]) If $hp[1] > 100 Then $hp[1] = 100 EndIf EndIf If $i[5] = "DM" Then $dmg[1] += $i[4] EndIf If $i[7] = "STR" Then $str[0] = Add_Check ($str[0],$i[6]) EndIf If $i[7] = "INT" Then $int[0] = Add_Check ($int[0],$i[6]) EndIf If $i[7] = "WIS" Then $wis[0] = Add_Check ($wis[0],$i[6]) EndIf If $i[7] = "DEX" Then $dex[0] = Add_Check ($dex[0],$i[6]) EndIf If $i[7] = "HP" Then $i[6] -= $dmg[1] If $i[6] > 0 Then $i[6] = 0 EndIf $dmg[1] = 0 $hp[0] += $i[6] If $hp[0] < 0 Then $hp[0] = 0 Lose_Game () EndIf EndIf If $i[7] = "DM" Then $dmg[0] += $i[6] EndIf EndIf $i = StringSplit ($deck2[$k],",") GUICtrlSetImage ($discard,"cards/"&$i[8]) $n = $deck2[$k] $deck2[$k] = $deck2[$card2] $deck2[$card2] = $n $card2 += 1 If $card2 = 79 Then $card2 = 8 EndIf $n = $deck2[8] $deck2[8] = $deck2[$card2] $deck2[$card2] = $n Refresh_Stats () $phase = 0 Update_Phase ("DRAW PHASE") EndFunc Func Win_Game () $ts = " PLAYER 1: "& $d1 & @CRLF & " WON THE MATCH" & @CRLF & " STR: " & $str[0] & @CRLF & " INT: " & $int[0] & @CRLF & " WIS: " & $wis[0] & @CRLF & " DEX: " & $dex[0] GUICtrlSetData ($ps1, $ts) $ts = " PLAYER 2: "& $d2 & @CRLF & " LOST THE MATCH" & @CRLF & " STR: " & $str[1] & @CRLF & " INT: " & $int[1] & @CRLF & " WIS: " & $wis[1] & @CRLF & " DEX: " & $dex[1] GUICtrlSetData ($ps2, $ts) Restart () EndFunc Func Lose_Game () $ts = " PLAYER 1: "& $d1 & @CRLF & " LOST THE MATCH" & @CRLF & " STR: " & $str[0] & @CRLF & " INT: " & $int[0] & @CRLF & " WIS: " & $wis[0] & @CRLF & " DEX: " & $dex[0] GUICtrlSetData ($ps1, $ts) $ts = " PLAYER 2: "& $d2 & @CRLF & " WON THE MATCH" & @CRLF & " STR: " & $str[1] & @CRLF & " INT: " & $int[1] & @CRLF & " WIS: " & $wis[1] & @CRLF & " DEX: " & $dex[1] GUICtrlSetData ($ps2, $ts) Restart () EndFunc Func Restart () $ts = MsgBox (0x24,"","Play again?") If $ts = 6 Then Run ("gtcard.exe") EndIf Sleep (250) Exit EndFunc EDIT: Here is little bit of help how game play works, I assume you can figure this part out by looking at the script. There are 3 decks in the deck.ini file. The program scans the file 3 times. The first scan looks for the colons ":" and pulls any text after that listing those as names. Example; anything typed before is trimmed:THIS is the name of my deck On the second pass it looks for the title you chose and counts in the next 80 cards 5,0,E,1,STR,0,0,EARTH.JPG The program takes the first number as quantity and converts it into 5 cards; $deck1[0] = "5,0,E,1,STR,0,0,EARTH.JPG" $deck1[1] = "5,0,E,1,STR,0,0,EARTH.JPG" $deck1[2] = "5,0,E,1,STR,0,0,EARTH.JPG" $deck1[3] = "5,0,E,1,STR,0,0,EARTH.JPG" $deck1[4] = "5,0,E,1,STR,0,0,EARTH.JPG" I am storing an array of 8 items inside an array. On the second pass the AI deck is read in the same as above. As for game play I kept the rules simple. Elements 4 and 5 of each card array tell what variable is effected by the person playing the card. Elements 6 and 7 of each card array tells how the variable effected on the opponent. Finally the AI wasn't hard to figure out. It checks for any playable health modifying cards if the HP is less than 81 points because health is everything. Then if a playable card has not been found it seeks a playable weapon. If no weapon has been found then it seeks a defensive card. If it has no playable cards one is chosen at random to discard. The HARD part or time consuming issue when making a game like this, is the graphics. I grabbed some images off the internet and ran them through the Gimp. That took me a few days. Another issue to consider is the balance of the decks. For example, you could easily make a deck impossible to beat by adding this card; 1,1,F,0,0,-100,HP,NUKEHIM.JPG Or you could make your deck too weak and get your butt kicked.