def load(): public = es.ServerVar('hu_qs', info.version, info.name) public.makepublic() quake_sounds_players = {} for userid in es.getUseridList(): quake_sounds_players[userid] = {'kills':0,'multikills':0,'headshot':False,'headshots':0} quake_sounds_setting.clearoption() quake_sounds_kv.load(es.getAddonPath('quake_sounds')+'/quake_sounds.txt') for keyname in quake_sounds_kv['styles']: quake_sounds_setting.addoption(str(keyname), str(quake_sounds_kv['styles'][str(keyname)])) quake_sounds_setting.addoption('off', 'Off') quake_sounds_setting.setdefault(str(quake_sounds_default)) quake_sounds_setting.addsound('ui/buttonclick.wav') es.regsaycmd('!quake', 'quake_sounds/saycmd', 'Quake Sounds Style') es.addons.registerForEvent(quake_sounds_module, 'player_changename', _check_event) es.addons.registerForEvent(quake_sounds_module, 'player_info', _check_event) es.addons.registerForEvent(quake_sounds_module, 'player_say', _check_event) es.addons.registerForEvent(quake_sounds_module, 'round_freeze_end', _check_event) es.addons.registerForEvent(quake_sounds_module, 'round_end', _check_event) es.addons.registerForEvent(quake_sounds_module, 'bomb_planted', _check_event) es.addons.registerForEvent(quake_sounds_module, 'bomb_defused', _check_event) es.log(hunter_quake_sounds_text) es.msg('#multi', '#green[QuakeSounds] #defaultLoaded')
def load(): global raw raw.read("%s/score.ini" % our_dir) es.regsaycmd('!points', 'ztricks-score/myscore', 'Tells the player their score') msg("loaded")
def registerSayCommand(self, name, callback, description, auth_capability=None, auth_recommendedlevel=None, auth_fail_callback=None): """ Registers a say command to the callback function with the option of authorization services """ self._validateAuthCapability(name, auth_capability, auth_recommendedlevel, 'say') self._validateCallback(callback) if not auth_fail_callback is None: self._validateCallback(auth_fail_callback) name = str(name).lower() if es.exists('saycommand', name): raise NameError, "'%s' is in use as a say command" % name es.regsaycmd(name, '_cmdlib/say', description) cmd = self.say_commands[name] = PlayerCommand(name, callback) if not auth_capability is None and not auth_recommendedlevel is None: cmd.setPermission(auth_capability, permissionToInteger(auth_recommendedlevel), auth_fail_callback)
def setUp(self): # lets suppress some noise debug = es.ServerVar("eventscripts_debug") olddebug = int(debug) if int(debug) == 0: debug.set(-1) es.regcmd("pycommand", "pyunittest/cmdtest_run", "Stuff") debug.set(olddebug) es.regsaycmd("pycommand", "pyunittest/cmdtest_run", "Stuff") es.regclientcmd("pycommand", "pyunittest/cmdtest_run", "Stuff")
def setUp(self): # lets suppress some noise debug = es.ServerVar("eventscripts_debug") olddebug = int(debug) if int(debug) == 0: debug.set(-1) es.regcmd("pycommand", "pyunittest/cmdtest_run", "Stuff") debug.set(olddebug) es.regsaycmd("pycommand","pyunittest/cmdtest_run", "Stuff") es.regclientcmd("pycommand","pyunittest/cmdtest_run", "Stuff")
def load(): #hooking the commands, not sure if ma_timeleft and ma_nextmap are actually necessary es.regclientcmd('timeleft', 'block_crash/watch_console', 'test to block channel overflow exploit') es.regclientcmd('ma_timeleft', 'block_crash/watch_console', 'test to block channel overflow exploit') es.regclientcmd('nextmap', 'block_crash/watch_console', 'test to block channel overflow exploit') es.regclientcmd('ma_nextmap', 'block_crash/watch_console', 'test to block channel overflow exploit') es.regclientcmd('listmaps', 'block_crash/watch_console', 'test to block channel overflow exploit') es.regsaycmd('ff', 'block_crash/watch_console', 'test to block channel overflow exploit') es.regsaycmd('@timeleft', 'block_crash/watch_console', 'test to block channel overflow exploit') es.regsaycmd('@nextmap', 'block_crash/watch_console', 'test to block channel overflow exploit') es.regsaycmd('@listmaps', 'block_crash/watch_console', 'test to block channel overflow exploit')
def load(): public = es.ServerVar('hu_qs', info.version, info.name) public.makepublic() quake_sounds_players = {} for userid in es.getUseridList(): quake_sounds_players[userid] = { 'kills': 0, 'multikills': 0, 'headshot': False, 'headshots': 0 } quake_sounds_setting.clearoption() quake_sounds_kv.load(es.getAddonPath('quake_sounds') + '/quake_sounds.txt') for keyname in quake_sounds_kv['styles']: quake_sounds_setting.addoption( str(keyname), str(quake_sounds_kv['styles'][str(keyname)])) quake_sounds_setting.addoption('off', 'Off') quake_sounds_setting.setdefault(str(quake_sounds_default)) quake_sounds_setting.addsound('ui/buttonclick.wav') es.regsaycmd('!quake', 'quake_sounds/saycmd', 'Quake Sounds Style') es.addons.registerForEvent(quake_sounds_module, 'player_changename', _check_event) es.addons.registerForEvent(quake_sounds_module, 'player_info', _check_event) es.addons.registerForEvent(quake_sounds_module, 'player_say', _check_event) es.addons.registerForEvent(quake_sounds_module, 'round_freeze_end', _check_event) es.addons.registerForEvent(quake_sounds_module, 'round_end', _check_event) es.addons.registerForEvent(quake_sounds_module, 'bomb_planted', _check_event) es.addons.registerForEvent(quake_sounds_module, 'bomb_defused', _check_event) es.log(hunter_quake_sounds_text) es.msg('#multi', '#green[QuakeSounds] #defaultLoaded')
def load(): global bat_menu bat_menu = popuplib.easymenu('bat_menu', 'choice', bat_menu_selection) bat_menu.settitle('Pick a Weapon Category:') bat_menu.addoption('rifles', 'Rifles') bat_menu.addoption('smg', 'SMG') global bat_menu_rifles bat_menu_rifles = popuplib.easymenu('bat_menu_rifles', 'choice', weapon_give) bat_menu_rifles.settitle('Pick a Weapon Category:') bat_menu_rifles.addoption('m4a1', 'M4A1') bat_menu_rifles.addoption('ak47', 'Ak47') bat_menu_rifles.addoption('sg552', 'Krieg') global bat_menu_smg bat_menu_smg = popuplib.easymenu('bat_menu_smg', 'choice', weapon_give) bat_menu_smg.settitle('Pick a Weapon Category:') bat_menu_smg.addoption('tmp', 'Tmp') bat_menu_smg.addoption('mp5navy', 'MP5') bat_menu_smg.addoption('p90', 'P90') if not es.exists('saycommand', 'batmenu'): es.regsaycmd('batmenu', 'superhero/heroes/Batman/batmenu') print "[SH] Batman successfully loaded"
def load(): global bat_menu bat_menu = popuplib.easymenu('bat_menu', 'choice', bat_menu_selection) bat_menu.settitle('Pick a Weapon Category:') bat_menu.addoption('rifles','Rifles') bat_menu.addoption('smg','SMG') global bat_menu_rifles bat_menu_rifles = popuplib.easymenu('bat_menu_rifles', 'choice', weapon_give) bat_menu_rifles.settitle('Pick a Weapon Category:') bat_menu_rifles.addoption('m4a1','M4A1') bat_menu_rifles.addoption('ak47','Ak47') bat_menu_rifles.addoption('sg552','Krieg') global bat_menu_smg bat_menu_smg = popuplib.easymenu('bat_menu_smg', 'choice', weapon_give) bat_menu_smg.settitle('Pick a Weapon Category:') bat_menu_smg.addoption('tmp','Tmp') bat_menu_smg.addoption('mp5navy','MP5') bat_menu_smg.addoption('p90','P90') if not es.exists('saycommand', 'batmenu'): es.regsaycmd('batmenu', 'superhero/heroes/Batman/batmenu') print "[SH] Batman successfully loaded"
def load(): # Define the global values in this script global serverId, websiteAddy, banAppealMessage, hashCode, teachAdmins, clanName, allowAdminBanning, playersChecked, badAccess, wgetPath gbanLog('###############################################') gbanLog('Global Ban Has Been Loaded') gbanLog('###############################################\n') # make sure the dictionaries are clear playersChecked.clear() badAccess.clear() # Register the necessary commands for this script es.regsaycmd('!banmenu', 'GlobalBan/banReasonList', 'Ban the selected user') es.regcmd('gb_externalBanUser', 'GlobalBan/banExternal', 'Allow other scripts to add to the ban list when executed by an admin') es.regcmd('gb_consoleBanUser', 'GlobalBan/banFromConsole', 'Allow other scripts to add to the ban list automatically') es.regcmd('gb_saveConfig', 'GlobalBan/saveConfig', 'Used to create the GlobalBan.cfg file from the web') es.regcmd('gb_loadConfig', 'GlobalBan/loadConfig', 'Used to load the GlobalBan.cfg file') es.regcmd('gb_refreshAdmins', 'GlobalBan/refreshAdmins', 'Used to get a new admin list from the web') es.regcmd('gb_refreshBanReasons', 'GlobalBan/refreshBanReasons', 'Used to get a new ban reasons from the web') es.regcmd('gb_refreshBanLengths', 'GlobalBan/refreshBanLengths', 'Used to get a new ban lengths from the web') es.regcmd('gb_refreshAdminsMod', 'GlobalBan/updateAdminMod', 'Used to get a new admin Mod list from the web') # Load the config file loadConfig() # If windows, we want the full path to wget.exe if os.name == "nt": wgetPath = es.getAddonPath('GlobalBan') + "/wget.exe" # Get the list of plugins this server is enabled for os.system(wgetPath + " -b --quiet -O " + es.getAddonPath('GlobalBan') + "/plugins.cfg -a " + es.getAddonPath('GlobalBan') + "/gban.log \"" + websiteAddy + "index.php?page=getPluginConfig&es=1&serverId=" + str(serverId) + "\"") gamethread.delayed(10, loadPluginConfig) refreshLists() gamethread.delayed(10, updateAdminModLists) # Wait 10 seconds before refreshing the admin lists
def load(): myRepeat = repeat.create('serverUpdate', serverUpdate, ()) myRepeat.start(60, 1200000000) # In game Commands if not es.exists('saycommand', '/help'): es.regsaycmd('/help', 'leetcoin/help') if not es.exists('saycommand', '/balance'): es.regsaycmd('/balance', 'leetcoin/getBalance') if not es.exists('saycommand', '/rank'): es.regsaycmd('/rank', 'leetcoin/getRank')
def load(): """ If the script is loaded halfway through a load, ensure the delays start """ if str(currentMap): es_map_start({'mapname':str(currentMap)}) es.regsaycmd('!restart', 'surftimer/restart', 'Teleport back to start')
def load(): cmdlib.registerServerCommand("wcs_myracemenu", wcrm, "wcschangerace_Menu_Handler") es.regclientcmd('myraces', 'tools/myraces/myracecmd', '') es.regsaycmd('myraces', 'tools/myraces/myracecmd', '')
def load(): """ If the script is loaded halfway through a load, ensure the delays start """ if str(currentMap): es_map_start({'mapname': str(currentMap)}) es.regsaycmd('!restart', 'surftimer/restart', 'Teleport back to start')
def regsaycmd(argv): if es.exists('saycommand', argv[0]): raise ValueError, 'command %s already exists' % argv[0] es.regsaycmd(*argv[:3])
def regsaycmd(argv): if es.exists('saycommand', argv[0]): raise ValueError('command %s already exists' % argv[0]) es.regsaycmd(*argv[:3])