Jump to content

Blank517

Members
  • Posts

    14
  • Joined

  • Last visited

Blank517's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. When my script run this code (without errors/warnings) , in theory should click the object, but wait a few seconds without click them (more then 1,5) and then closes AutoIt: $ObjData = _IEGetObjById($ObjForm[0], "sendlogs_button") _IEAction($ObjData, "click") Sleep(1500) _IEQuit($ObjForm[0]) HTML: <div class="send-container"> [html] <span class="send-logs show" id="sendlogs_button" style="cursor: pointer;"> Send logs to an Admin </span> </div> Sorry for my bad english ^^
  2. Solved _SQLite_Query(-1, "SELECT id FROM Users WHERE username = '" & $Recv[1] & "' AND password = '" & $Recv[2] & "' AND online = 0;", $hQuery) If _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK Then $sMsg = $aRow[0] EndIf If $sMsg = Null Then; <-- not $sMsg = "" but = Null ConsoleWrite("[Alert] Connection refused! (" & $Recv[1] & ")") TCPSend($Socket_Data[$0][0], "Connection refused!" & @CRLF & "There is a problem with the database:" & @CRLF & " - You're not registered" & @CRLF & " - You're already online") TCPCloseSocket($Socket_Data[$0][0]) Return EndIf
  3. Server Chat sqlite admin.7z
  4. The result does not change it always give me a null id
  5. Last help for sqlite xP When a user login, even if it is not registered and therefore hasn't an id, the server accepts the connection _SQLite_Query(-1, "SELECT id FROM Users WHERE username = '" & $Socket_Data[$0][1] & "' AND password = '" & $Socket_Data[$0][2] & "' AND online = 0;", $hQuery) If _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK Then $sMsg &= $aRow[0] EndIf If $sMsg = "" Then ConsoleWrite("[Alert] Connection refused! (" & $Socket_Data[$0][1] & ")") TCPSend($Socket_Data[$0][0], "Connection refused!" & @CRLF & "There is a problem with the database:" & @CRLF & " - You're not registered" & @CRLF & " - You're already online") TCPCloseSocket($Socket_Data[$0][0]) Return EndIf
  6. Thanks, now it works ^^
  7. Ok, but 'Blank517' has id '1' not '11'
  8. Hi, when a client sends /logout to the server i want that the server find the id of the client and set his online status to 0 Using 'default' I have no problems, but when I do this with 'blank517' gives me id 10 and then for the database remains online Database while Blank517 logout: id | username | password | permissions | online | 0 | default | pass1 | 0 | 0 | 1 | Blank517 | pass | 0 | 1 | Server recv: Func _Recv_From_Sockets_() For $0 = 1 To $max_connections $Recv = TCPRecv ($Socket_Data[$0][0],1024) If StringLeft($Recv, 1) = "/" Then If StringInStr($Recv, "logout") Then _SQLite_Query(-1, "SELECT id FROM Users WHERE username = '" & $Socket_Data[$0][1] & "' AND online = '1';", $hQuery) While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK $sMsg &= $aRow[0]; <-- $sMsg = 10 after FetchData WEnd _SQLite_Exec(-1, "UPDATE Users SET online = '0' WHERE id = '" & $sMsg & "';") For $000 = 1 To $max_connections TCPSend($Socket_Data[$000][0], $Socket_Data[$0][1] & " ha effettuato il logout") Next TCPCloseSocket($Socket_Data[$0][0]) $sMsg = Null EndIf Else _Broadcast_To_Sockets_ ($Recv) EndIf Next EndFunc *excuse me for my bad english *
  9. @JLogan3o13 I love youuuu <3 You solved my problem, I didn't understand how to correctly use _SQLite_Query with _SQLite_FetchData...
  10. I already tried but i think that $SQLITE_OK checks only if command was successful
  11. Hi, I would like to make a login script with SQLite. The database looks like this: _SQLite_Exec(-1, "CREATE TABLE Users (id INT(8) NOT NULL, username VARCHAR(30) NOT NULL, password VARCHAR(255) NOT NULL, permission INT(8) NOT NULL, PRIMARY KEY (id)); CREATE UNIQUE INDEX 'user_name_unique' ON 'Users' ('username' );") _SQLite_Exec(-1, "INSERT INTO Users(id, username, password, permission) VALUES ('0', 'default', 'password', '0');") theoretically I should make a query in this way, right? _SQLite_Query (-1, "SELECT id FROM Users WHERE username = '" & $ Recv [1] & "' AND password = '" & $ Recv [2] & "';", $ hQuery) but then I do not know how to know if you have found the 'id'
  12. Thanks for welcome! Yes, this is the whole code but i have rewrited the entire script... Now i use: While 1     _Recv_data_server()     If _IsPressed('0D') Then     _Send()     EndIf     Sleep(50) WEnd
  13. When i write in inputbox and hit send sends the message, but it also sends when I move the mouse. How can I fix? (sorry for my bad explanation but I don't know english very well) #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Compression=4 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;Client #include <GuiConstants.au3> #include <GuiEdit.au3> TCPStartup() $ip=InputBox("Chat","IP:",@IPAddress1,"",50,123)  If $ip="" Then Exit $socket=TCPConnect($ip,2000)       If $socket=-1 Then        MsgBox(16,"Error","Connection error",5)        Exit EndIf GUICreate("Client",300,240) $edit=GUICtrlCreateEdit("",0,0,300,200,BitOr($WS_VSCROLL, $ES_READONLY)) $msg=GUICtrlCreateInput("",10,210,200,20) $send=GUICtrlCreateButton("Send",215,210,80,20) Dim $AccelKeys[1][2] = [["{ENTER}", $send]] GUISetAccelerators($AccelKeys) GUISetState(@SW_SHOW) While 1         Switch GUIGetMsg()             Case $gui_event_close                 GUIDelete()             Case $send                 $msg1=GUICtrlRead($msg)                 TCPSend($socket,$msg1)                 GUICtrlSetData($msg,"")         EndSwitch         $recv=TCPRecv($socket,2048)         If $recv <> "" Then                 _GUICtrlEdit_AppendText($edit,$recv & @CRLF)         EndIf WEnd
×
×
  • Create New...