Jump to content

bleed

Active Members
  • Posts

    22
  • Joined

  • Last visited

Everything posted by bleed

  1. I`m using this peiece of code I have found here on the forums. I have a problem trying to get these queries into only one, because I`m getting "out of syn`c" error message when I`m trying to run it. Any ideas? #include <array.au3> #include "mysql.au3" _MySQL_InitLibrary() If @error Then Exit MsgBox(0, '', "") $MysqlConn = _MySQL_Init() $connected = _MySQL_Real_Connect($MysqlConn, "www.test.com", "DBusername", "DBpassword", "database") If $connected = 0 Then Exit MsgBox(16, 'Connection Error', _MySQL_Error($MysqlConn)) $uname = 'testuser2' $email = 'testuser2@test.com' ;"SELECT userid FROM profiles WHERE userid=(SELECT userid FROM users WHERE username=username)" $uid = "SELECT userid FROM user WHERE username='" & _MySQL_Real_Escape_String($MysqlConn,$uname) &"'" $substatus = "SELECT * FROM subscriptionlog WHERE userid='" & _MySQL_Real_Escape_String($MysqlConn,$uid) & "' AND status='" & _MySQL_Real_Escape_String($MysqlConn,"1") & "'" $query = "SELECT * FROM user WHERE username='" & _MySQL_Real_Escape_String($MysqlConn,$uname) & "' AND email='" & _MySQL_Real_Escape_String($MysqlConn,$email) & "' AND status ='" & _MySQL_Real_Escape_String($MysqlConn,$substatus) & "'" ;$query = "SELECT * FROM user WHERE username='" & _MySQL_Real_Escape_String($MysqlConn,$uid) & "' AND email='" & _MySQL_Real_Escape_String($MysqlConn,$email) MsgBox(0, '', $uid) If _MySQL_Real_Query($MysqlConn, $uid) = $MYSQL_ERROR Then MsgBox(0, 'Error', _MySQL_Error($MysqlConn)) EndIf If _MySQL_Real_Query($MysqlConn, $substatus) = $MYSQL_ERROR Then MsgBox(0, 'Error', _MySQL_Error($MysqlConn)) EndIf If _MySQL_Real_Query($MysqlConn, $query) = $MYSQL_ERROR Then MsgBox(0, 'Error', _MySQL_Error($MysqlConn)) Else ;------------------------------------------------------ ;------------------------------------------------------ $res = _MySQL_Store_Result($MysqlConn) $users = _MySQL_Num_Rows($res) if $users == 1 then MsgBox(0, '', "Account Found Login OK!") Else MsgBox(0,'',"Login Failed Either your ID and PW is wrong or your subscription has expired.");what to do if the UN and PW is not found EndIf _MySQL_Free_Result($res) EndIf _MySQL_Close($MysqlConn) _MySQL_EndLibrary()
  2. Dang it. I was affraid of that. Oh well, re-writting the server file into php is the next move I guess. Thanks Scriptonize!
  3. `Evening. Anyone has some guidance on how can I run an au3 script of my web server? I mean which files, how and where I have to install them in order to even run au3 script remotely. I couldn`t find any info in the help file or with a search function here. The server would have only an auth file and a mysql database for data storage, basicaly an "auth server". I just can`t figure out how set that all up. Btw, does it matter if the platform is Linux or Windows? Thanks.
  4. Hello, I`d need some help on passing the variables from my desktop application (compiled au3.exe file) to my web server auth script (.php) and vice versa for auth purposes. I have never done anything similar and I was trying to figure out all day today how to do this. COM is brand new to me totaly as you can see, and I would really appreciate some guidance about how to tackle this problem. I have managed to get some things working, like getting username from mysql database, but I cant pass the $var values from my desktop application to my .php script. In an essence, .php should compare username, password, ip address and hardware ID (still figuring that out)from my au3 file with mysql database, and act accordingly.The following code is messy, and not workable atm, but I need to get some sleep now, and hopefully someone will be able to point me into the right direction in next few hours. Thank you. au3 file: $oRet = _HTTPRequest('POST', 'http://www.mysite.com/file.php', 'zdvfsdf') $id = "testuser" $pw = "pass" $hid = "testHID" $ip = "Ipaddress" $oData = "some data here for testing" ConsoleWrite($oRet) Func _HTTPRequest($oMethod, $oURL, $oData) Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open($oMethod, $oURL, False) If $oMethod = "POST" Then $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") $oHTTP.Send($oData);error out requested Return $oHTTP.ResponseText ;ConsoleWrite($oHTTP) EndFunc server script: <? $username="test_user"; $password="somepw"; $database="some_bulletin"; $string="pass"; $passuser='';//COM object $iduser='';//COM object mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database, Let admins know immediately!"); $query="SELECT * FROM user WHERE username=$iduser And password=$passuser"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); //echo "<b><center>Database Output</center></b>"; $i=0; while ($i < $num) { $first=mysql_result($result,$i,"username"); $last=mysql_result($result,$i,"password"); $salt=mysql_result($result,$i,"salt"); $hash=md5(md5($string) . $salt); //echo "<b>$first</b><br>"; //echo "<b>$last</b><br>"; //echo "<b>$salt</b><br>"; //echo "<b>$hash</b><br>"; $i++; } ?>
  5. I`ve been trying to find an answer to this problem for two days now, and I really hope there is someone willing to help me reliaze where the problem is. Anyhow, I have a remote server, database userid and password are set correctly. Wildcard % is in place to allow database access to all. Privilages set to all, and the problem is that when I try to execute a script, or even this snippet, I get an error of "Access denied for user ******* to table username." I have never used mysql before, so I`m still learning. Even tho, I`m 100% positive that privs are all set (triple-checked) is it possible that remote server denies access after the certain depth in database? Thank you. #include <array.au3> #include <mysql.au3> _MySQL_InitLibrary() If @error Then Exit MsgBox(0, '', "") $MysqlConn = _MySQL_Init() $connected = _MySQL_Real_Connect($MysqlConn, "www.******.com","*****_vbuser","*********","******_vbuletin") If $connected = 0 Then Exit MsgBox(16, 'Connection Error', _MySQL_Error($MysqlConn)) $yam = "testuser" $pass = "pass" ;$query = "SELECT * FROM user WHERE username=" & _MySQL_Real_Escape_String($MysqlConn,$yam) & "'" $query = "SELECT * FROM user.username WHERE username = " & _MySQL_Real_Escape_String($MysqlConn,$yam) & " AND password=" & _MySQL_Real_Escape_String($MysqlConn,$pass) & "'" MsgBox(0, '', $query) If _MySQL_Real_Query($MysqlConn, $query) = $MYSQL_ERROR Then MsgBox(0, 'Error', _MySQL_Error($MysqlConn)) Else EndIf
  6. Thanks for responding John. The game used to have GG but not anymore. However, I can send every single keystroke/string without any problems, but "TAB" is a no go. FYI the game name is a "Silkroad-online".
  7. I`ve searched the forums for quite some time, and the snippet below shows everything I have tryed so far. I have managed to send every string I need to this game window using mostly ControlSend(). The last and only problem I have is how to send a "TAB" keystroke to this game window, because whatever I try, doesn`t work. ;$tab = "{ASC 09}" ;ControlSend ($hWnd,"","Edit1", ($tab)) ;ControlSend("[CLASS:CLIENT]", "", "Edit1", "{TAB}") ;DllCall("User32.dll", "int", "PostMessage", "hwnd", $hwnd, "int", 0x9, "int", 0, "long", "") ;_SendMessage($hWnd, 0x09) ;ControlSend ($hWnd,"","Edit1","{tab}") Anyone has any ideas what can I try next?
  8. Same here, It doesn`t work for me as well.
  9. Thanubis, Thats it! heh.... I`m spending way to many hours learning AutoIt, and sometimes very simple ideas wont come up Thanks again
  10. Hi 4Eyes and Thank You for a fast responce. I `ve been searching the forms and the help file for last few hours now, and I cant find any solution to my problem. The reason I have 2 exe files is that they have to be run simultaneously, so I can`t use processclose().
  11. I have a 2 exe files installed. Main.exe file is controled by other Parent.exe, now my question is this. How can I prevent the end user to start the Main.exe directly by double-clicking on it? I need him basicaly to start the Parent.exe first, and my Main.exe is called by ShellExecute() from Parent.exe. Thanks
  12. Well, after that error pops out, I can get it to the GUI where I`m supposed to add files, but after I do so, I get an error saying that the target file hasn`t been chosen, or something like that.(I can double check it if you want me to) FileGetLongName() is failing for me, and what do you want me to do to verify that?...sorry, I`m still a noob here
  13. I got this error msg. popping up when I try to create an innitial dll. I`m using winXP sp2 64 bit.
  14. What I`m trying to do is to compile 6 scripts into the one exe. The reason for this approach is because I have to run atleast 2-3 au3.exe files at the same time independently from each other, even tho, all of them are involved in controling the same application (game). Besides those 6 .exe files, I have a folder with files (ini, txt, png, class, etc.) that also has to be put into the main.exe file. I thought, it would be neat to have one .exe file to start the program from, instead of having all 6 of them installed + the data folder. I looked at Zedna`s Resources.au3, and tryed to implement something to suit my needs, but that is a bit over my head. I have tryed to compile those with Res-Add-Files, and everything seems to look fine if I run that main.exe file in the same folder where all other files are, but if I move that main.exe to another folder, or another comp, I get a windows error msg popping up saying that windows cannot find the file specified. I know that all those files got included into my main.exe during compilation process, and size of it increased accordingly, but still it wont work on other machines. I was looking at FileInstall() for my next move, but a problem with that is that I dont like having those files installed somewhere on other ppl`s machines. Is there a way to keep all those files in one.exe? Sorry for the long post, but I`m getting desperate here.
  15. Martin, after I did what you told me, everything is as it is supposed to be. I guess I have to learn how to walk, before I learn how to jump Thanks again
  16. Thanks Martin, I guess, I`ll go again from scratch.
  17. I`m stuck with this thing since last night. I have to make 15 tabs and each includes several input fields, and quite a bit of radios. The problem is, when I start the the script, it goes to a 2nd tab as a default insted of tab1. I can also save all the info in my .ini file from tab1, but not from tab2. If someone can take a quick look at it and show me where and what am I doing wrong here? Here is a code, and below is a DCAL.ini file part Thanks #include <GuiConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> $charname1 = IniRead("DCAL.ini", "Char1", "CharName1", "") $charname2 = IniRead("DCAL.ini", "Char2", "CharName2", "") $charname3 = IniRead("DCAL.ini", "Char3", "CharName3", "") $charname4 = IniRead("DCAL.ini", "Char4", "CharName4", "") $charname5 = IniRead("DCAL.ini", "Char5", "CharName5", "") $charname6 = IniRead("DCAL.ini", "Char6", "CharName6", "") $charname7 = IniRead("DCAL.ini", "Char7", "CharName7", "") $charname8 = IniRead("DCAL.ini", "Char8", "CharName8", "") $charname9 = IniRead("DCAL.ini", "Char9", "CharName9", "") $charname10 = IniRead("DCAL.ini", "Char10", "CharName10", "") $charname11 = IniRead("DCAL.ini", "Char11", "CharName11", "") $charname12 = IniRead("DCAL.ini", "Char12", "CharName12", "") $charname13 = IniRead("DCAL.ini", "Char13", "CharName13", "") $charname14 = IniRead("DCAL.ini", "Char14", "CharName14", "") $charname15 = IniRead("DCAL.ini", "Char15", "CharName15", "") $charname = "[MyCharName]" $stuckcheck = IniRead("DCAL.ini", "General", "stuckcheck", "") ; GUI $hGUI = GuiCreate("DC", 603, 430) GuiSetIcon(@WorkingDir & "\DC.ico", 0) GuiCtrlCreateTab(2, 5, 600, 295) ;--------------GENERAL----------------------------- GUICtrlCreateLabel("General Settings:", 4, 310) GUICtrlCreateLabel("Stuck protection every:", 4, 330) If $stuckcheck = "OFF" Then $stuckprot1 = GUICtrlCreateRadio("15 Min.", 158, 328, 60) $stuckprot2 = GUICtrlCreateRadio("30 Min.", 225, 328, 60) $stuckprot3 = GUICtrlCreateRadio("45 Min.", 290, 328, 60) $stuckprot4 = GUICtrlCreateRadio("60 Min.", 358, 328, 60) $stuckprot5 = GUICtrlCreateRadio("OFF", 418, 328, 60) GUICtrlSetState($stuckprot5, $GUI_CHECKED) GUIStartGroup() EndIf If $stuckcheck = 15 Then $stuckprot1 = GUICtrlCreateRadio("15 Min.", 158, 328, 60) $stuckprot2 = GUICtrlCreateRadio("30 Min.", 225, 328, 60) $stuckprot3 = GUICtrlCreateRadio("45 Min.", 290, 328, 60) $stuckprot4 = GUICtrlCreateRadio("60 Min.", 358, 328, 60) $stuckprot5 = GUICtrlCreateRadio("OFF", 418, 328, 60) GUICtrlSetState($stuckprot1, $GUI_CHECKED) GUIStartGroup() EndIf If $stuckcheck = 30 Then $stuckprot1 = GUICtrlCreateRadio("15 Min.", 158, 328, 60) $stuckprot2 = GUICtrlCreateRadio("30 Min.", 225, 328, 60) $stuckprot3 = GUICtrlCreateRadio("45 Min.", 290, 328, 60) $stuckprot4 = GUICtrlCreateRadio("60 Min.", 358, 328, 60) $stuckprot5 = GUICtrlCreateRadio("OFF", 418, 328, 60) GUICtrlSetState($stuckprot2, $GUI_CHECKED) GUIStartGroup() EndIf If $stuckcheck = 45 Then $stuckprot1 = GUICtrlCreateRadio("15 Min.", 158, 328, 60) $stuckprot2 = GUICtrlCreateRadio("30 Min.", 225, 328, 60) $stuckprot3 = GUICtrlCreateRadio("45 Min.", 290, 328, 60) $stuckprot4 = GUICtrlCreateRadio("60 Min.", 358, 328, 60) $stuckprot5 = GUICtrlCreateRadio("OFF", 418, 328, 60) GUICtrlSetState($stuckprot3, $GUI_CHECKED) GUIStartGroup() EndIf If $stuckcheck = 60 Then $stuckprot1 = GUICtrlCreateRadio("15 Min.", 158, 328, 60) $stuckprot2 = GUICtrlCreateRadio("30 Min.", 225, 328, 60) $stuckprot3 = GUICtrlCreateRadio("45 Min.", 290, 328, 60) $stuckprot4 = GUICtrlCreateRadio("60 Min.", 358, 328, 60) $stuckprot5 = GUICtrlCreateRadio("OFF", 418, 328, 60) GUICtrlSetState($stuckprot4, $GUI_CHECKED) GUIStartGroup() EndIf $SaveAllSettings = GUICtrlCreateButton("Save general Settings", 50, 360, 110, 35) $StopDCAL = GUICtrlCreateButton("Stop logging in", 250, 360, 110, 35) $StartDCAL = GUICtrlCreateButton("Start logging in", 450, 360, 110, 35) ;If GUIGetMsg ($StopDCAL) Then ;Call ("ExitDCAL") ;EndIf ;If GUIGetMsg ($StartDCAL) Then ;Call ("CharCheck1") ;EndIf GUICtrlCreateTabItem("") ;------------------------------------------------------------------------------------------- $Tab1 = GuiCtrlCreateTabItem($charname1) GUISwitch($hGUI, $Tab1) $sIniFile = @WorkingDir & "\DCAL.ini" $sValue = IniRead (@WorkingDir & "\DCAL.ini", "Char1", "CharName1", "Empty") $charname1 = GUICtrlCreateInput($sValue,50, 50, 130, 20) $sValue1 = IniRead (@WorkingDir & "\DCAL.ini", "Char1", "ID", "Empty") $charID1 = GUICtrlCreateInput($sValue1,50, 80, 130, 20) $sValue2 = IniRead (@WorkingDir & "\DCAL.ini", "Char1", "PW", "Empty") $charPW1 = GUICtrlCreateInput($sValue2, 50, 110, 130, 20) $char1Pos1 = IniRead("DCAL.ini", "Char1", "Pos 1-4", "") $autotrain1 = IniRead("DCAL.ini", "Char1", "Auto Training", "") $killclient1 = IniRead("DCAL.ini", "Char1", "Kill the client", "") $path1 = IniRead("DCAL.ini", "Char1", "Path Char1", "Path") $charsnr = IniRead("DCAL.ini", "Char1", "Number of chars (1-4)", "") $Label1 = GUICtrlCreateLabel("File name:", 200, 50, 230, 20) $patch = GUICtrlCreateInput($path1, 200, 75, 230, 20) $button = GUICtrlCreateButton("Browse", 450, 75, 50, 20) GuiCtrlCreateLabel("Char 1", 4, 55) GuiCtrlCreateLabel("ID", 4, 85) GuiCtrlCreateLabel("PW", 4, 115) GuiCtrlCreateLabel("Server Selection----- Not implemented yet", 4, 145) GuiCtrlCreateLabel("Pos 1-4:", 4, 175) GuiCtrlCreateLabel("Number of chars (1-4):", 4, 205) GUISetState() If $charsnr = 1 Then $charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60) $charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60) $charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60) $charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60) GUICtrlSetState($charsnr1, $GUI_CHECKED) EndIf If $charsnr = 2 Then $charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60) $charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60) $charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60) $charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60) GUICtrlSetState($charsnr2, $GUI_CHECKED) EndIf If $charsnr = 3 Then $charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60) $charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60) $charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60) $charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60) GUICtrlSetState($charsnr3, $GUI_CHECKED) EndIf If $charsnr = 4 Then $charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60) $charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60) $charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60) $charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60) GUICtrlSetState($charsnr4, $GUI_CHECKED) EndIf GUISetState() GUIStartGroup() GuiCtrlCreateLabel("Start Auto Training after logged in?", 4, 235) If $autotrain1 = 1 Then $RadioYesAutotraining = GuiCtrlCreateRadio("Yes", 260, 232, 45) GUICtrlSetState($RadioYesAutotraining, $GUI_CHECKED) $RadioNoAutotraining = GuiCtrlCreateRadio("No", 320, 232, 45) GUIStartGroup() EndIf If $autotrain1 = 0 Then $RadioYesAutotraining = GuiCtrlCreateRadio("Yes", 260, 232, 45) $RadioNoAutotraining = GuiCtrlCreateRadio("No", 320, 232, 45) GUICtrlSetState($RadioNoAutotraining, $GUI_CHECKED) GUIStartGroup() EndIf GuiCtrlCreateLabel("Kill the client", 4, 265) If $killclient1 = 1 Then $RadioKillClientYes = GuiCtrlCreateRadio("Yes", 260, 262, 45) GUICtrlSetState($RadioKillClientYes, $GUI_CHECKED) $RadioKillClientNo = GuiCtrlCreateRadio("No", 320, 262, 45) EndIf If $killclient1 = 0 Then $RadioKillClientYes = GuiCtrlCreateRadio("Yes", 260, 262, 45) $RadioKillClientNo = GuiCtrlCreateRadio("No", 320, 262, 45) GUICtrlSetState($RadioKillClientNo, $GUI_CHECKED) EndIf Opt("GUICoordMode", 1) GUIStartGroup() If $char1Pos1 = 1 Then $Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100) $Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100) $Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100) $Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100) GUICtrlSetState($Ch1position1, $GUI_CHECKED) EndIf If $char1Pos1 = 2 Then $Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100) $Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100) $Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100) $Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100) GUICtrlSetState($Ch1position2, $GUI_CHECKED) EndIf If $char1Pos1 = 3 Then $Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100) $Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100) $Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100) $Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100) GUICtrlSetState($Ch1position3, $GUI_CHECKED) EndIf If $char1Pos1 = 4 Then $Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100) $Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100) $Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100) $Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100) GUICtrlSetState($Ch1position4, $GUI_CHECKED) EndIf $Char1Save = GUICtrlCreateButton("Save Char Data!", 450, 200, 110, 48) GUIStartGroup() GUICtrlCreateTabItem("") GUISetState() ;--------------char2---------------------------------------------------------- $Tab2 = GuiCtrlCreateTabItem($charname2) GUISwitch($hGUI, $Tab2) GUISetState() $sIniFile = @WorkingDir & "\DCAL.ini" $sValue2 = IniRead (@WorkingDir & "\DCAL.ini", "Char2", "CharName2", "Empty") $charname2 = GUICtrlCreateInput($sValue2,50, 50, 130, 20) $sValue12 = IniRead (@WorkingDir & "\DCAL.ini", "Char2", "ID", "Empty") $charID2 = GUICtrlCreateInput($sValue12,50, 80, 130, 20) $sValue22 = IniRead (@WorkingDir & "\DCAL.ini", "Char2", "PW", "Empty") $charPW2 = GUICtrlCreateInput($sValue22, 50, 110, 130, 20) $2char1Pos1 = IniRead("DCAL.ini", "Char2", "Pos 1-4", "") $autotrain2 = IniRead("DCAL.ini", "Char2", "Auto Training", "") $killclient2 = IniRead("DCAL.ini", "Char2", "Kill the client", "") $path2 = IniRead("DCAL.ini", "Char2", "Path Char2", "Path") $2charsnr = IniRead("DCAL.ini", "Char2", "Number of chars (1-4)", "") $Label2 = GUICtrlCreateLabel("File name:", 200, 50, 230, 20) $patch2 = GUICtrlCreateInput($path2, 200, 75, 230, 20) $button2 = GUICtrlCreateButton("Browse", 450, 75, 50, 20) GuiCtrlCreateLabel("Char 2", 4, 55) GuiCtrlCreateLabel("ID", 4, 85) GuiCtrlCreateLabel("PW", 4, 115) GuiCtrlCreateLabel("Server Selection----- Not implemented yet", 4, 145) GuiCtrlCreateLabel("Pos 1-4:", 4, 175) GuiCtrlCreateLabel("Number of chars (1-4):", 4, 205) GUISetState() If $2charsnr = 1 Then $2charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60) $2charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60) $2charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60) $2charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60) GUICtrlSetState($2charsnr1, $GUI_CHECKED) EndIf If $2charsnr = 2 Then $2charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60) $2charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60) $2charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60) $2charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60) GUICtrlSetState($2charsnr2, $GUI_CHECKED) EndIf If $2charsnr = 3 Then $2charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60) $2charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60) $2charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60) $2charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60) GUICtrlSetState($2charsnr3, $GUI_CHECKED) EndIf If $2charsnr = 4 Then $2charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60) $2charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60) $2charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60) $2charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60) GUICtrlSetState($2charsnr4, $GUI_CHECKED) EndIf GUISetState() GUIStartGroup() GuiCtrlCreateLabel("Start Auto Training after logged in?", 4, 235) If $autotrain2 = 1 Then $RadioYesAutotraining2 = GuiCtrlCreateRadio("Yes", 260, 232, 45) GUICtrlSetState($RadioYesAutotraining2, $GUI_CHECKED) $RadioNoAutotraining2 = GuiCtrlCreateRadio("No", 320, 232, 45) GUIStartGroup() EndIf If $autotrain2 = 0 Then $RadioYesAutotraining2 = GuiCtrlCreateRadio("Yes", 260, 232, 45) $RadioNoAutotraining2 = GuiCtrlCreateRadio("No", 320, 232, 45) GUICtrlSetState($RadioNoAutotraining2, $GUI_CHECKED) GUIStartGroup() EndIf GuiCtrlCreateLabel("Kill the client", 4, 265) If $killclient2 = 1 Then $RadioKillClientYes2 = GuiCtrlCreateRadio("Yes", 260, 262, 45) GUICtrlSetState($RadioKillClientYes2, $GUI_CHECKED) $RadioKillClientNo2 = GuiCtrlCreateRadio("No", 320, 262, 45) EndIf If $killclient2 = 0 Then $RadioKillClientYes2 = GuiCtrlCreateRadio("Yes", 260, 262, 45) $RadioKillClientNo2 = GuiCtrlCreateRadio("No", 320, 262, 45) GUICtrlSetState($RadioKillClientNo2, $GUI_CHECKED) EndIf GUIStartGroup() If $2char1Pos1 = 1 Then $2Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100) $2Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100) $2Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100) $2Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100) GUICtrlSetState($2Ch1position1, $GUI_CHECKED) EndIf If $2char1Pos1 = 2 Then $2Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100) $2Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100) $2Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100) $2Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100) GUICtrlSetState($2Ch1position2, $GUI_CHECKED) EndIf If $2char1Pos1 = 3 Then $2Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100) $2Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100) $2Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100) $2Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100) GUICtrlSetState($2Ch1position3, $GUI_CHECKED) EndIf If $2char1Pos1 = 4 Then $2Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100) $2Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100) $2Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100) $2Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100) GUICtrlSetState($2Ch1position4, $GUI_CHECKED) EndIf $Char2Save = GUICtrlCreateButton("Save Char Data!", 450, 200, 110, 48) GUIStartGroup() GUICtrlCreateTabItem("") GUISetState() While 1 Switch GUIGetMsg() Case $Char1Save IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "CharName1", GUICtrlRead($Tab1)) IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "ID", GUICtrlRead($charID1)) IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "PW", GUICtrlRead($charPW1)) IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Path Char1", GUICtrlRead($patch)) If GUICtrlRead($Ch1position1) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Pos 1-4", "1") EndIf If GUICtrlRead($Ch1position2) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Pos 1-4", "2") EndIf If GUICtrlRead($Ch1position3) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Pos 1-4", "3") EndIf If GUICtrlRead($Ch1position4) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Pos 1-4", "4") EndIf If GUICtrlRead($RadioYesAutotraining) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Auto Training", "1") EndIf If GUICtrlRead($RadioNoAutotraining) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Auto Training", "0") EndIf If GUICtrlRead($RadioKillClientYes) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Kill the client", "1") EndIf If GUICtrlRead($RadioKillClientNo) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Kill the client", "0") EndIf If GUICtrlRead($charsnr1) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Number of chars (1-4)", "1") EndIf If GUICtrlRead($charsnr2) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Number of chars (1-4)", "2") EndIf If GUICtrlRead($charsnr3) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Number of chars (1-4)", "3") EndIf If GUICtrlRead($charsnr4) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Number of chars (1-4)", "4") EndIf ;GENERAL SETTINGS BELOW If GUICtrlRead($stuckprot1) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "General", "stuckcheck", "15") EndIf If GUICtrlRead($stuckprot2) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "General", "stuckcheck", "30") EndIf If GUICtrlRead($stuckprot3) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "General", "stuckcheck", "45") EndIf If GUICtrlRead($stuckprot4) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "General", "stuckcheck", "60") EndIf If GUICtrlRead($stuckprot5) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "General", "stuckcheck", "OFF") EndIf Case $Char2Save IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "CharName1", GUICtrlRead($Tab2)) IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "ID", GUICtrlRead($charID2)) IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "PW", GUICtrlRead($charPW2)) IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Path Char1", GUICtrlRead($patch2)) If GUICtrlRead($2Ch1position1) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Pos 1-4", "1") EndIf If GUICtrlRead($2Ch1position2) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Pos 1-4", "2") EndIf If GUICtrlRead($2Ch1position3) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Pos 1-4", "3") EndIf If GUICtrlRead($2Ch1position4) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Pos 1-4", "4") EndIf If GUICtrlRead($RadioYesAutotraining2) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Auto Training", "1") EndIf If GUICtrlRead($RadioNoAutotraining2) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Auto Training", "0") EndIf If GUICtrlRead($RadioKillClientYes2) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Kill the client", "1") EndIf If GUICtrlRead($RadioKillClientNo2) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Kill the client", "0") EndIf If GUICtrlRead($2charsnr1) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Number of chars (1-4)", "1") EndIf If GUICtrlRead($2charsnr2) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Number of chars (1-4)", "2") EndIf If GUICtrlRead($2charsnr3) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Number of chars (1-4)", "3") EndIf If GUICtrlRead($2charsnr4) = $GUI_Checked Then IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Number of chars (1-4)", "4") EndIf ;GENERAL SETTINGS ABOVE Case $GUI_EVENT_CLOSE Exit Case $button $message = "Choose a file" $var = FileSelectFolder($message, "" & "\", "", 1 + 1) If @error Then MsgBox(4096, "", "No File(s) chosen") Else $var = FileGetLongName($var) $tmp = StringTrimLeft($var, 3) $tmp = StringRegExpReplace($tmp, '(?<=\\).*?(?=\\)', '...') $tmp = StringLeft($var, 3) & $tmp GUICtrlSetData($patch, $tmp) EndIf Case $button2 $message = "Choose a file" $var = FileSelectFolder($message, "" & "\", "", 1 + 1) If @error Then MsgBox(4096, "", "No File(s) chosen") Else $var = FileGetLongName($var) $tmp = StringTrimLeft($var, 3) $tmp = StringRegExpReplace($tmp, '(?<=\\).*?(?=\\)', '...') $tmp = StringLeft($var, 3) & $tmp GUICtrlSetData($patch2, $tmp) EndIf Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd [General] stuckcheck=15 [Char1] CharName1=111 ID=111 PW=111 Pos 1-4=3 Number of chars (1-4)=3 Auto Training=1 Kill the client=1 Path Char1=C:\Documents and Settings\Administrator\Desktop\folder1 [Char2] CharName2=VVVVVVVV ID=gggggggggg PW=gggggggggggggggg Pos 1-4=3 Number of chars (1-4)=1 Auto Training=0 Kill the client=0 Path Char2=C:\Documents and Settings\Administrator\Desktop\Folder2 [Char3] CharName3=VVVVVVVV ID=gggggggggg PW=gggggggggggggggg Pos 1-4=3 Number of chars (1-4)=1 Auto Training=0 Kill the client=0 Path Char3=C:\Documents and Settings\Administrator\Desktop\Folder3
  18. I guess that would work, the problem I have is that the "Value" is a $var. I have tryed playing around, but couldnt come up with anything. IniWrite("File.ini", "Section", "[Key]", "[$var]") is what I acctually need.
  19. `evening. I`m finishing off my script where I have to write data into the .ini file. Everything works great except one last thing. IniWrite ( "filename", "section", "key", "value" ) Is there a way to add brackets [] to the "key" or "value" so they actually look in between the brackes when they got written inside of a .ini file? Basicaly I need to IniRead them like "[key]" or "[value]" . Thanks
  20. Thanks again man, You have really helped me a lot. I just have finished the entire GUI and it`s fireing up like a charm
  21. WOW! Thanx Authenticity, I see where I got stuck now. GUISwitch is the main thing I had overseen here. Is it mandatory for GUICtrlCreateInput to have GUICtrlCreateLabel assosiated with? Thanks again
  22. Hello. This is my first post so far, but I have been reading and learning alot about AutoIt for several weeks now. The help file, and the search feature on the forum here are simply amazing. Every time when I got a problem, I would find how to fix it, untill now. Anyways, this GUI that I`m trying to get to run my 1st .exe that I wrote in AutoIt is giving me a real !@#$. The application I`m attending to get it to run with, is working like a clockwork, but for gui...I realy need a help. What happens is in this part of the code, is that when I try to insert a 2nd piece of code instead of commented lines, my all tabs simply disappear, all except the first one. I have been trying to figure it on my own, but my head really hurts at this point bacause I`m trying to find a solution for the last 11 hrs. Thanks alot for any help and/or directions you can give me. ; AutoIt 3.0.103 example ; 17 Jan 2005 - CyberSlug ; This script shows manual positioning of all controls; ; there are much better methods of positioning... #include <GuiConstantsEx.au3> #include <ButtonConstants.au3> #include <StaticConstants.au3> $linex = ("comment") $line0 = ("comment1") $line1 = ("ListServer") $line2 = ("ListServer") $line3 = ("ListServer") $line4 = ("ListServer") $line5 = ("ListServer") $line6 = ("ListServer") $line7 = ("ListServer") $line8 = ("ListServer") $line9 = ("ListServer") $line10 = ("ListServer") $line11 = ("ListServer") $line12 = ("ListServer") $line13 = ("ListServer") $line14 = ("ListServer") $line15 = ("ListServer") $line = "[MyFile]" ; GUI GuiCreate("Label100", 603, 400) GuiSetIcon(@WorkingDir & "\Label.ico", 0) GuiCtrlCreateTab(2, 5, 600, 295) GuiCtrlCreateTabItem($line1) GuiCtrlCreateInput("Extra Name 1", 50, 50, 130, 20) GuiCtrlCreateLabel("Extra 1", 4, 55) GuiCtrlCreateInput(" ID for Extra 1", 50, 80, 130, 20) GuiCtrlCreateLabel(" ID", 4, 85) GuiCtrlCreateInput(" PW for Extra 1", 50, 110, 130, 20) GuiCtrlCreateLabel(" PW", 4, 115) GuiCtrlCreatecombo("test", 50, 140, 130, 20) GUICtrlSetData(-1, "test1|test2|test3|test4|test5|test6|test7|test8|", "test") GuiCtrlCreateLabel("Server:", 4, 145) GuiCtrlCreateLabel("Select (1-4):", 4, 175) GuiCtrlCreatecombo("1", 140, 172, 40, 20) GUICtrlSetData(-1, "2|3|4", "1") GuiCtrlCreateLabel("Loc. 1-4:", 4, 205) $position1 = GuiCtrlCreateRadio("Position 1", 60, 202, 100) $position2 = GuiCtrlCreateRadio("Position 2", 160, 202, 100) $position3 = GuiCtrlCreateRadio("Position 3", 260, 202, 100) $position4 = GuiCtrlCreateRadio("Position 4", 360, 202, 100) GUICtrlSetState($position1, $GUI_CHECKED) GUIStartGroup() ;$patch = GuiCtrlCreateInput("Path to the File folder (not .exe)", 200, 50, 230, 20) ;$button = GUICtrlCreateButton("Browse", 450, 50, 50, 20) GUICtrlCreateTabItem("") GuiCtrlCreateLabel("General Settings:", 4, 310) GuiCtrlCreateLabel("Stuck protection every:", 4, 330) $stuckprot1 = GuiCtrlCreateRadio("15 Min.", 158, 328, 60) $stuckprot2 = GuiCtrlCreateRadio("30 Min.", 225, 328, 60) $stuckprot3 = GuiCtrlCreateRadio("45 Min.", 290, 328, 60) $stuckprot4 = GuiCtrlCreateRadio("60 Min.", 358, 328, 60) $stuckprotOff = GuiCtrlCreateRadio("OFF", 418, 328, 60) GUICtrlSetState($stuckprotOff, $GUI_CHECKED) GUIStartGroup() GuiCtrlCreateTabItem("") GuiCtrlCreateTabItem($line2) GuiCtrlCreateTabItem($line3) GuiCtrlCreateTabItem($line4) GuiCtrlCreateTabItem($line5) GuiCtrlCreateTabItem($line6) GuiCtrlCreateTabItem($line7) GuiCtrlCreateTabItem($line8) GuiCtrlCreateTabItem($line9) GuiCtrlCreateTabItem($line10) GuiCtrlCreateTabItem($line11) GuiCtrlCreateTabItem($line12) GuiCtrlCreateTabItem($line13) GuiCtrlCreateTabItem($line14) GuiCtrlCreateTabItem($line15) GuiCtrlCreateTabItem("") GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd #2nd part $Label1 = GUICtrlCreateLabel("File name:", 200, 50, 230, 20) $patch = GuiCtrlCreateInput("Path to the SBot folder for this Char (not .exe)", 200, 50, 230, 20) $button = GUICtrlCreateButton("Browse", 450, 50, 50, 20) GUISetState() While 1 $Msg = GUIGetMsg() If $button = $Msg Then $message = "Chose a file" $var = FileSelectFolder ($message, "" & "\", "", 1 + 1) If @error Then MsgBox(4096, "", "No File(s) chosen") Else $var = FileGetLongName($var) $tmp = StringTrimLeft($var, 3) $tmp = StringRegExpReplace($tmp, '(?<=\\).*?(?=\\)', '...') $tmp = StringLeft($var, 3) & $tmp GUICtrlSetData($patch, $tmp) EndIf EndIf If $Msg = $GUI_EVENT_CLOSE Then Exit WEnd
×
×
  • Create New...