Server Clearance - Script Release


(avery) #41

Few questions.

Is there a way to edit the file? What program do I need to have to do that?
Do those go in the mod folder, or etmain folder?


(Mateos) #42

As it is LUA, you can try Notepad++ or another advanced text editor :slight_smile:


(Crytiqal) #43

May I make a suggestion? Would it be possible to ping a teamspeak server and display a list of active connected people on it?


(phisherman) #44

[QUOTE=Crytiqal;384175]Would it be possible to ping a teamspeak server and display a list of active connected people on it?[/QUOTE]Supposingly yes, if you find a way to store the current online users in a mySQL database and read out this database with lua. But unfortunately I can’t do this for you, I have no experience with mySQL at all.


(Crytiqal) #45

TS3 has a query port where you can retrieve the users etc. I don’t think a mysql db is nessecary to store the users.
I have a php script download on to my website that retrieves the channels and people in them, and it doesn’t store a mysql table

I don’t have any experience in LUA however, so I don’t know what is nessecary for that.

Anyway, keep up the good work :slight_smile:


(phisherman) #46

[QUOTE=Crytiqal;384310]TS3 has a query port where you can retrieve the users etc. I don’t think a mysql db is nessecary to store the users.[/quote]The point is that lua scripts can’t read the info out of the query port. What you need is a middle man, for example a php script that writes the data to a text file every 30secs. Lua could read that text file and forward the information to the player. But as I said, you need some sort of web-based script first, and I can’t help you with that.


(avery) #47

They wouldn’t work on my server. The server is running silent 0.4.0


(Crytiqal) #48

Does silent 0.4.0 support lua scripts?


(gaoesa) #49

Yes. But most probably the scripts need to be modified a bit to work. Looks great work Phishermans Friend.


(phisherman) #50

If the scripts won’t load, search your g_log file for errors like this:

2:49 Lua API: syntax error during pre-compilation: [string "test.lua"]:3: '=' expected near 'et'

I’ll be happy to help you out if you forward me the error message.

I understand if someone is completely new to lua scripts and doesn’t know how to deal with them, but please ensure one thing before you contact me: LUA scripts can and (at least mine) are supposed to be opened!! View them in your favorite text editor and configure them the way you want. Some even NEED configuration, so please make sure to carefully set each variable inside the script according to the description.

//And big thanks to gaoesa [noparse]:)[/noparse]


(Micha) #51

Hi, I get the following error on etpro with the nextmap.lua

etpro: et_ClientCommand error running lua script: [string “nextmap.lua”]:213: attempt to index local `string’ (a string value)

Any idea?

“nextmap” command loads it, for example: nextmap is “vstr m1r1”
Lua output is Nextmap is ERROR if I set nextmap to “map supply”.

map cycle:

set m1r1 “g_gametype 3; map sw_goldrush_te; set nextmap vstr m2r1”
set m2r1 “g_gametype 3; map radar; set nextmap vstr m3r1”
set m3r1 “g_gametype 3; map supply; set nextmap vstr m4r1”
set m4r1 “g_gametype 3; map bremen_b3; set nextmap vstr m5r1”
set m5r1 “g_gametype 3; map karsiah_te2; set nextmap vstr m6r1”
set m6r1 “g_gametype 3; map adlernest; set nextmap vstr m7r1”
set m7r1 “g_gametype 3; map erdenberg_b3; set nextmap vstr m8r1”
set m8r1 “g_gametype 3; map frostbite; set nextmap vstr m1r1”

vstr m1r1


(ailmanki) #52
etpro: et_ClientCommand error running lua script: [string "nextmap.lua"]:213: attempt to index local `string' (a string value)

If I understand the script correctly, the error yields from reading the arena file. So there might be something special in that arena file of supply.
I would have checked, but there are many supply versions - no idea which one you used.

[QUOTE=Micha;474863]“nextmap” command loads it, for example: nextmap is “vstr m1r1”
Lua output is Nextmap is ERROR if I set nextmap to “map supply”.
[/QUOTE]
If you do set the cvar nextmap to ‘map supply’ the script will output ‘ERROR’, it does expect ‘vstr’ as content of cvar nextmap. You can see that on line 155 in function NextMapName().


(Micha) #53

Supply was just an example. I wanted to see what happens. I also tried to use the lua with the standart objectcycle and same error appeared.


(ailmanki) #54

Don’t know either then, would have to debug it. Not using that script - only the advanced voting.


