|
|
| (6 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| | __NOTOC__ |
| <table witdh=100% height=100> | | <table witdh=100% height=100> |
| <tr> | | <tr> |
| <td width=400 align=center valign=center> | | <td> |
| http://www.dinotopia.com/hadro.jpg | | http://static.shiven.net/hadro/hadro.jpg |
| </td> | | </td> |
| <td width=100% align=left valign=center> | | <td width=83% align=left valign=center> |
| == Profile == | | == Lua Scripts == |
| * '''ET Server'''
| | === [http://static.shiven.net/hadro/old-skbot.lua anti spawnkill bot] === |
| ** ''[http://www.shiven.net www.shiven.net]''
| | An old script which was once used to enforce [http://shiven.net shiven.net] spawnkilling rules. Its an example of how gameplay can be changed enormously with Lua. It is however trailored to the Fueldump map. Player positions are constantly checked against conditions. Coordinates for the no-spawnkilling boxes can be read in-game with \viewpos. But more complex 3D shapes may require decompiling the map's .bsp file (with [http://en.wikibooks.org/wiki/Q3Map2 Q3Map2]) and the [http://www.qeradiant.com/cgi-bin/trac.cgi GtkRadiant] map editor. |
| * '''E-mail'''
| |
| ** ''adr7777@hotmail.com''
| |
| </td> | | </td> |
| </tr> | | </tr> |
| </table> | | </table> |
|
| |
|
| ==Anti Spawn Kill Bot== | | === [http://static.shiven.net/hadro/inacmod.lua player inactivity modification] === |
| | In addition to g_inactivity and g_spectatorinactivity, this mod offers the ability to put a player to spectator after being AFK a certain time. It can be configured to only drop spectators when the server has reached a certain population limit. Players on private slots can be protected against the drop. |
|
| |
|
| This bot enforces Shiven spawnkilling rules. It can detect a spawn switch and gives the withdrawing | | === [http://static.shiven.net/hadro/minipb.lua minipb extension] === |
| team time to clear the area. To see it operational /connect shiven.net
| | This offers server side protections like spam protection of other Lua mod's et_ClientCommand() function. Optionally block client commands \readyteam and the broken \guids. It can put a forced delay between vote-casts per player. Muted player are blocked from private messages and votes. Duplicate name checking and some other useful [http://www.evenbalance.com/publications/et-ad/index.htm Punkbuster] functions are present. |
|
| |
|
| Players are punished by removing health. Lua doesnt support this (yet):<br>
| | === [http://static.shiven.net/hadro/spammod.lua spam modification] === |
| et.trap_SendServerCommand(cno, "kill") -- this would show corpses
| | Inspired by the oh so addictive ETAdmin_mod !spam, this mod will read a simple file like [http://static.shiven.net/hadro/spam.luadat spam.luadat] and allow everyone to spam. It is recommended to load this mod after the minipb extension. But don't take my word for it ;) |
|
| |
|
| Allies can go through axis spawn in the first map part.. but only while holding a knife.
| | === [http://static.shiven.net/hadro/ifskrest.lua infight selfkill restrictor] === |
| This is the best i could do to avoid spawncamping. Unfortunately, Lua's function
| | Inspired by McSteve's infight selfkill announcer, this one simply disables \kill for a period of time after taking damage. By default it will block for two seconds. |
| et_ClientCommand(cno, cmd) was not triggered when a client issues "+attack" command.
| |
| So making a no-fire zone had to be done this way.
| |
|
| |
|
| It currently only supports the Fuel Dump map. But adding more maps should not be hard.
| |
| A useful tool for determining box/sphere coordinates is the Radiant map editor.
| |
| Decompile the maps .bsp first using q3map2.
| |
|
| |
| skbot.lua code:
| |
| <pre><nowiki>
| |
| -----------------------------------------------------------------------------------------------------
| |
| -- Lua Guardian
| |
| -- Anti Spawn Kill Bot
| |
| -- created by Hadro
| |
| -- contact adr7777@hotmail.com
| |
| -----------------------------------------------------------------------------------------------------
| |
| -- many thanks to the regulars from 'shiven.net ** 24/7 action'
| |
| -- for putting up with my genocidal beta tests =)
| |
| -----------------------------------------------------------------------------------------------------
| |
| -- origin[1] < ppos[1] and ppos[1] < endpt[1] and origin[2] < ppos[2] and ppos[2] < endpt[2] and origin[3] < ppos[3] and ppos[3] < endpt[3]
| |
| -- checks if a player is in a box with lowest coordinates origin[1,2,3] and highest coordinates endpt[1,2,3]
| |
| --
| |
| -- (ppos[1] - origin[1])^2 + (ppos[2] - origin[2])^2 + (ppos[3] - origin[3])^2 < radius^2
| |
| -- checks if a player is in a sphere with center origin[1,2,3] and radius
| |
| -- spheres are not used for the fueldump map
| |
| -----------------------------------------------------------------------------------------------------
| |
| version = "1.0"
| |
| samplerate = 500 -- bot will check player positions every x milliseconds
| |
|
| |
| function et_RunFrame(levelTime)
| |
| if math.mod(levelTime, samplerate) ~= 0 then return end
| |
| if mapname ~= "fueldump" then return end
| |
|
| |
| for cno=0, num_cl-1, 1 do
| |
| phealth = et.gentity_get(cno, "health")
| |
| if phealth > 0 then
| |
| msg = nil
| |
| ppos = et.gentity_get(cno,"r.currentOrigin")
| |
| teamnum = et.gentity_get(cno, "sess.sessionTeam")
| |
|
| |
| if teamnum == 1 then -- if you are Axis:
| |
| if fdspawnswitch == nil then
| |
| -- allied spawn hut
| |
| origin = { -2864, -9376, 64 }
| |
| endpt = { 496, -6192, 1152 }
| |
| if origin[1] < ppos[1] and ppos[1] < endpt[1] and origin[2] < ppos[2] and ppos[2] < endpt[2] and origin[3] < ppos[3] and ppos[3] < endpt[3] then
| |
| msg = "^7%s ^3was ^)wiped out ^3for getting too close to allied spawn"
| |
| end
| |
| elseif spawnfullyswitched == 1 then -- if spawn as switched and delay has passed:
| |
| -- balcony lookout
| |
| origin = { -4968, -2066, 792 }
| |
| endpt = { -4454, -808, 1024 }
| |
| if origin[1] < ppos[1] and ppos[1] < endpt[1] and origin[2] < ppos[2] and ppos[2] < endpt[2] and origin[3] < ppos[3] and ppos[3] < endpt[3] then
| |
| msg = "^7%s ^3was ^)crushed ^3for entering allied spawn"
| |
| end
| |
| -- office & balcony over main door
| |
| origin = { -5752, -3080, 488 }
| |
| endpt = { -5192, -1568, 1024 }
| |
| if origin[1] < ppos[1] and ppos[1] < endpt[1] and origin[2] < ppos[2] and ppos[2] < endpt[2] and origin[3] < ppos[3] and ppos[3] < endpt[3] then
| |
| msg = "^7%s ^3was ^)crushed ^3for entering allied spawn"
| |
| end
| |
| --lower office
| |
| origin = { -5720, -2064, 344 }
| |
| endpt = { -4848, -1272, 1024 }
| |
| if origin[1] < ppos[1] and ppos[1] < endpt[1] and origin[2] < ppos[2] and ppos[2] < endpt[2] and origin[3] < ppos[3] and ppos[3] < endpt[3] then
| |
| msg = "^7%s ^3was ^)crushed ^3for entering allied spawn"
| |
| end
| |
| end
| |
| end -- if axis
| |
|
| |
| if teamnum == 2 then -- if you are Allies:
| |
| if fdspawnswitch == nil then
| |
| -- dont trickjump over axis facade roof in first map part
| |
| origin = { -9272, -5328, 608 }
| |
| endpt = { -8576, -5028, 792 }
| |
| if origin[1] < ppos[1] and ppos[1] < endpt[1] and origin[2] < ppos[2] and ppos[2] < endpt[2] and origin[3] < ppos[3] and ppos[3] < endpt[3] then
| |
| msg = "^3Please don't do that LAME trickjump now, ^7%s"
| |
| end
| |
| -- knife only in axis spawn region
| |
| if et.gentity_get(cno, "s.weapon") ~= 1 then
| |
| -- balcony lookout
| |
| origin = { -4968, -2066, 792 }
| |
| endpt = { -4454, -808, 1024 }
| |
| if origin[1] < ppos[1] and ppos[1] < endpt[1] and origin[2] < ppos[2] and ppos[2] < endpt[2] and origin[3] < ppos[3] and ppos[3] < endpt[3] then
| |
| msg = "^7%s^3, you can ONLY pass through axis spawn holding a ^7KNIFE"
| |
| end
| |
| -- office & balcony over main door
| |
| origin = { -5752, -3080, 488 }
| |
| endpt = { -5192, -1568, 1024 }
| |
| if origin[1] < ppos[1] and ppos[1] < endpt[1] and origin[2] < ppos[2] and ppos[2] < endpt[2] and origin[3] < ppos[3] and ppos[3] < endpt[3] then
| |
| msg = "^7%s^3, you can ONLY pass through axis spawn holding a ^7KNIFE"
| |
| end
| |
| -- lower office
| |
| origin = { -5720, -2064, 344 }
| |
| endpt = { -4848, -1272, 1024 }
| |
| if origin[1] < ppos[1] and ppos[1] < endpt[1] and origin[2] < ppos[2] and ppos[2] < endpt[2] and origin[3] < ppos[3] and ppos[3] < endpt[3] then
| |
| msg = "^7%s^3, you can ONLY pass through axis spawn holding a ^7KNIFE"
| |
| end
| |
| end
| |
| else -- if spawn switched
| |
| -- axis facade
| |
| origin = { -9424, -5600, 440 }
| |
| endpt = { -8928, -5160, 600 }
| |
| if origin[1] < ppos[1] and ppos[1] < endpt[1] and origin[2] < ppos[2] and ppos[2] < endpt[2] and origin[3] < ppos[3] and ppos[3] < endpt[3] then
| |
| msg = "^7%s ^3was ^5spanked ^3for entering axis upper spawn"
| |
| end
| |
| -- axis rear spawn exit
| |
| origin = { -9240, -7448, 208 }
| |
| endpt = { -8728, -7184, 352 }
| |
| if origin[1] < ppos[1] and ppos[1] < endpt[1] and origin[2] < ppos[2] and ppos[2] < endpt[2] and origin[3] < ppos[3] and ppos[3] < endpt[3] then
| |
| msg = "^7%s ^3was ^)annihilated ^3for entering axis rear spawn"
| |
| end
| |
| end
| |
| end -- if allies
| |
| if msg ~= nil then
| |
| et.gentity_set(cno, "health", -511)
| |
| msg = string.format(msg, et.Info_ValueForKey(et.trap_GetUserinfo(cno), "name"))
| |
| msg = string.format("qsay %s\n", msg)
| |
| et.trap_SendConsoleCommand(et.EXEC_APPEND, msg)
| |
| et.trap_SendServerCommand(cno, "cp \"^1!! DO NOT SPAWNKILL !!\"\n" )
| |
| end
| |
| end -- if health > 0
| |
| end -- for loop
| |
|
| |
| if fdspawnswitch == 1 and spawnfullyswitched == nil then
| |
| if switchcounter == switchtime then
| |
| spawnfullyswitched = 1
| |
| else
| |
| if switchcounter == 0 then
| |
| et.trap_SendServerCommand(-1, "cpm \"^6Lua^7: allied spawn will be protected in 45 seconds\"\n")
| |
| end
| |
| if switchcounter == switchtime - 1 then
| |
| et.trap_SendServerCommand(-1, "cpm \"^6Lua^7: allied spawn is now protected\"\n")
| |
| end
| |
| switchcounter = switchcounter + 1
| |
| end
| |
| end
| |
|
| |
| end
| |
|
| |
| function et_InitGame(levelTime, randomSeed, restart)
| |
| num_cl = et.trap_Cvar_Get("sv_maxclients")
| |
| mapname = et.trap_Cvar_Get("mapname")
| |
| origin = {}
| |
| endpt = {}
| |
| switchcounter = 0
| |
| switchtime = 45 / samplerate * 1000 -- 45 seconds to spawn protection switch
| |
| end
| |
|
| |
| function et_ClientCommand(cno, cmd)
| |
| if cmd ~= "say" then return 0 end
| |
| if string.lower(et.ConcatArgs(1)) ~= "!luatest" then return 0 end
| |
| et.trap_SendConsoleCommand(et.EXEC_APPEND, "qsay \"^3test for ^6Lua ^7Guardian - Anti Spawn Kill Bot\"\n")
| |
| if mapname == "fueldump" then
| |
| tosend = string.format("qsay \"^3>version ^7%s ^3sampling at ^7%d ^3milliseconds\"\n", version, samplerate)
| |
| et.trap_SendConsoleCommand(et.EXEC_APPEND, tosend)
| |
| else
| |
| tosend = string.format("qsay \"^3>version ^7%s ^3no parameters set for ^7%s ^3map\"\n", version, mapname)
| |
| et.trap_SendConsoleCommand(et.EXEC_APPEND, tosend)
| |
| end
| |
| return 0
| |
| end
| |
|
| |
| function et_Print(text)
| |
| if text ~= "Setting Axis autospawn to Axis Fuel Dump\n" then return end
| |
| fdspawnswitch = 1
| |
| end
| |
|
| |
| </nowiki></pre>
| |
|
| |
| Note: typing !luatest in main chat will give the current status of the mod. Any possible future
| |
| mods will support this.
| |
|
| |
| ----
| |
|
| |
|
| [[Category:ETPro:Mods]] | | [[Category:ETPro:Mods]] |