So is there anything to this sorry im newto this

i get the feeling im using this wrong but ill fix it im going to do my best to explane my problem but my brain is dead from tryping this like 200 lines and losing it when blue screen of death (display post get a little wiggly)

ok i want to do a gui for game servers so lets say heres my CFG

mp_footsteps 1
mp_freezetime 6
mp_friendlyfire 1
mp_hostagepenalty 4
mp_limitteams 2
mp_roundtime 3
mp_tkpunish 0
sv_maxspeed 320
mp_startmoney 800
sv_allowupload 1
sv_voiceenable 1

now i was doing it manul and it took forever but i know there’s a way to automate it even more maybe do it in excel thats what i was going to try but i need to take a break

maxspeed_set = StringVar()
maxspeed_cmd = Label(root, text="maxspeed ")
maxspeed_entry = Entry(root, textvariable=maxspeed_set)

just use the large part of the setting cmd like i did above so i was thinking if u break it down into tiers of var u could use 4 lines of code to do all of them and i m trying to do a good amount of games

this is what i started trying
im new to coding but i was going to do it in excell and just addtext to get it back in one piece

so like 
A1     |  B1    | C1                     | D1 |E1
         |%T1%|_set =_set = StringVar()
         |%T1%|_cmd = Label(root, text="%T1% )
         |%T1%|_entry = Entry(root,
 ..ria  |%T1%|_set)

then just add T2+1 is this possible or how would u go about this i have a bunch of settings to go through and they vary a lot

i hope this make seance sorry im going to try and revive my brain

You should provide more infro about your working environment — What OS are you working on? (I assume Windows, since you mentioned BSD) What languages and tools are you working on? Etc.

I also didn’t quite understand what you’re trying to achieve here — “a gui for game servers” is a bit generic. Is this GUI intended for the server admins (a backend) or for the end users (a fronted)? What technologies are involved? (i.e. is it a browser front-end or is part of some dedicate binary application?)

BSD events on Windows are strong indicators that something is badly wrong — either the OS has become unstable, or you’re doing something really wrong with your code. Operating systems are designed to be able to intercept and handle errors of all sorts in order to prevent the machine from crashing and to provide a detailed error report. When you get frequent BSDs it means your OS is in such a bad state that it can’t handle similar errors and recover from them — this condition is far from ideal as a development environment, and hardly a reliable one. You should fix your OS first of all, to ensure that you’re working in a stable environment.

oh BSD is a display port that gets lose and it it connects / disconnects real quick i get it not reelated to the code im realy just make a list of variables i just cant help but feel theres a far easy way to do it

um sorry i really just wanted to try and get that posted b4 i got off they will be various game servers on some windows 19 servers the guis would be a way to give the user a way to edit configuration files and run bat scrips mainly… the type of configuration files would vary a good amount but all are a CMD quick explanation and and recomended setting then they can enter what they want in

so here i got it in excell and im breaking it up this part is not super important its just so i can easly pull the name from itsself and they wont get mixed up

mp_	forcerespawn		// set to force players to respawn after death
mp_	footsteps		// enable player footstep sounds
sv_	footsteps		
sv_	bounce		//  Bounce multiplier for when physically simulated objects collide with other objects.
mp_	flashlight		// enable flashlight
mp_	autocrosshair		// enable autocrosshair (default is 1)
mp_	allowNPCs		// allow bots
sv_	gravity		// world gravity (default 800)
sv_	friction		// world friction (default 4)
sv_	waterfriction		// world water friction (default 1)
sv_	stopspeed		// Minimum stopping speed when on ground
sv_	noclipaccelerate		// spectator settings

now after i get that all done ill get my python gui code

%VAR%_set = StringVar()
%VAR%_cmd = Label(root, text="%VAR% ")
%VAR%_entry = Entry(root, textvariable=%VAR%_set)

soo ill just do the top one

hostname	 "Counter-Strike:Source Dedicated Server!"	

hostname_set = StringVar()
hostname_cmd = Label(root, text="hostname ")
hostname_entry = Entry(root, textvariable=hostname_set)

i get my var from b colum so all the VAR% need to be hostname

then id need the row # to +1 and just repeat

hostname_set = StringVar()
hostname_cmd = Label(root, text="hostname ")
hostname_entry = Entry(root, textvariable=hostname_set)
forcerespawn_set = StringVar()
forcerespawn	_cmd = Label(root, text="forcerespawn	 ")
forcerespawn	_cmd.grid(row=1,column=0)
forcerespawn	_entry = Entry(root, textvariable=forcerespawn_set)
forcerespawn	_entry.grid(row=1,column=1)

then id take it back to excell and but the pieces back into one cmd and run it as .bat 

a good chunk if what i want to do is here but there more so i just feel theres a way to do it but i dont know a lot yet


i dont think the text shows what im trying to express here a SN

then take my new settings abd back to excell put them back with the SV then run in a bat a big list of them like 60

the more i look at it i feel like i just gota do it 1 at a time but i really think theres a way

wait is step 1 pointless
could i have a

Now the overall context is a bit more clear, but the actual work of the scripts is still rather obscure — you’d really need to publish the actual scripts and configuration files, either in a repository or as a Gist, because without the code it’s all too theoretical.

I’m not sure why you need to interact with Excel, Python and CMD scripts, but if you could store the settings in a format like JSON, YAML or TOML and use just Python to handle them it would be better.

Python is a powerful scripting language which should support all the operations you’re currently doing via batch scripts, thanks to its I/O and System libraries. Also, PowerShell would be a better alternative than using batch files.

If I’ve understood correctly, you’re looking for a way to eliminate redundant code by applying some sort of iteration through the different servers’ settings stored in Excel files. The reason why YAML, TOML and JSON would be better alternatives is because they allow structuring data (whereas Excel serializes data as CSV, which are “flat tables”). If Excel is a requirement for your GUI, you could find a way to serialize from Excel to/from YAML/JSON in some automated way, so you’ll be able to feed your scripts the settings as YAML/JSON data sets.

What you’re trying to achieve is a rather common need, so I’d say that chances are that you’ll probably find some ready-made solution for this task if you do some searching in open source projects. Finding a ready made solution and adapting your project to it would be (IMO) wiser and worth the effort, because you’d be relying on a third party tool which is maintained by the community, and would benefit from updates across time.

I don’t have any specific library or tool to recommend you because this is not my usual field of work (I don’t use Excel), but I’m sure that by using structured data in your scripts and settings files you would end up with cleaner code, and any sort of iterative work would be easier.

to use what i feel express the settins best

Step 1
//add var1%
var1%_set = StringVar()
Step 2
// add cmd
var1%__cmd = Label(root, text="var1% ")
Step 3
//poition cmd
Step 4
//add entry
var1% _entry = Entry(root, textvariable=var1%_set)

ALL var1% = maxspeed then can i strig code on the end like this with no ,

maxspeed_cmd = Label(root, text="maxspeed ")
maxspeed_entry = Entry(root, textvariable=maxspeed_set)

i just want a quick way to lik all settins like this i swear this kid is killin me lol

Forgive me, but the whole thread is really too entangled to follow — the fact that you need to take screenshots and edit them to overlay arrows and commenting text is an indicator that you’ve set up something over-complicated.

Screenshots and partial code snippets are unlikely to contribute to a solution. If it’s an open source project, you should provide a link to the source repository, which would raise the changes of you getting some help here. If it’s a proprietary and commercial software, you’ll need to formulate the problem in crystal clear terms. Also, at this point I’m not sure what you’re expecting in terms of help; you can reasonably expect some advice and general leads, but not that someone will write or fix the code on your behalf (especially if we’re dealing with proprietary and closed source commercial software).

As I mentioned earlier, using structured data (objects) is the most likely solution — the Python root object (which I believe you’re importing from a library) is the way to go, for it provides you with a single object containing structured data and functions attached to it — simply put, writing the script in idiomatic Python should solve the issue by itself.

Why have maxspeed_set, maxspeed_cmd, etc. when you could create a single maxspeed structured object to which you could add all the data as well as the functions you need to manipulate it (including extraction and serialization to other formats) — or maybe have two structured objects, one for the CMD and one for the internal data manipulation.

In most cases, being able to define the problem (the task at hand) in plain English is the best start to being able to translate it into operational code. Maybe you should restate your original problem from scratch, instead of focusing on the current code and trying to fix it.

I strongly advise you to pick a ready made library for handling settings and use that for your project, you’ll end up with a much more powerful tool and spend less time working on this part of the project.

ur trollin me ha u got me

why i dont not use “that” code well i think im to late the game came out in 1999 and i just dont think it would be a great use of time i like workin with a local boy … one day they say he might read but untill then ill be BASHIN my head into a wall

So, basically you’re telling us that you consider it as a waste of on your side, but that’s is worth passing on the task onto others here in the community. I think this speaks lengths about your appreciation of others sharing freely their time with your requests.

That, and your replying to my attempt to help you by posting a video titled “son i do believe ur a moron”, and further on comparing my efforts to “a moth” and labeling diligent coders as “odd people” — as well as assuming I’ve been trolling you.

I think you’re in the wrong community. Unless you’re able to abide by the Code of Conduct of GitHub, and the high standards that fuel this international community, you won’t benefit from it, but just end up wasting other people’s time.

1 Like