NOTICE: The wiki has undergone updates and everything is running smoothly. I am still working on the CSS so there are a few minor visual kinks.

Jahandar's Rules Script

From JAWiki

Jump to: navigation, search

Contents

[edit] About

This is a script for Rule messages that I wrote a while ago (November, 2005). It was posted in the Technical Resources subforum of the old JoH forums that I maintained once upon a time, but the original posts were lost when the clan changed forums.

Anyway, this script was designed to be fast, use as few keys as possible, and to be very configurable for use by others. In fact, you can slim it down to only 2 keys for all rule messages, though there are 8 commands you can play with in all.

I originally wanted to have a general warning message before the detailed rule-specific message, so I made it a separate say so the message wouldn't get too long. Unfortunately, this never worked out well for me in practice, so I don't use that, but it is still there for anyone who does want it.

If you don't care about a generic warning, you can leave it out altogether. and skip the rest this paragraph. and just use the rule selector buttons and then "vstr rulemsg" and maybe a command for echoing the current rule. If you do want the generic message, you can either have it on a separate key (binded to "vstr rulewarn") or you can have one QuickWarn key that you double-press. The first press says the warning, the second says the rule message. If you think you might accidentally press the quickwarn button, causing the next press to be the rule when you don't want it, neverfear. You can either fix it by either switching rules, using the current rule button (vstr currentrule) or using a separate reset button (vstr quickwarn_reset).

However you set it up, once you select a rule, you'll stay on that rule until you select a different one, or until the CFG is reloaded. You can bind a key for checking which rule is selected (vstr currentrule or vstr ruleecho), or just don't worry about it and cycle through to find what you want, if you forget which one you're on.

[edit] Commands

  • vstr rulewarn - Says the generic warning message (and echoes current rule)
  • vstr rulemsg - Says the message for the currently selected rule
  • vstr quickwarn - Warning and Rule Message on one key (push it twice)
  • vstr quickwarn_reset - If you think you'll accidently push the quickwarn button, bind this
  • vstr currentrule - Combines the ruleecho and quickwarn_reset commands (non-QuickWarn users use ruleecho)
  • vstr ruleecho - Echo to your screen the current rule (QuickWarn users use currentrule instead)
  • vstr next_rulemsg - Selects the next rule
  • vstr prev_rulemsg - Selects the previous rule

[edit] Customizing

  • If you want to use as few keys as possible and DO want a generic warning, bind these two:
    • vstr next_rulemsg - Selects the next rule
    • vstr quickwarn - Warning and Rule Message on one key (push it twice)


  • If you want to use as few keys as possible and DON'T want a generic warning (or don't want to have to double-press the second button), bind these two:
    • vstr next_rulemsg - Selects the next rule
    • vstr rulemsg - Says the message for the currently selected rule


  • If you'd also like to know which rule is currently selected, bind 1 of these:
    • vstr ruleecho - Echo to your screen the current rule (for non-QuickWarn users)
    • vstr currentrule - Combines the ruleecho and quickwarn_reset commands (for QuickWarn users)


  • If you want a little easier time switching between rules:
    • vstr prev_rulemsg - Selects the previous rule


  • If you're not using QuickWarn but still want to be able to do generic warning messages:
    • vstr rulewarn - Says the generic warning message (and echoes current rule)


  • Extra Fool-Proofing:

If you're really bad about pressing the wrong key or using the wrong rule message, or if you're using a 2-key setup, you might consider setting this so that after each rule it resets everything (by re-execing the cfg) so you won't be able to accidentally say anything and you have to reselect the rule you want each time (there are only 6 at this time, so its really not too bad). Anyway, to do this, remove the two slashes (//) from the beginning of line 64 and add them to the beginning of line 64.


[edit] The Code

Alternatively, you have the option of downloading this script as a .cfg that you can place in your base folder.

Download: JahRules.cfg

// **********************************************************************************************
//
// Jahandar's Rules Script
// 	Helps for warning lamers
//
// COMMANDS
// vstr rulewarn	- Says the generic warning message (and echoes current rule)
// vstr rulemsg		- Says the message for the currently selected rule
// vstr quickwarn	- Warning and Rule Message on one key (push it twice)
// vstr quickwarn_reset	- If you think you'll accidently push the quickwarn button, bind this
// vstr currentrule	- Combines the ruleecho and quickwarn_reset commands (non-QuickWarn users use ruleecho)
// vstr ruleecho	- Echo to your screen the current rule (QuickWarn users use currentrule instead)
// vstr next_rulemsg	- Selects the next rule
// vstr prev_rulemsg	- Selects the previous rule
//
// **********************************************************************************************

