Jump to content

bleed

Active Members
  • Posts

    22
  • Joined

  • Last visited

bleed's Achievements

Seeker

Seeker (1/7)

0

Reputation

  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
×
×
  • Create New...