Rinor 59 Report post Posted February 5, 2017 @KONG can you add it in my gs? if you got time. Quote Share this post Link to post Share on other sites
Ximboliex 85 Report post Posted May 12, 2017 (edited) Hi @Wrexor I can work whit this sytax? LuaSQL("UPDATE NathDB.dbo.account SET i_m_p_s = i_m_p_s + "..crystal.." WHERE act_name = '"..accountName.."'") Edited May 12, 2017 by Ximboliex Quote Share this post Link to post Share on other sites
Wrexor 61 Report post Posted May 12, 2017 On 1/19/2017 at 2:30 AM, Angelix said: @Wrexor that helped a lot! I didn't quite understand KONG's explanation and I though the functions only returned one value, that's where I was wrong since I didn't quite get the return of two values. Now with that and your help, I was able to get my account name. function GetAccountName() print("--------------------------------------------------") local String = "SELECT act_name FROM GameDB.dbo.account WHERE act_id IN (SELECT act_id FROM GameDB.dbo.character WHERE cha_name = 'Angelix')" local Connect, ConnectID = LuaSQL("connect", SQL.GameDB.Host, SQL.GameDB.User, SQL.GameDB.Password) if Connect == SQL_SUCCESS_WITH_INFO then print("Successful connection.") local Success, Query = LuaSQL("query", ConnectID, String) if Success == SQL_SUCCESS_WITH_INFO then print("Successful query.") local Data = LuaSQL("fetch", ConnectID, Query) print("Account Name = "..Data["act_name"]) LuaSQL("freehandle", ConnectID, Query) LuaSQL("close", ConnectID) return end end print("--------------------------------------------------") end GetAccountName() Which for testing purposes resulted this on GS console. Thanks a lot on both of you for the explanations and Vector since I got the query command from him on another thread since I have zero knowledge of SQL, hahah. @Ximboliex check this 1 Quote Share this post Link to post Share on other sites
Ximboliex 85 Report post Posted May 12, 2017 Thank's @Wrexor Now understand thaks to @Angelix 1 Quote Share this post Link to post Share on other sites
FapFap 13 Report post Posted May 27, 2019 On 10/12/2016 at 10:08 PM, Wrexor said: In link below there is an updated version of LuaSQL which should include all required files and its also registering lua functions automatically so after you compile or just copy already compiled dll just follow attaching guide in the first post on this topic. If you want to compile yourself be sure to select correct configuration depending on your server version, currently only 1.36 and 1.38 are supported. If someone wants a different version send me a pm. https://www.dropbox.com/s/3byhodvw2z26ef8/LuaSQL2.rar?dl=0 1.36 DLL is bug, it wont register lua functions, it only loads the dll on top of gameserver.. ( tried it in clean and custom gameservers 1.36 ) 1.38 works fine and registers lua functions.. could you check the 1.36 one? Quote Share this post Link to post Share on other sites
kyleflow 35 Report post Posted March 4, 2022 i dont understand where do you use function for the lua checking connection and editing which mobs drop igs.. can anyone explain iit Quote Share this post Link to post Share on other sites
kyleflow 35 Report post Posted March 13, 2022 On 7/15/2016 at 9:14 AM, GustavoHMA said: 1) If you do not use the MSSQL 2000 when inserting the host using double backslashes. Example: local host = 'PCNAME-PC\\SQLEXPRESS' 2) The paths of LuaSQL and ExecuteQueryAsync functions are not sufficient to add the functions to be performed on Lua files. PushPatch(&LuaSql, (PBYTE)0x5A5FD2); PushPatch(&ExecuteQueryAsync, (PBYTE)0x5A5EFE); does the second statement should be use in the LuaSQL ? from my undestanding, I should connect first and prompt the second command so that i can query my function afterward? is that the correct step or its not ? Quote Share this post Link to post Share on other sites
habs8024 2 Report post Posted April 20, 2023 Can anyone help me import this? I feel like I've tried everything or can someone show me the gameserver console of a working one? Quote Share this post Link to post Share on other sites
kyleflow 35 Report post Posted June 11, 2023 On 1/19/2017 at 9:30 AM, Angelix said: @Wrexor that helped a lot! I didn't quite understand KONG's explanation and I though the functions only returned one value, that's where I was wrong since I didn't quite get the return of two values. Now with that and your help, I was able to get my account name. function GetAccountName() print("--------------------------------------------------") local String = "SELECT act_name FROM GameDB.dbo.account WHERE act_id IN (SELECT act_id FROM GameDB.dbo.character WHERE cha_name = 'Angelix')" local Connect, ConnectID = LuaSQL("connect", SQL.GameDB.Host, SQL.GameDB.User, SQL.GameDB.Password) if Connect == SQL_SUCCESS_WITH_INFO then print("Successful connection.") local Success, Query = LuaSQL("query", ConnectID, String) if Success == SQL_SUCCESS_WITH_INFO then print("Successful query.") local Data = LuaSQL("fetch", ConnectID, Query) print("Account Name = "..Data["act_name"]) LuaSQL("freehandle", ConnectID, Query) LuaSQL("close", ConnectID) return end end print("--------------------------------------------------") end GetAccountName() Which for testing purposes resulted this on GS console. Thanks a lot on both of you for the explanations and Vector since I got the query command from him on another thread since I have zero knowledge of SQL, hahah. Forgot to ask, where do u put this function to get a print out in GS console? Quote Share this post Link to post Share on other sites