Jump to content

Raptor6872

Members
  • Posts

    13
  • Joined

  • Last visited

Personal Information

  • Flight Simulators
    DCS, P3D v4, FSX
  • Location
    Midwestern USA
  • Interests
    Flightsim, Strategy Games, Computers...
  • Occupation
    Network Engineer

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. The main goal was to make a "concept" script to pull ucids. Mainly to develop a "admin menu" so I could create different commands that only an authorized user could run. Was going to use the ucid as a "check" mechanism, as I'd only allow certain ucids to run certain commands. Now I've moved in to this by using circibobs SSB script with a combination of Group specific, custom F10 commands. Though it is proving more difficult than I'd thought...
  2. Thanks all for the ideas but I think I've figured out that one cannot simply run NET commands unless it is server side with a dedicated script. I'm doing a sort of workaround by using the SimpleSlotBlocking Mod by Circibob. Then trying to implement specific F10 commands to those blocked off group slots in this other post (https://forums.eagle.ru/topic/258583-lua-f10-menu-script-questions/?tab=comments#comment-4535725). Hopefully this will work out.
  3. Greetings All, I was making a script that will allow specific groups access to given options for the F10 Menu in multiplayer. In this example there are 4 groups, (e.g. XX-DRAGON-1-1-XX, ...) as seen in the code below. When the mission starts, I 'DO SCRIPT FILE' and run the following code to no avail. ------------------------------------------------------------------ -- CustomLUA F10 Menu for Specific Groups -- ------------------------------------------------------------------ ------------------------------------------------------------------ -- https://wiki.hoggitworld.com/view/DCS_func_addCommandForGroup -- https://wiki.hoggitworld.com/view/DCS_func_addSubMenu -- https://wiki.hoggitworld.com/view/DCS_func_addSubMenuForGroup ------------------------------------------------------------------ local function successSound() -- Run when called trigger.action.outSound("1-success.wav") -- Play sound end local function failureSound() trigger.action.outSound("2-failure.wav") end local tbl = {"XX-DRAGON-1-1-XX", "XX-DRAGON-1-2-XX", "XX-DRAGON-1-3-XX", "XX-DRAGON-1-4-XX"} -- List of group names to get menu access for i = 1, #tbl do if Group.getByName(tbl[i]) then local groupId = Group.getByName(tbl[i]):getID local adminM = missionCommands.addSubMenuForGroup(groupId, 'ADMIN MENU') local soundM = missionCommands.addSubMenuForGroup(groupId, 'Play Sounds', adminM) missionCommands.addCommandForGroup(groupId, 'Success', soundM , successSound, tbl[i]) missionCommands.addCommandForGroup(groupId, 'Failure', soundM , failureSound, tbl[i]) end end This code is based off of several links and I'm not quite sure why it does not work. When run in game, after joining the unit of said group, the menu never even shows up... Any ideas?
  4. Hmm, that would make sense as to why this does not work. Is there any way to check a player UCID with a singleton script? Or perhaps a way to call it from a mod like SLMOD?
  5. Greetings and happy new year all, I've been working on a script to detect a players ucid and print to screen in game, simple enough I thought... Doing this only to enable greater functions, gotta start somewhere. Below is a snippet of my code in a main function that is always running in the background -- If Flag # triggered do... if trigger.misc.getUserFlag('3002') == 1 then trigger.action.setUserFlag('3002', false) --trigger.action.outText("Success!", 10) trigger.action.outSound("1-success.wav") txt1 = " Your UCID is..." trigger.action.outText(txt1, 10) -- does not work starting here... id = net.get_player_info(playerID, 'ucid') trigger.action.outText(id, 10) end It will print the "Your UCID is..." part but neve the actual ucid. Feeling I am missing something here? Any feedback or help would be appreciated!
  6. Greetings All, I've been having a hard time learning exactly how to parse the existing SLMOD Stats file to eventually be able to display my server stats online. I've seen many mentions of this on the forums but no way to go about it and I am no LUA expert, though I am willing to try. SLMOD STATS sample LUA Table data... ------------------------------------------------------------------------------------------------ [color="Green"]stats = { ["b3961df7f720c4288522019d0455fa4a"] = { ["times"] = { ["AV8BNA"] = { ["inAir"] = 1441.802, ["weapons"] = { ["AIM-9M"] = { ["numHits"] = 0, ["kills"] = 0, ["shot"] = 1, ["hit"] = 0, }, -- end of ["AIM-9M"] ["kamikaze"] = { ["numHits"] = 0, ["kills"] = 0, ["shot"] = 0, ["hit"] = 0, }, -- end of ["kamikaze"] ["AGM-122"] = { ["numHits"] = 0, ["kills"] = 0, ["shot"] = 1, ["hit"] = 0, }, -- end of ["AGM-122"] }, -- end of ["weapons"] ["actions"] = { ["losses"] = { ["pilotDeath"] = 1, ["crash"] = 1, ["eject"] = 0, }, -- end of ["losses"] }, -- end of ["actions"] ["total"] = 2132.704, }, -- end of ["AV8BNA"] ["FA-18C_hornet"] = { ["total"] = 13412.988, ["kills"] = { ["Planes"] = { ["Fighters"] = 6, ["total"] = 6, }, -- end of ["Planes"] }, -- end of ["kills"] ["inAir"] = 8568.488, ["weapons"] = { ["M-61"] = { ["hit"] = 0, ["kills"] = 0, ["shot"] = 664, ["numHits"] = 48, }, -- end of ["M-61"] ["AGM-88C"] = { ["hit"] = 0, ["kills"] = 0, ["shot"] = 1, ["numHits"] = 0, }, -- end of ["AGM-88C"] ["AIM-120C"] = { ["hit"] = 0, ["kills"] = 4, ["shot"] = 4, ["numHits"] = 4, }, -- end of ["AIM-120C"] ["F/A-18C Lot 20"] = { ["numHits"] = 0, ["kills"] = 0, ["shot"] = 0, ["hit"] = 0, }, -- end of ["F/A-18C Lot 20"] ["AIM-9X"] = { ["hit"] = 0, ["kills"] = 2, ["shot"] = 6, ["numHits"] = 4, }, -- end of ["AIM-9X"] ["AGM-154A"] = { ["hit"] = 0, ["kills"] = 0, ["shot"] = 2, ["numHits"] = 0, }, -- end of ["AGM-154A"] }, -- end of ["weapons"] ["actions"] = { ["losses"] = { ["pilotDeath"] = 4, ["crash"] = 4, ["eject"] = 0, }, -- end of ["losses"] }, -- end of ["actions"] ["pvp"] = { ["kills"] = 6, }, -- end of ["pvp"] }, -- end of ["FA-18C_hornet"] ["F-5E-3"] = { ["inAir"] = 0, ["total"] = 3574.806, }, -- end of ["F-5E-3"] ["Ka-50"] = { ["inAir"] = 0, ["total"] = 3034.86, }, -- end of ["Ka-50"] ["F-15C"] = { ["inAir"] = 700.745, ["actions"] = { ["losses"] = { ["pilotDeath"] = 1, ["crash"] = 1, ["eject"] = 0, }, -- end of ["losses"] }, -- end of ["actions"] ["total"] = 5986.455, }, -- end of ["F-15C"] ["UH-1H"] = { ["inAir"] = 0, ["total"] = 420.383, }, -- end of ["UH-1H"] ["F-14B"] = { ["total"] = 21862.031, ["kills"] = { ["Planes"] = { ["Fighters"] = 4, ["total"] = 4, }, -- end of ["Planes"] }, -- end of ["kills"] ["inAir"] = 11952.818, ["weapons"] = { ["AIM_54A_Mk60"] = { ["hit"] = 0, ["kills"] = 4, ["shot"] = 4, ["numHits"] = 5, }, -- end of ["AIM_54A_Mk60"] }, -- end of ["weapons"] ["actions"] = { ["losses"] = { ["pilotDeath"] = 0, ["crash"] = 3, ["eject"] = 0, }, -- end of ["losses"] }, -- end of ["actions"] ["pvp"] = { ["kills"] = 4, }, -- end of ["pvp"] }, -- end of ["F-14B"] }, -- end of ["times"] ["joinDate"] = 1589674831, ["lastJoin"] = 1591926810, ["id"] = 3, ["names"] = { [1] = "DRAGON 1-2 | DeathTrooper", [2] = "DeathTrooper", }, -- end of ["names"] } -- end of stats[/color] ------------------------------------------------------------------------------------------------ I am seeking advice on how to separate the values in the sample data ( a way to parse LUA Tables to SQL via Python... or any other practical means) and and tie them all to the UUID (Unique user identification) shown as the string "b3961df7f720c4288522019d0455fa4a" above. I'm also very open to other solutions! The Python code I currently use to load all this data is as follows... ------------------------------------------------------------------------------------------------ [color="green"]import mysql.connector # Make connection to DB with below... db = mysql.connector.connect( host="192.168.1.10", user="user", passwd="password", db="database" ) # Declare cursor cursor = db.cursor() # Open file to be read and imported to table in "database" database file = open(r"C:\Users\Username\Desktop\slmodstats.lua", "r", encoding='utf-8') file_content = file.read() file.close() # Debug for me to see what the file content is... print(file_content, "\n") # Send data to table VALUES type LONGTEXT as one long string (proof of concept) # Push all that was read and is now "%s" from prior string and set query... query = "REPLACE INTO data VALUES (%s);" # insert all data from "query" and file content as %s, push to db cursor.execute(query, (file_content,)) # Commit changes and close... db.commit() db.close()[/color] ------------------------------------------------------------------------------------------------ Is there any way to more easily parse the data from the LUA Table file, filter it into categories tied to the UUID, make it end parsing when seeing "-- end of stats", and push to a database for eventual display with PHP on a webpage? Asking a lot, I apologize but I've researched for a while now with little results and know a few members of this community have accomplished this one way or another. For not just myself but many others, a solution would be amazing!!! Think I've got a decent foundation but am stuck on how to proceed?
  7. Thanks a ton! I appreciate the info and for saving me the development time!
  8. Greetings All, I've been working to try and create a LUA script that I can run in order to send data from the game to a Discord "webhook". I do not have a lot of knowledge on the topic but have been trying to learn more. It seems that LUASocket and JSON are all integrated in DCS thankfully, but I am not sure how to exactly make this work. So far I've come up with the following, but it does not work, any ideas? Just a post to provoke thought and ideas since I've not found any decent resources. (e.g. Have a trigger cause a msg. to send to Discord WebHook) ------------------------------------------------------- -- Discord Bot (Hook) Test ------------------------- ------------------------------------------------------- package.path = package.path..";.\\LuaSocket\\?.lua;" package.cpath = package.cpath..";.\\LuaSocket\\?.dll;" local JSON = loadfile("Scripts\\JSON.lua")() local http = require("http") local siteurl = "YourWebHookURL" local payload = "Test" local respback = { } local res, code, response_headers, status = http.request { url = siteurl, method = "POST", headers = { ["Content-Type"] = "application/json", ["Content-Length"] = payload:len() }, source = ltn12.source.string(payload), sink = ltn12.sink.table(respback) } -------------------------------------------------------
  9. It sure would be nice to see a overhaul of the underlying code behind DCS, though this is a major task. Overly graphics optimization is something that has been long needed and if no major changes come in the next few years the problems will just keep piling up. I have hope, but it is stretched thinly.
  10. It would be neat to some some particle effects on the ground in that case, kinda like the jets do when you zip over the water going really fast!
  11. Wish this was fixed, still seems to be quite a problem for server owners. +1 indeed.
  12. Can't wait to see the improved refueling in game, especially once we get of f-18!
  13. Hey all, as one of the many players who hosts a server for DCS, I've been waiting a while for a dedicated server application. It would be nice if ED would give us some news on this as it was apparently "in the works" years ago and has been kept quiet for some time now. Does anyone have any news on this subject/development? Or also wish for a dedicated server?
×
×
  • Create New...