Results 1 to 2 of 2
  1. #1
    Made his way buckwild787's Avatar
    Join Date
    Mar 2018
    Replies
    1
    Country
    United States

    Botwar(Bots vs Humans)

    Botwar(Bots vs Humans) on Enemy Territory server

    Omnibot files must be copied to Wolfenstein - Enemy Territory folder(Use latest:omni-bot_0_85_ET).
    Most Server Providers have Omnibot installed.
    You must have in server.cfg:
    set rconpassword "<your password>"
    set omnibot_enable "1"
    The omnibot_path cvar needs to be set to the absolute path of the omni-bot folder.
    If you are unsure of the absolute path, you will need to ask your server provider.
    set omnibot_path "<path to omnibot folder>" //This may be optional(""), Omnibot may find and load.
    For bots to run around on map, The map must have waypoints in Wolfenstein - Enemy Territory\omni-bot\et\nav folder,
    And maxbots set.
    If 10 pubs playing, You would need to set maxbots at 20 because one bot disconnects for each player.
    Wait for bots to start playing, Start botwar...
    Usage:
    In game:/rconpassword <password>
    /rcon bot maxbots 8 //For 8 bots on server.
    Or set maxBots in Wolfenstein - Enemy Territory\omni-bot\et\user folder>omni-bot.cfg
    It is required for maxbots to be set and that no bots be added beyond the maxbots setting.
    Disabling botwar will revert back to the regular server manager behavior.

    Usage:
    bot botwar <botTeam> <humanTeam> <botsPerHuman> (1=Allies 2=Axis).
    /rcon bot botwar 2 1 3 // set bots to be on Allies with a 3 to 1 ratio compared to humans
    /rcon bot botwar 1 2 1 // set bots to be on Axis with a 1 to 1 ratio compared to humans

    Botwar just keeps the bots on one team...Humans will not be moved.
    There must be one player at least on Human team for botwar to start.
    If all Humans on 'Human' team stop playing, Bots disconnect...
    If Human starts playing 'Human' team, Botwar will resume.
    Botwar will persist through next maps...
    /rcon bot botwar -1 //Disables it

    Other botwar commands:
    bot botteam <team>
    bot humanteam <team>
    bot botsperhuman <num> // Changes the ratio of bots

    After You stop botwar, You need to remove bots before You can set maxbots again.
    /rcon bot kickall
    Then set maxbots
    /rcon bot maxbots xx //If desired.

    These bot commands can be added to database or shrubbot:

    Jaymod with enhmod_commands.db:

    [command]
    command = kickall
    desc = No Bots
    exec = bot kickall; bot maxbots 0
    levels = 999

    [command]
    command = addbot
    desc = Adds bot to game. Syntax: !addbot <team> <class> <name>. Don't use whitespaces in <name>.
    exec = bot addbot
    levels = 999

    [command]
    command = kickbot
    desc = Kicks a bot. Syntax: !kickbot <name>.
    exec = bot kickbot
    levels = 999

    [command]
    command = minbots
    desc = Sets minimum count of bots in game(not for botwar).
    exec = bot minbots
    levels =

    [command]
    command = maxbots
    desc = Sets maximum count of bots in game.
    exec = bot maxbots
    levels =

    [command]
    command = botseasy
    desc = Sets bot difficulty to 1
    exec = cp The bots are set to easy ; bot difficulty 1 ; moveskill 1 ;
    levels =

    [command]
    command = botsmed
    desc = Sets bot difficulty to 3
    exec = cp The bots are set to medium ; bot difficulty 3 ; moveskill 2 ;
    levels =

    [command]
    command = botshard
    desc = Sets bot difficulty to 6
    exec = cp The bots are set to hard ; bot difficulty 6 ; moveskill 4 ;
    levels =

    [command]
    command = botwar
    desc = botwar <botTeam> <humanTeam> <botsPerHuman> (1=Allies 2=Axis Usage: !botwar 1 2 3)
    exec = bot botwar
    levels =

    [command]
    command = botwaroff
    desc = botwaroff turns botwar off
    exec = bot botwar -1
    levels =


    Nitmod commands.db:

    **********

    name = minbots
    exec = bot minbots [1]
    desc = Sets the minimum number of bots on the server
    levels =

    **********

    name = maxbots
    exec = bot maxbots [1]
    desc = Sets the maximum number of bots on the server
    levels =

    **********

    name = kickall
    exec = bot kickall; bot maxbots 0
    desc = No Bots
    levels =

    **********

    name = addbot
    exec = bot addbot [1] [2] [3]
    desc = Adds bot to game. Syntax: !addbot <team> <class> <name>. Don't use whitespaces in <name>.
    levels =

    **********

    name = kickbot
    exec = bot kickbot [1]
    desc = Kicks a bot. Syntax: !kickbot <name>.
    levels =

    **********

    name = botseasy
    exec = cp The bots are set to easy ; bot difficulty 1 ; moveskill 1 ;
    desc = Sets bot difficulty to 1
    levels =

    **********

    name = botsmed
    exec = cp The bots are set to medium ; bot difficulty 3 ; moveskill 2 ;
    desc = Sets bot difficulty to 3
    levels =

    **********

    name = botshard
    exec = cp The bots are set to hard ; bot difficulty 6 ; moveskill 4 ;
    desc = Sets bot difficulty to 6
    levels =

    **********

    name = botwar
    exec = bot botwar [1] [2] [3]
    desc = botwar <botTeam> <humanTeam> <botsPerHuman> (1=Allies 2=Axis Usage: !botwar 1 2 3)
    levels =

    **********

    name = botwaroff
    exec = bot botwar -1
    desc = botwaroff turns botwar off
    levels =


    Silent with shrubbot.cfg

    [command]
    command = addbot
    exec = bot addbot [1] [2] [3]
    desc = Adds bot to game. Syntax: !addbot <team> <class> <name>. Don't use whitespaces in <name>.
    syntax =
    levels =

    [command]
    command = kickbot
    exec = bot kickbot [1] [2] [3]
    desc = Kicks a bot. Syntax: !kickbot <name>.
    syntax =
    levels =

    [command]
    command = minbots
    exec = bot minbots [1]
    desc = Sets minimum count of bots in game.
    syntax =
    levels =

    [command]
    command = maxbots
    exec = bot maxbots [1]
    desc = Sets maximum count of bots in game.
    syntax =
    levels =

    [command]
    command = kickall
    exec = bot minbots 0; bot maxbots 0; bot kickall
    desc = Cleans server of bots.
    syntax =
    levels =

    [command]
    command = botseasy
    exec = cp The bots are set to easy ; bot difficulty 1 ; moveskill 1 ;
    desc = Sets bot difficulty to 1
    syntax =
    levels =

    [command]
    command = botsmed
    exec = cp The bots are set to medium ; bot difficulty 3 ; moveskill 2 ;
    desc = Sets bot difficulty to 3
    syntax =
    levels =

    [command]
    command = botshard
    exec = cp The bots are set to hard ; bot difficulty 6 ; moveskill 4 ;
    desc = Sets bot difficulty to 6
    syntax =
    levels =

    [command]
    command = botwar
    exec = bot botwar [1] [2] [3]
    desc = botwar <botTeam> <humanTeam> <botsPerHuman> (1=Allies 2=Axis Usage: !botwar 1 2 3)
    syntax =
    levels =

    [command]
    command = botwaroff
    exec = bot botwar -1
    desc = Turns botwar off
    syntax =
    levels =


    Shrubbot: This works in NQ, ETPUB

    [command]
    command = addbot
    exec = bot addbot [1] [2] [3]
    desc = Adds bot to game. Syntax: !addbot <team> <class> <name>. Don't use whitespaces in <name>.
    levels =

    [command]
    command = kickbot
    exec = bot kickbot [1] [2] [3]
    desc = Kicks a bot. Syntax: !kickbot <name>.
    levels =

    [command]
    command = minbots
    exec = bot minbots [1]
    desc = Sets minimum count of bots in game.
    levels =

    [command]
    command = maxbots
    exec = bot maxbots [1]
    desc = Sets maximum count of bots in game.
    levels =

    [command]
    command = kickall
    exec = bot minbots 0; bot maxbots 0; bot kickall
    desc = Cleans server of bots.
    levels =

    [command]
    command = botseasy
    exec = cp The bots are set to easy ; bot difficulty 1 ; moveskill 1 ;
    desc = Sets bot difficulty to 1
    levels =

    [command]
    command = botsmed
    exec = cp The bots are set to medium ; bot difficulty 3 ; moveskill 2 ;
    desc = Sets bot difficulty to 3
    levels =

    [command]
    command = botshard
    exec = cp The bots are set to hard ; bot difficulty 6 ; moveskill 4 ;
    desc = Sets bot difficulty to 6
    levels =

    [command]
    command = botwar
    exec = bot botwar [1] [2] [3]
    desc = botwar <botTeam> <humanTeam> <botsPerHuman> (1=Allies 2=Axis Usage: !botwar 1 2 3)
    levels =

    [command]
    command = botwaroff
    exec = bot botwar -1
    desc = Turns botwar off
    levels =


  2. #2
    See me, I'm great! mazak's Avatar
    Join Date
    Jun 2013
    Replies
    37
    Country
    Poland
    Clan
    [VODKA]
    Good job!
    I will give you a guide on how to do it in a vote.

    Mod n!tmod 2.3*

    We add a button to the ingame_vote_misc command:

    Code:
    BUTTONEXT( 75, 338, .5*(WINDOW_WIDTH-18), 14, "OMNIBOT SKILL SETTINGS", .24, 11, close ingame_vote_misc ; open omnibot_skill )
    Then add a line to menus.txt
    Code:
    loadMenu { "ui/omnibot_skill.menu" }
    Then create a menu script:

    omnibot_skill.menu
    Code:
    #include "ui/menudef.h"
    #define WINDOW_X		16
    #define WINDOW_Y		16
    #define WINDOW_WIDTH	296
    #define WINDOW_HEIGHT	210
    #define GROUP_NAME		"omnibot_skill"
    #include "ui/menumacros.h"
    
    menuDef {
    	name		"omnibot_skill"
    	visible		0
    	fullscreen	0
    	rect		WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
    	style		WINDOW_STYLE_FILLED
    
    	onOpen {
    		copyCvar g_gametype ui_voteGameType ;
    		conditionalScript ui_voteGameType 3	// 3: cvartest
    			( "setcvar ui_voteGameType 2" )
    			( "clearFocus" ) "4" ;
    	}
    
    	onEsc {
    		close omnibot_skill ;
    		open ingame_vote
    	}
    
    // Animated menu by mAzak
    // Polska vodka n!tmod
    // (C) 2017-2018
    
    //	itemDef {
    //		name		"Tlo"
    //		group		GROUP_NAME
    //		rect		0 0 296 210
    //		background	"ui/assets/bord.tga"
    //		style		WINDOW_STYLE_SHADER
    //		visible		1
    //		decoration
    //	}
    
    
    
    
    //itemDef {
    //		name		"glosowanie"
    //		rect		87 0 120 35
    //		style		WINDOW_STYLE_SHADER
    //		background	"menu/glosowanie.tga"
    //		forecolor	1 1 1 1
    //		visible		1
    //		decoration
    //		}
    //
    
    
    // DESCRIPTION OMNIBOT SETTING
    
    		BUTTONEXT( 6, 32, WINDOW_WIDTH-12, -1, "^qUSTAWIENIA SKILLA OMNIBOTOW^P:", .24, 11,  )
    		BUTTONEXT( 6, 44, WINDOW_WIDTH-12, -1, "^XDzieki ponizszym ustawieniom botow mozemy regulowac", .24, 11,  )
    		BUTTONEXT( 6, 56, WINDOW_WIDTH-12, -1, "^Xich poziom umiejetjetnosci za pomoca ponizszych guzikow", .24, 11,  )
    		BUTTONEXT( 6, 68, WINDOW_WIDTH-12, -1, "^XWybierz jedno z ponizszych ustawien aby zaglosowac", .24, 11,  )
    		
    		BUTTONEXT( 75, 86, .5*(WINDOW_WIDTH-18), 14, "LEVEL EASY", .24, 11, exec "cmd callvote easy"; exec "exec muza_stop.cfg"; exec "exec vote.cfg"; uiScript closeingame )
    		BUTTONEXT( 75, 104, .5*(WINDOW_WIDTH-18), 14, "LEVEL MEDIUM", .24, 11, exec "cmd callvote medium"; exec "exec muza_stop.cfg"; exec "exec vote.cfg"; uiScript closeingame )
    		BUTTONEXT( 75, 122, .5*(WINDOW_WIDTH-18), 14, "LEVEL HARD", .24, 11, exec "cmd callvote hard"; exec "exec muza_stop.cfg"; exec "exec vote.cfg"; uiScript closeingame )
    		BUTTONEXT( 75, 140, .5*(WINDOW_WIDTH-18), 14, "RANDOM", .24, 11, exec "cmd callvote random"; exec "exec muza_stop.cfg"; exec "exec vote.cfg"; uiScript closeingame )
    
    		BUTTONEXT( 6, 158, WINDOW_WIDTH-12, -1, "^sUwaga^q! ^sGlosowanie jest wazne jedna mape", .24, 11,  )
    
    
    
    	
    
    	BUTTON( 6, WINDOW_HEIGHT-24, WINDOW_WIDTH-12, 18, "BACK", .3, 14, close omnibot_skill ; open ingame_vote_misc )
    }
    We go to vote.db:

    vote.db
    Code:
    **********
    name = easy
    message = ^sSet the botow level to EASY?
    help = Vote for the level of bots EASY
    exec = bot difficulty 2; bot moveskill 2
    passtext = ^SOMNIBOT EASY
    levels = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
    
    **********
    name = medium
    message = ^sSet the botow level on a MEDIUM?
    help = Vote for the level of bots MEDIUM
    exec = bot difficulty 3; bot moveskill 3
    passtext = ^SP^SOMNIBOT MEDIUM
    levels = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
    
    **********
    name = hard
    message = ^sSet the botow level on a HARD?
    help = Vote for the level of bots HARD
    exec = bot difficulty 6; bot moveskill 4
    passtext = ^S^SOMNIBOT HARD
    levels = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
    
    **********
    name = random
    message = ^sSet the botow level on a RANDOM?
    help = Vote for the level of bots RANDOM
    exec = bot difficulty 6; bot moveskill 3
    passtext = ^S^SOMNIBOT RANDOM
    levels = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
    Finished.

    Other mod: silEnT 0.8.2, ETPub, NQ

    lua scripts:
    customvote.lua
    Code:
    		vote_allow_omnibot_easy		= 1		
    		vote_allow_omnibot_medium	= 1
    		vote_allow_omnibot_hard		= 1
    		vote_allow_omnibot_random	= 1		
    			
    			
    
    description = "Custom omnibots"
    
    
    function et_InitGame( levelTime, randomSeed, restart)
             local modname = string.format("%s", description)
    
        	et.G_Print(string.format("%s loaded\n", modname))
       	et.RegisterModname( modname)
    	
    	sv_maxclients = et.trap_Cvar_Get("sv_maxclients")
    		num0 = math.floor(sv_maxclients * 0.25)
    		num1 = math.floor(sv_maxclients * 0.5) 
    
    	if vote_allow_omnibot_easy == 1 then
    		et.trap_SendConsoleCommand( et.EXEC_APPEND, "sv_cvar vote_allow_omnibot_easy EQ 1;")
    	else et.trap_SendConsoleCommand( et.EXEC_APPEND, "sv_cvar vote_allow_omnibot_easy 0;")
    	end
    	
    	if vote_allow_omnibot_medium == 1 then
    		et.trap_SendConsoleCommand( et.EXEC_APPEND, "sv_cvar vote_omnibot_medium EQ 1;")
    	else et.trap_SendConsoleCommand( et.EXEC_APPEND, "sv_cvar vote_allow_omnibot_medium EQ 0;")
    	end
    
    	if vote_allow_omnibot_hard == 1 then
    		et.trap_SendConsoleCommand( et.EXEC_APPEND, "sv_cvar vote_omnibot_hard EQ 1;")
    	else et.trap_SendConsoleCommand( et.EXEC_APPEND, "sv_cvar vote_allow_omnibot_hard EQ 0;")
    	end
    
    	if vote_allow_omnibot_random == 1 then
    		et.trap_SendConsoleCommand( et.EXEC_APPEND, "sv_cvar vote_allow_omnibot_random EQ 1;")
    	else et.trap_SendConsoleCommand( et.EXEC_APPEND, "sv_cvar vote_allow_omnibot_random EQ 0;")
    	end
    end
    
    
    function et_ClientCommand( clientNum, command)
    	command = command:lower()
    
    	if et.trap_Argv(0) == "votes" then
    
    		et.trap_SendServerCommand( clientNum, "print \"\n")
    		et.trap_SendServerCommand( clientNum, "print \"^7Custom ^3callvote ^7commands are:\n")
    		et.trap_SendServerCommand( clientNum, "print \"^3-----------------------------\n")
    
    	if vote_allow_omnibot_easy == 1 then
    		et.trap_SendServerCommand( clientNum, "print \"^5Vote for the level of bots EASY\n")
           	end
    	
    	if vote_allow_omnibot_medium == 1 then
    		et.trap_SendServerCommand( clientNum, "print \"^5Vote for the level of bots MEDIUM\n")
            	end
    
    	if vote_allow_omnibot_hard == 1 then
    		et.trap_SendServerCommand( clientNum, "print \"^5Vote for the level of bots HARD\n")
    	end
    
    	if vote_allow_omnibot_random == 1 then
    		et.trap_SendServerCommand( clientNum, "print \"^5Vote for the level of bots RANDOM\n")
            	end
    
    
    		et.trap_SendServerCommand( clientNum, "print \"\n")
    		et.trap_SendServerCommand( clientNum, "print \"^7Usage: ^3\\callvote poll <command>\n")
            		et.trap_SendServerCommand( clientNum, "print \"\n")
    
    		return 1
    	end
    end
    
    
    function et_Print( text)
    	
    	if string.sub(text,1,19) == "Vote Passed: [poll]" then
    
    		if string.format(text) == "Vote Passed: [poll] easy\n" then
    			if vote_allow_omnibot_easy == 1 then
    				et.trap_SendConsoleCommand( et.EXEC_APPEND, "bot difficulty 2; bot moveskill 2")
    		end
    		return	
    
    		elseif string.format(text) == "Vote Passed: [poll] medium\n" then
    			if vote_allow_omnibot_medium == 1 then
    				et.trap_Cvar_Set( bot difficulty 3; bot moveskill 3)
    		end
    		return
    
    		elseif string.format(text) == "Vote Passed: [poll] hard\n" then
    			if vote_allow_omnibot_hard == 1 then
    				et.trap_Cvar_Set( "bot difficulty 6; bot moveskill 4)
    		end
    		return	
    
    		elseif string.format(text) == "Vote Passed: [poll] random\n" then
    			if vote_allow_random == 1 then
    				et.trap_SendConsoleCommand( et.EXEC_APPEND, "bot difficulty 6; bot moveskill 3")
    		end
    		return
    
    		end
           	 end
    end
    Add to mod.cfg
    Code:
    set lua_modules  "customvote.lua"
    Then add a line to menus.txt
    Code:
    loadMenu { "ui/omnibot_skill.menu" }
    We create a menu script:
    omnibot_skill.menu
    Code:
    #include "ui/menudef.h"
    
    // Defines //
    
    #define WINDOW_X 16
    #define WINDOW_Y 16
    //#define WINDOW_WIDTH	128
    #define WINDOW_WIDTH	252
    #define WINDOW_HEIGHT	200
    #define GROUP_NAME "grpCustomMain"
    
    // Macros //
    
    #include "ui/menumacros.h"
    
    // Misc Vote Menu //
    
    menuDef {
    name "omnibot_skill"
    visible 0
    fullscreen	0
    rect WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
    style WINDOW_STYLE_FILLED
    
    onOpen {
    
    conditionalScript vote_allow_omnibot_easy 0 
    ( "show bttn_easy" )	
    ( "hide bttn_easy" ) 
    
    conditionalScript vote_allow_omnibot_medium 0 
    ( "show bttn_medium" )	
    ( "hide bttn_medium" ) 
    
    conditionalScript vote_allow_omnibot_hard 0 
    ( "show bttn_hard" )	
    ( "hide bttn_hard" ) 
    
    conditionalScript vote_allow_omnibot_random 0 
    ( "show bttn_random" )	
    ( "hide bttn_random" ) 
    
    
    }
    
    onEsc {
    close omnibot_skill ;
    open ingame_main ;
    open custom_main
    }
    
    // Window //
    
    WINDOW( "^xVOTE", 50)
    
    // Buttons //
    
    // left side
    
    NAMEDBUTTON( "bttn_easy", 6, 50, .5*(WINDOW_WIDTH-18), 14, "^SBOTS EASY", .24, 11, exec "callvote poll easy"; uiScript closeingame )
    
    NAMEDBUTTON( "bttn_hard", 6, 32, .5*(WINDOW_WIDTH-18), 14, "^SBOTS HARD", .24, 11, exec "callvote poll hard"; uiScript closeingame )
    
    
    
    
    // right side
    
    NAMEDBUTTON( "bttn_medium", 6+.5*(WINDOW_WIDTH-18)+6, 50, .5*(WINDOW_WIDTH-18), 14, "^SBOTS MEDIUM", .24, 11, exec "callvote poll medium"; uiScript closeingame )
    
    NAMEDBUTTON( "bttn_random", 6+.5*(WINDOW_WIDTH-18)+6, 32, .5*(WINDOW_WIDTH-18), 14, "^SBOTS RANDOM", .24, 11, exec "callvote poll random"; uiScript closeingame )
    
    
    
    BUTTON( 6, WINDOW_HEIGHT-24, WINDOW_WIDTH-12, 18, "BACK", .3, 14, close omnibot_skill ; open ingame_main ; open custom_main )
    }
    Silent 0.9.0:

    We create a menu script:
    custom_main.menu
    Code:
    #include "ui/menudef.h"
    
    // Defines //
    
    #define WINDOW_X 16
    #define WINDOW_Y 214 // 16
    //#define WINDOW_WIDTH 150
    #define WINDOW_WIDTH 160
    //#define WINDOW_HEIGHT 196
    #define WINDOW_HEIGHT 175 // 248
    #define GROUP_NAME "grpCustomMain"
    
    // Macros //
    
    #include "ui/menumacros.h"
    
    // Main Menu //
    
    menuDef {
    name "Custom_Main"
    visible 0
    fullscreen 0
    rect WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
    style WINDOW_STYLE_FILLED
    
    
    onOpen {
    //ydnar
    conditionalscript ROldModeCheck 2
    ( "clearFocus ; open vid_confirm ")
    ( "clearFocus" )
    
    
    }
    
    onEsc {
    close ingame_main ;
    close custom_main 
    
    }
    
    
    // Window //
    
    WINDOW( "^WMAIN II", 50)
    
    // Buttons //
    
    
    BUTTON( 6, 32, WINDOW_WIDTH-12, 18, "CUSTOM VOTE", .3, 14, close custom_main ; open omnibot_skill  )
    
    
    }
    Then add a line to menus_server_custom.txt
    Code:
    {
    	loadMenu { "ui/custom_main.menu" } 
    	loadMenu { "ui/omnibot_skill.menu" }
    }
    Add to silent.cfg
    Code:
    set lua_modules  "customvote.lua"
    Last edited by mazak; 12-03-2018 at 08:50.


Posting Permissions