(mortis) #55

I don’t know if it will help, but here is a known good script I used for years on my servers, you’ll need to swap your map names. This one mixes objective and stopwatch game modes, but I know it’s good, I used it for years. See if this trips up the lua… (granted it is for nextcampaign rather than nextmap, but it’s good for comparison purposes)

 

set d1 "set g_gametype 4 ; campaign cmpgn_northafrica ; set nextcampaign vstr d2" 
set d2 "campaign cmpgn_centraleurope ; set nextcampaign vstr d3"
set d3 "set g_gametype 3 ; map supplydepot ; set nextmap vstr d4 ; sets StopwatchRound 1"
set d4 "map_restart 0 ; set nextmap vstr d5 ; sets StopwatchRound 2"
set d5 "set g_gametype 3 ; map sp_delivery ; set nextmap vstr d6 ; sets StopwatchRound 1" 
set d6 "map_restart 0 ; set nextmap vstr d7 ; sets StopwatchRound 2"
set d7 "set g_gametype 4 ; campaign cmpgn_northafrica ; set nextcampaign vstr d8" 
set d8 "set g_gametype 3 ; map et_beach ; set nextmap vstr d9 ; sets StopwatchRound 1"
set d9 "map_restart 0 ; set nextmap vstr e1 ; sets StopwatchRound 2"
set e1 "set g_gametype 3 ; map et_ice ; set nextmap vstr e2 ; sets StopwatchRound 1" 
set e2 "map_restart 0 ; set nextmap vstr d1 ; sets StopwatchRound 2"






// server doesn't recognise the campaign command when the gamecode isn't running yet.
set d_initial "set g_gametype 4 ; map oasis ; set nextcampaign vstr d2"
vstr d_initial



(phisherman) #56

[QUOTE=Micha;474884]Supply was just an example. I wanted to see what happens. I also tried to use the lua with the standart objectcycle and same error appeared.[/QUOTE]Have you tried the default objectivecycle.cfg, without altering any of the maps and it still crashes? I just tested this and it works fine. Does this happen for specific maps only?

Now that I see this thread again, it reminds me that I wanted to upload a fix for the clantag protection lua. It fixes the problems jemstar reported in this thread, I sent him the fix more than a year ago but never uploaded it here.


(Micha) #57

I tried with standart and modified. I changed to gametype 2 now and these cycle:

set d1 "set g_gametype 2 ; map sw_goldrush_te ; shuffle_teams ; set nextmap vstr d2"
set d2 "set g_gametype 2 ; map radar ; shuffle_teams ; set nextmap vstr d3"
set d3 "set g_gametype 2 ; map supply ; shuffle_teams ; set nextmap vstr d4"
set d4 "set g_gametype 2 ; map bremen_b3 ; shuffle_teams ; set nextmap vstr d5"
set d5 "set g_gametype 2 ; map karsiah_te2 ; shuffle_teams ; set nextmap vstr d6"
set d6 "set g_gametype 2 ; map adlernest ; shuffle_teams ; set nextmap vstr d7"
set d7 "set g_gametype 2 ; map erdenberg_b3 ; shuffle_teams ; set nextmap vstr d8"
set d8 "set g_gametype 2 ; map frostbite ; shuffle_teams ; set nextmap vstr d9"
set d9 "set g_gametype 2 ; map sp_delivery_te ; shuffle_teams ; set nextmap vstr d1"
vstr d1

I removed this part out of the nextmap.lua:


	--[[ --removed because etpro doesn't know et.G_shrubbot_permission
	if et.gentity_get( id, "sess.sessionTeam" ) == 3 or et.G_shrubbot_permission( id, "?" ) == 1 then
		return false
	end
	--]]

The rest is original and log shows same error again
etpro: et_RunFrame error running lua script: [string “nextmapetpro.lua”]:215: attempt to index local `string’ (a string value)

it’s about this part:
line 213 function clearSpace(string)
line 214 local output = “”
line 215 local i = string.len(string)


(Mateos) #58

Maybe phiser and you don’t run the same LUA version?


(Micha) #59

I use the one he linked here with the change I posted above. It doesn’t matter which cycle I use. Everytime the same error.


(phisherman) #60

What does “everytime” mean? Does this happen for every map, or only from time to time? Did this script work before? Or have you had these problems right from the start?

That’s a possibility, what lua version do you use with etpro? As I said, I couldn’t reproduce this on NQ, maybe this is caused by differing lua versions.