// Rule Keybinds - Set these keys however you like, below is the setup I use. 
// 	Some of these aren't really needed, but there for convenience in case you want it, so if you're 
//	running out of keys just put 2 slashes (//) at the beginning of the line to have it ignored.

bind F1 "vstr currentrule"
bind F2 "vstr next_rulemsg"
bind F3 "vstr rulemsg"


// Rule Messages - If you want to tweak the messages, you can do that here

set msg_rule_none	"echo No rule selected!"
set msg_warn 		"say ^1WARNING! ^3You have broken a server rule."
set msg_rule_laming 	"say ^1No Laming! ^7Laming is attacking someone when their saber is down or chat bubble is up (even in duels)."
set msg_rule_padawan 	"say ^1No Padawan Names! ^7Please choose a name in your profile settings or with the /name command."
set msg_rule_english 	"say ^1English Only! ^7Please use private chat for non-english conversation: /tell name message"
set msg_rule_language 	"say ^1No Vulgar Language! ^7This is a family-friendly server."
set msg_rule_recruiting "say ^1No Recruiting! ^7You may not recruit for other clans on JoH's server."
set msg_rule_spam 	"say ^1No Spamming! ^7It causes lag and interrupts other players' conversations."
set msg_rule_fun 	"say ^1Lack of Fun Violation! ^7Rule #10 clearly states that all players on this server must have fun."


// Rule Chooser Script - Don't modify this unless you know what you are doing

set next_rulemsg 	"vstr rulemsg_01"
set prev_rulemsg 	"vstr rulemsg_06"
set ruleecho 		"vstr msg_rule_none"
set currentrule		"vstr ruleecho; vstr quickwarn_reset"	// current rule is set to this after a rule has been chosen
set currentrule		"vstr ruleecho"
set rulemsg 		"vstr rulemsg_00"
set rulewarn		"vstr msg_warn; vstr ruleecho"

set rulemsg_00 "vstr ruleecho"
set rulemsg_01 "set next_rulemsg vstr rulemsg_02; set prev_rulemsg vstr rulemsg_06; set rulemsg vstr msg_rule_laming;		set ruleecho echo Rule: Laming; 		vstr ruleecho; vstr quickwarn_set"
set rulemsg_02 "set next_rulemsg vstr rulemsg_03; set prev_rulemsg vstr rulemsg_01; set rulemsg vstr msg_rule_padawan;		set ruleecho echo Rule: Padawan Name; 		vstr ruleecho; vstr quickwarn_set"
set rulemsg_03 "set next_rulemsg vstr rulemsg_04; set prev_rulemsg vstr rulemsg_02; set rulemsg vstr msg_rule_english;		set ruleecho echo Rule: English Only; 		vstr ruleecho; vstr quickwarn_set"
set rulemsg_04 "set next_rulemsg vstr rulemsg_05; set prev_rulemsg vstr rulemsg_03; set rulemsg vstr msg_rule_language;		set ruleecho echo Rule: Vulgarity; 		vstr ruleecho; vstr quickwarn_set"
set rulemsg_05 "set next_rulemsg vstr rulemsg_06; set prev_rulemsg vstr rulemsg_04; set rulemsg vstr msg_rule_recruiting;	set ruleecho echo Rule: Recruiting; 		vstr ruleecho; vstr quickwarn_set"
set rulemsg_06 "set next_rulemsg vstr rulemsg_01; set prev_rulemsg vstr rulemsg_05; set rulemsg vstr msg_rule_spam;		set ruleecho echo Rule: Spam;			vstr ruleecho; vstr quickwarn_set"

set quickwarn_warning 	"vstr msg_warn;	set quickwarn vstr quickwarn_rule"
set quickwarn_rule	"vstr rulemsg; vstr quickwarn_set"
//set quickwarn_rule	"vstr rulemsg; exec jahadmin.cfg"	// use this line instead of the one above if you want extra saftey to prevent accidentally saying the wrong rule
set quickwarn_set 	"set quickwarn vstr quickwarn_warning; set currentrule vstr currentrule2; set quickwarn_reset vstr quickwarn_reset2"
set quickwarn_reset	"echo Nothing to reset!"
set quickwarn_reset2	"vstr quickwarn_set"	// QuickWarn_reset is set to this after a rule has been chosen
set quickwarn 		"vstr msg_rule_none"

echo "Rules Script Loaded!" // Echoes so you know its loaded, but doesn't say so in chat, so you won't annoy people.. Nobody else cares that the script is running. :)
Personal tools