initial release
This commit is contained in:
461
cosmic rage/worlds/Cosmic Rage/cosmic rage.MCL
Normal file
461
cosmic rage/worlds/Cosmic Rage/cosmic rage.MCL
Normal file
@@ -0,0 +1,461 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Sunday, May 25, 2025, 1:55 PM -->
|
||||
<!-- MuClient version 5.06 -->
|
||||
<!-- Written by Nick Gammon -->
|
||||
<!-- Home Page: http://www.mushclient.com/ -->
|
||||
<muclient>
|
||||
<world
|
||||
muclient_version="5.06"
|
||||
world_file_version="15"
|
||||
date_saved="2025-05-25 13:55:57"
|
||||
|
||||
auto_say_override_prefix="-"
|
||||
auto_say_string="say "
|
||||
chat_name="Name-not-set"
|
||||
command_stack_character=";"
|
||||
id="d2211ef7d54c4a7bd0cc9ab7"
|
||||
input_font_name="Fixedsys"
|
||||
mapping_failure="Alas, you cannot go that way."
|
||||
name="Cosmic Rage"
|
||||
new_activity_sound="(No sound)"
|
||||
output_font_name="FixedSys"
|
||||
script_editor="notepad"
|
||||
script_editor_argument="%file"
|
||||
script_filename="worlds\Cosmic Rage\cosmic rage.lua"
|
||||
script_language="Lua"
|
||||
script_prefix="///"
|
||||
site="cosmicrage.earth"
|
||||
spam_message="look"
|
||||
speed_walk_prefix="#"
|
||||
terminal_identification="mushclient"
|
||||
|
||||
arrows_change_history="y"
|
||||
auto_pause="y"
|
||||
auto_resize_minimum_lines="1"
|
||||
auto_resize_maximum_lines="20"
|
||||
chat_foreground_colour="red"
|
||||
chat_background_colour="black"
|
||||
chat_port="4050"
|
||||
confirm_on_paste="y"
|
||||
confirm_on_send="y"
|
||||
default_trigger_sequence="100"
|
||||
default_alias_sequence="100"
|
||||
detect_pueblo="y"
|
||||
echo_hyperlink_in_output_window="y"
|
||||
edit_script_with_notepad="y"
|
||||
enable_aliases="y"
|
||||
enable_beeps="y"
|
||||
enable_scripts="y"
|
||||
enable_timers="y"
|
||||
enable_triggers="y"
|
||||
enable_trigger_sounds="y"
|
||||
fade_output_opacity_percent="20"
|
||||
fade_output_seconds="8"
|
||||
history_lines="1000"
|
||||
hyperlink_adds_to_command_history="y"
|
||||
hyperlink_colour="#0080FF"
|
||||
indent_paras="y"
|
||||
input_background_colour="white"
|
||||
input_font_height="9"
|
||||
input_font_weight="400"
|
||||
input_text_colour="black"
|
||||
keypad_enable="y"
|
||||
log_output="y"
|
||||
max_output_lines="5000"
|
||||
mud_can_change_link_colour="y"
|
||||
mud_can_change_options="y"
|
||||
note_text_colour="#040000"
|
||||
output_font_height="9"
|
||||
output_font_weight="400"
|
||||
paste_delay_per_lines="1"
|
||||
pixel_offset="1"
|
||||
port="7777"
|
||||
proxy_port="1080"
|
||||
save_world_automatically="y"
|
||||
script_reload_option="1"
|
||||
script_errors_to_output_window="y"
|
||||
send_file_delay_per_lines="1"
|
||||
send_mxp_afk_response="y"
|
||||
show_connect_disconnect="y"
|
||||
show_italic="y"
|
||||
show_underline="y"
|
||||
spam_line_count="20"
|
||||
tab_completion_lines="200"
|
||||
timestamp_input_text_colour="maroon"
|
||||
timestamp_notes_text_colour="blue"
|
||||
timestamp_output_text_colour="white"
|
||||
timestamp_input_back_colour="black"
|
||||
timestamp_notes_back_colour="black"
|
||||
timestamp_output_back_colour="black"
|
||||
tool_tip_visible_time="5000"
|
||||
tool_tip_start_time="400"
|
||||
treeview_triggers="y"
|
||||
treeview_aliases="y"
|
||||
treeview_timers="y"
|
||||
underline_hyperlinks="y"
|
||||
unpause_on_send="y"
|
||||
use_custom_link_colour="y"
|
||||
use_default_input_font="y"
|
||||
use_default_output_font="y"
|
||||
warn_if_scripting_inactive="y"
|
||||
wrap="y"
|
||||
wrap_column="80"
|
||||
write_world_name_to_log="y"
|
||||
> <!-- end of general world attributes -->
|
||||
|
||||
</world>
|
||||
|
||||
<!-- triggers -->
|
||||
|
||||
<triggers
|
||||
muclient_version="5.06"
|
||||
world_file_version="15"
|
||||
date_saved="2025-05-25 13:55:57"
|
||||
>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^\$buffer (.*?)$"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
regexp="y"
|
||||
send_to="10"
|
||||
sequence="100"
|
||||
>
|
||||
<send>tts_interrupt %1</send>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
<!-- aliases -->
|
||||
|
||||
<aliases
|
||||
muclient_version="5.06"
|
||||
world_file_version="15"
|
||||
date_saved="2025-05-25 13:55:57"
|
||||
>
|
||||
</aliases>
|
||||
|
||||
<!-- timers -->
|
||||
|
||||
<timers
|
||||
muclient_version="5.06"
|
||||
world_file_version="15"
|
||||
date_saved="2025-05-25 13:55:57"
|
||||
>
|
||||
</timers>
|
||||
|
||||
<!-- macros -->
|
||||
|
||||
<macros
|
||||
muclient_version="5.06"
|
||||
world_file_version="15"
|
||||
date_saved="2025-05-25 13:55:57"
|
||||
>
|
||||
|
||||
<macro name="up" type="send_now" >
|
||||
<send>up</send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="down" type="send_now" >
|
||||
<send>down</send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="north" type="send_now" >
|
||||
<send>north</send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="south" type="send_now" >
|
||||
<send>south</send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="east" type="send_now" >
|
||||
<send>east</send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="west" type="send_now" >
|
||||
<send>west</send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="examine" type="replace" >
|
||||
<send>examine </send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="look" type="replace" >
|
||||
<send>look </send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="page" type="replace" >
|
||||
<send>page </send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="say" type="replace" >
|
||||
<send>say </send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="whisper" type="replace" >
|
||||
<send>whisper </send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="doing" type="send_now" >
|
||||
<send>DOING</send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="who" type="send_now" >
|
||||
<send>WHO</send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="drop" type="replace" >
|
||||
<send>drop </send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="take" type="replace" >
|
||||
<send>take </send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="logout" type="send_now" >
|
||||
<send>LOGOUT</send>
|
||||
|
||||
</macro>
|
||||
|
||||
<macro name="quit" type="send_now" >
|
||||
<send>QUIT</send>
|
||||
|
||||
</macro>
|
||||
</macros>
|
||||
|
||||
<!-- variables -->
|
||||
|
||||
<variables
|
||||
muclient_version="5.06"
|
||||
world_file_version="15"
|
||||
date_saved="2025-05-25 13:55:57"
|
||||
>
|
||||
</variables>
|
||||
|
||||
<!-- colours -->
|
||||
|
||||
<colours
|
||||
muclient_version="5.06"
|
||||
world_file_version="15"
|
||||
date_saved="2025-05-25 13:55:57"
|
||||
>
|
||||
|
||||
<ansi>
|
||||
|
||||
<normal>
|
||||
<colour seq="1" rgb="black" />
|
||||
<colour seq="2" rgb="maroon" />
|
||||
<colour seq="3" rgb="green" />
|
||||
<colour seq="4" rgb="olive" />
|
||||
<colour seq="5" rgb="navy" />
|
||||
<colour seq="6" rgb="purple" />
|
||||
<colour seq="7" rgb="teal" />
|
||||
<colour seq="8" rgb="silver" />
|
||||
|
||||
</normal>
|
||||
|
||||
<bold>
|
||||
<colour seq="1" rgb="gray" />
|
||||
<colour seq="2" rgb="red" />
|
||||
<colour seq="3" rgb="lime" />
|
||||
<colour seq="4" rgb="yellow" />
|
||||
<colour seq="5" rgb="blue" />
|
||||
<colour seq="6" rgb="magenta" />
|
||||
<colour seq="7" rgb="cyan" />
|
||||
<colour seq="8" rgb="white" />
|
||||
|
||||
</bold>
|
||||
|
||||
</ansi>
|
||||
|
||||
<custom>
|
||||
<colour seq="1" name="Custom1" text="#FF8080" back="black" />
|
||||
<colour seq="2" name="Custom2" text="#FFFF80" back="black" />
|
||||
<colour seq="3" name="Custom3" text="#80FF80" back="black" />
|
||||
<colour seq="4" name="Custom4" text="#80FFFF" back="black" />
|
||||
<colour seq="5" name="Custom5" text="#0080FF" back="black" />
|
||||
<colour seq="6" name="Custom6" text="#FF80C0" back="black" />
|
||||
<colour seq="7" name="Custom7" text="red" back="black" />
|
||||
<colour seq="8" name="Custom8" text="#0080C0" back="black" />
|
||||
<colour seq="9" name="Custom9" text="magenta" back="black" />
|
||||
<colour seq="10" name="Custom10" text="#804040" back="black" />
|
||||
<colour seq="11" name="Custom11" text="#FF8040" back="black" />
|
||||
<colour seq="12" name="Custom12" text="teal" back="black" />
|
||||
<colour seq="13" name="Custom13" text="#004080" back="black" />
|
||||
<colour seq="14" name="Custom14" text="#FF0080" back="black" />
|
||||
<colour seq="15" name="Custom15" text="green" back="black" />
|
||||
<colour seq="16" name="Custom16" text="blue" back="black" />
|
||||
|
||||
</custom>
|
||||
</colours>
|
||||
|
||||
<!-- keypad -->
|
||||
|
||||
<keypad
|
||||
muclient_version="5.06"
|
||||
world_file_version="15"
|
||||
date_saved="2025-05-25 13:55:57"
|
||||
>
|
||||
|
||||
<key name="0" >
|
||||
<send>exits</send>
|
||||
</key>
|
||||
|
||||
<key name="1" >
|
||||
<send>sw</send>
|
||||
</key>
|
||||
|
||||
<key name="2" >
|
||||
<send>south</send>
|
||||
</key>
|
||||
|
||||
<key name="3" >
|
||||
<send>se</send>
|
||||
</key>
|
||||
|
||||
<key name="4" >
|
||||
<send>west</send>
|
||||
</key>
|
||||
|
||||
<key name="5" >
|
||||
<send>look</send>
|
||||
</key>
|
||||
|
||||
<key name="6" >
|
||||
<send>east</send>
|
||||
</key>
|
||||
|
||||
<key name="7" >
|
||||
<send>nw</send>
|
||||
</key>
|
||||
|
||||
<key name="8" >
|
||||
<send>north</send>
|
||||
</key>
|
||||
|
||||
<key name="9" >
|
||||
<send>ne</send>
|
||||
</key>
|
||||
|
||||
<key name="." >
|
||||
<send>hide</send>
|
||||
</key>
|
||||
|
||||
<key name="/" >
|
||||
<send>inventory</send>
|
||||
</key>
|
||||
|
||||
<key name="*" >
|
||||
<send>score</send>
|
||||
</key>
|
||||
|
||||
<key name="-" >
|
||||
<send>up</send>
|
||||
</key>
|
||||
|
||||
<key name="+" >
|
||||
<send>down</send>
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+0" >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+1" >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+2" >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+3" >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+4" >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+5" >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+6" >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+7" >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+8" >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+9" >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+." >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+/" >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+*" >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl+-" >
|
||||
</key>
|
||||
|
||||
<key name="Ctrl++" >
|
||||
</key>
|
||||
</keypad>
|
||||
|
||||
<!-- printing -->
|
||||
|
||||
<printing
|
||||
muclient_version="5.06"
|
||||
world_file_version="15"
|
||||
date_saved="2025-05-25 13:55:57"
|
||||
>
|
||||
|
||||
<ansi>
|
||||
|
||||
<normal>
|
||||
|
||||
</normal>
|
||||
|
||||
<bold>
|
||||
<style seq="1" bold="y" />
|
||||
<style seq="2" bold="y" />
|
||||
<style seq="3" bold="y" />
|
||||
<style seq="4" bold="y" />
|
||||
<style seq="5" bold="y" />
|
||||
<style seq="6" bold="y" />
|
||||
<style seq="7" bold="y" />
|
||||
<style seq="8" bold="y" />
|
||||
|
||||
</bold>
|
||||
|
||||
</ansi>
|
||||
</printing>
|
||||
|
||||
<!-- plugins -->
|
||||
<include name="LuaAudio.xml" plugin="y" />
|
||||
<include name="CaptureMudOutput.xml" plugin="y" />
|
||||
<include name="Copy_Output.xml" plugin="y" />
|
||||
<include name="direction_plugin.xml" plugin="y" />
|
||||
<include name="MushReader.xml" plugin="y" />
|
||||
<include name="output_functions.xml" plugin="y" />
|
||||
<include name="Omit_Blank_Lines.xml" plugin="y" />
|
||||
<include name="Reconnecter.xml" plugin="y" />
|
||||
<include name="Repeat_Command.xml" plugin="y" />
|
||||
<include name="CosmicRage.xml" plugin="y" />
|
||||
</muclient>
|
||||
132
cosmic rage/worlds/plugins/AFK_timer.xml
Normal file
132
cosmic rage/worlds/plugins/AFK_timer.xml
Normal file
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient [
|
||||
<!ENTITY afk_command "afk" >
|
||||
<!ENTITY timer_mins "5" >
|
||||
<!ENTITY timer_secs "0" >
|
||||
<!ENTITY afk_message "You are now AFK." >
|
||||
<!ENTITY not_afk_message "You return to your keyboard." >
|
||||
]>
|
||||
|
||||
<!--
|
||||
|
||||
Customising (change above entities) ...
|
||||
|
||||
Change "afk_command" to whatever sets you AFK.
|
||||
Default: afk
|
||||
|
||||
Change "timer_mins" to be the number of minutes before you are AFK.
|
||||
Default: 5 minutes
|
||||
|
||||
Change "timer_secs" to be the number of seconds before you are AFK.
|
||||
Default: 0 seconds
|
||||
|
||||
In other words, to be AFK after 2.5 minutes, timer_mins would be 2, and
|
||||
timer_secs would be 30.
|
||||
|
||||
-->
|
||||
|
||||
<!-- Saved on Saturday, October 08, 2005, 10:37 AM -->
|
||||
<!-- MuClient version 3.66 -->
|
||||
|
||||
<!-- Plugin "AFK_timer" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="AFK_timer"
|
||||
author="Nick Gammon"
|
||||
id="4d167d47cac26fb36e161e48"
|
||||
language="Lua"
|
||||
purpose="Sends AFK to the MUD when 5 minutes elapse"
|
||||
date_written="2005-10-08 10:32:50"
|
||||
requires="3.52"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
After the specified interval (default 5 minutes) elapse, sends "afk" to the MUD.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
<!-- Timers -->
|
||||
|
||||
<timers>
|
||||
<timer name="afk_timer"
|
||||
second="&timer_secs;"
|
||||
minute="&timer_mins;"
|
||||
send_to="12"
|
||||
enabled="y"
|
||||
>
|
||||
<send>
|
||||
Note("You are now AFK.")
|
||||
Send ("&afk_command;")
|
||||
EnableTimer ("afk_timer", 0)
|
||||
</send>
|
||||
</timer>
|
||||
</timers>
|
||||
|
||||
<!-- Triggers -->
|
||||
|
||||
<triggers>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="¬_afk_message;"
|
||||
send_to="12"
|
||||
>
|
||||
<send>
|
||||
FixTimer () -- make sure timer is back on
|
||||
</send>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
<triggers>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="&afk_message;"
|
||||
send_to="12"
|
||||
>
|
||||
<send>
|
||||
EnableTimer ("afk_timer", 0) -- make sure timer is off
|
||||
</send>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
-- when they type something, reset AFK status
|
||||
|
||||
function OnPluginCommandEntered (sText)
|
||||
FixTimer ()
|
||||
return true -- process the command
|
||||
end
|
||||
|
||||
-- when you connect to the MUD, presumably you are not AFK
|
||||
|
||||
function OnPluginConnect ()
|
||||
FixTimer ()
|
||||
end
|
||||
|
||||
-- shared routine to handle turning AFK off
|
||||
|
||||
function FixTimer ()
|
||||
if GetTimerOption ("afk_timer", "enabled") == 0 then
|
||||
Note("You are no longer AFK.")
|
||||
end
|
||||
|
||||
-- turn timer back on
|
||||
EnableTimer ("afk_timer", 1)
|
||||
|
||||
-- make sure the full time interval elapses
|
||||
ResetTimer ("afk_timer")
|
||||
|
||||
end
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
350
cosmic rage/worlds/plugins/ANSI_Log.xml
Normal file
350
cosmic rage/worlds/plugins/ANSI_Log.xml
Normal file
@@ -0,0 +1,350 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient
|
||||
[
|
||||
<!ENTITY PreserveLineBreaksWanted "vbTrue" >
|
||||
<!ENTITY LogOutputWanted "vbTrue" >
|
||||
<!ENTITY LogCommandsWanted "vbTrue" >
|
||||
]>
|
||||
<!-- Saved on Friday, July 25, 2003, 10:50 AM -->
|
||||
<!-- MuClient version 3.42 -->
|
||||
|
||||
<!-- Plugin "ANSI_Log" generated by Plugin Wizard -->
|
||||
|
||||
<!--
|
||||
You can change the entities at the top to control the way it works.
|
||||
|
||||
PreserveLineBreaksWanted = Whether or not each line ends with a hard carriage return
|
||||
LogOutputWanted = Whether output from the MUD is to be logged
|
||||
LogCommandsWanted = Whether commands you type are to be logged
|
||||
|
||||
vbTrue = yes
|
||||
vbFalse = no
|
||||
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="ANSI_Log"
|
||||
author="Nick Gammon"
|
||||
id="08025212f70f54d3bb25dd02"
|
||||
language="VBscript"
|
||||
purpose="Logs commands and MUD output using ANSI colours"
|
||||
date_written="2003-07-25 10:45:39"
|
||||
requires="3.35"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Once installed, this plugin will log player commands, and output from the MUD, to the current log file using ANSI colour sequences.
|
||||
|
||||
As far as possible, the plugin will try to match the colours on the output lines to existing ANSI codes (this may fail if you are using MXP and the MUD sends non-ANSI colours).
|
||||
|
||||
It then generates the appropriate ANSI code and writes it to the log file.
|
||||
|
||||
The trigger and alias in the plugin set the "omit from log" flags so the lines are not logged twice.
|
||||
|
||||
They are set to "keep evaluating" so that other triggers and aliases are still processed.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Triggers -->
|
||||
|
||||
<triggers>
|
||||
<trigger
|
||||
enabled="y"
|
||||
keep_evaluating="y"
|
||||
match="^.*$"
|
||||
name="ansi_log"
|
||||
omit_from_log="y"
|
||||
regexp="y"
|
||||
script="LogOutput"
|
||||
sequence="5"
|
||||
>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
name="ansi_log"
|
||||
script="LogCommand"
|
||||
match="^.*$"
|
||||
enabled="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
regexp="y"
|
||||
keep_evaluating="y"
|
||||
sequence="5"
|
||||
>
|
||||
<send>%0</send>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
dim PreserveLineBreaksWanted
|
||||
PreserveLineBreaksWanted = &PreserveLineBreaksWanted;
|
||||
dim LogOutputWanted
|
||||
LogOutputWanted = &LogOutputWanted;
|
||||
dim LogCommandsWanted
|
||||
LogCommandsWanted = &LogCommandsWanted;
|
||||
|
||||
<![CDATA[
|
||||
|
||||
'
|
||||
' Helper function to output code for bold, underline etc.
|
||||
'
|
||||
|
||||
Function DoExtra (is_set, was_set, on_code, off_code)
|
||||
|
||||
DoExtra = ""
|
||||
|
||||
If is_set And (not was_set) Then
|
||||
DoExtra = ANSI (on_code) ' send setting code
|
||||
ElseIf (Not is_set) And (was_set) Then
|
||||
DoExtra = ANSI (off_code) ' send resetting code
|
||||
End If ' need to un-set it
|
||||
|
||||
End Function
|
||||
|
||||
'
|
||||
' log in ANSI colours (call from trigger/alias that matches everything)
|
||||
'
|
||||
sub LogOutput (name, matchingline, wildcards)
|
||||
|
||||
dim firstline, lastline, line, style, styles
|
||||
dim logline, colour, target, bold, column
|
||||
dim normal (8)
|
||||
dim hilite (8)
|
||||
dim lastfore, lastback, lastbold
|
||||
dim lastul, lastblink, lastinverse
|
||||
dim ul, blink, inverse
|
||||
dim i
|
||||
|
||||
'
|
||||
' Not necessary if logging not active or not wanted
|
||||
'
|
||||
|
||||
If (Not IsLogOpen) Or (not LogOutputWanted) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
' find which line this is
|
||||
lastline = GetLinesInBufferCount
|
||||
|
||||
' now find the first line in this paragraph
|
||||
|
||||
firstline = lastline - 1
|
||||
|
||||
do while firstline > 0
|
||||
|
||||
if GetLineInfo (firstline, 3) then
|
||||
exit do
|
||||
end if
|
||||
|
||||
firstline = firstline - 1
|
||||
|
||||
loop ' end while loop - finding start of paragraph
|
||||
|
||||
'
|
||||
' paragraph starts with first line *past* the previous newline
|
||||
'
|
||||
|
||||
firstline = firstline + 1
|
||||
|
||||
'
|
||||
' paragraph can't end past where it started
|
||||
'
|
||||
|
||||
if firstline > lastline then firstline = lastline
|
||||
|
||||
'
|
||||
' discard world.notes and user input
|
||||
'
|
||||
|
||||
if GetLineInfo (firstline, 4) then exit sub ' note line
|
||||
if GetLineInfo (firstline, 5) then exit sub ' input line
|
||||
|
||||
'
|
||||
' Empty lines are a special and simple case
|
||||
'
|
||||
|
||||
if firstline = lastline and GetLineInfo (firstline, 2) = 0 then
|
||||
WriteLog "" ' just write the blank line
|
||||
Exit Sub
|
||||
end if
|
||||
|
||||
'
|
||||
' find what the ANSI colours are for this world
|
||||
'
|
||||
|
||||
for i = 1 to 8
|
||||
normal (i) = NormalColour (i) ' normal
|
||||
hilite (i) = BoldColour (i) ' highlight
|
||||
next
|
||||
|
||||
'
|
||||
' process entire paragraph
|
||||
'
|
||||
|
||||
logline = logline & ANSI (0) ' reset all styles
|
||||
lastfore = 37 ' reset is white
|
||||
lastback = 40 ' on black
|
||||
lastbold = vbFalse
|
||||
lastul = vbFalse
|
||||
lastblink = vbFalse
|
||||
lastinverse = vbFalse
|
||||
|
||||
for line = firstline to lastline
|
||||
|
||||
styles = GetLineInfo (line, 11) ' how many styles
|
||||
|
||||
'
|
||||
' process all styles runs in this line
|
||||
'
|
||||
|
||||
for style = 1 to styles
|
||||
|
||||
'
|
||||
' find text style (ANSI code)
|
||||
'
|
||||
|
||||
target = GetStyleInfo (line, style, 14) ' RGB colour of style text
|
||||
colour = -1
|
||||
bold = vbFalse
|
||||
|
||||
'
|
||||
' work out which ANSI colour it must have been by a scan
|
||||
'
|
||||
for i = 1 to 8
|
||||
' normal colour
|
||||
if target = normal (i) then
|
||||
colour = 29 + i
|
||||
exit for
|
||||
end if
|
||||
' bold colour
|
||||
if target = hilite (i) then
|
||||
colour = 29 + i
|
||||
bold = vbTrue
|
||||
exit for
|
||||
end if
|
||||
next ' colour
|
||||
|
||||
'
|
||||
' if found, output that colour
|
||||
'
|
||||
|
||||
if colour <> -1 then
|
||||
'
|
||||
' only output if colour change
|
||||
'
|
||||
if colour <> lastfore then
|
||||
logline = logline & ANSI (colour)
|
||||
lastfore = colour
|
||||
end if
|
||||
|
||||
end if ' colour found
|
||||
|
||||
logline = logline & DoExtra (bold, lastbold, 1, 22)
|
||||
lastbold = bold
|
||||
|
||||
target = GetStyleInfo (line, style, 15) ' RGB colour of style background
|
||||
colour = -1
|
||||
|
||||
'
|
||||
' work out which ANSI colour it must have been by a scan
|
||||
'
|
||||
for i = 1 to 8
|
||||
' normal colour
|
||||
if target = normal (i) then
|
||||
colour = 39 + i
|
||||
exit for
|
||||
end if
|
||||
next ' colour
|
||||
|
||||
'
|
||||
' if found, output that colour
|
||||
'
|
||||
|
||||
if colour <> -1 then
|
||||
'
|
||||
' only output if colour change
|
||||
'
|
||||
if colour <> lastback then
|
||||
logline = logline & ANSI (colour)
|
||||
lastback = colour
|
||||
end if
|
||||
|
||||
end if ' colour found
|
||||
|
||||
'
|
||||
' do other styles (underline, blink, inverse)
|
||||
'
|
||||
|
||||
bold = GetStyleInfo (line, style, 8) ' bold flag
|
||||
logline = logline & DoExtra (bold, lastbold, 1, 22)
|
||||
lastbold = bold
|
||||
|
||||
ul = GetStyleInfo (line, style, 9) ' underline flag
|
||||
logline = logline & DoExtra (ul, lastul, 4, 24)
|
||||
lastul = ul
|
||||
|
||||
blink = GetStyleInfo (line, style, 10) ' blink flag
|
||||
logline = logline & DoExtra (blink, lastblink, 3, 23)
|
||||
lastblink = blink
|
||||
|
||||
inverse = GetStyleInfo (line, style, 11) ' inverse flag
|
||||
logline = logline & DoExtra (inverse, lastinverse, 7, 27)
|
||||
lastinverse = inverse
|
||||
|
||||
'
|
||||
' now output the text
|
||||
'
|
||||
|
||||
logline = logline & GetStyleInfo (line, style, 1)
|
||||
|
||||
next ' process the next style
|
||||
|
||||
'
|
||||
' If wanted, keep the original (soft) line breaks
|
||||
'
|
||||
|
||||
If PreserveLineBreaksWanted And line <> lastline Then
|
||||
logline = logline & vbCrLf
|
||||
End If
|
||||
|
||||
next ' end for loop - processing each line in the paragraph
|
||||
|
||||
WriteLog logline
|
||||
|
||||
end sub ' end of LogOutput
|
||||
|
||||
|
||||
|
||||
sub LogCommand (name, matchingline, wildcards)
|
||||
'
|
||||
' Not necessary if logging not active or not wanted
|
||||
'
|
||||
|
||||
If (Not IsLogOpen) Or (not LogCommandsWanted) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'
|
||||
' simply log in default ANSI colours
|
||||
'
|
||||
|
||||
WriteLog ANSI (0) & matchingline
|
||||
|
||||
end sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
1947
cosmic rage/worlds/plugins/ATCP_Mapper.xml
Normal file
1947
cosmic rage/worlds/plugins/ATCP_Mapper.xml
Normal file
File diff suppressed because it is too large
Load Diff
203
cosmic rage/worlds/plugins/ATCP_NJG.xml
Normal file
203
cosmic rage/worlds/plugins/ATCP_NJG.xml
Normal file
@@ -0,0 +1,203 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="ATCP_NJG"
|
||||
author="Nick Gammon"
|
||||
id="85f72d0e263d75df7bde6f00"
|
||||
language="Lua"
|
||||
purpose="Nick Gammon's ATCP plugin"
|
||||
date_written="2010-03-09 10:04:32"
|
||||
requires="4.50"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Install into IRE games to catch ATCP messages.
|
||||
|
||||
Other plugins can detect ATCP messages like this:
|
||||
|
||||
function OnPluginBroadcast (msg, id, name, text)
|
||||
if id == "85f72d0e263d75df7bde6f00" then
|
||||
|
||||
if msg == 1 then
|
||||
do_ATCP_vitals (text) -- eg. "H:496/496 M:412/412 E:1380/1380 W:960/960 NL:89/100 "
|
||||
-- health mana endurance willpower experience
|
||||
elseif msg == 2 then
|
||||
do_ATCP_room_brief (text) -- eg. "Continuing on the Parade of Zarathustra"
|
||||
elseif msg == 3 then
|
||||
do_ATCP_room_exit (text) -- eg. "n,s"
|
||||
elseif msg == 4 then
|
||||
do_ATCP_room_number (text) -- eg. "401"
|
||||
elseif msg == 5 then
|
||||
do_ATCP_room_full_exits (text) -- eg. "ne(8564),w(8428)"
|
||||
elseif msg == 6 then
|
||||
do_ATCP_room_environment (text) -- eg. "Urban"
|
||||
elseif msg == 7 then
|
||||
do_ATCP_room_coordinates (text) -- eg. "38,3,1,0"
|
||||
elseif msg == 8 then
|
||||
do_ATCP_room_info (text) -- eg. "shop,postoffice"
|
||||
end -- if
|
||||
|
||||
end -- if ATCP message
|
||||
end
|
||||
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
local CLIENT_ID = "MUSHclient " .. Version ()
|
||||
local IAC, SB, SE, DO = 0xFF, 0xFA, 0xF0, 0xFD
|
||||
local ATCP = 200
|
||||
|
||||
|
||||
-- agree to use ATCP
|
||||
function OnPluginTelnetRequest (type, data)
|
||||
|
||||
if type == ATCP and data == "WILL" then
|
||||
return true
|
||||
end -- if
|
||||
|
||||
if type == ATCP and data == "SENT_DO" then
|
||||
Note ("Enabling ATCP.")
|
||||
SendPkt (string.char (IAC, SB, ATCP) ..
|
||||
"hello " .. CLIENT_ID .. "\n" ..
|
||||
"auth 1\n" ..
|
||||
"char_name 1\n" ..
|
||||
"char_vitals 1\n" ..
|
||||
"room_brief 1\n" ..
|
||||
"room_exits 1" ..
|
||||
string.char (IAC, SE))
|
||||
return true
|
||||
end -- if ATCP login needed (just sent DO)
|
||||
|
||||
return false
|
||||
|
||||
end -- function OnPluginTelnetRequest
|
||||
|
||||
-- we got authorization request, eg.
|
||||
-- Auth.Request CH\n<identstr>
|
||||
-- Auth.Request ON
|
||||
|
||||
function got_auth_request (s)
|
||||
|
||||
-- calculate challenge response
|
||||
local function atcp_auth (seed)
|
||||
local a = 17
|
||||
local i = 0
|
||||
local n
|
||||
|
||||
for letter in string.gmatch (seed, ".") do
|
||||
n = string.byte (letter) - 96
|
||||
if bit.band (i, 1) == 0 then -- even/odd?
|
||||
a = a + n * bit.bor (i, 13)
|
||||
else
|
||||
a = a - n * bit.bor (i, 11)
|
||||
end -- if
|
||||
i = i + 1
|
||||
end -- for
|
||||
return a
|
||||
end
|
||||
|
||||
if s:upper () == "ON" then
|
||||
Note ("ATCP authorization accepted.")
|
||||
return
|
||||
end -- if
|
||||
|
||||
local identstr = string.match (s, "^CH\n(.+)$")
|
||||
|
||||
if identstr then
|
||||
SendPkt (string.char (IAC, SB, ATCP) ..
|
||||
"auth " ..
|
||||
tostring (atcp_auth (identstr)) ..
|
||||
" " .. CLIENT_ID ..
|
||||
string.char (IAC, SE))
|
||||
return
|
||||
end -- if
|
||||
|
||||
end -- got_auth_request
|
||||
|
||||
|
||||
function got_vitals (s) -- eg. "H:496/496 M:412/412 E:1380/1380 W:960/960 NL:89/100"
|
||||
BroadcastPlugin (1, s)
|
||||
end -- got_vitals
|
||||
|
||||
function got_room_brief (s) -- eg. "Continuing on the Parade of Zarathustra"
|
||||
BroadcastPlugin (2, s)
|
||||
end -- got_room_brief
|
||||
|
||||
function got_room_exits (s) -- eg. "n,s"
|
||||
BroadcastPlugin (3, s)
|
||||
end -- got_room_exits
|
||||
|
||||
function got_room_number (s) -- eg. "441"
|
||||
BroadcastPlugin (4, s)
|
||||
end -- got_room_number
|
||||
|
||||
function got_full_exits (s) -- eg. "ne(8564),w(8428)"
|
||||
BroadcastPlugin (5, s)
|
||||
end -- got_full_exits
|
||||
|
||||
function got_environment (s) -- eg. "Urban"
|
||||
BroadcastPlugin (6, s)
|
||||
end -- got_environment
|
||||
|
||||
function got_coordinates (s) -- eg. "38,3,1,0" (area,x,y,z)
|
||||
BroadcastPlugin (7, s)
|
||||
end -- got_coordinates
|
||||
|
||||
function got_info (s) -- eg. "shop,postoffice"
|
||||
BroadcastPlugin (8, s)
|
||||
end -- got_info
|
||||
|
||||
handlers = {
|
||||
['Auth.Request'] = got_auth_request, -- handled here
|
||||
|
||||
['Room.Num'] = got_room_number,
|
||||
['Room.Brief'] = got_room_brief,
|
||||
['Room.Exits'] = got_room_exits,
|
||||
['Char.Vitals'] = got_vitals,
|
||||
['Room.FullExits'] = got_full_exits,
|
||||
['Room.Environment'] = got_environment,
|
||||
['Room.Coordinates'] = got_coordinates,
|
||||
['Room.Info'] = got_info,
|
||||
|
||||
|
||||
} -- end handlers
|
||||
|
||||
function OnPluginTelnetSubnegotiation (type, option)
|
||||
|
||||
if type ~= ATCP then
|
||||
return
|
||||
end -- not Achaea subnegotiation
|
||||
|
||||
local command, args = string.match (option, "^([%a.]+)%s+(.*)$")
|
||||
|
||||
if not command then
|
||||
return
|
||||
end -- don't seem to have a command
|
||||
|
||||
local f = handlers [command]
|
||||
|
||||
if f then
|
||||
f (args) -- call handler
|
||||
else
|
||||
BroadcastPlugin (0, option) -- other, just send whole message
|
||||
end -- handler
|
||||
|
||||
end -- function OnPluginTelnetSubnegotiation
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
</muclient>
|
||||
41
cosmic rage/worlds/plugins/Add_NewLine_To_Prompt.xml
Normal file
41
cosmic rage/worlds/plugins/Add_NewLine_To_Prompt.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Sunday, October 22, 2006, 7:40 AM -->
|
||||
<!-- MuClient version 3.82 -->
|
||||
|
||||
<!-- Plugin "Add_NewLine_To_Prompt" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Add_NewLine_To_Prompt"
|
||||
author="Nick Gammon"
|
||||
id="1f68b8da856ceccb6f2ea308"
|
||||
language="Lua"
|
||||
purpose="Forces a newline after a prompt line"
|
||||
date_written="2006-10-22 07:38:36"
|
||||
requires="3.82"
|
||||
version="1.0"
|
||||
>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
function OnPluginPacketReceived (s)
|
||||
return (string.gsub (s, "Press <return> or 'cont' to continue, anything else to quit...", "%1\n"))
|
||||
end -- function OnPluginPacketReceived
|
||||
function OnPluginPacketReceived (s)
|
||||
return (string.gsub (s, "Would you like to create a new character\?","%1\n"))
|
||||
end -- function OnPluginPacketReceived
|
||||
function OnPluginPacketReceived (s)
|
||||
return (string.gsub (s, "Password\:","%1\n"))
|
||||
end -- function OnPluginPacketReceived
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
60
cosmic rage/worlds/plugins/Automatic_Backup.xml
Normal file
60
cosmic rage/worlds/plugins/Automatic_Backup.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Automatic_Backup"
|
||||
author="Nick Gammon"
|
||||
id="bb6a05ed7534b5db1ed40511"
|
||||
language="Lua"
|
||||
purpose="Backs up the world file to a new name each day"
|
||||
date_written="2010-09-08 09:38:17"
|
||||
requires="4.40"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Install to backup your world file to a file of the same name with the day/month/year added to it.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
function do_backup ()
|
||||
-- find name of world file
|
||||
local world_file_name = GetInfo (54)
|
||||
|
||||
-- if found (ie. not just newly created) back it up
|
||||
if world_file_name and world_file_name ~= "" then
|
||||
-- strip out .MCL (or .mcl), add the date, and put .MCL back
|
||||
world_file_with_date = string.gsub (world_file_name, "%.[Mm][Cc][Ll]$", "") ..
|
||||
os.date ("-backup-%d-%b-%Y.MCL")
|
||||
|
||||
-- save if possible
|
||||
if (Save (world_file_with_date, true) == false) then
|
||||
ColourNote ("orange","", "World file backed up as " .. world_file_with_date)
|
||||
else
|
||||
ColourNote ("red", "", "Could not back up world file.")
|
||||
end -- if
|
||||
|
||||
end -- if world file name known
|
||||
|
||||
end -- do_backup
|
||||
|
||||
-- back when first connecting
|
||||
function OnPluginConnect ()
|
||||
do_backup ()
|
||||
end -- OnPluginConnect
|
||||
|
||||
-- back up when disconnecting (eg. after improving it)
|
||||
function OnPluginDisconnect ()
|
||||
do_backup ()
|
||||
end -- OnPluginDisconnect
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
87
cosmic rage/worlds/plugins/Calculator.xml
Normal file
87
cosmic rage/worlds/plugins/Calculator.xml
Normal file
@@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Calculator"
|
||||
author="Nick Gammon"
|
||||
id="ba1329d6355e728dd100fd41"
|
||||
language="Lua"
|
||||
purpose="Provides a simple calculator"
|
||||
date_written="2010-08-25 14:55:13"
|
||||
date_modified="2015-01-10 14:11:00"
|
||||
requires="4.50"
|
||||
version="1.2"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
To calculate something enter "=" followed by an expression which can be evaluated by Lua.
|
||||
|
||||
eg.
|
||||
|
||||
= 2 + 2 (prints 4)
|
||||
|
||||
= sqrt (64) (prints 8)
|
||||
|
||||
The functions in the math, bit, string, utils and world libraries can be used without prefixing them with the library name.
|
||||
|
||||
eg.
|
||||
|
||||
= GetWorldID ()
|
||||
= match ("fruit", "u")
|
||||
= shl (4, 4)
|
||||
|
||||
In addition, you can use hex, oct, bin functions to convert to those bases for printing.
|
||||
|
||||
eg.
|
||||
|
||||
= hex (1234)
|
||||
= oct (5678)
|
||||
= bin (15)
|
||||
|
||||
If the number is small (with an exponent shown) it is echoed again with up to 15 decimal places.
|
||||
|
||||
eg. 28 * 16e-9 = 4.48e-007 (0.000000448)
|
||||
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
match="=*"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>
|
||||
-- useful number conversions
|
||||
bit.hex = function (num) return bit.tostring (num, 16) end
|
||||
bit.oct = function (num) return bit.tostring (num, 8) end
|
||||
bit.bin = function (num) return bit.tostring (num, 2) end
|
||||
|
||||
result = setfenv (assert (loadstring "return %1"), setmetatable ({},
|
||||
{__index = function (_, n) return math [n] or bit [n] or string [n] or utils [n] or world [n] end}) ) ()
|
||||
|
||||
-- turn result into a string, to see if it has "e-xxx" in it.
|
||||
formatted_result = tostring (result)
|
||||
|
||||
-- if an exponent shown, recalculate as a decimal without exponent
|
||||
if string.match (formatted_result, "e%%-") then
|
||||
local extra = string.format (" (%%0.15f)", result)
|
||||
|
||||
-- append number without exponent, omitting trailing zeroes
|
||||
formatted_result = formatted_result .. string.gsub (extra, "0+%%)", ")")
|
||||
end -- if
|
||||
|
||||
-- display result
|
||||
print ("%1 =", formatted_result)
|
||||
</send>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
</muclient>
|
||||
110
cosmic rage/worlds/plugins/CaptureMudOutput.xml
Normal file
110
cosmic rage/worlds/plugins/CaptureMudOutput.xml
Normal file
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Sunday, March 08, 2009, 1:14 PM -->
|
||||
<!-- MuClient version 4.40 -->
|
||||
|
||||
<!-- Plugin "CaptureMudOutput" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="CaptureMudOutput"
|
||||
author="Sean randall"
|
||||
id="fb1229fd8aa21fed1531db5c"
|
||||
language="lua"
|
||||
purpose="Allows quick logging of text from the connected world to a notepad window."
|
||||
date_written="2009-03-08 13:09:30"
|
||||
requires="4.40"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
I used this code as a script on a few MOOs I played.
|
||||
|
||||
The Plugin has one command, which is the abbreviation cmo. This needs to be typed by itself, without the period, in lower case.
|
||||
|
||||
Typing it once sets the plugin to "on" and anything received from the MUD that you haven't gagged will be appended to a notepad window. if you type it again, the appending will stop and the notepad will be activated.
|
||||
|
||||
The next time you turn it on, it will append - if the notepad was closed meantime it will create a new one.
|
||||
|
||||
At present this only works in one world at a time and doesn't check for an overfull notepad but it works welle enough for code listings, lists (from skills, spells, shops) etc.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
<include name="constants.lua"/>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="CMOProcessor"
|
||||
match="^cmo$"
|
||||
enabled="y"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
regexp="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
pad=""
|
||||
cmostate = 0
|
||||
function CMOProcessor(name, line, wildcards)
|
||||
if line ~= "cmo" then return end
|
||||
pad = "Output from "..world.GetInfo(2)
|
||||
if cmostate == 0 then
|
||||
Note("Now capturing Output.")
|
||||
if world.GetNotepadLength(pad) > 0 then
|
||||
Note("Output will be appended to the existing notepad.")
|
||||
end
|
||||
cmostate = 1
|
||||
else
|
||||
cmostate = 0
|
||||
Note("Capturing has been turned off.")
|
||||
if world.GetNotepadLength(pad) > 0 then
|
||||
world.ActivateNotepad(pad)
|
||||
else
|
||||
Note("Nothing was captured.")
|
||||
end
|
||||
end
|
||||
end
|
||||
function OnPluginScreendraw (t, log, line)
|
||||
if cmostate ~= 1 then return end
|
||||
pad = "Output from "..world.GetInfo(2)
|
||||
world.AppendToNotepad(pad,line.."\r\n")
|
||||
end
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="cmo:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
function OnHelp (sName, sLine, wildcards)
|
||||
world.Note (world.GetPluginInfo (world.GetPluginID, 3))
|
||||
end
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
127
cosmic rage/worlds/plugins/Code_Chart.xml
Normal file
127
cosmic rage/worlds/plugins/Code_Chart.xml
Normal file
@@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Code_Chart"
|
||||
author="Nick Gammon"
|
||||
id="fe800afdd06ded4235f35baa"
|
||||
language="Lua"
|
||||
purpose="Displays an ASCII code chart"
|
||||
date_written="2010-08-01 13:51:03"
|
||||
requires="4.40"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Type 'code_chart' to display a code chart.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="ascii_chart"
|
||||
match="code_chart"
|
||||
enabled="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
function ascii_chart (name, line, wildcards)
|
||||
|
||||
local control_characters = {
|
||||
|
||||
-- control sequences
|
||||
|
||||
[0] = "NUL", "SOH", "STX", "ETX", "EOT", "ENQ",
|
||||
"ACK", "BEL", "BS", "TAB", "LF", "VT",
|
||||
"FF", "CR", "SO", "SI", "DLE", "DC1",
|
||||
"DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
|
||||
"CAN", "EM", "SUB", "ESC", "FS", "GS",
|
||||
"RS", "US", "Space",
|
||||
|
||||
[127] = "DEL",
|
||||
|
||||
-- telnet codes
|
||||
|
||||
[0xEF] = "EOR",
|
||||
[0xF0] = "SE",
|
||||
[0xF1] = "NOP",
|
||||
[0xF2] = "DM",
|
||||
[0xF3] = "BRK",
|
||||
[0xF4] = "IP",
|
||||
[0xF5] = "AO",
|
||||
[0xF6] = "AYT",
|
||||
[0xF7] = "EC",
|
||||
[0xF8] = "EL",
|
||||
[0xF9] = "GA",
|
||||
[0xFA] = "SB",
|
||||
[0xFB] = "WILL",
|
||||
[0xFC] = "WONT",
|
||||
[0xFD] = "DO",
|
||||
[0xFE] = "DONT",
|
||||
[0xFF] = "IAC",
|
||||
}
|
||||
|
||||
-- telnet negotiation requests (eg. IAC WILL ECHO)
|
||||
local telnet_options = {
|
||||
|
||||
[0x01] = "Echo", -- 1 Echo
|
||||
[0x03] = "Suppress Go-ahead (SGA)", -- 3 Suppress go ahead
|
||||
[0x05] = "Status", -- 5 Status
|
||||
[0x06] = "Timing Mark", -- 6 Timing mark
|
||||
[0x18] = "Termtype", -- 24 Terminal type
|
||||
[0x19] = "End of record (EOR)", -- 25 EOR
|
||||
[0x1F] = "Window Size (NAWS)", -- 31 Window size
|
||||
[0x20] = "Terminal Speed", -- 32 Terminal speed
|
||||
[0x21] = "RFC", -- 33 Remote flow control
|
||||
[0x22] = "Line Mode", -- 34 Line mode
|
||||
[0x24] = "EV", -- 36 Environment variables
|
||||
[0x2A] = "Charset", -- 42 Character set
|
||||
[0x55] = "MCCP1", -- 85 MUD Compression Protocol v1
|
||||
[0x56] = "MCCP2", -- 86 MUD Compression Protocol v2
|
||||
[0x5A] = "MSP", -- 90 (MUD Sound Protocol)
|
||||
[0x5B] = "MXP", -- 91 (MUD eXtension Protocol)
|
||||
[0x5D] = "ZMP", -- 93 (ZMP Protocol)
|
||||
[0x66] = "Aardwolf", -- 102 (Aardwolf telnet protocol)
|
||||
[0xC8] = "ATCP", -- 200 ATCP (Achaea Telnet Protocol)
|
||||
[0xC9] = "ATCP2/GMCP", -- 201 ATCP2/GMCP (Generic Mud Control Protocol)
|
||||
[0xFF] = "Extended Options", -- for future expansion
|
||||
}
|
||||
|
||||
-- show each character
|
||||
for i = 0, 255 do
|
||||
local special = control_characters [i] or ""
|
||||
local telnet = telnet_options [i] or ""
|
||||
if i >= 32 then
|
||||
if GetOption ("utf_8") == 1 then
|
||||
char = utils.utf8encode (i)
|
||||
else
|
||||
char = string.char (i)
|
||||
end -- if Unicode or not
|
||||
else
|
||||
char = " ";
|
||||
end -- if printable or not
|
||||
print (string.format ("%3i %-5s %s 0x%02X %s", i, special, char, i, telnet))
|
||||
end -- for
|
||||
|
||||
end -- ascii_chart
|
||||
|
||||
-- show description
|
||||
ColourNote ("cyan", "", GetPluginInfo (GetPluginID (), 3))
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
</muclient>
|
||||
213
cosmic rage/worlds/plugins/ColourNote.xml
Normal file
213
cosmic rage/worlds/plugins/ColourNote.xml
Normal file
@@ -0,0 +1,213 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Wednesday, October 23, 2002, 12:48 PM -->
|
||||
<!-- MuClient version 3.26 -->
|
||||
|
||||
<!-- Plugin "ColourNote" generated by Plugin Wizard -->
|
||||
|
||||
<!--
|
||||
You can edit the lookup_colour function to add more colour codes.
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="ColourNote"
|
||||
author="Nick Gammon"
|
||||
id="8f86e2da6eea3806f1836050"
|
||||
language="JScript"
|
||||
purpose="Lets you send a string with colour codes to the world window"
|
||||
date_written="2002-10-23 12:46:12"
|
||||
requires="3.23"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
This is designed to be called from a script like this:
|
||||
|
||||
world.CallPlugin "8f86e2da6eea3806f1836050", _
|
||||
"colournote", _
|
||||
"~R red ~G green ~B blue ~RG red-on-green"
|
||||
|
||||
To simplify things, make a "stub" routine in your main script file, like this:
|
||||
|
||||
// example in Jscript:
|
||||
function ColourNote (text)
|
||||
{
|
||||
world.CallPlugin ("8f86e2da6eea3806f1836050", "colournote", text);
|
||||
}
|
||||
|
||||
' example in VBscript:
|
||||
sub ColourNote (text)
|
||||
world.CallPlugin "8f86e2da6eea3806f1836050", "colournote", text
|
||||
end sub
|
||||
|
||||
Then you can just do colour text like this:
|
||||
|
||||
ColourNote ("~R This is red ~G This is green ~B This is blue");
|
||||
|
||||
|
||||
ColourNote:help - this help
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
function lookup_colour (which)
|
||||
{
|
||||
var c;
|
||||
|
||||
// add more codes below if you want to process different letters
|
||||
// Reserved characters are: space, and: . # ^ ~
|
||||
|
||||
switch (which)
|
||||
{
|
||||
case "K": c = "gray"; break;
|
||||
case "k": c = "black"; break;
|
||||
|
||||
case "R": c = "red"; break;
|
||||
case "r": c = "maroon"; break;
|
||||
|
||||
case "G": c = "lime"; break;
|
||||
case "g": c = "green"; break;
|
||||
|
||||
case "Y": c = "yellow"; break;
|
||||
case "y": c = "olive"; break;
|
||||
|
||||
case "B": c = "blue"; break;
|
||||
case "b": c = "navy"; break;
|
||||
|
||||
case "M": c = "magenta"; break;
|
||||
case "m": c = "purple"; break;
|
||||
|
||||
case "C": c = "aqua"; break;
|
||||
case "c": c = "teal"; break;
|
||||
|
||||
case "W": c = "white"; break;
|
||||
case "w": c = "silver"; break;
|
||||
|
||||
default: c = ""; break; // unknown ones are no change
|
||||
} // end of switch on which colour code
|
||||
|
||||
return c;
|
||||
} // end of lookup_colour
|
||||
|
||||
/*
|
||||
This sends a coloured message to the world window.
|
||||
|
||||
Colour codes are like this: ~fb
|
||||
|
||||
~ = colour code delimiter
|
||||
f = foreground colour (eg. R = bright red, g = dull green)
|
||||
b = background colour (same meanings)
|
||||
|
||||
If the background colour is a space, then it is assumed to be
|
||||
unchanged. eg. ~R red ~G green ~B blue
|
||||
|
||||
Otherwise, it is processed as the background colour,
|
||||
eg. ~RB red-on-blue ~.G red-on-green ~yc dark-yellow on dark-cyan
|
||||
|
||||
Special colours:
|
||||
|
||||
. = no change (eg. to change background only)
|
||||
# = save colours (save current foreground/background colour)
|
||||
^ = restore colours (restore to saved colour)
|
||||
|
||||
eg.
|
||||
|
||||
colournote ("This will be a ~R red ~G green ~B blue.");
|
||||
|
||||
*/
|
||||
|
||||
function colournote (msg)
|
||||
{
|
||||
var msg_array, // split up line
|
||||
stext, // what we are sending
|
||||
fcolour, // foreground colour code
|
||||
bcolour, // background colour code
|
||||
foreground, // converted foreground colour
|
||||
background, // converted background colour
|
||||
save_foreground, // saved foreground colour
|
||||
save_background // saved background colour
|
||||
|
||||
// save colours for later restore
|
||||
|
||||
save_foreground = world.RGBColourToName (world.NoteColourFore ());
|
||||
save_background = world.RGBColourToName (world.NoteColourBack ());
|
||||
foreground = save_foreground;
|
||||
background = save_background;
|
||||
|
||||
// convert into an array
|
||||
|
||||
msg_array = msg.split ("~");
|
||||
|
||||
// first element in array (before tilde) is just shown as is
|
||||
|
||||
world.Tell (msg_array [0]);
|
||||
|
||||
for (i = 1; i < msg_array.length; i++)
|
||||
{
|
||||
fcolour = msg_array [i].substring (0, 1); // foreground colour
|
||||
bcolour = msg_array [i].substring (1, 2); // background colour
|
||||
stext = msg_array [i].substring (2); // rest is message
|
||||
|
||||
// get foreground colour, handle special cases, lookup others
|
||||
switch (fcolour)
|
||||
{
|
||||
case ".": break; // colour unchanged
|
||||
case "#": save_foreground = foreground; break;
|
||||
case "^": foreground = save_foreground; break;
|
||||
default: foreground = lookup_colour (fcolour); break;
|
||||
} // end of switch on fcolour
|
||||
|
||||
// get background colour, handle special cases, lookup others
|
||||
switch (bcolour)
|
||||
{
|
||||
case " ":
|
||||
case ".": break; // colour unchanged
|
||||
case "#": save_background = background; break;
|
||||
case "^": background = save_background; break;
|
||||
default: background = lookup_colour (bcolour); break;
|
||||
} // end of switch on fcolour
|
||||
|
||||
//
|
||||
// now display the text in the appropriate colour
|
||||
//
|
||||
world.ColourTell (foreground, background, stext);
|
||||
|
||||
} // end of loop on each colour change
|
||||
|
||||
world.Note (""); // finish off line
|
||||
|
||||
} // end of colournote
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="ColourNote:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
function OnHelp (sName, sLine, wildcards)
|
||||
{
|
||||
world.Note (world.GetPluginInfo (world.GetPluginID, 3));
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
295
cosmic rage/worlds/plugins/Config_Option_Changer.xml
Normal file
295
cosmic rage/worlds/plugins/Config_Option_Changer.xml
Normal file
@@ -0,0 +1,295 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Config_Option_Changer"
|
||||
author="Nick Gammon"
|
||||
id="edb75e5e80221bfb1a83a234"
|
||||
language="Lua"
|
||||
purpose="Changes options not available in GUI configuration"
|
||||
date_written="2010-08-09 10:28:14"
|
||||
date_modified="2010-09-15 13:00"
|
||||
requires="4.50"
|
||||
version="3.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Type 'config_options' to see dialog of options to change.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="config_options"
|
||||
match="config_options"
|
||||
enabled="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
-- See: http://www.gammon.com.au/forum/?id=10430
|
||||
|
||||
-- alpha options they can change
|
||||
alpha_options = {
|
||||
editor_window_name = { desc = 'Name of external editor window' },
|
||||
script_editor_argument = { desc = 'External editor argument' },
|
||||
timestamp_input = { desc = 'Timestamp (input)' },
|
||||
timestamp_notes = { desc = 'Timestamp (notes)' },
|
||||
timestamp_output = { desc = 'Timestamp (output)' },
|
||||
} -- end alpha_options
|
||||
|
||||
|
||||
-- boolean options they can change
|
||||
boolean_options = {
|
||||
auto_resize_command_window = { desc = 'Auto-resize command window?' },
|
||||
ctrl_backspace_deletes_last_word = { desc = 'Ctrl+Backspace deletes last word in command window' },
|
||||
default_alias_regexp = { desc = 'New aliases: default to regular expression?' },
|
||||
default_alias_expand_variables = { desc = 'New aliases: default to expand variables?' },
|
||||
default_alias_keep_evaluating = { desc = 'New aliases: default to keep evaluating?' },
|
||||
default_alias_ignore_case = { desc = 'New aliases: default to ignore case?' },
|
||||
default_trigger_regexp = { desc = 'New triggers: default to regular expression?' },
|
||||
default_trigger_expand_variables = { desc = 'New triggers: default to expand variables?' },
|
||||
default_trigger_keep_evaluating = { desc = 'New triggers: default to keep evaluating?' },
|
||||
default_trigger_ignore_case = { desc = 'New triggers: default to ignore case?' },
|
||||
do_not_add_macros_to_command_history = { desc = 'Add macros to command history?' , invert = true },
|
||||
do_not_show_outstanding_lines = { desc = 'Show outstanding lines count?' , invert = true },
|
||||
do_not_translate_iac_to_iac_iac = { desc = 'Translate IAC to IAC IAC?' , invert = true },
|
||||
log_script_errors = { desc = 'Log scripting errors?' },
|
||||
omit_date_from_save_files = { desc = 'Omit the date from world file saves?' },
|
||||
play_sounds_in_background = { desc = 'Play sounds in background?' },
|
||||
send_keep_alives = { desc = 'Send keep-alives?' },
|
||||
wrap_input = { desc = 'Wrap command window at output wrap column' },
|
||||
} -- end boolean_options
|
||||
|
||||
-- numeric options they can change
|
||||
numeric_options = {
|
||||
auto_resize_minimum_lines = { desc = 'Auto-resize: minimum lines', min = 1, max = 100 },
|
||||
auto_resize_maximum_lines = { desc = 'Auto-resize: maximum lines', min = 1, max = 100 },
|
||||
default_alias_send_to = { desc = 'New aliases: Default send-to location', min = 0, max = 14 },
|
||||
default_alias_sequence = { desc = 'New aliases: Default sequence', min = 0, max = 10000 },
|
||||
default_timer_send_to = { desc = 'New timers: Default send-to location', min = 0, max = 14 },
|
||||
default_trigger_send_to = { desc = 'New triggers: Default send-to location', min = 0, max = 14 },
|
||||
default_trigger_sequence = { desc = 'New triggers: Default sequence', min = 0, max = 10000 },
|
||||
fade_output_buffer_after_seconds = { desc = 'Output buffer: Time in seconds before fading lines (0=disable)', min = 0, max = 3600 },
|
||||
fade_output_opacity_percent = { desc = 'Output buffer: Percent opacity to fade to', min = 0, max = 100 },
|
||||
fade_output_seconds = { desc = 'Output buffer: Time to take to fade opacity (seconds)', min = 1, max = 60 },
|
||||
tool_tip_start_time = { desc = 'Tool tips: time before show, in milliseconds', min = 0, max = 120000 },
|
||||
tool_tip_visible_time = { desc = 'Tool tips: time visible, in milliseconds', min = 0, max = 120000 },
|
||||
} -- end numeric_options
|
||||
|
||||
-- colour options they can change
|
||||
colour_options = {
|
||||
timestamp_input_text_colour = { desc = 'Timestamp (input) text colour' },
|
||||
timestamp_notes_text_colour = { desc = 'Timestamp (notes) text colour' },
|
||||
timestamp_output_text_colour = { desc = 'Timestamp (output) text colour' },
|
||||
timestamp_input_back_colour = { desc = 'Timestamp (input) background colour' },
|
||||
timestamp_notes_back_colour = { desc = 'Timestamp (notes) background colour' },
|
||||
timestamp_output_back_colour = { desc = 'Timestamp (output) background colour' },
|
||||
} -- end colour_options
|
||||
|
||||
function edit_boolean_option (name)
|
||||
local val = GetOption (name)
|
||||
local info = boolean_options [name]
|
||||
|
||||
local default = 1 -- default to "Yes" button
|
||||
|
||||
-- if option not set, default to "No" button
|
||||
if (val == 0 and not info.invert) or
|
||||
(val == 1 and info.invert) then
|
||||
default = 2 -- default is "No" button
|
||||
end -- if
|
||||
|
||||
-- what do they *really* want?
|
||||
local response = utils.msgbox (info.desc, "Change option", "yesnocancel", "?", default )
|
||||
|
||||
-- if cancelled dialog, just return
|
||||
if response == "cancel" then
|
||||
return
|
||||
end -- if cancelled
|
||||
|
||||
-- if inverted question, we invert the response meaning
|
||||
local newval = 0
|
||||
|
||||
if info.invert then
|
||||
if response == "no" then
|
||||
newval = 1
|
||||
end -- if
|
||||
else
|
||||
if response == "yes" then
|
||||
newval = 1
|
||||
end -- if
|
||||
end -- if
|
||||
|
||||
-- notify if switched
|
||||
if val ~= newval then
|
||||
SetOption (name, newval)
|
||||
ColourNote ("cyan", "", "Option '" .. info.desc .. "' changed to: " .. response)
|
||||
end -- if
|
||||
|
||||
end -- edit_boolean_option
|
||||
|
||||
function edit_alpha_option (name)
|
||||
local val = GetAlphaOption (name)
|
||||
local info = alpha_options [name]
|
||||
|
||||
local response = utils.inputbox (info.desc, "Change option", val, "Courier", 9)
|
||||
|
||||
-- if cancelled dialog, just return
|
||||
if not response then
|
||||
return
|
||||
end -- cancelled
|
||||
|
||||
-- if value changed, notify them
|
||||
if response ~= val then
|
||||
SetAlphaOption (name, response)
|
||||
ColourNote ("cyan", "", string.format ("Option '%s' changed from '%s' to '%s'", info.desc, val, response))
|
||||
end -- if
|
||||
|
||||
end -- edit_alpha_option
|
||||
|
||||
function edit_numeric_option (name)
|
||||
local val = tonumber (GetOption (name))
|
||||
local info = numeric_options [name]
|
||||
|
||||
local response = utils.inputbox (
|
||||
string.format ("%s\r\n\r\nRange: %i to %i", info.desc, info.min, info.max),
|
||||
"Change option", val, "Courier", 9)
|
||||
|
||||
-- if cancelled dialog, just return
|
||||
if not response then
|
||||
return
|
||||
end -- cancelled
|
||||
|
||||
-- check numeric
|
||||
n = tonumber (response)
|
||||
|
||||
if not n then
|
||||
utils.msgbox ("You must enter a number",
|
||||
"Incorrect input", "ok", "!", 1)
|
||||
return
|
||||
end -- if
|
||||
|
||||
-- check in range
|
||||
if n < info.min or n > info.max then
|
||||
utils.msgbox (info.desc .. " must be in range " ..
|
||||
info.min .. " to " .. info.max,
|
||||
"Incorrect input", "ok", "!", 1)
|
||||
return
|
||||
end -- if
|
||||
|
||||
-- notify them if value changed
|
||||
if n ~= val then
|
||||
SetOption (name, n)
|
||||
ColourNote ("cyan", "", string.format ("Option '%s' changed from %i to %i", info.desc, val, n))
|
||||
end -- if
|
||||
|
||||
end -- edit_numeric_option
|
||||
|
||||
function edit_colour_option (name)
|
||||
local val = tonumber (GetOption (name))
|
||||
local info = colour_options [name]
|
||||
|
||||
local response = PickColour (val)
|
||||
|
||||
-- if cancelled dialog, just return
|
||||
if response == -1 then
|
||||
return
|
||||
end -- cancelled
|
||||
|
||||
-- if value changed, notify them
|
||||
if response ~= val then
|
||||
SetOption (name, response)
|
||||
ColourNote ("cyan", "", string.format ("Option '%s' changed from '%s' to '%s'",
|
||||
info.desc,
|
||||
RGBColourToName (val),
|
||||
RGBColourToName (response)))
|
||||
end -- if
|
||||
|
||||
end -- edit_colour_option
|
||||
|
||||
function config_options (name, line, wildcards)
|
||||
|
||||
repeat
|
||||
local choices = {}
|
||||
|
||||
-- build table of choices, with existing values
|
||||
|
||||
-- alpha
|
||||
for k, v in pairs (alpha_options) do
|
||||
local val = GetAlphaOption (k)
|
||||
if val then
|
||||
choices [k] = string.format ("%s (%s)", v.desc, val)
|
||||
end -- if exists
|
||||
end -- for alpha_options
|
||||
|
||||
-- boolean
|
||||
for k, v in pairs (boolean_options) do
|
||||
local val = GetOption (k)
|
||||
local yes_no = "Yes"
|
||||
if (val == 0 and not v.invert) or
|
||||
(val == 1 and v.invert) then
|
||||
yes_no = "No"
|
||||
end -- if
|
||||
if val then
|
||||
choices [k] = string.format ("%s (%s)", v.desc, yes_no)
|
||||
end -- if exists
|
||||
end -- for boolean_options
|
||||
|
||||
-- numeric
|
||||
for k, v in pairs (numeric_options) do
|
||||
local val = GetOption (k)
|
||||
if val then
|
||||
choices [k] = string.format ("%s (%i)", v.desc, val)
|
||||
end -- if exists
|
||||
end -- for numeric_options
|
||||
|
||||
-- colour
|
||||
for k, v in pairs (colour_options) do
|
||||
local val = GetOption (k)
|
||||
if val then
|
||||
choices [k] = string.format ("%s (%s)", v.desc, RGBColourToName (val))
|
||||
end -- if exists
|
||||
end -- for colour_options
|
||||
|
||||
-- choose one ...
|
||||
local result = utils.listbox (
|
||||
"Choose an option to edit.\r\n\r\nClick Cancel when done (any changes will be retained).",
|
||||
"Options", choices)
|
||||
|
||||
-- if not cancelled, go to appropriate handler
|
||||
if result then
|
||||
if alpha_options [result] then
|
||||
edit_alpha_option (result)
|
||||
elseif boolean_options [result] then
|
||||
edit_boolean_option (result)
|
||||
elseif numeric_options [result] then
|
||||
edit_numeric_option (result)
|
||||
elseif colour_options [result] then
|
||||
edit_colour_option (result)
|
||||
end -- if
|
||||
end -- if they chose something
|
||||
|
||||
until not result -- loop until dialog cancelled
|
||||
|
||||
end -- function config_options
|
||||
|
||||
ColourNote ("cyan", "", "Type 'config_options' to view options dialog.")
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
</muclient>
|
||||
98
cosmic rage/worlds/plugins/Copy_Output.xml
Normal file
98
cosmic rage/worlds/plugins/Copy_Output.xml
Normal file
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on vrijdag, augustus 03, 2007, 2:06 -->
|
||||
<!-- MuClient version 4.14 -->
|
||||
|
||||
<!-- Plugin "CopyScript" generated by Plugin Wizard -->
|
||||
|
||||
<!-- Amended slightly by Nick Gammon, from Worstje's version, on 17 Feb 2008 -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Copy_Output"
|
||||
author="Worstje"
|
||||
id="a0df42a8e796d974f4364245"
|
||||
language="Lua"
|
||||
purpose="Allows you to use CTRL+C for the output window if 'All typing goes to command window' is turned on."
|
||||
save_state="n"
|
||||
date_written="2007-08-03 02:04:12"
|
||||
requires="4.00"
|
||||
version="1.0"
|
||||
>
|
||||
|
||||
</plugin>
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
match="^Copy_Output:Copy:1bb75c016bc3e2b9d4c292db$"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
script="CopyScript"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
-- Thank you, Shaun Biggs, for taking your time to write the CopyScript
|
||||
-- (formerly Copy2) function below. It was slightly altered by me to suit
|
||||
-- my usage (wordwrapped lines and no \r\n at start of selection).
|
||||
|
||||
-- See forum: http://www.gammon.com.au/forum/bbshowpost.php?id=8052
|
||||
|
||||
-- some long alias that no-one will ever want to type
|
||||
Accelerator ("Ctrl+C", "Copy_Output:Copy:1bb75c016bc3e2b9d4c292db")
|
||||
|
||||
function CopyScript(name, line, wildcs)
|
||||
|
||||
-- find selection in output window, if any
|
||||
local first_line, last_line = GetSelectionStartLine(),
|
||||
math.min (GetSelectionEndLine(), GetLinesInBufferCount ())
|
||||
|
||||
local first_column, last_column = GetSelectionStartColumn(), GetSelectionEndColumn()
|
||||
|
||||
-- nothing selected, do normal copy
|
||||
if first_line <= 0 then
|
||||
DoCommand("copy")
|
||||
return
|
||||
end -- if nothing to copy from output window
|
||||
|
||||
local copystring = ""
|
||||
|
||||
-- iterate to build up copy text
|
||||
for line = first_line, last_line do
|
||||
|
||||
if line < last_line then
|
||||
copystring = copystring .. GetLineInfo(line).text:sub (first_column) -- copy rest of line
|
||||
first_column = 1
|
||||
|
||||
-- Is this a new line or merely the continuation of a paragraph?
|
||||
if GetLineInfo (line, 3) then
|
||||
copystring = copystring .. "\r\n"
|
||||
end -- new line
|
||||
|
||||
else
|
||||
copystring = copystring .. GetLineInfo(line).text:sub (first_column, last_column - 1)
|
||||
end -- if
|
||||
|
||||
end -- for loop
|
||||
|
||||
-- Get rid of a spurious extra new line at the start.
|
||||
if copystring:sub (1, 2) == "\r\n" then
|
||||
copystring = copystring:sub (3)
|
||||
end -- if newline at start
|
||||
|
||||
-- finally can set clipboard contents
|
||||
SetClipboard(copystring)
|
||||
|
||||
end -- function CopyScript
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
302
cosmic rage/worlds/plugins/CosmicRage.xml
Normal file
302
cosmic rage/worlds/plugins/CosmicRage.xml
Normal file
@@ -0,0 +1,302 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Thursday, October 11, 2018, 7:12 PM -->
|
||||
<!-- MuClient version 5.05 -->
|
||||
|
||||
<!-- Plugin "CosmicRage" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="CosmicRage"
|
||||
author="The Cosmic Rage hosting team"
|
||||
id="57139deb42b490952946f9e4"
|
||||
language="Lua"
|
||||
purpose="Main plugin for Cosmic Rage, which holds the main triggers, keystrokes, and functions."
|
||||
date_written="2004-08-26 19:06:10"
|
||||
requires="4.82"
|
||||
version="1.0"
|
||||
sequence="10000"
|
||||
>
|
||||
|
||||
</plugin>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
for i = 1, 9 do
|
||||
Accelerator("alt + " .. i, "@buffer " .. i)
|
||||
end
|
||||
Accelerator("alt + 0", "@buffer 10") -- 10 is a special case
|
||||
Accelerator("alt + right", "@buffer forward")
|
||||
Accelerator("alt + left", "@buffer backward")
|
||||
Accelerator("alt + down", "@buffer down")
|
||||
Accelerator("alt + up", "@buffer up")
|
||||
Accelerator("alt + pagedown", "@buffer scrolldown")
|
||||
Accelerator("alt + pageup", "@buffer scrollup")
|
||||
Accelerator("alt + end", "@buffer bottom")
|
||||
Accelerator("alt + home", "@buffer top")
|
||||
Accelerator("alt+shift+delete", "@buffer clear")
|
||||
Accelerator("alt+shift+right", "@buffer add")
|
||||
Accelerator("alt+shift+left", "@buffer delete")
|
||||
Accelerator("f5", "@sp-settings ambiance volume")
|
||||
Accelerator("f6", "@sp-settings clocks volume")
|
||||
Accelerator("f7", "@sp-settings in and out of character communications volume")
|
||||
Accelerator("f8", "@sp-settings planetary music volume")
|
||||
Accelerator("ctrl+f5", "@sp-settings General volume")
|
||||
Accelerator("ctrl+f6", "@sp-settings Combat music volume")
|
||||
Accelerator("ctrl+f7", "@sp-settings IC social volume")
|
||||
Accelerator("ctrl+f8", "@sp-settings OOC social volume")
|
||||
Accelerator("alt+f5", "@sp-settings Ground Combat volume")
|
||||
Accelerator("alt+f6", "@sp-settings harvesting activity volume")
|
||||
Accelerator("alt+f7", "@sp-settings Salvage activity volume")
|
||||
Accelerator("alt+f8", "@sp-settings volume for games such as Pilot's Parody")
|
||||
Accelerator("shift+f5", "@sp-settings starship combat volume")
|
||||
Accelerator("shift+f6", "@sp-settings ship volume")
|
||||
Accelerator("shift+f7", "@sp-settings ship movement volume")
|
||||
Accelerator("shift+f8", "@sp-settings vehicle volume")
|
||||
Accelerator("f9", "@sp-settings IC social sounds")
|
||||
Accelerator("f10", "@sp-settings OOC social sounds")
|
||||
Accelerator("alt+f9", "@sp-settings panning of sounds")
|
||||
Accelerator("alt+f10", "@sp-settings pitch-shifting sounds")
|
||||
Accelerator("alt+f11", "@sp-settings ambiance")
|
||||
Accelerator("ctrl+f9", "@sp-settings planetary music")
|
||||
Accelerator("ctrl+f10", "@sp-settings space combat music")
|
||||
Accelerator("ctrl+f11", "@sp-settings weather sounds")
|
||||
Accelerator("alt+f12", "@sp-restart")
|
||||
Accelerator("f2", "@sp-settings")
|
||||
Accelerator("shift+f1", "@sp-toggle")
|
||||
Accelerator("ctrl+alt+down", "nextline")
|
||||
Accelerator("ctrl+alt+up", "prevline")
|
||||
Accelerator("ctrl+alt+left", "topline")
|
||||
Accelerator("ctrl+alt+right", "endline")
|
||||
Accelerator("Ctrl+shift+enter", "@sp-settings buffer sounds")
|
||||
Accelerator("ctrl+shift+v", "@sp-version")
|
||||
|
||||
|
||||
function RegisterMushClient(name, line, wildcards)
|
||||
DoAfter(1, '@sp-register mush')
|
||||
end
|
||||
|
||||
-- Define the latest soundpack version here
|
||||
CURRENT_SP_VERSION = 6
|
||||
|
||||
function CheckSoundpackVersion(name, line, wildcards, styles)
|
||||
local user_version = tonumber(wildcards.user_version)
|
||||
if not user_version then
|
||||
ColourNote("red", "", "Error: Could not read your soundpack version.")
|
||||
return
|
||||
end
|
||||
|
||||
Note("You are currently running version " .. tostring(CURRENT_SP_VERSION).." of the Cosmic Rage Mush Immersion.")
|
||||
|
||||
local version_diff = user_version - CURRENT_SP_VERSION
|
||||
|
||||
if version_diff > 0 then
|
||||
ColourNote("yellow", "", "Warning: Your soundpack is " .. version_diff .. " version(s) out of date. We are now on version " .. user_version .. " of the soundpack.")
|
||||
ColourNote("yellow", "", "Run Updater.bat to pull the latest version.")
|
||||
else
|
||||
ColourNote("green", "", "Your soundpack is up to date!")
|
||||
end
|
||||
end
|
||||
|
||||
function url_encode(str)
|
||||
return (str:gsub("([^%w%-%_%.%~%/])", function(c)
|
||||
return string.format("%%%02X", string.byte(c))
|
||||
end))
|
||||
end
|
||||
]]>
|
||||
|
||||
|
||||
dir=world.GetInfo(67)
|
||||
require "socket.http"
|
||||
require "ltn12"
|
||||
PPI = require("ppi")
|
||||
ppi = PPI.Load("aedf0cb0be5bf045860d54b7")
|
||||
if not ppi then
|
||||
error("Dependency plugin not installed!")
|
||||
end
|
||||
</script>
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
<include name="constants.lua"/>
|
||||
|
||||
<!-- Triggers -->
|
||||
<triggers>
|
||||
<trigger
|
||||
enabled="y"
|
||||
group="hook"
|
||||
keep_evaluating="y"
|
||||
match = "Welcome to: Cosmic Rage!"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>
|
||||
local intro = tonumber(GetVariable("intro") or "")
|
||||
if not intro or ppi.isPlaying(intro) == 0 then
|
||||
temp = ppi.play(dir.."sounds/ogg/music/IntroMusic/DefaultIntro.ogg", 1, 0, 40)
|
||||
SetVariable("intro", temp)
|
||||
end
|
||||
</send>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
group="hook"
|
||||
keep_evaluating="y"
|
||||
match = "synaptic signal verified. Sleep mode disengaged. Welcome back to Cosmic Rage!"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
script="RegisterMushClient"
|
||||
>
|
||||
<send>
|
||||
temp=GetVariable("intro")
|
||||
ppi.stop(temp)
|
||||
</send>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
group="hook"
|
||||
keep_evaluating="y"
|
||||
match = "Your synaptic signal wavers for a moment, then returns with a snap!"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
script="RegisterMushClient"
|
||||
>
|
||||
<send>
|
||||
temp=GetVariable("intro")
|
||||
ppi.stop(temp)
|
||||
</send>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
group="hook"
|
||||
omit_from_output="y"
|
||||
match="^\$soundpack mush last version: (?P<user_version>\d+)"
|
||||
regexp="y"
|
||||
script="CheckSoundpackVersion"
|
||||
sequence="100"
|
||||
/>
|
||||
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
group="hook"
|
||||
omit_from_output="y"
|
||||
keep_evaluating="n"
|
||||
match="^\$sphook\s+(?P<action>[\w]+):(?P<path>[\w./\\\s]+):(?P<volume>[\w]+):(?P<pitch>[\w-]+):(?P<pan>[\w-]+):(?P<id>[\w]+)$"
|
||||
regexp="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>
|
||||
action="%1"
|
||||
path="%2"
|
||||
volume="%3"
|
||||
pitch="%4"
|
||||
pan="%5"
|
||||
id="%6"
|
||||
volume=tonumber(volume)
|
||||
if (path == "na") then
|
||||
else
|
||||
sound_path = dir .. "sounds/ogg/" .. path .. ".ogg"
|
||||
directory_path = sound_path:match("(.*/)")
|
||||
if directory_path then
|
||||
test_file = io.open(directory_path .. "tester.txt", "w")
|
||||
if test_file then
|
||||
test_file:close()
|
||||
os.remove(directory_path .. "checker.txt") -- Clean up
|
||||
else
|
||||
os.execute('mkdir "' .. directory_path .. '" 2>nul')
|
||||
end
|
||||
end
|
||||
file = io.open(sound_path, "r")
|
||||
if file then
|
||||
file:close()
|
||||
else
|
||||
local encoded_path = url_encode(path)
|
||||
local download_url = "http://nathantech.net:3000/CosmicRage/CosmicRageSounds/raw/branch/main/ogg/" .. encoded_path .. ".ogg"
|
||||
body = {}
|
||||
result, status_code, headers, status = socket.http.request{
|
||||
url = download_url, sink = ltn12.sink.table(body)
|
||||
}
|
||||
if result and status_code == 200 then
|
||||
save_file = io.open(sound_path, "wb")
|
||||
if save_file then
|
||||
save_file:write(table.concat(body))
|
||||
save_file:close()
|
||||
end
|
||||
else
|
||||
Note("Download of "..path.." failed with status code: " .. tostring(status_code))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (pitch == "na") then
|
||||
pitch = -10000
|
||||
else
|
||||
pitch = tonumber(pitch)
|
||||
pitch = (pitch - 44100) / 98
|
||||
end
|
||||
|
||||
if (pan == "na") then
|
||||
pan = -10000
|
||||
else
|
||||
pan = tonumber(pan)
|
||||
end
|
||||
|
||||
if (action == "play") then
|
||||
temp = ppi.play(dir.."sounds/ogg/"..path..".ogg", 0, pan, volume)
|
||||
if (pitch > -10000) then
|
||||
ppi.setPitch(pitch, temp)
|
||||
end
|
||||
if (pan > -10000) then
|
||||
ppi.setPan(pan, temp)
|
||||
end
|
||||
end
|
||||
if (action=="playrec") then
|
||||
temp=ppi.play(dir.."sounds/ogg/"..path..".ogg", 0, pan, volume)
|
||||
SetVariable(id, temp)
|
||||
if(pitch>-10000) then
|
||||
ppi.setPitch(pitch,temp)
|
||||
end
|
||||
if(pan>-10000) then
|
||||
ppi.setPan(pan,temp)
|
||||
end
|
||||
end
|
||||
if (action=="loop") then
|
||||
temp=ppi.play(dir.."sounds/ogg/"..path..".ogg", 1, pan, volume)
|
||||
SetVariable(id, temp)
|
||||
if(pitch>-10000) then
|
||||
ppi.setPitch(pitch,temp)
|
||||
end
|
||||
if(pan>-10000) then
|
||||
ppi.setPan(pan,temp)
|
||||
end
|
||||
end
|
||||
if (action=="adjustsound") then
|
||||
temp=GetVariable (id)
|
||||
if(volume>-1) then
|
||||
ppi.setVol(volume,temp)
|
||||
end
|
||||
if(pitch>-10000) then
|
||||
ppi.setPitch(pitch,temp)
|
||||
end
|
||||
if(pan>-10000) then
|
||||
ppi.setPan(pan,temp)
|
||||
end
|
||||
end
|
||||
if (action=="stop") then
|
||||
temp=GetVariable(id)
|
||||
ppi.stop(temp)
|
||||
end
|
||||
</send>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
</aliases>
|
||||
|
||||
</muclient>
|
||||
207
cosmic rage/worlds/plugins/Current_Output_Window.xml
Normal file
207
cosmic rage/worlds/plugins/Current_Output_Window.xml
Normal file
@@ -0,0 +1,207 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Current_Output_Window"
|
||||
author="Nick Gammon"
|
||||
id="391192793248409895090099"
|
||||
language="Lua"
|
||||
purpose="Redirects recent output to a miniwindow"
|
||||
date_written="2009-02-05 17:00"
|
||||
date_modified="2009-07-20"
|
||||
save_state="y"
|
||||
requires="4.42"
|
||||
version="2.0"
|
||||
>
|
||||
|
||||
</plugin>
|
||||
|
||||
<timers>
|
||||
<timer second="0.50"
|
||||
enabled="y"
|
||||
script="heartbeat"
|
||||
>
|
||||
</timer>
|
||||
</timers>
|
||||
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
-- configuration
|
||||
|
||||
-- number of lines to show
|
||||
MAX_LINES = 20
|
||||
|
||||
-- font
|
||||
FONT_NAME = "Dina"
|
||||
FONT_SIZE = 8
|
||||
|
||||
-- where to put the window
|
||||
WINDOW_POSITION = 6 -- see below (6 is top right)
|
||||
|
||||
--[[
|
||||
Useful positions:
|
||||
|
||||
4 = top left
|
||||
5 = center left-right at top
|
||||
6 = top right
|
||||
7 = on right, center top-bottom
|
||||
8 = on right, at bottom
|
||||
9 = center left-right at bottom
|
||||
--]]
|
||||
|
||||
|
||||
-- colours
|
||||
WINDOW_BACKGROUND_COLOUR = ColourNameToRGB ("khaki")
|
||||
WINDOW_TEXT_COLOUR = ColourNameToRGB ("black")
|
||||
|
||||
-- offset of text from edge
|
||||
TEXT_INSET = 5
|
||||
|
||||
-- where to store the trace line
|
||||
lines = {} -- table of recent trace lines
|
||||
|
||||
-- display one line
|
||||
function Display_Line (line, text)
|
||||
|
||||
local left = TEXT_INSET
|
||||
local top = (line - 1) * font_height + TEXT_INSET
|
||||
|
||||
WindowText (win, "f", text, left, top, window_width - TEXT_INSET, 0, WINDOW_TEXT_COLOUR)
|
||||
|
||||
end -- Display_Line
|
||||
|
||||
function add_line (line)
|
||||
-- remove first line if filled up
|
||||
if #lines >= MAX_LINES then
|
||||
table.remove (lines, 1)
|
||||
end -- if
|
||||
|
||||
-- add new line
|
||||
table.insert (lines, line)
|
||||
|
||||
end -- add_line
|
||||
|
||||
-- here on output to display
|
||||
function OnPluginScreendraw (type, log, line)
|
||||
|
||||
-- blank existing window contents
|
||||
WindowRectOp (win, 2, 0, 0, 0, 0, WINDOW_BACKGROUND_COLOUR)
|
||||
|
||||
-- draw drag bar rectangle
|
||||
WindowRectOp (win, 2, 0, 0, 0, font_height, ColourNameToRGB ("darkgoldenrod"))
|
||||
|
||||
-- wrap long lines, at a space if possible
|
||||
while #line > wrap_column do
|
||||
|
||||
-- find a space not followed by a space, closest to the end of the line
|
||||
local col = string.find (line:sub (1, wrap_column), "%s%S*$")
|
||||
|
||||
if col and col > 2 then
|
||||
col = col - 1 -- use the space to indent
|
||||
else
|
||||
col = wrap_column -- just cut off at wrap_column
|
||||
end -- if
|
||||
|
||||
add_line (line:sub (1, col))
|
||||
line = line:sub (col + 1)
|
||||
|
||||
end -- while line > max
|
||||
|
||||
-- add remainder of line
|
||||
add_line (line)
|
||||
|
||||
local sz = WindowTextWidth (win, "fb", "Recent Output")
|
||||
WindowText (win, "fb", "Recent Output", (window_width - sz) / 2, 0, window_width - TEXT_INSET, 0, WINDOW_TEXT_COLOUR)
|
||||
|
||||
-- display all lines
|
||||
for k, v in ipairs (lines) do
|
||||
Display_Line (k + 1, v)
|
||||
end -- for
|
||||
|
||||
end -- end OnPluginScreendraw
|
||||
|
||||
|
||||
-- hide window on removal
|
||||
function OnPluginClose ()
|
||||
WindowShow (win, false) -- hide it
|
||||
end -- OnPluginClose
|
||||
|
||||
-- hide window on disable
|
||||
function OnPluginDisable ()
|
||||
WindowShow (win, false) -- hide it
|
||||
end -- OnPluginDisable
|
||||
|
||||
-- show window on enable
|
||||
function OnPluginEnable ()
|
||||
if #lines > 0 then
|
||||
WindowShow (win, true) -- show it
|
||||
end -- if
|
||||
end -- OnPluginEnable
|
||||
|
||||
function heartbeat (timername)
|
||||
|
||||
if GetInfo (113) then
|
||||
-- display window if output window paused and we have something to show
|
||||
WindowShow (win, GetInfo (114) and #lines > 0)
|
||||
end -- if world active
|
||||
|
||||
end -- heartbeat
|
||||
|
||||
function OnPluginSaveState ()
|
||||
-- save window current location for next time
|
||||
movewindow.save_state (win)
|
||||
end -- function OnPluginSaveState
|
||||
|
||||
-- startup stuff
|
||||
|
||||
win = GetPluginID () -- get a unique name
|
||||
|
||||
-- make the window
|
||||
WindowCreate (win, 0, 0, 1, 1, WINDOW_POSITION, 0,
|
||||
WINDOW_BACKGROUND_COLOUR) -- create window
|
||||
|
||||
-- grab a font
|
||||
WindowFont (win, "f", FONT_NAME, FONT_SIZE) -- define font
|
||||
WindowFont (win, "fb", FONT_NAME, FONT_SIZE, true) -- define font
|
||||
|
||||
-- work out how high and wide it is
|
||||
font_height = WindowFontInfo (win, "f", 1) -- height of the font
|
||||
wrap_column = GetOption ("wrap_column")
|
||||
|
||||
window_width = (wrap_column * WindowFontInfo (win, "f", 6)) + (TEXT_INSET * 2)
|
||||
window_height = (MAX_LINES + 1) * font_height + TEXT_INSET * 2 -- one more line for title
|
||||
|
||||
require "movewindow" -- load the movewindow.lua module
|
||||
|
||||
-- install the window movement handler, get back the window position
|
||||
windowinfo = movewindow.install (win, WINDOW_POSITION)
|
||||
|
||||
-- remake the window with the correct width
|
||||
WindowCreate (win,
|
||||
windowinfo.window_left,
|
||||
windowinfo.window_top,
|
||||
window_width, window_height,
|
||||
windowinfo.window_mode,
|
||||
windowinfo.window_flags,
|
||||
WINDOW_BACKGROUND_COLOUR)
|
||||
|
||||
-- add the drag handler so they can move the window around
|
||||
movewindow.add_drag_handler (win, 0, 0, 0, font_height)
|
||||
|
||||
fonts = utils.getfontfamilies ()
|
||||
|
||||
if not fonts.Dina then
|
||||
AddFont (GetInfo (66) .. "\\Dina.fon")
|
||||
end -- if Dina not installed
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
|
||||
183
cosmic rage/worlds/plugins/Global_Option_Updater.xml
Normal file
183
cosmic rage/worlds/plugins/Global_Option_Updater.xml
Normal file
@@ -0,0 +1,183 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Global_Option_Updater"
|
||||
author="Nick Gammon"
|
||||
id="1204316574ebc1d41d7011b3"
|
||||
language="Lua"
|
||||
purpose="Shows / changes global options"
|
||||
date_written="2010-09-17 08:28:51"
|
||||
date_modified="2018-03-28 11:06"
|
||||
requires="4.50"
|
||||
version="2.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Usage:
|
||||
|
||||
list_global_options --> list all valid option names
|
||||
show_global_option x --> displays value of option
|
||||
change_global_option x y --> changes value of option x to y
|
||||
|
||||
|
||||
eg.
|
||||
|
||||
show_global_option FixedPitchFont
|
||||
|
||||
change_global_option FixedPitchFont Dina
|
||||
|
||||
After changing an option you should exit the client and re-open it, otherwise
|
||||
if you use the GUI interface (global preferences) it may put the option back again.
|
||||
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
match="change_global_option * *"
|
||||
enabled="y"
|
||||
sequence="100"
|
||||
script="ChangeOption"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="show_global_option *"
|
||||
enabled="y"
|
||||
sequence="100"
|
||||
script="ShowOption"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="list_global_options"
|
||||
enabled="y"
|
||||
sequence="100"
|
||||
script="ListOptions"
|
||||
>
|
||||
</alias>
|
||||
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
|
||||
function ListOptions (name, line, wildcards)
|
||||
|
||||
ColourNote ("cyan", "", "Global Options")
|
||||
ColourNote ("cyan", "", string.rep ("-", 40))
|
||||
|
||||
-- show all
|
||||
|
||||
local t = GetGlobalOptionList ()
|
||||
table.sort (t)
|
||||
|
||||
for k, v in ipairs (t) do
|
||||
ColourNote ("cyan", "", v)
|
||||
end -- for
|
||||
|
||||
ColourNote ("cyan", "", string.rep ("-", 40))
|
||||
end -- ListOptions
|
||||
|
||||
function ShowOption (name, line, wildcards)
|
||||
|
||||
local whichOption = wildcards [1]
|
||||
|
||||
-- find all possible keys
|
||||
local t = { }
|
||||
for k, v in ipairs (GetGlobalOptionList ()) do
|
||||
t [v] = true
|
||||
end -- for
|
||||
|
||||
if not t [whichOption] then
|
||||
ColourNote ("red", "", "Item '" .. whichOption .. "' is not a global option. Try: list_global_options")
|
||||
ColourNote ("deepskyblue", "", "Option names are case-sensitive.")
|
||||
return
|
||||
end -- if option not found
|
||||
|
||||
-- open preferences database
|
||||
local db = assert (sqlite3.open (GetInfo (82)))
|
||||
local value = nil
|
||||
|
||||
-- find the item
|
||||
for a in db:nrows ("SELECT * FROM prefs WHERE name = '" .. whichOption .. "'") do
|
||||
value = a.value
|
||||
end -- for
|
||||
|
||||
-- if found, display it
|
||||
if value then
|
||||
ColourTell ("cyan", "", "Item '" .. whichOption .. "' has value '")
|
||||
ColourTell ("orange", "", value)
|
||||
ColourNote ("cyan", "", "'")
|
||||
else
|
||||
ColourNote ("red", "", "Item '" .. whichOption .. "' is not in preferences database")
|
||||
end -- does not exist
|
||||
|
||||
db:close()
|
||||
|
||||
end -- ShowOption
|
||||
|
||||
function ChangeOption (name, line, wildcards)
|
||||
|
||||
local whichOption = wildcards [1]
|
||||
local newValue = wildcards [2]
|
||||
|
||||
-- find all possible keys
|
||||
local t = { }
|
||||
for k, v in ipairs (GetGlobalOptionList ()) do
|
||||
t [v] = true
|
||||
end -- for
|
||||
|
||||
if not t [whichOption] then
|
||||
ColourNote ("red", "", "Item '" .. whichOption .. "' is not a global option. Try: list_global_options")
|
||||
ColourNote ("deepskyblue", "", "Option names are case-sensitive.")
|
||||
return
|
||||
end -- if
|
||||
|
||||
-- open preferences database
|
||||
local db = assert (sqlite3.open (GetInfo (82)))
|
||||
local value = '(nothing)'
|
||||
|
||||
-- see if this key already exists and if so, what its value is
|
||||
for a in db:nrows ("SELECT * FROM prefs WHERE name = '" .. whichOption .. "'") do
|
||||
value = a.value
|
||||
end -- for
|
||||
|
||||
-- fix up quotes
|
||||
newValueFixed = string.gsub (newValue, "'", "''")
|
||||
|
||||
if db:execute ("INSERT OR REPLACE INTO prefs " ..
|
||||
"(name, value) VALUES ('" .. whichOption .. "', '"
|
||||
.. newValue .. "')") ~= sqlite3.OK then
|
||||
ColourNote ("red", "", "Unable to modify preferences: " .. db:errmsg ())
|
||||
else
|
||||
if value ~= "%2" then
|
||||
ColourNote ("cyan", "", "Item '" .. whichOption .. "' changed from '"
|
||||
.. value .. "' to '" .. newValue .. "'")
|
||||
ColourNote ("orange", "", [[
|
||||
After changing an option you should exit the client and re-open it, otherwise
|
||||
if you use the GUI interface (global preferences) it may put the option back again
|
||||
to its old value because the options are kept in memory.]])
|
||||
|
||||
else
|
||||
ColourNote ("cyan", "", "No change required, value of '"
|
||||
.. whichOption .. "' is already '" .. newValue .. "'")
|
||||
end -- if
|
||||
end -- if updated OK
|
||||
|
||||
db:close()
|
||||
|
||||
end -- ChangeOption
|
||||
|
||||
-- show help
|
||||
ColourNote ("cyan", "", GetPluginInfo (GetPluginID (), 3))
|
||||
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
72
cosmic rage/worlds/plugins/Hyperlink_URL.xml
Normal file
72
cosmic rage/worlds/plugins/Hyperlink_URL.xml
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Friday, July 25, 2003, 11:37 AM -->
|
||||
<!-- MuClient version 3.42 -->
|
||||
|
||||
<!-- Plugin "Hyperlink_URL" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Hyperlink_URL"
|
||||
author="Nick Gammon"
|
||||
id="eb9ea32827509752b18f9d70"
|
||||
language="VBscript"
|
||||
purpose="Makes a URL on a line into a hyperlink"
|
||||
date_written="2003-07-25 11:35:21"
|
||||
requires="3.41"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Detects text starting with HTTP:xxx and makes that part into a hyperlink.
|
||||
|
||||
Limitations -
|
||||
|
||||
1. Only detects one per line
|
||||
|
||||
2. The rest of the line will be shown in white on black - other colours will be discarded.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
<include name="constants.vbs"/>
|
||||
|
||||
<!-- Triggers -->
|
||||
|
||||
<triggers>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="(.*)(http\:\/\/(?:[A-Za-z0-9\.\\\/\?])+)(.*)"
|
||||
omit_from_output="y"
|
||||
regexp="y"
|
||||
script="OnHyperlink"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
sub OnHyperlink (name, line, wildcards)
|
||||
ColourTell RGBColourToName (NormalColour(8)), _
|
||||
RGBColourToName (NormalColour(1)), _
|
||||
wildcards (1)
|
||||
Hyperlink wildcards (2), wildcards (2), "", "", "", 1
|
||||
ColourNote RGBColourToName (NormalColour(8)), _
|
||||
RGBColourToName (NormalColour(1)), _
|
||||
wildcards (3)
|
||||
end sub
|
||||
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
</muclient>
|
||||
519
cosmic rage/worlds/plugins/InfoBox_Demo.xml
Normal file
519
cosmic rage/worlds/plugins/InfoBox_Demo.xml
Normal file
@@ -0,0 +1,519 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Monday, November 24, 2008, 11:16 PM -->
|
||||
<!-- MuClient version 4.38 -->
|
||||
|
||||
<!-- Plugin "InfoBox_Demo" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="InfoBox_Demo"
|
||||
author="Spellbound"
|
||||
id="48b09fb93b098e1fac548e10"
|
||||
language="Lua"
|
||||
purpose="Demonstrate the InfoBox.lua module"
|
||||
date_written="2008-11-24 23:12:53"
|
||||
requires="4.37"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
This demo module will walk you through the functionality of the InfoBox lua module. Start the demo with "Demo Intro" or "Demo 1" to see what this module can do for you.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
<include name="constants.lua"/>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="Demofunc"
|
||||
match="Demo *"
|
||||
enabled="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
match="Example"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>print() print()
|
||||
print(Demo[ThisTopic].code)</send>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
require "InfoBox"
|
||||
|
||||
ThisTopic = "Intro"
|
||||
|
||||
function Demofunc (a, l, w, sr)
|
||||
print(string.rep("\n", 40))
|
||||
for i,v in ipairs(WindowList() or {}) do
|
||||
if v:match("^IBDemo") then WindowDelete(v) end
|
||||
end
|
||||
ThisTopic = w[1]
|
||||
if tonumber(w[1]) then ThisTopic = Demo[tonumber(w[1])] end
|
||||
if Demo[ThisTopic] then
|
||||
print(ThisTopic, "\n")
|
||||
print ( Demo[ThisTopic].text)
|
||||
ColourNote("white", "black", "\nExample:\n")
|
||||
assert(loadstring(Demo[ThisTopic].code))()
|
||||
ColourNote("white", "black", Demo[ThisTopic].code )
|
||||
print("\nDemo Topics:\n\t")
|
||||
print ( Demo:concat(", ") )
|
||||
print('\n\nSelect a "Demo <Topic>", or press enter to continue.\n\n')
|
||||
AddTimer('Next', 0, 0, .3, '', timer_flag.Enabled + timer_flag.OneShot + timer_flag.Temporary + timer_flag.ActiveWhenClosed, 'SetCmdArea')
|
||||
end end
|
||||
|
||||
|
||||
function SetCmdArea (t,l,w)
|
||||
SelectCommand()
|
||||
PasteCommand ("Demo " .. Demo[ThisTopic].NextTopic)
|
||||
SelectCommand()
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- The Samples --
|
||||
|
||||
Demo = { "Intro",
|
||||
"MiniWindowOverview",
|
||||
"Bar-Overview", "BarStyles-Fills", "BarStyles-Frames", "MiniWindowGrid", "ThresholdAndFade",
|
||||
"Text", "Text-Placement", "Text-Font", "Text-Advanced", "MiniWindowPosition",
|
||||
"BarSpacing", "Watches", "Misc", "Putting-It-Together"}
|
||||
|
||||
|
||||
setmetatable(Demo, {__index = table})
|
||||
|
||||
Demo.Intro = {
|
||||
text =[[This Plugin will demonstrate the functions in the InfoBox.lua module.
|
||||
The Module itself is meant to give you flexible, powerful results with minimal scripting on your part. The white example text is the exact script that generates the sample boxes for each topic.
|
||||
|
||||
For a Quick start, you can be up and running with only the following lines of code:
|
||||
|
||||
require "InfoBox"
|
||||
box = InfoBox:New("HP")
|
||||
hp = box:AddBar("HP: ", 50)
|
||||
|
||||
and in your prompt/hpbar trigger:
|
||||
hp.value = <new percentage number>
|
||||
box:Update()
|
||||
]],
|
||||
code = [[box = InfoBox:New("IBDemo")
|
||||
box:AddBar("HP: ", 75)
|
||||
box:Update()
|
||||
]]}
|
||||
|
||||
|
||||
Demo.MiniWindowOverview = {text = [[
|
||||
The InfoBox has 3 main tables that you will deal with.
|
||||
The MiniWindow itself, is the table that's created by
|
||||
MW = InfoBox:New("name")
|
||||
|
||||
MiniWindow.Bar is the table where default settings for gauges are set.
|
||||
MiniWindow.Bars is a table with a reference to all bars within the
|
||||
miniwindow.
|
||||
|
||||
A bar is a table created by calling MW:AddBar(<options>).
|
||||
This table is added to MW.Bars, and has a metatable referring to MW.Bar, which in turn refers to MW, which also refers back to InfoBox itself.
|
||||
This allows you to inherit default values.
|
||||
|
||||
Naming conventions within the module are:
|
||||
all values begin with a lower case letter. i.e. hp.value, box.backgroundColour
|
||||
all functions begin with a capital letter. i.e. box:Update()
|
||||
The exceptions to this convention are the .Bar and .Bars subtables. ]] , -- [[Crimson's shadow routine is buggy.]]
|
||||
code =
|
||||
[[ ]]}
|
||||
|
||||
Demo["Bar-Overview"] = {text =
|
||||
[[The AddBar function takes a numer of optional parameters. Parameters
|
||||
not specified will be supplied from the MW.Bar table, the MW itself, or the module.
|
||||
|
||||
bar = MW:AddBar(caption, value, goodColour, badColour, anchorRight, barStyle)
|
||||
|
||||
The values all have coresponding functions that perform any additional validation.
|
||||
The bar variable assignment is optional. You can still access the created bar
|
||||
through the MW.Bars table.
|
||||
|
||||
The anchorRight value determines what side of the gauge has the 0 value.
|
||||
|
||||
:InsertBar() takes an index as the first parameter, and then the same parameters the AddBar() function does.
|
||||
:RemoveBar() takes the index of the bar you want to remove. It is recommended using the RemoveBar() function instead of just setting .Bars[n] = nil since the Draw routine depends on ipairs() and not having any gaps in the indices of the .Bars table.
|
||||
]] ,
|
||||
code = [[
|
||||
MW = InfoBox:New("IBDemoAddBar")
|
||||
MW:AddBar() ; MW.Bars[1].barStyle = 0 -- An empty bar.
|
||||
MW:AddBar("2nd", 80, "green", 0x000000, false, MW.barStyles.flat + MW.barStyles.solid)
|
||||
MW:AddBar("3rd", 80, "#FFaa55", "cyan", true, MW.barStyles.flat + MW.barStyles.solid)
|
||||
MW:AddBar("4th")
|
||||
MW:Update()
|
||||
]]}
|
||||
|
||||
Demo.ThresholdAndFade = {text = [[
|
||||
The .threshold value has slightly different effects based on what barStyle the
|
||||
gauge currently has. It is the value where goodColour transitions to badColour.
|
||||
.value > .threshold is .goodColour; .value <= .threshold is .badColour.
|
||||
|
||||
The .fade property changes the gauge's color based on its .value. The gauge
|
||||
will be drawn in .badColour from 0% to its .threshold value; it will then step
|
||||
towards goodColour at 100%, in 5% increments. The fade property affects goodColour on gradient type fills as well.
|
||||
]] , --']] >
|
||||
code =[[
|
||||
MW = InfoBox:New("IBDemoFade")
|
||||
MW.windowWidth = 360 ; MW:Columns(2)
|
||||
MW.Bar.fade = true ; MW.Bar.threshold = 40
|
||||
for i = 100,30,-5 do
|
||||
MW:AddBar(i, i, "#00FFFF", "red")
|
||||
end
|
||||
for i = 100,30,-5 do
|
||||
MW:AddBar(i, i, "cyan", "firebrick")
|
||||
MW.Bars[#MW.Bars].barStyle = MW.barStyles.glass + MW.barStyles.gradientFixed
|
||||
end
|
||||
MW:Update()
|
||||
]]}
|
||||
|
||||
|
||||
Demo["BarStyles-Fills"] = {text =[[
|
||||
The look of a gauge is determined by its .barStyle value, which is a
|
||||
combination of a fill and a frame. The values are enumerated in the
|
||||
InfoBox.barStyles table.
|
||||
.barStyles.solid is a standard solid color. The .fade property looks best on this fillstyle.
|
||||
.barStyles.gradientScale has goodColour at the value. The midpoint of the gradient is one half of the value.
|
||||
.barStyles.gradientFixed has goodColour at 100%, and the visibility changes. The midpoint is set by .threshold.
|
||||
.barStyles.gradientShift has its midpoint at value. It always fills 100% of .gaugeWidth .
|
||||
]],
|
||||
code =[[
|
||||
local stylename = {[0]="sunken","raised","raisedCap", "flat","glass",
|
||||
"solid", "gradientScale", "gradientFixed", "gradientShift"}
|
||||
MWs = {}
|
||||
for i = 5,8 do
|
||||
MWs [#MWs+1] = InfoBox:New("IBDemo" .. i)
|
||||
MWs[#MWs]:AddBar(string.format(".barStyles.%s = %i", stylename[i], 2^i),
|
||||
0,0,0,false,0)
|
||||
for j = 1,4 do
|
||||
MWs[#MWs]:AddBar("",100 - (14*j), "green","firebrick",
|
||||
false,InfoBox.barStyles[ stylename[i] ] + InfoBox.barStyles.glass)
|
||||
MWs[#MWs].Bars[j+1].threshold = 35
|
||||
end end
|
||||
for i=1,3 do
|
||||
MWs[3]:AddBar("",90, "dodgerblue", "purple", false,
|
||||
MWs[3].barStyles.gradientFixed + MWs[3].barStyles.glass)
|
||||
MWs[3].Bars[i+5].threshold = i * 25
|
||||
end
|
||||
for i=1,4 do MWs[i]:Update() end
|
||||
]]}
|
||||
|
||||
Demo["BarStyles-Frames"] = {text = [[
|
||||
The complement to barStyles fills are frames.
|
||||
The difference between .raised and .raisedCap is only noticable when the bar has
|
||||
a .captionPlacment of .left or .right; in which case, the frame extends around
|
||||
the caption as well.
|
||||
]]
|
||||
,
|
||||
code = [[
|
||||
MW = InfoBox:New("IBDemoFrames")
|
||||
MW:AddBar("none", 80, "green", 0, false, MW.barStyles.solid)
|
||||
MW:AddBar("sunken", 80, "green", 0, false, MW.barStyles.solid + MW.barStyles.sunken)
|
||||
MW:AddBar("raised", 80, "green", 0, false, MW.barStyles.solid + MW.barStyles.raised)
|
||||
MW:AddBar("raisedCap", 80, "green", 0, false, MW.barStyles.solid + MW.barStyles.raisedCap)
|
||||
MW:AddBar("flat", 80, "green", 0, false, MW.barStyles.solid + MW.barStyles.flat)
|
||||
MW:AddBar("glass", 80, "green", 0, false, MW.barStyles.solid + MW.barStyles.glass)
|
||||
MW:Update()
|
||||
]]}
|
||||
|
||||
Demo["Text"] = {text = [[
|
||||
Simple text can be added by setting a bar's .caption value.
|
||||
The Caption function sets the value, or if given a number,
|
||||
it sets the caption with commas added to the ciphers.
|
||||
|
||||
The .textColour value is a number specifying the color of the text.
|
||||
(i.e. .textColour = 255, not "red")
|
||||
The TextColour function will do the appropriate conversion between a color
|
||||
name, the (long) number value, and an HTML formatted hex string ("#FF00AA").
|
||||
|
||||
Text effects can be added with the .textStyle value. They are enumerated in the .textStyles table.
|
||||
]], -- ']]
|
||||
code = [[
|
||||
MW = InfoBox:New("IBDemoText")
|
||||
for i = 1,2 do MW:AddBar() end
|
||||
MW.Bars[1].caption = "Sample Text" ; MW.Bars[1].textColour = 0x006600
|
||||
MW.Bars[2]:Caption(100000)
|
||||
MW:Update()
|
||||
|
||||
|
||||
MW2 = InfoBox:New("IBDemoTextStyles")
|
||||
local txtstyles ={"plain", "matte", "raised", "raised + matte", "sunken", "sunken + matte"}
|
||||
for i = 0,5 do
|
||||
MW2:AddBar(txtstyles[i+1], 45, "dodgerblue", 0x272727, false, 65)
|
||||
MW2.Bars[#MW2.Bars].textStyle = i
|
||||
end
|
||||
MW2:Update()
|
||||
]]}
|
||||
|
||||
|
||||
Demo["Text-Advanced"] = {text = [[
|
||||
The ColourText function is designed to take a value, a threshold, and 3 colors;
|
||||
good, bad, neutral(optional). This is intended to simplify coloring changes to
|
||||
HP (-17, 0, "green", "red", "black"), or displaying your hp (MyHP, maxHP*.3,
|
||||
"darkgreen", "red").
|
||||
This function sets .textColour accordingly, and returns no value.
|
||||
|
||||
The caption also supports coloring syntax similar to the chat plugin, with
|
||||
the @ symbol denoting a color identifier. The 16 ansi values are set to
|
||||
MushClient's color settings (c,m,y,k,r,g,b,w & bolds C,M,Y,K...). Additional
|
||||
colors can be specified in a table attached to the .customColourCodes value
|
||||
on the bar or MiniWindow tables.
|
||||
This table should have a single character key, and the number value of the
|
||||
color.
|
||||
|
||||
An "@~" identifies the .textColour value in the caption.
|
||||
]], --']]
|
||||
code = [[
|
||||
MW = InfoBox:New("IBDemoColor")
|
||||
MW.customColourCodes = { O = colour_names.orange, I = colour_names.indigo }
|
||||
MW:AddBar("@RR @Oa @Yi @Gn @Bb @Io @mw")
|
||||
MW.Bars[1].textStyle = MW.textStyles.raised
|
||||
HPGauge = MW:AddBar("", 75)
|
||||
local hpCaptionFmt = "@kHP: %i/%i (@~%+3i@k)"
|
||||
local hpDelta = -25
|
||||
HPGauge:ColourText(hpDelta, 0, "green", "red", "black")
|
||||
HPGauge.caption = hpCaptionFmt:format(530, 600, hpDelta)
|
||||
MW:Update()
|
||||
]]}
|
||||
|
||||
Demo["Text-Placement"] = {text =[[You should call CaptionPlacement() function when changing the value of .captionPlacement as it calculates the .gaugeLeft and .gaugeWidth values for you.
|
||||
Bar:CaptionPlacement(x) sets and recalculates the column. MW:CaptionPlacement([x]) sets the default for bars, or recalculates all columns if left blank.
|
||||
]] ,
|
||||
|
||||
code =[[MWs = {}
|
||||
caps = { "left", "innerLeft", "innerRight","right", "center","centerCell", "both",}
|
||||
for i = 1,7 do
|
||||
MWs[i] = InfoBox:New("IBDemoCap" .. i)
|
||||
MWs[i]:AddBar(caps[i],100) ; MWs[i]:AddBar(caps[i],100)
|
||||
MWs[i].Bars[1].captionPlacement = i-1
|
||||
MWs[i].Bars[2].captionPlacement = i-1
|
||||
if i > 4 then
|
||||
MWs[i].Bars[1].captionPlacement = i-1
|
||||
MWs[i].Bars[2].captionPlacement = 3
|
||||
end
|
||||
if i == 7 then
|
||||
MWs[i].Bars[1].captionPlacement = 0
|
||||
end
|
||||
MWs[i]:CaptionPlacement()
|
||||
end
|
||||
MWs[4].Bars[1].barStyle = MWs[4].barStyles.solid + MWs[4].barStyles.raised
|
||||
MWs[4].Bars[2].barStyle = MWs[4].barStyles.solid + MWs[4].barStyles.raisedCap
|
||||
for i = 1,7 do
|
||||
MWs[i]:Update()
|
||||
end
|
||||
|
||||
]]
|
||||
|
||||
}
|
||||
|
||||
|
||||
Demo["MiniWindowGrid"] = { text =[[So far, you've seen an InfoBox window with a column of gauges. The InfoBox window is actually a grid.
|
||||
The size and layout is determined by 3 values in the MiniWindow table, .rows, .columns, and .axis
|
||||
The height of the MiniWindow is determined by the number of rows.
|
||||
The width of the Miniwindow is determined by the .windowWidth value.
|
||||
The size of the cell for the gauge and caption is the windowWidth divided by the number of columns.
|
||||
The .axis value should be either "rows" or "columns" and determines which value is incremented if the grid is not large enough to display all bars.
|
||||
Bars are displayed in columns, filling one before moving over to the top of the next.]], --']]
|
||||
|
||||
code = [[MW1 = InfoBox:New("IBDemoColumn")
|
||||
MW1.axis = "columns"
|
||||
MW1:AddBar("1",50) MW1:AddBar("2",50) MW1:AddBar("3",50)
|
||||
MW2 = InfoBox:New("IBDemoGrid")
|
||||
MW2.columns = 2
|
||||
MW2:AddBar("1",50) MW2:AddBar("2",50) MW2:AddBar("3",50)
|
||||
MW1:Update() MW2:Update()
|
||||
]]}
|
||||
|
||||
|
||||
Demo["Text-Font"] = {text = [[Fonts can be specified on a per bar or per window basis. Module supplies the windowName and fontID values automatically, other optional values are:
|
||||
"fontName", "fontSize", "fontBold", "fontItalic", "fontUnderline", "fontStrikeout", "fontCharset", "fontPitchAndFamily"
|
||||
|
||||
Calling :Font() with no parameters deletes the font on the specified object so that you can re-inherit from a parent object.
|
||||
]],
|
||||
|
||||
code = [[MW = InfoBox:New("IBDemoFonts")
|
||||
bar = MW:AddBar("Test") bar:Font("Sylvaen", 12)
|
||||
bar = MW:AddBar("Test") bar:Font("Comic Sans MS", 14)
|
||||
bar = MW:AddBar("Test") bar:Font("Courier New", 8)
|
||||
MW:Update()
|
||||
]]
|
||||
}
|
||||
|
||||
Demo["MiniWindowPosition"] ={ text=[[The .windowPosition value should be read only; you should always use the :WindowPosition() function to set the value.
|
||||
The positions are enumerated in the .windowPositions table. They are named after the cardinal points of the compass to help you remember.
|
||||
The N and S (north/top and south/bottom) automatically set the .axis value to "columns". The W,SW and S positions resize the output window to not overlap each other. InfoBox windows share screen space with other miniwindows from other plugins nicely. The resizing routines for the N and S windows won't overlap E and W windows. If there are enough windows, the module will size windows accordingly:
|
||||
WNNNNE
|
||||
W E
|
||||
W E
|
||||
SSSSSS
|
||||
|
||||
Setting the .displaceOutput value to true will cause other window positions to resize the mud text area.]], --']]
|
||||
|
||||
code = [[SE = InfoBox:New("IBDemoSE") ; SE:AddBar() ; SE:AddBar() ; SE:AddBar()
|
||||
SE:WindowPosition(SE.windowPositions.SE)
|
||||
MW = InfoBox:New("IBDemoWinPosS")
|
||||
MW:WindowPosition(MW.windowPositions.S)
|
||||
MW:AddBar("Hi") MW:AddBar("There")
|
||||
MW2 = InfoBox:New("IBDemoWinPosE")
|
||||
MW2:AddBar("Default")
|
||||
SE:Update() MW:Update() MW2:Update()
|
||||
]]
|
||||
|
||||
}
|
||||
|
||||
|
||||
Demo["BarSpacing"] ={ text=[[You can tweak the appearance of gauges with the following values:
|
||||
.fontHeight is set automatically from the loaded font's properties. Don't change it. :)
|
||||
.cellPadding is added to .fontHeight to generate the default value for .cellHeight
|
||||
.cellHeight actually determines the bottom edge of the gauge.
|
||||
.gaugeHeight is subtracted from cellHeight to get the top edge of the gauge.
|
||||
.padding is added to cellHeight before drawing the next Bar.
|
||||
.fontPadding is used to adjust the text position. It's added from the top of the cell.]], --']]
|
||||
|
||||
code = [[MW = InfoBox:New("IBDemoFunky")
|
||||
a = MW:AddBar("First", 50) ; a.padding = 10
|
||||
b = MW:AddBar("Second", 50)
|
||||
c = MW:AddBar("Third", 50) ; c.fontPadding = 0
|
||||
d = MW:AddBar("Fourth", 50) ; d.gaugeHeight = d.cellHeight *.5 ; d.textStyle=1
|
||||
e = MW:AddBar("Fifth", 50)
|
||||
MW:Update()
|
||||
|
||||
]]
|
||||
|
||||
}
|
||||
Demo["Watches"] ={ text=[[There are 2 more convenient functions in the bar object.
|
||||
The WatchCaption() and WatchValue() functions take the name of a variable and use the contents of that variable for the respective property values.
|
||||
This can simplify your prompt triggers. Clearing them is done by setting a specific value with the Caption() or Value() functions.]],
|
||||
|
||||
code = [[myVars ={hp=100, maxHp=200} myVars.percentHP=(myVars.hp/myVars.maxHp)*100
|
||||
|
||||
MW = InfoBox:New("IBDemoWatch")
|
||||
MW:AddBar()
|
||||
MW.Bars[1]:WatchValue("myVars.percentHP")
|
||||
MW:Update()
|
||||
--myVars.percentHP = 20 ; MW:Update()
|
||||
--myVars.percentHP = 80 ; MW:Update()
|
||||
--etc...
|
||||
|
||||
]]
|
||||
|
||||
}
|
||||
Demo["Misc"] ={ text=[[The CloseWindow() and ReloadFonts() functions are for plugin authors and Disable/enable features.
|
||||
The Resize() function is useful for the PluginOnWorldOutputResized callback for InfoBoxes positioned at the top or bottom.
|
||||
|
||||
The Update function will only redraw once a second, to prevent slamming the CPU during speedwalks. It returns true or false on whether it did update. This is useful for keeping displayed Deltas in sync.
|
||||
|
||||
The CaptionPlacement() function uses a different algorithm for determining a bar's column placement than the Update() and Resize() functions.
|
||||
The CaptionPlacement() routine just uses the bar.id modulo .columns to determine which column a bar is in.
|
||||
|
||||
This Update() routine enables the following behaviour when, for example:
|
||||
You have a 2x3 grid, 5 bars, and bar #3 is a larger font size than the other bars; the grid will shift bar 4 to the next column so that it can be as short as possible.
|
||||
|
||||
The difference in algorithms means that if bar 3's .captionPlacement is left, but bar 4's .captionPlacement is innerLeft, bar 4's .gaugeLeft and .gaugeWidth are still set as if it draws in column 2.
|
||||
Reset bar4's .gaugeLeft and .gaugeWidth manually in this fringe case.
|
||||
]],
|
||||
|
||||
code = [[local wp = InfoBox.windowPositions
|
||||
MW=InfoBox:New("IBDemoBug") ;
|
||||
MW.windowWidth = 400 ; MW.rows=2 ; MW.columns = 3
|
||||
for i=1,5 do MW:AddBar("Blah",75,"blue") end
|
||||
A = MW.Bars[3] ; A.caption = "Big" ; A:Font("Comic Sans MS", 16)
|
||||
A:CaptionPlacement(A.captionPlacements.left)
|
||||
B = MW.Bars[4] ; B.caption = "Oops" ; B:TextColour("cyan")
|
||||
|
||||
MW2 = InfoBox:New("IBDemoBugWorkaround")
|
||||
MW2.windowWidth = 400 ; MW2.rows=2 ; MW2.columns = 3
|
||||
for i=1,5 do MW2:AddBar("Whee",75,"cyan") end
|
||||
C = MW2.Bars[3] ; C.caption = "Big" ; C:Font("Comic Sans MS", 16)
|
||||
C:CaptionPlacement(C.captionPlacements.left)
|
||||
D = MW2.Bars[4] ; D.caption = "Fixed"
|
||||
D.gaugeWidth = nil ; D.gaugeLeft = nil
|
||||
MW:Update() ; MW2:Update()]]
|
||||
|
||||
}
|
||||
Demo["Putting-It-Together"] ={ text=[[Here's a sample from my own character.]],
|
||||
|
||||
code = [[sty = InfoBox.barStyles
|
||||
HPBox = InfoBox:New("IBDemoHP")
|
||||
HPBox.Bar.textStyle = HPBox.textStyles.sunken
|
||||
HPBox.Bar.barStyle = sty.glass + sty.gradientFixed
|
||||
HPBar = HPBox:AddBar("HP", 0, "green", "firebrick", false)
|
||||
HPBar.threshold = 52
|
||||
HPBar:WatchValue ("vars.pHP")
|
||||
HPStatus = HPBox:AddBar("",0,0,0,false,0)
|
||||
HPStatus.textStyle = 1
|
||||
KarmaBar = HPBox:AddBar("Karma", 0,"dodgerblue", "firebrick", false)
|
||||
KarmaBar.threshold = 40
|
||||
KarmaBar:WatchValue("vars.pKarma")
|
||||
KStatus = HPBox:AddBar("",0,0,0,false,0)
|
||||
KStatus:TextColour ("peachpuff")
|
||||
KStatus.captionPlacement = 4
|
||||
SPBar = HPBox:AddBar("SP", 0, "deepskyblue", "dimgray", false, sty.glass + sty.gradientShift)
|
||||
SPBar:WatchValue("vars.pSP")
|
||||
VoiceBar = HPBox:AddBar("Voice", 0, "mediumpurple", "indigo", false, sty.glass + sty.gradientScale)
|
||||
VoiceBar:WatchValue("vars.cVoice")
|
||||
EnemyBar = HPBox:AddBar("", 0, 0x222222, 0x000070, true, sty.glass + sty.gradientScale)
|
||||
EnemyBar.fade = true ; EnemyBar.threshold = 10
|
||||
EnemyBar.textStyle = 1
|
||||
EnemyBar:CaptionPlacement(1)
|
||||
HPBox:WindowPosition ( InfoBox.windowPositions.S )
|
||||
HPBox:Rows (2)
|
||||
HPBox:Columns(4)
|
||||
--Following values are normally set by other triggers.
|
||||
vars = {pHP = 90, pSP=80, cVoice = 57, pKarma = 85}
|
||||
EnemyBar.caption = "Bad Guy" ; EnemyBar.value = 65
|
||||
KStatus.caption = "Perfoming: Amazing Grace"
|
||||
HPStatus.caption = " HP: 900/1027 (@G+25@~)"
|
||||
HPBox:Update()
|
||||
]]
|
||||
|
||||
}
|
||||
|
||||
for i,v in ipairs (Demo) do Demo[v].NextTopic = Demo[i+1] or Demo[1] end
|
||||
|
||||
function OnPluginInstall()
|
||||
Demofunc(nil,nil,{"Intro"})
|
||||
end
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="InfoBox_Demo:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
function OnHelp ()
|
||||
world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
|
||||
end
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
63
cosmic rage/worlds/plugins/Installer_sumcheck.xml
Normal file
63
cosmic rage/worlds/plugins/Installer_sumcheck.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Saturday, August 19, 2006, 2:50 PM -->
|
||||
<!-- MuClient version 3.78 -->
|
||||
|
||||
<!-- Plugin "Installer_sumcheck" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Installer_sumcheck"
|
||||
author="Nick Gammon"
|
||||
id="4a267cd69ba59b5ecefe42d8"
|
||||
language="Lua"
|
||||
purpose="Sumchecks the MUSHclient installer"
|
||||
date_written="2006-08-19 14:48:45"
|
||||
requires="3.74"
|
||||
version="1.0"
|
||||
>
|
||||
|
||||
<description trim="y">
|
||||
* Type 'md5sum' to activate.
|
||||
|
||||
* Navigate to the mushclientXXX.exe file you downloaded.
|
||||
(The XXX will be the version number).
|
||||
|
||||
* Click 'Open'.
|
||||
|
||||
The resulting message (in the output window) will show you the sumcheck.
|
||||
|
||||
This should agree with the sumcheck shown on the web page announcing the MUSHclient version.
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
match="md5sum"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>name = utils.filepicker ("Choose file", "mushclient*.exe", "exe",
|
||||
{ exe = "MUSHclient installers" } )
|
||||
|
||||
if name then
|
||||
f = io.open (name, "rb")
|
||||
if f then
|
||||
print ("sumcheck of", name, "=", string.lower (utils.tohex (utils.md5 (f:read ("*a")))))
|
||||
f:close ()
|
||||
end -- if opened file ok
|
||||
end -- if have name
|
||||
</send>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
ColourNote ("cyan", "", "Type 'md5sum' to sumcheck a file.")
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
402
cosmic rage/worlds/plugins/LuaAudio.xml
Normal file
402
cosmic rage/worlds/plugins/LuaAudio.xml
Normal file
@@ -0,0 +1,402 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Tuesday, December 09, 2008, 2:04 PM -->
|
||||
<!-- MuClient version 4.37 -->
|
||||
|
||||
<!-- Plugin "LuaAudio" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="LuaAudio"
|
||||
author="Tyler Spivey"
|
||||
id="aedf0cb0be5bf045860d54b7"
|
||||
language="Lua"
|
||||
purpose="Test audio plugin for lua"
|
||||
save_state="y"
|
||||
date_written="2008-12-09 14:02:34"
|
||||
requires="4.37"
|
||||
version="1.0"
|
||||
>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
<include name="constants.lua"/>
|
||||
<aliases>
|
||||
<alias
|
||||
match="sound_toggle"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>
|
||||
if (sounds==0) then
|
||||
sounds=1
|
||||
Note("Sounds on.")
|
||||
audio.volume(vol,0)
|
||||
Sound(GetInfo(67).."/sounds/luaaudio/on.ogg")
|
||||
return
|
||||
else
|
||||
sounds=0
|
||||
Sound(GetInfo(67).."/sounds/luaaudio/off.ogg")
|
||||
Note("Sounds off.")
|
||||
vol=audio.getVolume()
|
||||
DoAfterSpecial(0.3, 'Sound("volume=0")', 12)
|
||||
return
|
||||
end
|
||||
</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="volume_down"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>
|
||||
if (sounds==0) then
|
||||
Execute("tts_interrupt You're not supposed to use this function while sounds are off you weird person.")
|
||||
Sound(GetInfo(67).."/sounds/luaaudio/error2.ogg")
|
||||
return
|
||||
end
|
||||
if (volume_changed==1) then
|
||||
if (vol==0) then
|
||||
Note("It's muted you noob.")
|
||||
else
|
||||
vol=vol-5
|
||||
SetVariable("vol", vol)
|
||||
SaveState()
|
||||
Sound("volume="..vol.."")
|
||||
Sound(GetInfo(67).."/sounds/luaaudio/down.ogg")
|
||||
end --volume changed 0
|
||||
else
|
||||
volume_changed=1
|
||||
if (GetVariable("vol") == nil) then
|
||||
vol=100
|
||||
vol=vol-5
|
||||
SetVariable("vol", vol)
|
||||
SaveState()
|
||||
Sound("volume="..vol.."")
|
||||
Sound(GetInfo(67).."/sounds/luaaudio/down.ogg")
|
||||
else --if it is not nil
|
||||
vol=tonumber(GetVariable("vol"))
|
||||
if (vol==0) then
|
||||
Note("It's muted you noob.")
|
||||
else
|
||||
vol=vol-5
|
||||
SetVariable("vol", vol)
|
||||
SaveState()
|
||||
Sound("volume="..vol.."")
|
||||
Sound(GetInfo(67).."/sounds/luaaudio/up.ogg")
|
||||
end --not 0
|
||||
end --not nil
|
||||
end --changed not changed
|
||||
</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="vol"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>
|
||||
Note(vol)
|
||||
Note(GetVariable("vol"))
|
||||
Note(sounds)
|
||||
</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="volume_up"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>
|
||||
if (sounds==0) then
|
||||
Execute("tts_interrupt You're not supposed to use this function while sounds are off you weird person.")
|
||||
return
|
||||
end
|
||||
if (volume_changed==1) then
|
||||
if (vol>=100) then
|
||||
Note("Volume range can't be greater than 100.")
|
||||
Sound(GetInfo(67).."/sounds/luaaudio/error.ogg")
|
||||
else
|
||||
vol=vol+5
|
||||
SetVariable("vol", vol)
|
||||
SaveState()
|
||||
Sound("volume="..vol.."")
|
||||
Sound(GetInfo(67).."/sounds/luaaudio/up.ogg")
|
||||
end --volume changed 100
|
||||
else
|
||||
volume_changed=1
|
||||
if (GetVariable("vol") == nil) then
|
||||
vol=100
|
||||
SetVariable("vol", 100)
|
||||
Note("Volume range can't be greater than 100.")
|
||||
Sound(GetInfo(67).."/sounds/luaaudio/error.ogg")
|
||||
SaveState()
|
||||
else --if it is not nil
|
||||
vol=tonumber(GetVariable("vol"))
|
||||
if (vol>=100) then
|
||||
Note("Volume range can't be greater than 100.")
|
||||
Sound(GetInfo(67).."/sounds/luaaudio/error.ogg")
|
||||
else
|
||||
vol=vol+5
|
||||
SetVariable("vol", vol)
|
||||
SaveState()
|
||||
Sound("volume="..vol.."")
|
||||
Sound(GetInfo(67).."/sounds/luaaudio/up.ogg")
|
||||
end --not 100
|
||||
end --not nil
|
||||
end --changed not changed
|
||||
</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="sound_close"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>audio.free()
|
||||
</send>
|
||||
</alias>
|
||||
</aliases>
|
||||
<script>
|
||||
<![CDATA[
|
||||
local ppi=require "ppi"
|
||||
|
||||
|
||||
|
||||
|
||||
function sfreq(freqing)
|
||||
freq=split(freqing, "=")
|
||||
val=freq[1]
|
||||
file=freq[2]
|
||||
Sound("freq="..val)
|
||||
Sound(file)
|
||||
end
|
||||
|
||||
local function isPlaying(id)
|
||||
return audio.isPlaying(id)
|
||||
end
|
||||
|
||||
local function getVolume(id)
|
||||
return audio.getVolume(id)
|
||||
end -- local function getVolume(id)
|
||||
|
||||
function SoundPan(panning)
|
||||
pan=split(panning, "=")
|
||||
current=tonumber(pan[1])
|
||||
max=tonumber(pan[2])
|
||||
file=pan[3]
|
||||
Sound("pan="..(current*200/max)-100)
|
||||
Sound(file)
|
||||
Sound("pan=0")
|
||||
end -- function SoundPan(panning)
|
||||
|
||||
function split(str, pat)
|
||||
local t = {}
|
||||
local fpat = "(.-)" .. pat
|
||||
local last_end = 1
|
||||
local s, e, cap = str:find(fpat, 1)
|
||||
while s do
|
||||
if s ~= 1 or cap ~= "" then
|
||||
table.insert(t,cap)
|
||||
end
|
||||
last_end = e+1
|
||||
s, e, cap = str:find(fpat, last_end)
|
||||
end
|
||||
if last_end <= #str then
|
||||
cap = str:sub(last_end)
|
||||
table.insert(t, cap)
|
||||
end
|
||||
return t
|
||||
end -- function split(str, pat)
|
||||
|
||||
-- mapping of loops to ids
|
||||
loops = {}
|
||||
|
||||
|
||||
function OnPluginPlaySound(file)
|
||||
if file == "" then
|
||||
audio.stop(0)
|
||||
return
|
||||
end -- if
|
||||
|
||||
if file:find("=") then
|
||||
t = split(file, "=")
|
||||
if t[1] == "pan" then
|
||||
audio.pan(tonumber(t[2]))
|
||||
elseif t[1] == "volume" then
|
||||
audio.volume(tonumber(t[2]))
|
||||
elseif t[1] == "freq" then
|
||||
audio.freq(tonumber(t[2]))
|
||||
elseif t[1] == "loop" then
|
||||
file = t[2]
|
||||
local id = audio.play(file, 1)
|
||||
|
||||
if id ~= 0 then
|
||||
loops[file] = id
|
||||
end -- If
|
||||
|
||||
elseif t[1] == "stop" then
|
||||
if t[2] == "all" then
|
||||
for k,v in pairs(loops) do
|
||||
audio.stop(v)
|
||||
end
|
||||
elseif loops[t[2]] then
|
||||
audio.stop(loops[t[2]])
|
||||
loops[t[2]] = nil
|
||||
end
|
||||
end -- if t1
|
||||
else -- doesn't contain =
|
||||
id=audio.play(file,0)
|
||||
end -- if contains =
|
||||
end -- function OnPluginPlaySound(file)
|
||||
|
||||
function setPan(x, id)
|
||||
if x and id then
|
||||
audio.pan(x, id)
|
||||
else
|
||||
|
||||
end -- if
|
||||
end -- function setPan(x,id)
|
||||
|
||||
function setPitch(x, id)
|
||||
if x and id then
|
||||
audio.pitch(x,id)
|
||||
else
|
||||
|
||||
end -- if
|
||||
end -- function setPitch(x,id)
|
||||
|
||||
function setVol(x, id)
|
||||
if x and id then
|
||||
audio.volume(x, id)
|
||||
else
|
||||
|
||||
end -- if
|
||||
end -- function setVol(x,id)
|
||||
|
||||
--
|
||||
-- Slides volume up or down aka fading. x refers to the desired volume, id the playout id, and time is in ms.
|
||||
function slideVol(x, id, time)
|
||||
if x and id and time then
|
||||
audio.slideVol(x, id, time)
|
||||
else
|
||||
|
||||
end -- if
|
||||
end -- function slideVol(x,id,time)
|
||||
|
||||
function fadeout(id, _time)
|
||||
if id then
|
||||
audio.fadeout(id, _time)
|
||||
else
|
||||
end -- if
|
||||
end -- function fadeout(id,time)
|
||||
|
||||
function slidePan(x, id, _time)
|
||||
if x and id then
|
||||
audio.slidePan(x, id, _time)
|
||||
else
|
||||
end -- if
|
||||
end -- function slidePan(x, id, time)
|
||||
|
||||
local function slidePitch(x, id, _time)
|
||||
if x and id then
|
||||
audio.slidePitch(x, id, _time)
|
||||
else
|
||||
|
||||
end -- if
|
||||
end
|
||||
|
||||
local function stop(id)
|
||||
if id then
|
||||
audio.stop(id)
|
||||
end -- if
|
||||
end
|
||||
|
||||
local function playDelay(file, time, pan, vol)
|
||||
return audio.playDelay(file, time, pan, vol)
|
||||
end -- local function playDelay(file, time, pan, vol)
|
||||
|
||||
local function playDelayLooped(file,time,pan,vol)
|
||||
id=audio.playDelayLooped(file,time,pan,vol)
|
||||
return id
|
||||
end -- local function playDelayLooped(file,time,pan,vol)
|
||||
|
||||
local function playLooped(file)
|
||||
id=audio.play(file,1)
|
||||
--Note(id)
|
||||
--if id==0 then
|
||||
--Sound(GetInfo(67).."/sounds/luaaudio/error.ogg")
|
||||
--end
|
||||
return id
|
||||
end -- local function playLooped(file)
|
||||
|
||||
local function play(file, loop, pan, vol)
|
||||
id=audio.play(file, loop, pan, vol)
|
||||
|
||||
--if vol not nil and greater than 100 then cap at 100
|
||||
if vol ~= nil then
|
||||
if vol > 100 then
|
||||
vol=100
|
||||
end -- if
|
||||
end -- if
|
||||
|
||||
return id
|
||||
end -- local function play(file,loop,pan,vol)
|
||||
|
||||
--------------------------------------------------------
|
||||
-- startup/shutdown
|
||||
--------------------------------------------------------
|
||||
|
||||
function OnPluginInstall ()
|
||||
assert(package.loadlib("audio.dll", "luaopen_audio"))()
|
||||
|
||||
if not (GetVariable("vol")==nil) then
|
||||
vol=tonumber(GetVariable("vol"))
|
||||
Sound("volume="..vol.."")
|
||||
else
|
||||
vol=100
|
||||
Sound("volume=100")
|
||||
SetVariable("vol", "100")
|
||||
SaveState()
|
||||
end -- if
|
||||
end -- function OnPluginInstall ()
|
||||
|
||||
function OnPluginClose()
|
||||
if #GetWorldList()==1 then
|
||||
audio.free()
|
||||
end -- if
|
||||
end -- function OnPluginClose()
|
||||
|
||||
--------------------------------------------------------
|
||||
-- external interfaces
|
||||
--------------------------------------------------------
|
||||
|
||||
ppi.Expose("init",OnPluginInstall)
|
||||
ppi.Expose("unload",OnPluginClose)
|
||||
ppi.Expose("setPitch",setPitch)
|
||||
ppi.Expose("slidePitch",slidePitch)
|
||||
|
||||
ppi.Expose("isPlaying",isPlaying)
|
||||
ppi.Expose("getVolume",getVolume)
|
||||
|
||||
ppi.Expose("stop",stop)
|
||||
ppi.Expose("setPan",setPan)
|
||||
ppi.Expose("play",play)
|
||||
ppi.Expose("playDelay",playDelay)
|
||||
ppi.Expose("playDelayLooped",playDelayLooped)
|
||||
ppi.Expose("setVol",setVol)
|
||||
ppi.Expose("slideVol",slideVol)
|
||||
ppi.Expose("fadeout",fadeout)
|
||||
ppi.Expose("slidePan",slidePan)
|
||||
ppi.Expose("playLooped",playLooped)
|
||||
|
||||
--set keybindings
|
||||
Accelerator("ctrl+f12", "sound_toggle")
|
||||
]]>
|
||||
</script>
|
||||
</muclient>
|
||||
564
cosmic rage/worlds/plugins/MUSHclient_Help.xml
Normal file
564
cosmic rage/worlds/plugins/MUSHclient_Help.xml
Normal file
@@ -0,0 +1,564 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="MUSHclient_Help"
|
||||
author="Nick Gammon"
|
||||
id="d2fa45d390d935d947cdc169"
|
||||
language="Lua"
|
||||
purpose="Shows the MUSHclient help file"
|
||||
save_state="y"
|
||||
date_written="2011-06-13 08:58:30"
|
||||
date_modified="2016-07-17 12:25"
|
||||
requires="4.76"
|
||||
version="1.1"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
To get general help:
|
||||
|
||||
mchelp <search string>
|
||||
mchelps <search string> --> get help with snippet (context) shown
|
||||
mchelp <number> --> show help on numbered item from previous search
|
||||
|
||||
mchelp --> on its own, shows this help
|
||||
|
||||
Search strings can have boolean operators in them, namely the words:
|
||||
|
||||
AND NEAR NOT OR
|
||||
|
||||
These words must be in all capitals or they are just searched for literally.
|
||||
|
||||
For example:
|
||||
|
||||
mchelp trigger AND alias
|
||||
mchelp delete AND trigger NEAR count
|
||||
mchelp search NOT table
|
||||
mchelp search -table
|
||||
mchelp add OR delete
|
||||
mchelp next NEAR/5 table
|
||||
mchelp add AND (trigger OR alias)
|
||||
|
||||
(The syntax NEAR/5 means if one word is within 5 words of another word, the default is 10)
|
||||
|
||||
You can use a wildcard suffix, eg.
|
||||
|
||||
mchelp trigg*
|
||||
|
||||
You can look for phrases by putting them in quotes, eg.
|
||||
|
||||
mchelp "hash a string"
|
||||
|
||||
You can restrict the lookup to the item name (eg. the function name) like this:
|
||||
|
||||
mchelp name:utils.*
|
||||
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="help_find"
|
||||
match="^mchelp (.+)$"
|
||||
enabled="y"
|
||||
group="help"
|
||||
regexp="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
script="help_number"
|
||||
match="^mchelp (\d+)$"
|
||||
enabled="y"
|
||||
group="help"
|
||||
regexp="y"
|
||||
sequence="90"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
script="help_find_snippet"
|
||||
match="^mchelps (.+)$"
|
||||
enabled="y"
|
||||
group="help"
|
||||
regexp="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="^mchelps?$"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
>
|
||||
</alias>
|
||||
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
require "pairsbykeys"
|
||||
|
||||
-- major headings
|
||||
local HEADINGCOLOUR = "yellow"
|
||||
local NAMECOLOUR = "cyan"
|
||||
local SUMMARYCOLOUR = "white"
|
||||
local PROTOTYPECOLOUR = "cyan"
|
||||
local DESCRIPTIONCOLOUR = "white"
|
||||
local NOTESCOLOUR = "white"
|
||||
local HELPCOLOUR = "indianred"
|
||||
|
||||
-- tags (eg. bold, italic)
|
||||
local CODECOLOUR = "greenyellow"
|
||||
local RETURNVALUE = "thistle"
|
||||
local BOLDCOLOUR = "orange"
|
||||
local ITALICCOLOUR = "linen"
|
||||
|
||||
-- for snippets
|
||||
local RESET = ANSI (0)
|
||||
local BOLD = ANSI (1)
|
||||
local UNBOLD = ANSI (22)
|
||||
local SNIPPETSIZE = -15 -- how many tokens to show around snippet
|
||||
|
||||
local styles
|
||||
|
||||
-- SQL fixup function
|
||||
|
||||
local function fixsql (s)
|
||||
-- replace single quotes with two lots of single quotes
|
||||
if s then
|
||||
return "'" .. (string.gsub (s, "'", "''")) .. "'"
|
||||
end -- if string exists
|
||||
|
||||
return "NULL"
|
||||
end -- fixsql
|
||||
|
||||
-- for fixing up entities
|
||||
local entities = {
|
||||
["<"] = "<";
|
||||
[">"] = ">";
|
||||
["&"] = "&";
|
||||
["""] = "\"";
|
||||
} -- end of entities
|
||||
|
||||
-- what to do on getting a tag like <b>
|
||||
local tag_handlers = {
|
||||
["<b>"] = function () SetNoteColourFore (ColourNameToRGB (BOLDCOLOUR)) end;
|
||||
["<i>"] = function () SetNoteColourFore (ColourNameToRGB (ITALICCOLOUR)) end;
|
||||
["<code>"] = function () SetNoteColourFore (ColourNameToRGB (CODECOLOUR)) end;
|
||||
["<ul>"] = function () end;
|
||||
["<li/>"] = function () Tell (" * ") end;
|
||||
["<hr/>"] = function () NoteHr () end;
|
||||
|
||||
} -- end of tag_handlers
|
||||
|
||||
-- called by LPEG to output an opening, closing, or empty tag
|
||||
local function tag_output (tag)
|
||||
|
||||
-- restore colour on closing tag, save colour on nested tag
|
||||
if tag:sub (2, 2) == "/" then
|
||||
SetNoteColourFore (table.remove (styles))
|
||||
elseif tag:sub (-2, -2) ~= "/" then
|
||||
table.insert (styles, GetNoteColourFore () )
|
||||
end -- if
|
||||
|
||||
local f = tag_handlers [tag:lower ()]
|
||||
if f then
|
||||
f ()
|
||||
end -- if handler found
|
||||
|
||||
end -- tag_output
|
||||
|
||||
-- called by LPEG to output straight text
|
||||
local function text_output (text)
|
||||
-- fix up entities like <
|
||||
Tell ((text:gsub ("&%a-;", entities)))
|
||||
end -- text_output
|
||||
|
||||
-- LPEG grammar for (simplified) HTML
|
||||
local P, R, S, C, Cc, Ct = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Ct
|
||||
local TAG = (P"<" * P"/"^-1 * R("AZ", "az")^1 * P"/"^-1 * P">")/tag_output
|
||||
local NOT_TAG = ((1 - lpeg.P"<")^0/text_output)
|
||||
local HTML = (NOT_TAG * TAG * NOT_TAG)^1 + NOT_TAG
|
||||
|
||||
-- show a help item with a coloured heading, and coloured text
|
||||
|
||||
local function show_item (hdg_colour, hdg, text_colour, text, tagged)
|
||||
|
||||
if text and text ~= "" then
|
||||
|
||||
if hdg and hdg ~= "" then
|
||||
ColourNote (hdg_colour, "", hdg)
|
||||
print ""
|
||||
end -- if any heading
|
||||
|
||||
if tagged then
|
||||
local notecolour = GetNoteColourFore ()
|
||||
styles = {} -- nested styles - start off with none
|
||||
SetNoteColourFore (ColourNameToRGB (text_colour))
|
||||
lpeg.match (HTML, text)
|
||||
SetNoteColourFore (notecolour)
|
||||
print "" -- probably doesn't end with newline
|
||||
else
|
||||
ColourNote (text_colour, "", text)
|
||||
end -- if tagged or not
|
||||
|
||||
print ""
|
||||
end -- if any text
|
||||
|
||||
end -- show_item
|
||||
|
||||
-- normal functions
|
||||
local function show_functions_help (row)
|
||||
NoteHr ()
|
||||
show_item (HEADINGCOLOUR, "Function", NAMECOLOUR, row.name)
|
||||
show_item (HEADINGCOLOUR, "Summary", SUMMARYCOLOUR, row.summary)
|
||||
show_item (HEADINGCOLOUR, "Prototype", PROTOTYPECOLOUR, row.prototype)
|
||||
show_item (HEADINGCOLOUR, "Description", DESCRIPTIONCOLOUR, row.description)
|
||||
show_item (HEADINGCOLOUR, "Return Value", RETURNVALUE, row.return_value)
|
||||
show_item (HEADINGCOLOUR, "Lua Example", CODECOLOUR, row.lua_example)
|
||||
show_item (HEADINGCOLOUR, "Lua Notes", NOTESCOLOUR, row.lua_notes)
|
||||
end -- show_functions_help
|
||||
|
||||
-- general help (major topics)
|
||||
local function show_general_help (row)
|
||||
NoteHr ()
|
||||
show_item (NOTESCOLOUR, "", NAMECOLOUR, row.title)
|
||||
show_item (HEADINGCOLOUR, "Summary", SUMMARYCOLOUR, row.description, true) -- HTML codes
|
||||
end -- show_general_help
|
||||
|
||||
-- lua functions
|
||||
local function show_lua_functions_help (row)
|
||||
NoteHr ()
|
||||
show_item (HEADINGCOLOUR, "Lua", NAMECOLOUR, row.name)
|
||||
show_item (HEADINGCOLOUR, "Summary", SUMMARYCOLOUR, row.summary)
|
||||
show_item (HEADINGCOLOUR, "Prototype", PROTOTYPECOLOUR, row.prototype)
|
||||
show_item (HEADINGCOLOUR, "Description", DESCRIPTIONCOLOUR, row.description, true) -- HTML codes
|
||||
end -- show_lua_functions_help
|
||||
|
||||
|
||||
local hyperlink_handlers = {
|
||||
|
||||
functions = { sql = "SELECT * FROM functions WHERE name = %s",
|
||||
handler = show_functions_help };
|
||||
|
||||
general = { sql = "SELECT * FROM general_doc WHERE doc_name = %s",
|
||||
handler = show_general_help };
|
||||
|
||||
lua_functions = { sql = "SELECT * FROM lua_functions WHERE name = %s",
|
||||
handler = show_lua_functions_help };
|
||||
|
||||
} -- end of hyperlink_handlers
|
||||
|
||||
-- here when hyperlink clicked
|
||||
|
||||
function do_hyperlink (s)
|
||||
local what, name = string.match (s, "([%a_]+):([%a%d_%. :]+)")
|
||||
|
||||
if not what then return end
|
||||
|
||||
local help = hyperlink_handlers [what]
|
||||
|
||||
if not help then
|
||||
ColourNote ("red", "", "Handler not found for " .. what)
|
||||
return
|
||||
end -- if not found
|
||||
|
||||
-- should only find one match here ...
|
||||
for row in db:nrows(string.format (help.sql, fixsql (name))) do
|
||||
help.handler (row)
|
||||
end -- finding function
|
||||
|
||||
end -- do_hyperlink
|
||||
|
||||
help_items = {}
|
||||
|
||||
function general_help (search_string, want_snippet)
|
||||
|
||||
local searchfor = fixsql (search_string)
|
||||
|
||||
AnsiNote (RESET)
|
||||
|
||||
if not db then
|
||||
ColourNote ("red", "", "MUSHclient help database 'help.db' not found.")
|
||||
return
|
||||
end -- if
|
||||
|
||||
local count = 0
|
||||
local functions = {}
|
||||
local general = {}
|
||||
local lua_functions = {}
|
||||
help_items = {}
|
||||
local item_count = 0
|
||||
|
||||
function show_snippet (what, name, title, extra, snippet)
|
||||
item_count = item_count + 1
|
||||
help_items [item_count] = what .. ":" .. name
|
||||
Tell " "
|
||||
Hyperlink ("!!" .. GetPluginID () .. ":do_hyperlink(" .. what .. ":" .. name .. ")",
|
||||
item_count .. ". " .. title, "Click for help on " .. title, "cyan", "", false)
|
||||
if extra ~= "" then
|
||||
Tell (" - ", extra)
|
||||
end -- if
|
||||
print ""
|
||||
|
||||
-- show snippet
|
||||
|
||||
if want_snippet then
|
||||
-- get rid of newlines, and multiple spaces
|
||||
AnsiNote (RESET .. string.gsub (snippet, "%s+", " "))
|
||||
print ""
|
||||
end -- if snippet wanted
|
||||
|
||||
end -- show_snippet
|
||||
|
||||
NoteHr ()
|
||||
|
||||
-- GENERAL documentation
|
||||
|
||||
-- find matching items using FTS
|
||||
for row in db:nrows(string.format (
|
||||
[[
|
||||
SELECT name, summary, snippet(general_doc_lookup, '%s', '%s', ' ... ', -1, %i) AS snippet
|
||||
FROM general_doc_lookup
|
||||
WHERE general_doc_lookup MATCH %s]],
|
||||
BOLD, UNBOLD, SNIPPETSIZE,
|
||||
searchfor)) do
|
||||
general [row.name] = { snippet = row.snippet, summary = row.summary }
|
||||
count = count + 1
|
||||
end -- finding item
|
||||
|
||||
if next (general) then
|
||||
ColourNote (HEADINGCOLOUR, "", "Topics")
|
||||
for k, v in pairsByKeys (general) do
|
||||
show_snippet ("general", k, v.summary, "", v.snippet)
|
||||
end -- for
|
||||
end -- if
|
||||
|
||||
-- FUNCTIONS documentation
|
||||
|
||||
-- find matching items using FTS
|
||||
for row in db:nrows(string.format (
|
||||
[[
|
||||
SELECT name, summary, snippet(functions_lookup, '%s', '%s', ' ... ', -1, %i) AS snippet
|
||||
FROM functions_lookup
|
||||
WHERE functions_lookup MATCH %s]],
|
||||
BOLD, UNBOLD, SNIPPETSIZE,
|
||||
searchfor)) do
|
||||
functions [row.name] = { snippet = row.snippet, summary = row.summary }
|
||||
count = count + 1
|
||||
end -- finding item
|
||||
|
||||
if next (functions) then
|
||||
ColourNote (HEADINGCOLOUR, "", "Functions")
|
||||
for k, v in pairsByKeys (functions) do
|
||||
show_snippet ("functions", k, k, v.summary, v.snippet)
|
||||
end -- for
|
||||
end -- if
|
||||
|
||||
-- LUA FUNCTIONS documentation
|
||||
|
||||
-- find matching items using FTS
|
||||
for row in db:nrows(string.format (
|
||||
[[
|
||||
SELECT name, summary, snippet(lua_functions_lookup, '%s', '%s', ' ... ', -1, %i) AS snippet
|
||||
FROM lua_functions_lookup
|
||||
WHERE lua_functions_lookup MATCH %s]],
|
||||
BOLD, UNBOLD, SNIPPETSIZE,
|
||||
searchfor)) do
|
||||
lua_functions [row.name] = { snippet = row.snippet, summary = row.summary }
|
||||
count = count + 1
|
||||
end -- finding item
|
||||
|
||||
if next (lua_functions) then
|
||||
ColourNote (HEADINGCOLOUR, "", "Lua")
|
||||
for k, v in pairsByKeys (lua_functions) do
|
||||
show_snippet ("lua_functions", k, k, v.summary, v.snippet)
|
||||
end -- for
|
||||
end -- if
|
||||
|
||||
if count == 0 then
|
||||
print ("Nothing found for:", search_string)
|
||||
elseif item_count == 1 then
|
||||
do_hyperlink (help_items [1]) -- automatically show only match
|
||||
end -- if
|
||||
|
||||
end -- general_help
|
||||
|
||||
-- here when they want to search the help
|
||||
|
||||
function help_find (name, line, wildcards)
|
||||
general_help (wildcards [1], false)
|
||||
end -- help_find
|
||||
|
||||
function help_find_snippet (name, line, wildcards)
|
||||
general_help (wildcards [1], true)
|
||||
end -- help_find_snippet
|
||||
|
||||
local function fix_description (s)
|
||||
if not s then
|
||||
return ""
|
||||
end -- if
|
||||
|
||||
-- get rid of tags
|
||||
s = s:gsub ("</?%a+/?>", "")
|
||||
|
||||
-- convert entities ...
|
||||
s = s:gsub ("&%a-;", entities)
|
||||
|
||||
return s
|
||||
end -- fix_description
|
||||
|
||||
function help_number (name, line, wildcards)
|
||||
local which = tonumber (wildcards [1])
|
||||
|
||||
if #help_items == 0 then
|
||||
print ("No recent search done which gave any results")
|
||||
return
|
||||
end -- if
|
||||
|
||||
if which < 1 or which > #help_items then
|
||||
print (string.format ("Requested help item %i not recently displayed - valid range is 1 to %i",
|
||||
which, #help_items))
|
||||
return
|
||||
end -- if
|
||||
|
||||
do_hyperlink (help_items [which])
|
||||
|
||||
end -- help_number
|
||||
|
||||
function OnPluginInstall ()
|
||||
-- open database on disk
|
||||
|
||||
if not db then
|
||||
db = assert (sqlite3.open(GetInfo (66) .. "help.db"))
|
||||
end -- if
|
||||
|
||||
local commands = false
|
||||
|
||||
-- see if commands table exists
|
||||
for row in db:nrows("SELECT * FROM sqlite_master WHERE type = 'table' AND name = 'commands'") do
|
||||
commands = true
|
||||
end
|
||||
|
||||
if not commands then
|
||||
ColourNote ("red", "", "MUSHclient help database 'help.db' not found.")
|
||||
db:close ()
|
||||
db = nil
|
||||
return
|
||||
end -- if
|
||||
|
||||
local fts4 = false
|
||||
|
||||
-- see if fts4 tables exist
|
||||
for row in db:nrows("SELECT * FROM sqlite_master WHERE type = 'table' AND name = 'commands_lookup'") do
|
||||
fts4 = true
|
||||
end
|
||||
|
||||
-- if no fts4 tables, make them
|
||||
if not fts4 then
|
||||
local start = utils.timer ()
|
||||
ColourNote ("cyan", "", "Creating help database full-text lookup tables ...")
|
||||
|
||||
-- START
|
||||
assert (db:execute [[
|
||||
BEGIN TRANSACTION;
|
||||
DROP TABLE IF EXISTS commands_lookup;
|
||||
DROP TABLE IF EXISTS dialogs_lookup;
|
||||
DROP TABLE IF EXISTS functions_lookup;
|
||||
DROP TABLE IF EXISTS general_doc_lookup;
|
||||
DROP TABLE IF EXISTS errors_lookup;
|
||||
DROP TABLE IF EXISTS lua_functions_lookup;
|
||||
]])
|
||||
|
||||
-- COMMANDS
|
||||
assert (db:execute "CREATE VIRTUAL TABLE commands_lookup USING FTS4(name, summary, description)")
|
||||
|
||||
-- fix up HTML stuff
|
||||
for row in db:nrows("SELECT command_name, short_description, description FROM commands") do
|
||||
assert (db:execute (string.format ([[
|
||||
INSERT INTO commands_lookup (name, summary, description)
|
||||
VALUES (%s, %s, %s)]],
|
||||
fixsql (row.command_name),
|
||||
fixsql (row.short_description),
|
||||
fixsql (fix_description (row.description)))))
|
||||
end -- for
|
||||
|
||||
-- DIALOGS
|
||||
assert (db:execute "CREATE VIRTUAL TABLE dialogs_lookup USING FTS4(name, summary, description)")
|
||||
|
||||
-- fix up HTML stuff
|
||||
for row in db:nrows("SELECT dialog_name, title, description FROM dialogs") do
|
||||
assert (db:execute (string.format ([[
|
||||
INSERT INTO dialogs_lookup (name, summary, description)
|
||||
VALUES (%s, %s, %s)]],
|
||||
fixsql (row.dialog_name),
|
||||
fixsql (row.title),
|
||||
fixsql (fix_description (row.description)))))
|
||||
end -- for
|
||||
|
||||
-- WORLD FUNCTIONS
|
||||
assert (db:execute "CREATE VIRTUAL TABLE functions_lookup USING FTS4(name, summary, description, lua_example, lua_notes)")
|
||||
assert (db:execute [[INSERT INTO functions_lookup (name, summary, description, lua_example, lua_notes)
|
||||
SELECT name, summary, description, lua_example, lua_notes FROM functions]])
|
||||
|
||||
-- GENERAL TOPICS
|
||||
assert (db:execute "CREATE VIRTUAL TABLE general_doc_lookup USING FTS4(name, summary, description)")
|
||||
|
||||
-- fix up HTML stuff
|
||||
for row in db:nrows("SELECT doc_name, title, description FROM general_doc") do
|
||||
assert (db:execute (string.format ([[
|
||||
INSERT INTO general_doc_lookup (name, summary, description)
|
||||
VALUES (%s, %s, %s)]],
|
||||
fixsql (row.doc_name),
|
||||
fixsql (row.title),
|
||||
fixsql (fix_description (row.description)))))
|
||||
end -- for
|
||||
|
||||
-- ERRORS
|
||||
assert (db:execute "CREATE VIRTUAL TABLE errors_lookup USING FTS4(name, error_code, description)")
|
||||
assert (db:execute [[INSERT INTO errors_lookup (name, error_code, description)
|
||||
SELECT error_name, error_code, meaning FROM errors ]])
|
||||
|
||||
-- LUA FUNCTIONS
|
||||
assert (db:execute "CREATE VIRTUAL TABLE lua_functions_lookup USING FTS4(name, summary, description)")
|
||||
|
||||
-- fix up HTML stuff
|
||||
for row in db:nrows("SELECT name, summary, description FROM lua_functions") do
|
||||
assert (db:execute (string.format ([[
|
||||
INSERT INTO lua_functions_lookup (name, summary, description)
|
||||
VALUES (%s, %s, %s)]],
|
||||
fixsql (row.name),
|
||||
fixsql (row.summary),
|
||||
fixsql (fix_description (row.description)))))
|
||||
end -- for
|
||||
|
||||
-- DONE
|
||||
assert (db:execute "COMMIT;")
|
||||
ColourNote ("cyan", "", string.format ("Done. Took %0.3f seconds.", utils.timer () - start))
|
||||
|
||||
end -- if
|
||||
|
||||
end -- OnPluginInstall
|
||||
|
||||
function OnHelp ()
|
||||
NoteHr ()
|
||||
ColourNote (HELPCOLOUR, "", world.GetPluginInfo (world.GetPluginID (), 3))
|
||||
end
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
311
cosmic rage/worlds/plugins/Messages_Window.xml
Normal file
311
cosmic rage/worlds/plugins/Messages_Window.xml
Normal file
@@ -0,0 +1,311 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Messages_Window"
|
||||
author="Nick Gammon"
|
||||
id="126d9061f9758498c878a204"
|
||||
language="Lua"
|
||||
purpose="Shows messages in a miniwindow"
|
||||
date_written="2010-08-24 10:30"
|
||||
date_modified="2010-08-24 13:30"
|
||||
save_state="y"
|
||||
requires="4.55"
|
||||
version="1.1"
|
||||
>
|
||||
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Call from scripts to display information messages.
|
||||
|
||||
See: http://www.gammon.com.au/forum/?id=10515
|
||||
|
||||
eg.
|
||||
|
||||
Note a message (starts a new line):
|
||||
|
||||
CallPlugin ("126d9061f9758498c878a204", "MsgNote", "test note")
|
||||
CallPlugin ("126d9061f9758498c878a204", "MsgNote", "test note", "yellow") -- yellow text
|
||||
CallPlugin ("126d9061f9758498c878a204", "MsgNote", "test note", "yellow", "white") -- yellow on white
|
||||
|
||||
Tell a message in the default text colour (stays on same line):
|
||||
|
||||
CallPlugin ("126d9061f9758498c878a204", "MsgTell", "test tell")
|
||||
CallPlugin ("126d9061f9758498c878a204", "MsgTell", "test tell", "yellow") -- yellow text
|
||||
CallPlugin ("126d9061f9758498c878a204", "MsgTell", "test tell", "yellow", "white") -- yellow on white
|
||||
|
||||
Clear the message window:
|
||||
|
||||
CallPlugin ("126d9061f9758498c878a204", "MsgClear")
|
||||
|
||||
Hide the message window:
|
||||
|
||||
CallPlugin ("126d9061f9758498c878a204", "MsgHide")
|
||||
|
||||
Show the message window:
|
||||
|
||||
CallPlugin ("126d9061f9758498c878a204", "MsgShow")
|
||||
|
||||
Change the message window title:
|
||||
|
||||
CallPlugin ("126d9061f9758498c878a204", "MsgTitle", "Combat text")
|
||||
|
||||
]]>
|
||||
</description>
|
||||
</plugin>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
-- configuration
|
||||
|
||||
-- number of lines to show
|
||||
local MAX_LINES = 20
|
||||
|
||||
-- font
|
||||
local FONT_NAME = "Dina"
|
||||
local FONT_SIZE = 8
|
||||
|
||||
-- where to put the window
|
||||
local WINDOW_POSITION = miniwin.pos_top_right
|
||||
|
||||
-- colours
|
||||
local WINDOW_BACKGROUND_COLOUR = "black"
|
||||
local WINDOW_TITLE_COLOUR = "black"
|
||||
local WINDOW_TITLE_BACKGROUND = "darkgoldenrod"
|
||||
|
||||
local NOTE_COLOUR = "Cyan"
|
||||
|
||||
|
||||
-- window title
|
||||
local title = "Messages"
|
||||
|
||||
-- offset of text from edge
|
||||
local TEXT_INSET = 5
|
||||
|
||||
-- where to store the message lines
|
||||
local lines = {} -- table of recent message lines
|
||||
local styles = {} -- current line
|
||||
|
||||
-- display one line
|
||||
local function show_line (n, styles)
|
||||
|
||||
local left = TEXT_INSET
|
||||
local top = (n - 1) * font_height + TEXT_INSET
|
||||
|
||||
-- display each style, including the appropriate background under it
|
||||
for _, v in ipairs (styles) do
|
||||
local width = WindowTextWidth (win, "f", v.text) -- get width of text
|
||||
local right = left + width -- work out RH side
|
||||
local bottom = top + font_height -- work out bottom
|
||||
WindowRectOp (win, miniwin.rect_fill, left, top, right, bottom,
|
||||
ColourNameToRGB (v.backcolour or WINDOW_BACKGROUND_COLOUR)) -- draw background
|
||||
WindowText (win, "f", v.text, left, top, window_width - TEXT_INSET, 0,
|
||||
ColourNameToRGB (v.textcolour or NOTE_COLOUR)) -- draw text
|
||||
left = left + width -- advance horizontally
|
||||
end -- for each style run
|
||||
|
||||
end -- Display_Line
|
||||
|
||||
local function add_line (line)
|
||||
|
||||
-- remove first line if filled up
|
||||
if #lines >= MAX_LINES then
|
||||
table.remove (lines, 1)
|
||||
end -- if
|
||||
|
||||
-- add new line
|
||||
table.insert (lines, line)
|
||||
|
||||
end -- add_line
|
||||
|
||||
-- here on output to display
|
||||
local function redraw_all ()
|
||||
|
||||
-- blank existing window contents
|
||||
WindowRectOp (win, miniwin.rect_fill, 0, 0, 0, 0, ColourNameToRGB (WINDOW_BACKGROUND_COLOUR))
|
||||
|
||||
-- draw drag bar rectangle
|
||||
WindowRectOp (win, miniwin.rect_fill, 0, 0, 0, font_height + 2, ColourNameToRGB (WINDOW_TITLE_BACKGROUND))
|
||||
|
||||
-- draw border
|
||||
check (WindowRectOp (win, miniwin.rect_draw_edge, 0, 0, 0, 0, miniwin.rect_edge_raised, miniwin.rect_edge_at_all))
|
||||
|
||||
local sz = WindowTextWidth (win, "fb", title)
|
||||
WindowText (win, "fb", title, (window_width - sz) / 2, 1, window_width - TEXT_INSET, 0,
|
||||
ColourNameToRGB (WINDOW_TITLE_COLOUR))
|
||||
|
||||
-- display all lines
|
||||
for k, v in ipairs (lines) do
|
||||
show_line (k + 1, v)
|
||||
end -- for
|
||||
|
||||
Redraw ()
|
||||
|
||||
end -- end redraw_all
|
||||
|
||||
local function warning (msg)
|
||||
ColourNote ("white", "red", msg)
|
||||
end -- warning
|
||||
|
||||
-- EXPOSED FUNCTIONS
|
||||
|
||||
-- hide window on removal
|
||||
function OnPluginClose ()
|
||||
WindowShow (win, false) -- hide it
|
||||
end -- OnPluginClose
|
||||
|
||||
-- hide window on disable
|
||||
function OnPluginDisable ()
|
||||
WindowShow (win, false) -- hide it
|
||||
end -- OnPluginDisable
|
||||
|
||||
-- show window on enable
|
||||
function OnPluginEnable ()
|
||||
if #lines > 0 then
|
||||
WindowShow (win, true) -- show it
|
||||
end -- if
|
||||
end -- OnPluginEnable
|
||||
|
||||
function OnPluginSaveState ()
|
||||
-- save window current location for next time
|
||||
movewindow.save_state (win)
|
||||
end -- function OnPluginSaveState
|
||||
|
||||
|
||||
-- FOR CALLING BY SCRIPTS:
|
||||
|
||||
-- eg. CallPlugin ("126d9061f9758498c878a204", "MsgNote", "test note")
|
||||
-- CallPlugin ("126d9061f9758498c878a204", "MsgNote", "test note", "yellow") -- yellow text
|
||||
-- CallPlugin ("126d9061f9758498c878a204", "MsgNote", "test note", "yellow", "white") -- yellow on white
|
||||
|
||||
-- Note a line (starts a new line afterwards). Text colour and background colour are optional.
|
||||
|
||||
function MsgNote (text, textcolour, backcolour)
|
||||
|
||||
-- add this style (if any text)
|
||||
if text then
|
||||
|
||||
if type (text) ~= "string" then
|
||||
warning ("First argument to MsgNote must be message text (string)")
|
||||
return
|
||||
end -- if
|
||||
|
||||
table.insert (styles, { text = text, textcolour = textcolour, backcolour = backcolour } )
|
||||
end -- if
|
||||
|
||||
-- add all styles to this line
|
||||
add_line (styles)
|
||||
|
||||
-- start new line
|
||||
styles = {}
|
||||
|
||||
-- display existing lines
|
||||
redraw_all ()
|
||||
|
||||
WindowShow (win, true) -- show it
|
||||
|
||||
end -- MsgNote
|
||||
|
||||
|
||||
-- eg. CallPlugin ("126d9061f9758498c878a204", "MsgTell", "test note")
|
||||
-- CallPlugin ("126d9061f9758498c878a204", "MsgTell", "test note", "yellow") -- yellow text
|
||||
-- CallPlugin ("126d9061f9758498c878a204", "MsgTell", "test note", "yellow", "white") -- yellow on white
|
||||
|
||||
-- Tell a line (does not start a new line). Text colour and background colour are optional.
|
||||
|
||||
function MsgTell (text, textcolour, backcolour)
|
||||
|
||||
if type (text) ~= "string" then
|
||||
warning ("First argument to MsgTell must be message text (string)")
|
||||
return
|
||||
end -- if
|
||||
|
||||
-- add this style
|
||||
table.insert (styles, { text = text, textcolour = textcolour, backcolour = backcolour } )
|
||||
end -- MsgTell
|
||||
|
||||
-- eg. CallPlugin ("126d9061f9758498c878a204", "MsgClear")
|
||||
|
||||
function MsgClear ()
|
||||
lines = {}
|
||||
styles = {}
|
||||
-- display blank window
|
||||
redraw_all ()
|
||||
end -- MsgClear
|
||||
|
||||
-- eg. CallPlugin ("126d9061f9758498c878a204", "MsgHide")
|
||||
|
||||
function MsgHide ()
|
||||
WindowShow (win, false) -- hide it
|
||||
end -- MsgHide
|
||||
|
||||
-- eg. CallPlugin ("126d9061f9758498c878a204", "MsgShow")
|
||||
|
||||
function MsgShow ()
|
||||
WindowShow (win, true) -- show it
|
||||
redraw_all ()
|
||||
end -- MsgShow
|
||||
|
||||
-- eg. CallPlugin ("126d9061f9758498c878a204", "MsgTitle", "Combat Messages")
|
||||
|
||||
function MsgTitle (new_title)
|
||||
if type (new_title) ~= "string" then
|
||||
warning ("First argument to MsgTitle must be window title (string)")
|
||||
return
|
||||
end -- if
|
||||
|
||||
title = new_title
|
||||
redraw_all ()
|
||||
end -- MsgTitle
|
||||
|
||||
-- startup stuff - create window, find font characteristics
|
||||
|
||||
win = GetPluginID () -- get a unique name
|
||||
|
||||
-- make the window
|
||||
WindowCreate (win, 0, 0, 1, 1, WINDOW_POSITION, 0, 0) -- create window
|
||||
|
||||
fonts = utils.getfontfamilies ()
|
||||
|
||||
if not fonts.Dina then
|
||||
AddFont (GetInfo (66) .. "\\Dina.fon")
|
||||
end -- if Dina not installed
|
||||
|
||||
-- grab a font
|
||||
WindowFont (win, "f", FONT_NAME, FONT_SIZE) -- define font
|
||||
WindowFont (win, "fb", FONT_NAME, FONT_SIZE, true) -- define font
|
||||
|
||||
-- work out how high and wide it is
|
||||
font_height = WindowFontInfo (win, "f", 1) -- height of the font
|
||||
wrap_column = GetOption ("wrap_column")
|
||||
|
||||
window_width = (wrap_column * WindowFontInfo (win, "f", 6)) + (TEXT_INSET * 2)
|
||||
window_height = (MAX_LINES + 1) * font_height + TEXT_INSET * 2 -- one more line for title
|
||||
|
||||
require "movewindow" -- load the movewindow.lua module
|
||||
|
||||
-- install the window movement handler, get back the window position
|
||||
windowinfo = movewindow.install (win, WINDOW_POSITION)
|
||||
|
||||
-- remake the window with the correct width
|
||||
WindowCreate (win,
|
||||
windowinfo.window_left,
|
||||
windowinfo.window_top,
|
||||
window_width, window_height,
|
||||
windowinfo.window_mode,
|
||||
windowinfo.window_flags,
|
||||
0)
|
||||
|
||||
-- add the drag handler so they can move the window around
|
||||
movewindow.add_drag_handler (win, 0, 0, 0, font_height + 2)
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
|
||||
676
cosmic rage/worlds/plugins/MudDatabase.xml
Normal file
676
cosmic rage/worlds/plugins/MudDatabase.xml
Normal file
@@ -0,0 +1,676 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Thursday, November 07, 2002, 12:57 PM -->
|
||||
<!-- MuClient version 3.31 -->
|
||||
|
||||
<!-- Plugin "MudDatabase" generated by Plugin Wizard -->
|
||||
|
||||
<!--
|
||||
Amend the start of the script to change the database name or location.
|
||||
|
||||
Version 1.1 - added 'setdatabase filename'
|
||||
|
||||
Version 1.2 - a) added error handling for errors on queries and sql statements
|
||||
b) Sort mud list by mud name
|
||||
|
||||
Version 1.3 - changed error handling to show exact error reason
|
||||
|
||||
Version 1.4 - a) improved error handling (eg. on database open)
|
||||
b) detect if database exists on 'setdatabase'
|
||||
c) a bit more modular
|
||||
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="MudDatabase"
|
||||
author="Nick Gammon"
|
||||
id="464461cbb3a282dc839f1e5d"
|
||||
language="VBscript"
|
||||
purpose="Maintains a database of MUDs, demonstrates using SQL"
|
||||
date_written="2002-11-07 12:51:24"
|
||||
date_modified="2002-11-10 14:30"
|
||||
requires="3.24"
|
||||
save_state="y"
|
||||
version="1.4"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
This plugin demonstrates accessing a Database from within a plugin.
|
||||
|
||||
It uses the Microsoft.Jet.OLEDB.4.0 database provider, which should be installed with default Windows 98 and upwards installations. If it doesn't work, try installing the Jet engine.
|
||||
|
||||
Functions provided are:
|
||||
|
||||
addmud name ip port description <-- adds a MUD
|
||||
|
||||
eg. addmud realms_of_despair game.org 4000 Realms of Despair MUD
|
||||
|
||||
deletemud name <-- deletes a MUD from the database by name
|
||||
|
||||
eg. deletemud realms_of_despair
|
||||
|
||||
listmuds [searchstring] <-- lists MUDs with optional search
|
||||
|
||||
eg. listmuds
|
||||
listmuds realms
|
||||
|
||||
sql command <-- issues arbitrary SQL command to the database
|
||||
|
||||
eg. sql DELETE FROM muds WHERE port = 4000
|
||||
|
||||
query command <-- issues SQL query, displays results
|
||||
|
||||
eg. query SELECT * FROM muds WHERE port > 1000 ORDER BY mud_name
|
||||
|
||||
setdatabase filename <-- changes to different database file
|
||||
|
||||
eg. setdatabase c:\mydatabase.mdb
|
||||
|
||||
The plugin attempts to create the database file, and then the muds table, 5 seconds after it is installed. It checks to see if the database is there so it doesn't get created twice.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="AddMud"
|
||||
match="addmud * * * *"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="DeleteMud"
|
||||
match="deletemud *"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="ListMuds"
|
||||
match="listmuds"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="ListMuds"
|
||||
match="listmuds *"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="SQLalias"
|
||||
match="sql *"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="QueryAlias"
|
||||
match="query *"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="SetDatabase"
|
||||
match="setdatabase *"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
'
|
||||
' Author: Nick Gammon <nick@gammon.com.au>
|
||||
'
|
||||
' Written: 7th November 2002
|
||||
'
|
||||
|
||||
option explicit
|
||||
|
||||
'
|
||||
' Amend this to change the location or name of the database.
|
||||
'
|
||||
' Default is world file directory, mushclient_db.mdb
|
||||
'
|
||||
function GetDatabaseFileName
|
||||
GetDatabaseFileName = _
|
||||
world.GetVariable ("database")
|
||||
end function
|
||||
|
||||
'
|
||||
' Central spot for showing errors, so we can easily customise colours
|
||||
'
|
||||
sub ShowError (sMessage)
|
||||
world.ColourNote "white", "red", sMessage
|
||||
end sub
|
||||
|
||||
'
|
||||
' Central spot for showing information, so we can easily customise colours
|
||||
'
|
||||
sub ShowInfo (sMessage)
|
||||
world.ColourNote "lightblue", "midnightblue", sMessage
|
||||
end sub
|
||||
|
||||
'
|
||||
' We need the provider (engine, database name) in various
|
||||
' spots so we make a function to return it.
|
||||
'
|
||||
function GetProvider
|
||||
GetProvider = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
|
||||
"Data Source=" & _
|
||||
GetDatabaseFileName & _
|
||||
";" & _
|
||||
"Jet OLEDB:Engine Type=5;"
|
||||
end function
|
||||
|
||||
'
|
||||
' Helper function to see if a file exists
|
||||
'
|
||||
function DoesFileExist (sFileName)
|
||||
Dim FSO
|
||||
|
||||
Set FSO = CreateObject("Scripting.FileSystemObject")
|
||||
DoesFileExist = FSO.FileExists (sFileName)
|
||||
Set FSO = Nothing
|
||||
|
||||
end function
|
||||
|
||||
'
|
||||
' Helper function to see if a table exists in the database
|
||||
'
|
||||
function DoesTableExist (sTableName)
|
||||
dim db, oTable
|
||||
|
||||
On Error Resume Next
|
||||
|
||||
Set db = CreateObject ("ADOX.Catalog")
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
ShowError Err.Description
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
db.ActiveConnection = GetProvider
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
ShowError Err.Description
|
||||
Set db = Nothing
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
On Error GoTo 0
|
||||
|
||||
DoesTableExist = vbFalse
|
||||
For Each oTable In db.Tables
|
||||
If UCase(oTable.Name) = UCase(sTableName) Then
|
||||
DoesTableExist = vbTrue
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
Set db = Nothing
|
||||
|
||||
end function
|
||||
|
||||
'
|
||||
' Create database in MUSHclient world file directory
|
||||
'
|
||||
sub CreateDatabase
|
||||
Dim db
|
||||
'
|
||||
' Don't create the database twice - so check if file exists
|
||||
'
|
||||
if DoesFileExist (GetDatabaseFileName) then
|
||||
exit sub
|
||||
end if
|
||||
'
|
||||
' Doesn't exist? Create it.
|
||||
'
|
||||
Set db = CreateObject ("ADOX.Catalog")
|
||||
db.Create GetProvider
|
||||
Set db = Nothing
|
||||
|
||||
ShowInfo "Database '" & GetDatabaseFileName & "' created."
|
||||
|
||||
end sub
|
||||
|
||||
'
|
||||
' Execute some arbitrary SQL
|
||||
'
|
||||
Function DoSQL (sSQL)
|
||||
dim db
|
||||
|
||||
DoSQL = vbTrue ' error return
|
||||
|
||||
On Error Resume Next
|
||||
|
||||
Set db = CreateObject ("ADODB.Connection")
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
ShowError Err.Description
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' Open the connection
|
||||
|
||||
db.Open GetProvider
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
ShowError Err.Description
|
||||
Set db = Nothing
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' Execute it
|
||||
db.Execute sSQL
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
ShowError Err.Description
|
||||
Set db = Nothing
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
On Error GoTo 0
|
||||
|
||||
' Wrap up
|
||||
db.Close
|
||||
Set db = Nothing
|
||||
|
||||
DoSQL = vbFalse ' OK return
|
||||
|
||||
end Function
|
||||
|
||||
'
|
||||
' Create the table we want
|
||||
'
|
||||
sub CreateTable
|
||||
|
||||
if DoesTableExist ("muds") then
|
||||
exit sub
|
||||
end if
|
||||
|
||||
If DoSQL _
|
||||
("CREATE TABLE muds (" & _
|
||||
" mud_id int NOT NULL IDENTITY," & _
|
||||
" mud_name varchar(64) NOT NULL," & _
|
||||
" ip_address varchar(64) NOT NULL," & _
|
||||
" port int NOT NULL default '4000'," & _
|
||||
" description text," & _
|
||||
" PRIMARY KEY (mud_id)" & _
|
||||
")") Then Exit Sub
|
||||
|
||||
ShowInfo "Table 'muds' created."
|
||||
|
||||
end sub
|
||||
|
||||
'
|
||||
' Called 5 seconds after plugin installation to create the
|
||||
' database and its table, if necessary
|
||||
'
|
||||
sub OnSetup (sTimerName)
|
||||
ShowInfo "Plugin " & world.GetPluginName & " installed."
|
||||
|
||||
'
|
||||
' Don't create databases everywhere once they change the name
|
||||
'
|
||||
if world.GetVariable ("database_changed") <> "Y" then
|
||||
CreateDatabase
|
||||
CreateTable
|
||||
end if
|
||||
|
||||
ShowInfo "Database is: " & GetDatabaseFileName
|
||||
end sub
|
||||
|
||||
|
||||
'
|
||||
' When the plugin is installed we will wait 5 seconds
|
||||
' and then create the database and table.
|
||||
'
|
||||
sub OnPluginInstall
|
||||
|
||||
' timer: enabled, one-shot, active-if-not-connected
|
||||
|
||||
world.addtimer "", 0, 0, 5, "", 1 + 4 + 32, "OnSetup"
|
||||
|
||||
'
|
||||
' Set up default database name if variable does not exist
|
||||
'
|
||||
if IsEmpty (world.GetVariable ("database")) Then
|
||||
world.SetVariable "database", _
|
||||
world.GetInfo (57) & "mushclient_db.mdb"
|
||||
end if
|
||||
|
||||
end sub
|
||||
|
||||
'
|
||||
' Since we are doing queries in a few places, we will do the main
|
||||
' part here ...
|
||||
' A "true" result means the query failed.
|
||||
' A "false" (zero) result means the query succeeded
|
||||
'
|
||||
|
||||
Function ExecuteQuery (db, rst, sQuery)
|
||||
|
||||
ExecuteQuery = vbTrue ' assume bad result
|
||||
|
||||
On Error Resume Next
|
||||
|
||||
Set db = CreateObject ("ADODB.Connection")
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
ShowError Err.Description
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
Set rst = CreateObject ("ADODB.Recordset")
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
ShowError Err.Description
|
||||
set db = Nothing
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' Open the connection
|
||||
db.Open GetProvider
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
ShowError Err.Description
|
||||
Set rst = Nothing
|
||||
Set db = Nothing
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' Open the Recordset
|
||||
rst.Open sQuery, db
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
ShowError Err.Description
|
||||
Set rst = Nothing
|
||||
Set db = Nothing
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
On Error GoTo 0
|
||||
|
||||
ExecuteQuery = vbFalse ' good result
|
||||
|
||||
End Function
|
||||
|
||||
'
|
||||
' Do some arbitrary query, display the results
|
||||
'
|
||||
sub DoQuery (sQuery)
|
||||
dim db, rst, count, fld
|
||||
|
||||
if ExecuteQuery (db, rst, sQuery) Then Exit Sub
|
||||
|
||||
count = 0
|
||||
|
||||
' display each record
|
||||
Do Until rst.EOF
|
||||
|
||||
count = count + 1
|
||||
|
||||
' display each field name
|
||||
if count = 1 then
|
||||
For Each fld In rst.Fields
|
||||
world.ColourTell "white", "darkblue", _
|
||||
fld.Name & chr(9)
|
||||
Next
|
||||
world.note "" ' newline
|
||||
end if
|
||||
|
||||
' display each field
|
||||
For Each fld In rst.Fields
|
||||
world.tell fld.Value & chr(9)
|
||||
Next
|
||||
|
||||
world.note "" ' newline
|
||||
|
||||
rst.MoveNext
|
||||
|
||||
Loop
|
||||
|
||||
db.Close
|
||||
|
||||
Set rst = Nothing
|
||||
Set db = Nothing
|
||||
|
||||
world.note count & " record(s)"
|
||||
|
||||
end sub
|
||||
|
||||
'
|
||||
' Does a query, and returns the first field returned
|
||||
' eg. select count(*) from muds where mud_name = "foo"
|
||||
'
|
||||
function GetOneValue (sQuery)
|
||||
dim db, rst
|
||||
|
||||
if ExecuteQuery (db, rst, sQuery) Then Exit Function
|
||||
|
||||
If Not rst.EOF Then
|
||||
GetOneValue = rst.Fields (0).Value
|
||||
End If
|
||||
|
||||
db.Close
|
||||
|
||||
Set rst = Nothing
|
||||
Set db = Nothing
|
||||
|
||||
end function
|
||||
|
||||
'
|
||||
' called from an alias to add a mud to the list
|
||||
'
|
||||
sub AddMud (sName, sLine, wildcards)
|
||||
dim mud_name, ip_address, port, description
|
||||
|
||||
mud_name = wildcards (1)
|
||||
ip_address = wildcards (2)
|
||||
port = wildcards (3)
|
||||
description = wildcards (4)
|
||||
|
||||
'
|
||||
' Quotes will throw us out (because the SQL uses them)
|
||||
'
|
||||
if Instr (mud_name, """") > 0 or _
|
||||
Instr (ip_address, """") > 0 or _
|
||||
Instr (port, """") > 0 or _
|
||||
Instr (description, """") > 0 Then
|
||||
ShowError "You cannot use quotes in the mud name/port/ip/description"
|
||||
exit sub
|
||||
end if
|
||||
|
||||
'
|
||||
' Check not already there
|
||||
'
|
||||
if GetOneValue (_
|
||||
"select count(*) from muds where mud_name = """ & _
|
||||
mud_name & _
|
||||
"""") > 0 Then
|
||||
ShowError "MUD '" & mud_name & "' is already in the database"
|
||||
exit sub
|
||||
end if
|
||||
|
||||
'
|
||||
' Insert it
|
||||
'
|
||||
If DoSQL _
|
||||
("INSERT INTO muds (mud_name, ip_address," & _
|
||||
"port, description) VALUES (" & _
|
||||
"""" & mud_name & """, " & _
|
||||
"""" & ip_address & """, " & _
|
||||
"""" & port & """, " & _
|
||||
"""" & description & """ );") Then Exit Sub
|
||||
|
||||
world.ColourNote "white", "green", "MUD '" & mud_name & _
|
||||
"' added to the database"
|
||||
|
||||
end sub
|
||||
|
||||
'
|
||||
' called from an alias to delete a mud from the list
|
||||
'
|
||||
sub DeleteMud (sName, sLine, wildcards)
|
||||
dim mud_name
|
||||
|
||||
mud_name = wildcards (1)
|
||||
|
||||
'
|
||||
' Quotes will throw us out (because the SQL uses them)
|
||||
'
|
||||
if Instr (mud_name, """") > 0 Then
|
||||
ShowError "You cannot use quotes in the mud name"
|
||||
exit sub
|
||||
end if
|
||||
|
||||
'
|
||||
' Check already there
|
||||
'
|
||||
if not GetOneValue (_
|
||||
"select count(*) from muds where mud_name = """ & _
|
||||
mud_name & _
|
||||
"""") > 0 Then
|
||||
ShowError "MUD '" & mud_name & "' is not in the database"
|
||||
exit sub
|
||||
end if
|
||||
|
||||
'
|
||||
' Delete it
|
||||
'
|
||||
If DoSQL _
|
||||
("DELETE FROM muds WHERE mud_name = " & _
|
||||
"""" & mud_name & """ ") Then Exit Sub
|
||||
|
||||
world.ColourNote "white", "green", "MUD '" & mud_name & _
|
||||
"' deleted from the database"
|
||||
|
||||
end sub
|
||||
|
||||
|
||||
'
|
||||
' List the muds in a nice way
|
||||
'
|
||||
sub ListMuds (sName, sLine, wildcards)
|
||||
dim db, rst, count, sQuery
|
||||
dim mud_name, ip_address, port, description
|
||||
|
||||
'
|
||||
' a wildcard means to match on a subset
|
||||
'
|
||||
if wildcards (1) = "" then
|
||||
sQuery = "SELECT * FROM muds ORDER BY mud_name"
|
||||
else
|
||||
sQuery = "SELECT * FROM muds WHERE " & _
|
||||
"mud_name like ""%" & wildcards (1) & "%"" " & _
|
||||
"OR ip_address like ""%" & wildcards (1) & "%"" " & _
|
||||
"OR port like ""%" & wildcards (1) & "%"" " & _
|
||||
"OR description like ""%" & wildcards (1) & "%"" " & _
|
||||
"ORDER BY mud_name"
|
||||
end if
|
||||
|
||||
if ExecuteQuery (db, rst, sQuery) Then Exit Sub
|
||||
|
||||
count = 0
|
||||
|
||||
' display each record
|
||||
Do Until rst.EOF
|
||||
|
||||
count = count + 1
|
||||
|
||||
mud_name = rst.Fields ("mud_name").Value
|
||||
ip_address = rst.Fields ("ip_address").Value
|
||||
port = rst.Fields ("port").Value
|
||||
description = rst.Fields ("description").Value
|
||||
|
||||
world.ColourTell "white", "darkred", mud_name
|
||||
world.ColourTell "white", "black", " IP: " & ip_address
|
||||
world.ColourTell "white", "black", " Port: " & port
|
||||
world.Note ""
|
||||
|
||||
world.ColourNote "silver", "black", description
|
||||
|
||||
world.Note ""
|
||||
|
||||
rst.MoveNext
|
||||
|
||||
Loop
|
||||
|
||||
db.Close
|
||||
|
||||
Set rst = Nothing
|
||||
Set db = Nothing
|
||||
|
||||
world.note count & " MUD(s)"
|
||||
|
||||
end sub
|
||||
|
||||
'
|
||||
' Alias to execute arbitrary SQL
|
||||
'
|
||||
' eq. sql drop table muds
|
||||
'
|
||||
sub SQLalias (sName, sLine, wildcards)
|
||||
If DoSQL (wildcards (1)) Then Exit Sub
|
||||
ShowInfo "SQL statement processed OK."
|
||||
end sub
|
||||
|
||||
'
|
||||
' Alias to execute arbitrary query
|
||||
'
|
||||
' eq. query select * from muds order by port
|
||||
'
|
||||
sub QueryAlias (sName, sLine, wildcards)
|
||||
DoQuery wildcards (1)
|
||||
end sub
|
||||
|
||||
'
|
||||
' Change to some other database so we can do queries on it
|
||||
'
|
||||
sub SetDatabase (sName, sLine, wildcards)
|
||||
|
||||
'
|
||||
' Check database is there
|
||||
'
|
||||
if not DoesFileExist (wildcards (1)) then
|
||||
ShowError "File '" & wildcards (1) & "' does not exist."
|
||||
exit sub
|
||||
end if
|
||||
|
||||
world.SetVariable "database", wildcards (1)
|
||||
world.SetVariable "database_changed", "Y"
|
||||
ShowInfo "Database changed to: " & GetDatabaseFileName
|
||||
end sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="MudDatabase:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Sub OnHelp (sName, sLine, wildcards)
|
||||
World.Note World.GetPluginInfo (World.GetPluginID, 3)
|
||||
End Sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
323
cosmic rage/worlds/plugins/MushReader.xml
Normal file
323
cosmic rage/worlds/plugins/MushReader.xml
Normal file
@@ -0,0 +1,323 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Plugin "xirr_mushreader" generated by modification and merge of several existing plugins -->
|
||||
<!-- Constructed 2022-05-03 -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="MushReader"
|
||||
author="Tyler Spivey and many others"
|
||||
id="925cdd0331023d9f0b8f05a7"
|
||||
language="Lua"
|
||||
purpose="Plugin for multiple screen readers"
|
||||
save_state="y"
|
||||
date_written="2022-05-03 17:00:00"
|
||||
requires="4.60"
|
||||
version="1.2"
|
||||
>
|
||||
</plugin>
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
match="tts_stop"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>stop()</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="subst *"
|
||||
enabled="y"
|
||||
script="substfunc"
|
||||
sequence="100"
|
||||
>
|
||||
<send></send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="tts_interrupt *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>
|
||||
if jfwobject and nvda.jaws_running() then
|
||||
jfwobject:SayString("%1", 1)
|
||||
else
|
||||
stop()
|
||||
say("%1")
|
||||
end
|
||||
</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="tts_note *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>say("%1")</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
script="TTSToggle"
|
||||
match="tts"
|
||||
enabled="y"
|
||||
group="TTS"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
script="TTSFocusToggle"
|
||||
match="ftts"
|
||||
enabled="y"
|
||||
group="TTS"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
<include name="constants.lua"/>
|
||||
|
||||
<!-- Main script -->
|
||||
<script>
|
||||
<![CDATA[
|
||||
-----------------------------------------
|
||||
-- general local configuration - run at startup
|
||||
-----------------------------------------
|
||||
|
||||
-- note that because this plugin is configured with "save_state",
|
||||
-- initializing things here will reset them
|
||||
|
||||
require "serialize"
|
||||
require "tprint"
|
||||
|
||||
tts_enabled = true
|
||||
etts = true
|
||||
focusnote = false
|
||||
|
||||
-- init prior to load of substitutions file
|
||||
subst={}
|
||||
subst.status=1
|
||||
|
||||
function OnPluginInstall ()
|
||||
-- ensure ftts config setting exists
|
||||
if (GetVariable("ftts")==nil) then
|
||||
SetVariable("ftts",0)
|
||||
-- focusnote is a one-time flag to print a help message
|
||||
focusnote=true
|
||||
end
|
||||
|
||||
-- load substitutions file
|
||||
if (FileExists(GetInfo(67).."/settings/substitutions.mushz")==true) then
|
||||
dofile(GetInfo(67).."/settings/substitutions.mushz")
|
||||
end
|
||||
|
||||
-- make sure we can load the mushreader dll
|
||||
assert(package.loadlib("MushReader.dll", "luaopen_audio"))()
|
||||
stop()
|
||||
say("mush reader initialized")
|
||||
end
|
||||
|
||||
-----------------------------------------
|
||||
-- helper functions
|
||||
-----------------------------------------
|
||||
|
||||
function tnote(what)
|
||||
Execute("tts_note "..what)
|
||||
end
|
||||
|
||||
function say(str)
|
||||
nvda.say(" "..str)
|
||||
end
|
||||
|
||||
function stop()
|
||||
nvda.stop()
|
||||
end
|
||||
|
||||
function FileExists(filename)
|
||||
local file = io.open(filename)
|
||||
if file then
|
||||
io.close(file)
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------
|
||||
-- substitution matcher
|
||||
-----------------------------------------
|
||||
|
||||
function split(str, pat)
|
||||
local t = {}
|
||||
local fpat = "(.-)" .. pat
|
||||
local last_end = 1
|
||||
local s, e, cap = str:find(fpat, 1)
|
||||
while s do
|
||||
if s ~= 1 or cap ~= "" then
|
||||
table.insert(t,cap)
|
||||
end
|
||||
last_end = e+1
|
||||
s, e, cap = str:find(fpat, last_end)
|
||||
end
|
||||
if last_end <= #str then
|
||||
cap = str:sub(last_end)
|
||||
table.insert(t, cap)
|
||||
end
|
||||
return t
|
||||
end
|
||||
|
||||
function substfunc(n,l,w)
|
||||
act=split(w[1]," ")
|
||||
if act[1]=="on" then
|
||||
subst.status=1
|
||||
tnote("Substitutions on.")
|
||||
elseif act[1]=="off" then
|
||||
tnote("Substitutions off.")
|
||||
subst.status=0
|
||||
elseif (act[1]=="remove") then
|
||||
w[1]=string.sub(w[1],8)
|
||||
if subst[w[1]]==nil then
|
||||
Note("No substitution found for the entered text.")
|
||||
else
|
||||
subst[w[1]]=nil
|
||||
Note("Substitution removed!")
|
||||
Execute("subst save")
|
||||
end
|
||||
elseif act[1]=="add" then
|
||||
wc=split(w[1],"==")
|
||||
wc[1]=string.sub(wc[1],5)
|
||||
if wc[2]==nil then
|
||||
Note("You must specify a substitution replacement by including 2 equal signs in your command (line==substitute).")
|
||||
return
|
||||
end
|
||||
tnote("OK, substitution added.")
|
||||
wc1=wc[1]
|
||||
wc2=wc[2]
|
||||
subst[wc1]=wc2
|
||||
Execute("subst save")
|
||||
elseif act[1]=="clear" then
|
||||
tnote("cleared!")
|
||||
subst={}
|
||||
subst.status=1
|
||||
Execute("subst save")
|
||||
elseif act[1]=="list" then
|
||||
tprint(subst)
|
||||
elseif act[1]=="save" then
|
||||
if not (subst==nil) then
|
||||
local vars=GetInfo(67).."/settings/substitutions.mushz"
|
||||
local exfw=assert(io.open(vars, "w"))
|
||||
exfc=serialize.save_simple(subst)
|
||||
assert (exfw:write ("subst="..exfc))
|
||||
exfw:close()
|
||||
end
|
||||
tnote("Saved!")
|
||||
else
|
||||
tnote("Unrecognized substitutions command. Possible commands are: clear, list, add, remove, on, off")
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------
|
||||
-- TTS toggle
|
||||
-----------------------------------------
|
||||
|
||||
function TTSFocusToggle()
|
||||
if GetVariable("ftts")=="0" then
|
||||
Note("Speech will now be disabled when switching windows.")
|
||||
SetVariable("ftts",1)
|
||||
elseif GetVariable("ftts")=="1" then
|
||||
Note("Speech will no longer be disabled when switching windows.")
|
||||
SetVariable("ftts",0)
|
||||
end
|
||||
end
|
||||
|
||||
function TTSToggle (name, line, wc)
|
||||
if tts_enabled then
|
||||
tts_enabled = false
|
||||
etts=false
|
||||
stop()
|
||||
say("speech off")
|
||||
else
|
||||
tts_enabled = true
|
||||
etts=true
|
||||
stop()
|
||||
say("speech on")
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------
|
||||
-- OnPlugin event hooks
|
||||
-----------------------------------------
|
||||
|
||||
function OnPluginLoseFocus()
|
||||
if (etts==false) then
|
||||
return
|
||||
end
|
||||
if (GetVariable("ftts")=="0") then
|
||||
return
|
||||
end
|
||||
tts_enabled=false
|
||||
end
|
||||
|
||||
function OnPluginGetFocus()
|
||||
if focusnote then
|
||||
DoAfterSpecial(5,'Note("You can type ftts to control whether mush-z speech should be silenced when switching windows on your computer.")',12)
|
||||
focusnote=false
|
||||
end
|
||||
if (etts==false) then
|
||||
return
|
||||
end
|
||||
if (GetVariable("ftts")=="0") then
|
||||
return
|
||||
end
|
||||
tts_enabled=true
|
||||
end
|
||||
|
||||
function OnPluginTabComplete(word)
|
||||
if tts_enabled then
|
||||
say(word)
|
||||
end
|
||||
end
|
||||
|
||||
-- "t" is type of line, where 0 = output line, 1 = note, 2 = command
|
||||
function OnPluginScreendraw(t, log, line)
|
||||
if not tts_enabled then
|
||||
return
|
||||
end
|
||||
-- checking for an empty string, or a string composed only of spaces.
|
||||
-- If we don't, NVDA says blank.
|
||||
if (t == 0 or t == 1) and not line:find("^%s*$") then
|
||||
if subst.status==0 then
|
||||
return
|
||||
end
|
||||
if subst[line]==nil then
|
||||
say(line)
|
||||
else
|
||||
if (subst[line]=="!skip") then
|
||||
return
|
||||
else
|
||||
say(subst[line])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------
|
||||
-- function key accelerator setup
|
||||
-----------------------------------------
|
||||
|
||||
Accelerator("ctrl+shift+f12","tts")
|
||||
]]>
|
||||
</script>
|
||||
</muclient>
|
||||
122
cosmic rage/worlds/plugins/NewActivity.xml
Normal file
122
cosmic rage/worlds/plugins/NewActivity.xml
Normal file
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient
|
||||
[
|
||||
<!ENTITY activity_alias "na" >
|
||||
<!ENTITY warn_if_none "vbTrue" >
|
||||
]>
|
||||
|
||||
<!-- Saved on Sunday, October 27, 2002, 10:00 AM -->
|
||||
<!-- MuClient version 3.29 -->
|
||||
|
||||
<!-- Plugin "NewActivity" generated by Plugin Wizard -->
|
||||
|
||||
<!--
|
||||
Customise the entities above if you want:
|
||||
|
||||
activity_alias <- what alias to match on, default "na"
|
||||
warn_if_none <- warn if no new activity, change to vbFalse to omit
|
||||
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="NewActivity"
|
||||
author="Nick Gammon"
|
||||
id="1c365f77c8f7915e97b2658c"
|
||||
language="VBscript"
|
||||
purpose="Switches to a world with new activity"
|
||||
date_written="2002-10-27 09:58:04"
|
||||
requires="3.21"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
Type "&activity_alias;" to switch to the next world with new activity.
|
||||
|
||||
New activity is defined as output that has been received while the world is not the active window.
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
&activity_alias; <-- Switch to world with activity
|
||||
|
||||
NewActivity:help <-- This help
|
||||
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnNewActivity"
|
||||
match="&activity_alias;"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
Sub OnNewActivity (sName, sLine, wildcards)
|
||||
Dim name, otherworld
|
||||
|
||||
'
|
||||
' Get list of all worlds, check each one
|
||||
'
|
||||
|
||||
For Each name In world.GetWorldList
|
||||
Set otherworld = world.GetWorld (name)
|
||||
If Not ((otherworld Is Nothing)) Then
|
||||
|
||||
'
|
||||
' GetInfo (202) is the count of new lines for a world
|
||||
'
|
||||
If otherworld.GetInfo (202) > 0 Then
|
||||
otherworld.Activate
|
||||
Exit Sub
|
||||
End If ' end of a world with new activity
|
||||
|
||||
End If ' end of good world object, and not ourselves
|
||||
Next ' end of looping through all open worlds
|
||||
|
||||
]]>
|
||||
|
||||
'
|
||||
' Optional message to warn you there were none ...
|
||||
'
|
||||
If &warn_if_none; Then
|
||||
world.Note "-- No new activity --"
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="NewActivity:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Sub OnHelp (sName, sLine, wildcards)
|
||||
World.Note World.GetPluginInfo (World.GetPluginID, 3)
|
||||
End Sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
41
cosmic rage/worlds/plugins/Omit_Blank_Lines.xml
Normal file
41
cosmic rage/worlds/plugins/Omit_Blank_Lines.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Monday, July 07, 2008, 1:07 PM -->
|
||||
<!-- MuClient version 4.31 -->
|
||||
|
||||
<!-- Plugin "Omit_Blank_Lines" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Omit_Blank_Lines"
|
||||
author="Nick Gammon"
|
||||
id="87a0ec3649ab9a04d5ea618d"
|
||||
language="Lua"
|
||||
purpose="Omits blank lines from output"
|
||||
date_written="2008-07-07 13:06:47"
|
||||
requires="4.00"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Omits completely empty lines from output.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Triggers -->
|
||||
|
||||
<triggers>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^$"
|
||||
omit_from_output="y"
|
||||
regexp="y"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
</muclient>
|
||||
222
cosmic rage/worlds/plugins/Reconnecter.xml
Normal file
222
cosmic rage/worlds/plugins/Reconnecter.xml
Normal file
@@ -0,0 +1,222 @@
|
||||
<?xml Version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient [
|
||||
<!ENTITY interval "10" >
|
||||
<!ENTITY quit_command "quit" >
|
||||
<!ENTITY Connect_command "connect" >
|
||||
<!ENTITY noconnect_command "NOCONNECT" >
|
||||
]>
|
||||
|
||||
<!-- Plugin "Reconnecter" generated by Plugin Wizard -->
|
||||
|
||||
<!--
|
||||
1. Change the entity above "interval" to be the number of seconds
|
||||
between retries.
|
||||
|
||||
2. Change the entity above "quit_command" to be the command you
|
||||
type to quit (eg. quit, QUIT, @quit or whatever)
|
||||
|
||||
3. Change the entity above "Connect_command" to be the command you
|
||||
type to enable connection checking.
|
||||
|
||||
4. Change the entity above "noconnect_command" to be the command you
|
||||
type to disable connection checking.
|
||||
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Reconnecter"
|
||||
author="Nick Gammon"
|
||||
id="dc8cb4a314674db813c12c90"
|
||||
language="Lua"
|
||||
purpose="Reconnects when disconnected"
|
||||
date_written="2007-12-12 11:30:00"
|
||||
requires="3.80"
|
||||
version="2.0"
|
||||
>
|
||||
<description Trim="y">
|
||||
<![CDATA[
|
||||
This plugin will automatically reconnect you when you are disconnected, at a user-configurable interval (say, every 5 seconds)
|
||||
]]>
|
||||
|
||||
Reconnecter:Help - this Help screen
|
||||
|
||||
&Connect_command; - enable recconnection (eg. after using &noconnect_command;)
|
||||
|
||||
&noconnect_command; - disable reconnection (eg. if you are leaving the PC)
|
||||
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Timers -->
|
||||
|
||||
<timers>
|
||||
<timer name="ConnectCheckTimer"
|
||||
script="OnConnectCheckTimer"
|
||||
second="&interval;"
|
||||
active_closed="y"
|
||||
enabled="y">
|
||||
|
||||
</timer>
|
||||
</timers>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnQuit"
|
||||
match="&quit_command;"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
script="OnConnect"
|
||||
match="&Connect_command;"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="OnNoConnect"
|
||||
match="&noconnect_command;"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
local retry, did_quit
|
||||
|
||||
retry = 0 -- retry count
|
||||
did_quit = false
|
||||
|
||||
function OnConnectCheckTimer (sName)
|
||||
|
||||
--
|
||||
-- If currently connecting, leave it to do that ...
|
||||
--
|
||||
|
||||
if GetInfo (107) then
|
||||
return
|
||||
end -- if
|
||||
|
||||
|
||||
--
|
||||
-- If currently connected, we don't need to check any more
|
||||
--
|
||||
|
||||
if IsConnected () then
|
||||
Note "World is connected, disabling disconnection check"
|
||||
EnableTimer (sName, false)
|
||||
return
|
||||
end -- if
|
||||
|
||||
--
|
||||
-- If deliberate quit, we don't need to check any more
|
||||
--
|
||||
if did_quit then
|
||||
Note "Deliberate quit, disabling disconnection check"
|
||||
EnableTimer (sName, false)
|
||||
return
|
||||
end -- if
|
||||
|
||||
--
|
||||
-- OK, we need to Connect now ...
|
||||
--
|
||||
|
||||
retry = retry + 1
|
||||
|
||||
Note ("Connecting to world, attempt # " .. retry)
|
||||
Connect ()
|
||||
|
||||
end -- function
|
||||
|
||||
function OnPluginDisconnect ()
|
||||
--
|
||||
-- If deliberate quit, we don't need to enable the connection check
|
||||
--
|
||||
|
||||
if did_quit then
|
||||
return
|
||||
end -- if
|
||||
|
||||
--
|
||||
-- We have been disconnected, we need to try connecting again
|
||||
--
|
||||
|
||||
Note "Connection checker enabled"
|
||||
EnableTimer ("ConnectCheckTimer", true)
|
||||
|
||||
end -- function
|
||||
|
||||
function OnPluginConnect ()
|
||||
|
||||
--
|
||||
-- Now we are connected, no need to keep trying to Connect
|
||||
--
|
||||
|
||||
retry = 0
|
||||
EnableTimer ("ConnectCheckTimer", false)
|
||||
|
||||
--
|
||||
-- No deliberate quit yet
|
||||
--
|
||||
|
||||
did_quit = false
|
||||
|
||||
end -- function
|
||||
|
||||
function OnPluginInstall ()
|
||||
DoAfterNote (1, "Connection checker installed.")
|
||||
end -- function
|
||||
|
||||
]]>
|
||||
|
||||
function OnQuit (sName, sLine, wildcards)
|
||||
did_quit = true
|
||||
Send ("&quit_command;") -- Send to world so it does it
|
||||
Note "Deliberate quit (&quit_command;), reconnect disabled"
|
||||
end -- function
|
||||
|
||||
function OnConnect (sName, sLine, wildcards)
|
||||
Note "Connection checker enabled"
|
||||
EnableTimer ("ConnectCheckTimer", true)
|
||||
did_quit = false
|
||||
end -- function
|
||||
|
||||
function OnNoConnect (sName, sLine, wildcards)
|
||||
Note "Connection checker disabled"
|
||||
EnableTimer ("ConnectCheckTimer", false)
|
||||
did_quit = true
|
||||
end -- function
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin Help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="Reconnecter:Help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
function OnHelp (sName, sLine, wildcards)
|
||||
Note (GetPluginInfo (GetPluginID, 3))
|
||||
end -- function
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
209
cosmic rage/worlds/plugins/Reconnecter_Lua.xml
Normal file
209
cosmic rage/worlds/plugins/Reconnecter_Lua.xml
Normal file
@@ -0,0 +1,209 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient [
|
||||
<!ENTITY interval "10" >
|
||||
<!ENTITY quit_command "QUIT" >
|
||||
<!ENTITY connect_command "CONNECT" >
|
||||
<!ENTITY noconnect_command "NOCONNECT" >
|
||||
]>
|
||||
|
||||
<!--
|
||||
1. Change the entity above "interval" to be the number of seconds
|
||||
between retries.
|
||||
|
||||
2. Change the entity above "quit_command" to be the command you
|
||||
type to quit (eg. quit, QUIT, @quit or whatever)
|
||||
|
||||
3. Change the entity above "connect_command" to be the command you
|
||||
type to enable connection checking.
|
||||
|
||||
4. Change the entity above "noconnect_command" to be the command you
|
||||
type to disable connection checking.
|
||||
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Reconnecter_Lua"
|
||||
author="Nick Gammon"
|
||||
id="42c2c0b90c00344c55eabdfe"
|
||||
language="Lua"
|
||||
purpose="Reconnects when disconnected"
|
||||
date_written="2017-12-24"
|
||||
requires="4.00"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
This plugin will automatically reconnect you when you are disconnected,
|
||||
at a user-configurable interval (say, every 5 seconds)
|
||||
]]>
|
||||
|
||||
Reconnecter:help - this help screen
|
||||
|
||||
&connect_command; - enable recconnection (eg. after using &noconnect_command;)
|
||||
|
||||
&noconnect_command; - disable reconnection (eg. if you are leaving the PC)
|
||||
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Timers -->
|
||||
|
||||
<timers>
|
||||
<timer
|
||||
name="ConnectCheckTimer"
|
||||
script="OnConnectCheckTimer"
|
||||
second="&interval;"
|
||||
active_closed="y"
|
||||
enabled="y">
|
||||
|
||||
</timer>
|
||||
</timers>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnQuit"
|
||||
match="&quit_command;"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
script="OnConnect"
|
||||
match="&connect_command;"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="OnNoConnect"
|
||||
match="&noconnect_command;"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
retry = 0
|
||||
did_quit = false
|
||||
|
||||
function OnConnectCheckTimer (sName)
|
||||
--
|
||||
-- If currently connecting, leave it to do that ...
|
||||
--
|
||||
|
||||
if world.GetInfo (107) then
|
||||
return
|
||||
end -- if
|
||||
|
||||
--
|
||||
-- If currently connected, we don't need to check any more
|
||||
--
|
||||
if IsConnected () then
|
||||
ColourNote ("yellow", "", "World is connected, disabling disconnection check")
|
||||
EnableTimer (sName, false)
|
||||
return
|
||||
end -- if
|
||||
|
||||
--
|
||||
-- If deliberate quit, we don't need to check any more
|
||||
--
|
||||
if did_quit then
|
||||
ColourNote ("yellow", "", "Deliberate quit, disabling disconnection check")
|
||||
EnableTimer (sName, false)
|
||||
return
|
||||
end -- if
|
||||
|
||||
--
|
||||
-- OK, we need to connect now ...
|
||||
--
|
||||
|
||||
retry = retry + 1
|
||||
|
||||
ColourNote ("yellow", "", "Connecting to world, attempt # " .. retry)
|
||||
Connect ()
|
||||
|
||||
end -- function OnConnectCheckTimer
|
||||
|
||||
function OnPluginDisconnect ()
|
||||
--
|
||||
-- If deliberate quit, we don't need to enable the connection check
|
||||
--
|
||||
if did_quit then
|
||||
return
|
||||
end -- if did a deliberate quit
|
||||
|
||||
--
|
||||
-- We have been disconnected, we need to try connecting again
|
||||
--
|
||||
ColourNote ("yellow", "", "Connection checker enabled")
|
||||
EnableTimer ("ConnectCheckTimer", true)
|
||||
end -- function OnPluginDisconnect
|
||||
|
||||
function OnPluginConnect ()
|
||||
--
|
||||
-- Now we are connected, no need to keep trying to connect
|
||||
--
|
||||
retry = 0
|
||||
EnableTimer ("ConnectCheckTimer", false)
|
||||
--
|
||||
-- No deliberate quit yet
|
||||
--
|
||||
did_quit = false
|
||||
end -- function OnPluginConnect
|
||||
|
||||
function OnPluginInstall ()
|
||||
DoAfterNote (1, "Connection checker installed.")
|
||||
end -- function OnPluginInstall
|
||||
|
||||
]]>
|
||||
|
||||
function OnQuit (sName, sLine, wildcards)
|
||||
did_quit = true
|
||||
Send ("&quit_command;") -- send to world so it does it
|
||||
ColourNote ("yellow", "", "Deliberate quit (&quit_command;), reconnect disabled")
|
||||
end -- function OnQuit
|
||||
|
||||
function OnConnect (sName, sLine, wildcards)
|
||||
ColourNote ("yellow", "", "Connection checker enabled")
|
||||
EnableTimer ("ConnectCheckTimer", true)
|
||||
did_quit = false
|
||||
end -- function OnConnect
|
||||
|
||||
function OnNoConnect (sName, sLine, wildcards)
|
||||
ColourNote ("yellow", "", "Connection checker disabled")
|
||||
EnableTimer ("ConnectCheckTimer", false)
|
||||
did_quit = true
|
||||
end -- function OnNoConnect
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="Reconnecter:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
function OnHelp (sName, sLine, wildcards)
|
||||
Note (GetPluginInfo (GetPluginID (), 3))
|
||||
end -- function OnHelp
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
70
cosmic rage/worlds/plugins/Repeat_Command.xml
Normal file
70
cosmic rage/worlds/plugins/Repeat_Command.xml
Normal file
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Sunday, February 17, 2008, 2:05 PM -->
|
||||
<!-- MuClient version 4.19 -->
|
||||
|
||||
<!-- Plugin "Repeat_Command" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Repeat_Command"
|
||||
author="Nick Gammon"
|
||||
id="7f69fe2f7913b2ac312ecbad"
|
||||
language="Lua"
|
||||
purpose="Repeats a command "x" times"
|
||||
date_written="2008-02-17 14:04:23"
|
||||
requires="4.00"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
To use, type:
|
||||
|
||||
#n command
|
||||
|
||||
This sends "command" n times to the MUD.
|
||||
|
||||
For example:
|
||||
|
||||
#3 kick kobold
|
||||
|
||||
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
match="^#\s*(\d+) (.*?)$"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>
|
||||
-- check at least 1 repeat
|
||||
if %1 < 1 then
|
||||
ColourNote ("white", "red", "Too few repeats specified (%1)")
|
||||
return
|
||||
end -- if
|
||||
|
||||
-- check not more than 50 repeats
|
||||
if %1 > 50 then
|
||||
ColourNote ("white", "red", "Too many repeats specified (%1)")
|
||||
return
|
||||
end -- if
|
||||
|
||||
-- execute (send to command processor) the command
|
||||
for i = 1, %1 do
|
||||
Execute "%2"
|
||||
end -- for loop
|
||||
|
||||
</send>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
</muclient>
|
||||
102
cosmic rage/worlds/plugins/SMAUG_automapper_helper.xml
Normal file
102
cosmic rage/worlds/plugins/SMAUG_automapper_helper.xml
Normal file
@@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Tuesday, August 20, 2002, 10:53 AM -->
|
||||
<!-- MuClient version 3.26 -->
|
||||
|
||||
<!-- Plugin "SMAUG_automapper_helper" generated by Plugin Wizard -->
|
||||
|
||||
<!--
|
||||
|
||||
To modify for other MUDs you would need to change the trigger, as appropriate, to match how a room name appears (eg. different colours, maybe not necessarily bold).
|
||||
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="SMAUG_automapper_helper"
|
||||
author="Nick Gammon"
|
||||
id="1f35c7a694942758589d3cd8"
|
||||
language="VBscript"
|
||||
purpose="Adds room names to the auto mapper"
|
||||
date_written="2002-08-20 10:49:57"
|
||||
requires="3.26"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
This plugin (attempts to) detect room names as you walk around in SMAUG, and if found, and the automapper is active, adds them to the automapper as a comment.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Just have the plugin installed and it will detect room names.
|
||||
It looks for bold, white-on-black text, that does *not* start with the word "Exits:".
|
||||
|
||||
automapper:help <-- this help screen
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Triggers -->
|
||||
|
||||
<triggers>
|
||||
<trigger
|
||||
back_colour="8"
|
||||
bold="y"
|
||||
enabled="y"
|
||||
match="^(?!Exits: )(.*)$"
|
||||
match_back_colour="y"
|
||||
match_bold="y"
|
||||
match_inverse="y"
|
||||
match_italic="y"
|
||||
match_text_colour="y"
|
||||
regexp="y"
|
||||
script="OnRoomName"
|
||||
send_to="2"
|
||||
sequence="100"
|
||||
text_colour="15"
|
||||
>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
sub OnRoomName (strName, strLine, aryWildcards)
|
||||
'
|
||||
' if automapper active, add room name as comment
|
||||
'
|
||||
if world.getinfo (112) then
|
||||
world.addmappercomment (aryWildcards (1))
|
||||
end if
|
||||
|
||||
end sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="automapper:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Sub OnHelp (sName, sLine, wildcards)
|
||||
World.Note World.GetPluginInfo (World.GetPluginID, 3)
|
||||
End Sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
32
cosmic rage/worlds/plugins/Summary.xml
Normal file
32
cosmic rage/worlds/plugins/Summary.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Summary"
|
||||
author="Nick Gammon"
|
||||
id="71a90acddb14f784437b8b80"
|
||||
language="Lua"
|
||||
purpose="Provides a system summary you can post into a forum message"
|
||||
date_written="2010-07-22 07:29:52"
|
||||
requires="4.55"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
Type "summary" to use.
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
match="summary"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>Debug "summary"</send>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
</muclient>
|
||||
475
cosmic rage/worlds/plugins/Text_To_Speech.xml
Normal file
475
cosmic rage/worlds/plugins/Text_To_Speech.xml
Normal file
@@ -0,0 +1,475 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
|
||||
<!-- Based on work by Nick Gammon based on work by Tyler Spivey -->
|
||||
<!-- See: http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=7767 -->
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Text_To_Speech"
|
||||
author="Avi Kelman (Fiendish)"
|
||||
id="463242566069ebfd1b379ec1"
|
||||
language="Lua"
|
||||
purpose="Speaks incoming text using SAPI."
|
||||
date_written="2010-09-01"
|
||||
requires="4.60"
|
||||
version="2.0"
|
||||
save_state="y"
|
||||
>
|
||||
|
||||
<description trim="y">
|
||||
Text To Speech Plug-in Commands:
|
||||
|
||||
sapi on : turn on automatic speaking of MUD output.
|
||||
sapi off : turn off automatic speaking of MUD output.
|
||||
sapi skip : skips one sentence in output stream.
|
||||
sapi clear : clear the speech output queue.
|
||||
sapi faster : speeds speech up.
|
||||
sapi slower : slows speech down.
|
||||
sapi rate [number] : set speech rate to [number].
|
||||
sapi list voices : list the available TTS voices.
|
||||
sapi voice [number] : switch to the given TTS voice number.
|
||||
sapi test : speak a test phrase.
|
||||
sapi punctuation [number] : set punctuation filtering level to [number].
|
||||
sapi say [text] : speak the given text.
|
||||
|
||||
Scripts can also speak stuff by doing:
|
||||
|
||||
CallPlugin ("463242566069ebfd1b379ec1", "say", "What to say")
|
||||
</description>
|
||||
</plugin>
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
match="sapi on"
|
||||
enabled="n"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
script="speak_on"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="sapi off"
|
||||
enabled="n"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
script="speak_off"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="sapi faster"
|
||||
enabled="n"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
script="speak_faster"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="sapi slower"
|
||||
enabled="n"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
script="speak_slower"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="^sapi voice( .+)?$"
|
||||
regexp="y"
|
||||
enabled="n"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
script="speak_choose_voice"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="sapi list voices"
|
||||
enabled="n"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
script="list_voices"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="sapi test"
|
||||
enabled="n"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
script="speak_test"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="^sapi rate( .+)?$"
|
||||
enabled="n"
|
||||
regexp="y"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
script="speak_rate"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="sapi skip"
|
||||
enabled="n"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
script="speak_skip"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="sapi clear"
|
||||
enabled="n"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
script="speak_skip_all"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="^sapi say (.*)$"
|
||||
regexp="y"
|
||||
enabled="n"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
send_to="12"
|
||||
>
|
||||
<send>
|
||||
say("%1")
|
||||
</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="^sapi help( printed)?$"
|
||||
regexp="y"
|
||||
enabled="n"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
send_to="12"
|
||||
><send>
|
||||
if "%1" == "" then
|
||||
say("This help is being spoken but not printed to the screen. To print it to the screen, use: sapi help printed.")
|
||||
say(GetPluginInfo(GetPluginID(), 3), true)
|
||||
else
|
||||
NoteSilent(GetPluginInfo(GetPluginID(), 3))
|
||||
end
|
||||
</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="sapi debug"
|
||||
enabled="n"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
send_to="12"
|
||||
><send>
|
||||
show_spoken_lines = not show_spoken_lines
|
||||
</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="sapi punctuation( .+)?"
|
||||
regexp="y"
|
||||
enabled="n"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
group="speech"
|
||||
script="speak_punctuation_level"
|
||||
></alias>
|
||||
</aliases>
|
||||
|
||||
<triggers>
|
||||
</triggers>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
local punc_descs = {
|
||||
"Say all punctuation.",
|
||||
"Say only non-standard punctuation.",
|
||||
"Extra filtering to mask symbols and other garbage."
|
||||
}
|
||||
|
||||
function current_punctuation_level()
|
||||
return "SAPI punctuation level is currently "..tostring(punctuation_level)..". "..punc_descs[punctuation_level]
|
||||
end
|
||||
|
||||
function speak_punctuation_level(name, line, wildcards)
|
||||
local function list_options()
|
||||
say("Punctuation level options are:")
|
||||
for i,v in ipairs(punc_descs) do say("Level "..tostring(i)..": "..v) end
|
||||
say("Level "..tostring(#punc_descs).." is recommended.")
|
||||
end
|
||||
|
||||
local arg = Trim(wildcards[1])
|
||||
if arg == "" then
|
||||
say(current_punctuation_level())
|
||||
list_options()
|
||||
return
|
||||
end
|
||||
arg = tonumber(arg)
|
||||
if (arg == nil) or (punc_descs[arg] == nil) then
|
||||
say("SAPI punctuation level must be an index number between 1 and 3.")
|
||||
list_options()
|
||||
return
|
||||
end
|
||||
punctuation_level = arg
|
||||
SetVariable("punctuation_level", tostring(punctuation_level))
|
||||
say("SAPI punctuation level set to "..tostring(punctuation_level)..". "..punc_descs[punctuation_level])
|
||||
end
|
||||
|
||||
-- turn on speaking
|
||||
function speak_on (name, line, wildcards)
|
||||
speak = true
|
||||
SetVariable("speak", speak and "1" or "0")
|
||||
say("SAPI auto speak now activated.")
|
||||
end -- function speak_on
|
||||
|
||||
-- turn off speaking
|
||||
function speak_off (name, line, wildcards)
|
||||
speak = false
|
||||
SetVariable("speak", speak and "1" or "0")
|
||||
speak_skip_all()
|
||||
say("SAPI auto speak now deactivated.")
|
||||
end -- function speak_off
|
||||
|
||||
-- skip a sentence
|
||||
function speak_skip (name, line, wildcards)
|
||||
talk:Skip("Sentence", 1)
|
||||
end -- function speak_skip
|
||||
|
||||
function speak_skip_all (name, line, wildcards)
|
||||
talk:Speak(' ', SAPI_ENUMS.SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak)
|
||||
end
|
||||
|
||||
function speak_faster (name, line, wildcards)
|
||||
talk.Rate = talk.Rate + 1
|
||||
SetVariable("talk_Rate", talk.Rate)
|
||||
speak_test()
|
||||
end
|
||||
|
||||
function speak_slower (name, line, wildcards)
|
||||
talk.Rate = talk.Rate - 1
|
||||
SetVariable("talk_Rate", talk.Rate)
|
||||
speak_test()
|
||||
end
|
||||
|
||||
function speak_rate (name, line, wildcards)
|
||||
local input = Trim(wildcards[1])
|
||||
if input == "" then
|
||||
say("SAPI rate currently set to "..talk.Rate)
|
||||
return
|
||||
end
|
||||
if tonumber(input) then
|
||||
talk.Rate = tonumber(wildcards[1])
|
||||
SetVariable("talk_Rate", talk.Rate)
|
||||
speak_test()
|
||||
else
|
||||
say("Invalid SAPI rate \""..wildcards[1].."\"")
|
||||
end
|
||||
end
|
||||
|
||||
western_happy_faces = "[8:]%-?[D%)%]]" -- arbitrary heuristics
|
||||
western_sad_faces = "[8:;]%-?[%(%[]" -- arbitrary heuristics
|
||||
another_sad_face = "%-_%-" -- arbitrary heuristics
|
||||
another_happy_face = "%^_%^" -- arbitrary heuristics
|
||||
western_wink_faces = ";%-?[D%)%]]" -- arbitrary heuristics
|
||||
western_tongue_faces = "[8:;]%-?[pP9b]" -- arbitrary heuristics
|
||||
remove_two_or_more_of_these = "[%-%+%^#$~><*`_]" -- arbitrary heuristics
|
||||
remove_three_or_more_of_these = "[%p\\/|_%-%(%)%[]{}%%%+%^#%$~><*`_]" -- arbitrary heuristics
|
||||
silent_if_only_these = "[%p%s]+" -- arbitrary heuristics
|
||||
two_or_more_pattern = remove_two_or_more_of_these:rep(2).."+" -- arbitrary heuristics
|
||||
three_or_more_pattern = remove_three_or_more_of_these:rep(3).."+" -- arbitrary heuristics
|
||||
pad_left_braces = "([%[%(%{])" -- arbitrary heuristics
|
||||
pad_right_braces = "([%]%}%)])" -- arbitrary heuristics
|
||||
function filter_more_punctuation(msg) -- uses arbitrary heuristics
|
||||
msg = msg:gsub(western_happy_faces, ", smiley. "):gsub(western_sad_faces, ", sad-face. "):gsub(western_wink_faces, ", winks. "):gsub(western_tongue_faces, ", sticks-tongue-out. "):gsub(another_sad_face, ", sad-face. "):gsub(another_happy_face, ", smiley. "):gsub(three_or_more_pattern, " "):gsub(two_or_more_pattern, " "):gsub("|", " "):gsub(pad_left_braces, " %1"):gsub(pad_right_braces, "%1 ")
|
||||
if msg:gsub(silent_if_only_these, "") == "" then
|
||||
return ""
|
||||
else
|
||||
return msg
|
||||
end
|
||||
end
|
||||
|
||||
function speak_choose_voice (name, line, wildcards)
|
||||
local new_voice = nil
|
||||
local param = Trim(wildcards[1])
|
||||
local voice_number = tonumber(param)
|
||||
if voice_number~=nil and voice_number >= 1 and voice_number <= NUM_SAPI_VOICES and talk:GetVoices():Item(voice_number-1).ID ~= "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens\\SampleTTSVoice" then
|
||||
current_voice_index = voice_number-1
|
||||
new_voice = talk:GetVoices():Item(current_voice_index)
|
||||
else
|
||||
if param ~= "" then
|
||||
say(param.." is not a valid SAPI voice number.")
|
||||
else
|
||||
say("The SAPI voice command must be given a number corresponding to the desired voice.")
|
||||
end
|
||||
list_voices()
|
||||
return
|
||||
end
|
||||
|
||||
talk:setVoice(new_voice) -- luacom can't do `talk.Voice =`
|
||||
SetVariable("talk_Voice_ID", talk.Voice.ID)
|
||||
speak_test()
|
||||
end
|
||||
|
||||
function speak_test (name, line, wildcards)
|
||||
say("SAPI speech is set to voice "..tostring(current_voice_index+1)..", "..talk.Voice:GetDescription()..", speaking at rate " .. tostring(talk.Rate))
|
||||
end
|
||||
|
||||
function list_voices (name, line, wildcards)
|
||||
local enumerate_voices = luacom.GetEnumerator(talk:GetVoices())
|
||||
local voice = enumerate_voices:Next()
|
||||
local i = 0
|
||||
while voice do
|
||||
if voice.ID ~= "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens\\SampleTTSVoice" then
|
||||
talk:setVoice(voice)
|
||||
say("Voice number "..tostring(i+1).." is "..voice:GetDescription())
|
||||
end
|
||||
i = i + 1
|
||||
voice = enumerate_voices:Next()
|
||||
end
|
||||
talk:setVoice(talk:GetVoices():Item(current_voice_index))
|
||||
say("Type sapi voice [number] to set the desired SAPI voice.")
|
||||
end
|
||||
|
||||
-- installation
|
||||
function OnPluginInstall ()
|
||||
|
||||
-- load Lua COM
|
||||
require "luacom"
|
||||
|
||||
-- Instantiate a SAPI voice obejct
|
||||
talk = assert(luacom.CreateObject("SAPI.SpVoice"), [[
|
||||
Cannot open SAPI.
|
||||
Note for Linux and Mac OS users.
|
||||
Text to speech functionality depends on the Microsoft Speech API.
|
||||
This is not included by default in Wine, and SpeechSDK51.exe must be separately installed.
|
||||
You can download it from http://download.microsoft.com/download/B/4/3/B4314928-7B71-4336-9DE7-6FA4CF00B7B3/SpeechSDK51.exe
|
||||
]])
|
||||
|
||||
SAPI_ENUMS = luacom.GetTypeInfo(talk):GetTypeLib():ExportEnumerations()
|
||||
NUM_SAPI_VOICES = talk:GetVoices().Count
|
||||
assert(NUM_SAPI_VOICES > 0, "No SAPI voices found.")
|
||||
|
||||
current_voice = GetVariable("talk_Voice_ID") or talk.Voice.ID
|
||||
|
||||
-- find index of saved voice
|
||||
current_voice_index = 0
|
||||
local enumerate_voices = luacom.GetEnumerator(talk:GetVoices())
|
||||
local voice = enumerate_voices:Next()
|
||||
local i = 0
|
||||
while voice do
|
||||
if voice.ID == current_voice then
|
||||
current_voice_index = i
|
||||
break
|
||||
end
|
||||
i = i + 1
|
||||
voice = enumerate_voices:Next()
|
||||
end
|
||||
|
||||
talk:setVoice(voice) -- luacom can't do `talk.Voice =`
|
||||
talk.Rate = GetVariable("talk_Rate") or talk.Rate
|
||||
speak = ((GetVariable("speak") or "1") == "1")
|
||||
punctuation_level = tonumber(GetVariable("punctuation_level"))
|
||||
if punc_descs[punctuation_level] == nil then
|
||||
punctuation_level = 3
|
||||
end
|
||||
show_spoken_lines = false
|
||||
EnableGroup("speech", true)
|
||||
|
||||
-- Method call
|
||||
say("SAPI Plug-in installed and is ready")
|
||||
say(current_punctuation_level())
|
||||
end -- function OnPluginInstall
|
||||
|
||||
-- here to draw the screen
|
||||
function OnPluginScreendraw (t, log, line)
|
||||
|
||||
if (t == 0 or t == 1) and speak then
|
||||
say(line, true)
|
||||
end -- if
|
||||
|
||||
end -- function
|
||||
|
||||
function NoteSilent(what)
|
||||
local prev_speak = speak
|
||||
speak = false
|
||||
Note(what)
|
||||
speak = prev_speak
|
||||
end
|
||||
|
||||
-- Speak from other scripts
|
||||
-- eg. CallPlugin ("463242566069ebfd1b379ec1", "say", "What to say")
|
||||
function say (what, force_debug_off)
|
||||
|
||||
-- check loaded
|
||||
if not talk then
|
||||
return false -- failure
|
||||
end -- if not installed
|
||||
|
||||
if show_spoken_lines and not force_debug_off then
|
||||
local escaped_what = what:gsub("\\","\\\\"):gsub("\"","\\\"")
|
||||
-- this uses DoAfterSpecial instead of Note directly, because of http://www.gammon.com.au/forum/?id=12915&reply=38#reply38
|
||||
DoAfterSpecial(0.1, "CallPlugin (\"463242566069ebfd1b379ec1\", \"NoteSilent\", \""..escaped_what.."\")", 12)
|
||||
end
|
||||
if punctuation_level == 1 then
|
||||
talk:Speak(what, SAPI_ENUMS.SpeechVoiceSpeakFlags.SVSFlagsAsync + SAPI_ENUMS.SpeechVoiceSpeakFlags.SVSFNLPSpeakPunc)
|
||||
elseif punctuation_level == 2 then
|
||||
talk:Speak(what, SAPI_ENUMS.SpeechVoiceSpeakFlags.SVSFlagsAsync)
|
||||
else
|
||||
local cleaned_speech = filter_more_punctuation(what)
|
||||
if cleaned_speech ~= "" then
|
||||
talk:Speak(cleaned_speech, SAPI_ENUMS.SpeechVoiceSpeakFlags.SVSFlagsAsync)
|
||||
end
|
||||
end
|
||||
|
||||
return true -- OK
|
||||
end -- function say
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
158
cosmic rage/worlds/plugins/Timestamps.xml
Normal file
158
cosmic rage/worlds/plugins/Timestamps.xml
Normal file
@@ -0,0 +1,158 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
|
||||
<!--
|
||||
Change the following variables to customise your timestamps:
|
||||
|
||||
TIMESTAMP_INPUT : what to put in front of things you type
|
||||
TIMESTAMP_OUTPUT : what to put in front of MUD output
|
||||
TIMESTAMP_NOTES : what to put in front of scripted notes
|
||||
|
||||
Text colours:
|
||||
|
||||
TIMESTAMP_INPUT_TEXT_COLOUR
|
||||
TIMESTAMP_OUTPUT_TEXT_COLOUR
|
||||
TIMESTAMP_NOTES_TEXT_COLOUR
|
||||
|
||||
Background (behind the timestamp) colours:
|
||||
|
||||
TIMESTAMP_INPUT_BACK_COLOUR
|
||||
TIMESTAMP_OUTPUT_BACK_COLOUR
|
||||
TIMESTAMP_NOTES_BACK_COLOUR
|
||||
|
||||
Special characters for date/time etc.
|
||||
|
||||
General
|
||||
|
||||
%E - MUSHclient initial (startup) directory
|
||||
%F - world files directory
|
||||
%L - log files directory
|
||||
%N - world name
|
||||
%P - player name
|
||||
|
||||
Date/time
|
||||
|
||||
%a - Abbreviated weekday name
|
||||
%A - Full weekday name
|
||||
%b - Abbreviated month name
|
||||
%B - Full month name
|
||||
%c - Date and time representation appropriate for locale
|
||||
%d - Day of month as decimal number (01 - 31)
|
||||
%H - Hour in 24-hour format (00 - 23)
|
||||
|
||||
%I - Hour in 12-hour format (01 - 12)
|
||||
%j - Day of year as decimal number (001 - 366)
|
||||
%m - Month as decimal number (01 - 12)
|
||||
%M - Minute as decimal number (00 - 59)
|
||||
%p - A.M./P.M. indicator for 12-hour clock
|
||||
%S - Second as decimal number (00 - 59)
|
||||
%U - Week of year as decimal number, with Sunday as first day of week (00 - 53)
|
||||
%w - Weekday as decimal number (0 - 6; Sunday is 0)
|
||||
%W - Week of year as decimal number, with Monday as first day of week (00 - 53)
|
||||
%x - Date representation for current locale
|
||||
%X - Time representation for current locale
|
||||
%y - Year without century, as decimal number (00 - 99)
|
||||
%Y - Year with century, as decimal number
|
||||
%z, %Z - Time-zone name or abbreviation; no characters if time zone is unknown
|
||||
%% - Percent sign
|
||||
|
||||
%e - Elapsed time in microseconds since world started
|
||||
%D - Delta time, in microseconds, since previous line
|
||||
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Timestamps"
|
||||
author="Nick Gammon"
|
||||
id="559d05b18c3fd5602a433cf8"
|
||||
language="Lua"
|
||||
purpose="Adds a timestamp to each line in the output window"
|
||||
save_state="y"
|
||||
date_written="2010-09-25 14:02:11"
|
||||
date_modified="2011-05-20 16:05:00"
|
||||
requires="4.62"
|
||||
version="1.1"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Enable this plugin to see timestamps.
|
||||
|
||||
Disable to hide them.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
TIMESTAMP_INPUT = "%H:%M:%S $ "
|
||||
TIMESTAMP_OUTPUT = "%H:%M:%S > "
|
||||
TIMESTAMP_NOTES = "%H:%M:%S ! "
|
||||
|
||||
TIMESTAMP_INPUT_TEXT_COLOUR = ColourNameToRGB ("maroon")
|
||||
TIMESTAMP_OUTPUT_TEXT_COLOUR = ColourNameToRGB ("white")
|
||||
TIMESTAMP_NOTES_TEXT_COLOUR = ColourNameToRGB ("cyan")
|
||||
|
||||
TIMESTAMP_INPUT_BACK_COLOUR = ColourNameToRGB ("#151515")
|
||||
TIMESTAMP_OUTPUT_BACK_COLOUR = ColourNameToRGB ("#151515")
|
||||
TIMESTAMP_NOTES_BACK_COLOUR = ColourNameToRGB ("#151515")
|
||||
|
||||
function OnPluginInstall ()
|
||||
|
||||
-- if disabled last time, stay disabled
|
||||
if GetVariable ("enabled") == "false" then
|
||||
ColourNote ("yellow", "", "Warning: Plugin " .. GetPluginName ().. " is currently disabled.")
|
||||
check (EnablePlugin(GetPluginID (), false))
|
||||
end -- they didn't enable us last time
|
||||
|
||||
OnPluginEnable ()
|
||||
|
||||
end -- OnPluginInstall
|
||||
|
||||
function OnPluginSaveState ()
|
||||
SetVariable ("enabled", tostring (GetPluginInfo (GetPluginID (), 17)))
|
||||
end -- OnPluginSaveState
|
||||
|
||||
function OnPluginDisable ()
|
||||
|
||||
SetAlphaOption ("timestamp_input", "")
|
||||
SetAlphaOption ("timestamp_output", "")
|
||||
SetAlphaOption ("timestamp_notes", "")
|
||||
Redraw ()
|
||||
|
||||
end -- OnPluginDisable
|
||||
|
||||
function OnPluginClose ()
|
||||
OnPluginDisable ()
|
||||
end -- OnPluginClose
|
||||
|
||||
function OnPluginEnable ()
|
||||
|
||||
SetAlphaOption ("timestamp_input", TIMESTAMP_INPUT)
|
||||
SetAlphaOption ("timestamp_output", TIMESTAMP_OUTPUT)
|
||||
SetAlphaOption ("timestamp_notes", TIMESTAMP_NOTES)
|
||||
|
||||
SetOption ("timestamp_input_text_colour", TIMESTAMP_INPUT_TEXT_COLOUR )
|
||||
SetOption ("timestamp_output_text_colour", TIMESTAMP_OUTPUT_TEXT_COLOUR )
|
||||
SetOption ("timestamp_notes_text_colour", TIMESTAMP_NOTES_TEXT_COLOUR )
|
||||
|
||||
SetOption ("timestamp_input_back_colour", TIMESTAMP_INPUT_BACK_COLOUR )
|
||||
SetOption ("timestamp_output_back_colour", TIMESTAMP_OUTPUT_BACK_COLOUR )
|
||||
SetOption ("timestamp_notes_back_colour", TIMESTAMP_NOTES_BACK_COLOUR )
|
||||
|
||||
Redraw ()
|
||||
|
||||
end -- OnPluginEnable
|
||||
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
</muclient>
|
||||
394
cosmic rage/worlds/plugins/Version_Check.xml
Normal file
394
cosmic rage/worlds/plugins/Version_Check.xml
Normal file
@@ -0,0 +1,394 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Version_Check"
|
||||
author="Nick Gammon"
|
||||
id="2eb7301f3ac637b02a4467ef"
|
||||
language="Lua"
|
||||
purpose="Checks for a new version of MUSHclient"
|
||||
date_written="2010-11-13 16:45:58"
|
||||
requires="4.60"
|
||||
version="1.5"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
This automatically checks every week for a new version of MUSHclient.
|
||||
|
||||
It only checks when you load the plugin. You can change that by enabling the
|
||||
timer in the plugin (change to: enabled="y" )
|
||||
|
||||
To check right now, type: version_check
|
||||
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
name="check_version_now"
|
||||
script="do_version_check"
|
||||
match="version_check"
|
||||
enabled="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
|
||||
<!-- Timers -->
|
||||
|
||||
<timers>
|
||||
<timer name="version_check"
|
||||
script="check_for_new_version"
|
||||
enabled="n"
|
||||
minute="30"
|
||||
active_closed="y"
|
||||
>
|
||||
|
||||
</timer>
|
||||
</timers>
|
||||
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
-- interval
|
||||
|
||||
CHECK_INTERVAL = 60 * 60 * 24 * 7 -- every 7 days
|
||||
|
||||
-- font
|
||||
FONT_NAME = "Microsoft Sans Serif"
|
||||
FONT_SIZE = 10
|
||||
font_id = "f"
|
||||
font_id_bold = "fb"
|
||||
font_id_underline = "fu"
|
||||
|
||||
MAX_WIDTH = 500
|
||||
GAP = 5
|
||||
|
||||
TITLE = "A new version of MUSHclient is available."
|
||||
|
||||
VERSION_URL = "http://www.mushclient.com/scripts/version.php"
|
||||
|
||||
ANNOUNCEMENTS_URL = "http://www.mushclient.com/scripts/?bbtopic_id=1"
|
||||
RELNOTES_URL = "http://www.mushclient.com/relnotes"
|
||||
|
||||
|
||||
-- colours
|
||||
WINDOW_BACKGROUND_COLOUR = ColourNameToRGB ("khaki")
|
||||
WINDOW_TEXT_COLOUR = ColourNameToRGB ("black")
|
||||
WINDOW_FRAME_COLOUR = ColourNameToRGB ("saddlebrown")
|
||||
HYPERLINK_COLOUR = ColourNameToRGB ("mediumblue")
|
||||
|
||||
win = "version_info_" .. GetPluginID () -- get a unique name
|
||||
|
||||
-- find when we last checked the version number
|
||||
db = sqlite3.open(GetInfo (82)) -- open preferences
|
||||
|
||||
for row in db:nrows('SELECT * FROM prefs WHERE name = "time_last_version_check"') do
|
||||
last_check_time = tonumber (row.value)
|
||||
end
|
||||
|
||||
-- if not in database, insert row
|
||||
if not last_check_time then
|
||||
db:exec 'INSERT INTO prefs (name, value) VALUES ("time_last_version_check", 0)'
|
||||
last_check_time = 0
|
||||
end -- if
|
||||
|
||||
db:close() -- close
|
||||
|
||||
function hyperlink_download ()
|
||||
OpenBrowser (installer_url)
|
||||
end -- hyperlink_download
|
||||
|
||||
function hyperlink_announcements ()
|
||||
OpenBrowser (ANNOUNCEMENTS_URL)
|
||||
end -- hyperlink_announcements
|
||||
|
||||
function hyperlink_relnotes ()
|
||||
OpenBrowser (RELNOTES_URL)
|
||||
end -- hyperlink_relnotes
|
||||
|
||||
function hyperlink_close ()
|
||||
WindowShow (win, false)
|
||||
end -- hyperlink_close
|
||||
|
||||
-- here if they click on the hyperlink
|
||||
function mouseup (flags, hotspotid)
|
||||
local f = hyperlink_functions [hotspotid]
|
||||
if f then
|
||||
f ()
|
||||
end -- function found
|
||||
end -- mouseup
|
||||
|
||||
hyperlink_functions = {}
|
||||
|
||||
function make_hyperlink (text, id, left, top, action, hint)
|
||||
|
||||
-- work out text rectangle size
|
||||
local height = WindowFontInfo (win, font_id, 1)
|
||||
local right = left + WindowTextWidth (win, font_id, text)
|
||||
local bottom = top + height
|
||||
|
||||
-- add the hotspot
|
||||
WindowAddHotspot(win, id,
|
||||
left, top, right, bottom,
|
||||
"", -- mouseover (do nothing)
|
||||
"", -- cancelmouseover (do nothing)
|
||||
"", -- mousedown (do nothing)
|
||||
"", -- cancelmousedown (do nothing)
|
||||
"mouseup", -- mouseup
|
||||
hint, -- hint text if they hover over it
|
||||
miniwin.cursor_hand, 0)
|
||||
|
||||
|
||||
-- draw the hyperlink text in the rectangle
|
||||
WindowText (win, font_id_underline, text, left, top, right, bottom, HYPERLINK_COLOUR)
|
||||
|
||||
-- remember action function
|
||||
hyperlink_functions [id] = action
|
||||
|
||||
end -- make_hyperlink
|
||||
|
||||
function do_version_check ()
|
||||
|
||||
require "getlines"
|
||||
require "movewindow"
|
||||
|
||||
if package.loaders [3] == nil or package.loadlib == nil then
|
||||
ColourNote ("orange", "", GetPluginName () .. " cannot do version check.")
|
||||
ColourNote ("orange", "", "You need to allow DLLs to be loaded.")
|
||||
ColourNote ("orange", "", "You also need to trust this plugin.")
|
||||
ColourNote ("orange", "", "See File Menu -> Global Preferences -> Lua")
|
||||
return
|
||||
end -- if
|
||||
|
||||
local http = require "socket.http"
|
||||
|
||||
SetStatus "Checking for latest MUSHclient version ..."
|
||||
local page = http.request (string.format ("%s?plat=%i,%i,%i&vers=%s",
|
||||
VERSION_URL,
|
||||
GetInfo (268), GetInfo (265), GetInfo (266),
|
||||
Version ()))
|
||||
SetStatus "Ready"
|
||||
|
||||
if not page then return end -- page doesn't exist
|
||||
|
||||
local s = string.match (page, "<pre>(.*)</pre>")
|
||||
|
||||
if not s then return end -- page in wrong format
|
||||
|
||||
local t = {}
|
||||
setfenv (assert (loadstring (s)), t) () -- compile and load into t
|
||||
|
||||
local info = t.installer_info
|
||||
|
||||
if not info then return end -- installer_info not there
|
||||
|
||||
local new_version = tonumber (info.version)
|
||||
local old_version = tonumber (Version ())
|
||||
|
||||
-- naive version check (chuckle)
|
||||
if new_version <= old_version then
|
||||
ColourNote ("cyan", "", "You have version " .. Version () ..
|
||||
" of MUSHclient, which is the lastest version.")
|
||||
return -- have latest version
|
||||
end -- if
|
||||
|
||||
-- make the window to get font info
|
||||
WindowCreate (win, 0, 0, 0, 0, -- very small
|
||||
miniwin.pos_center_all, 0,
|
||||
WINDOW_BACKGROUND_COLOUR) -- create window
|
||||
|
||||
local Charset = miniwin.font_charset_default
|
||||
local PitchAndFamily = miniwin.font_family_swiss + miniwin.font_pitch_variable
|
||||
|
||||
-- grab fonts
|
||||
WindowFont (win, font_id, FONT_NAME, FONT_SIZE, false, false, false, false, Charset, PitchAndFamily)
|
||||
WindowFont (win, font_id_bold, FONT_NAME, FONT_SIZE, true, false, false, false, Charset, PitchAndFamily )
|
||||
WindowFont (win, font_id_underline, FONT_NAME, FONT_SIZE, false, false, true, false, Charset, PitchAndFamily)
|
||||
|
||||
-- work out how high a font line is
|
||||
font_height = WindowFontInfo (win, font_id, 1) -- height of the font
|
||||
|
||||
-- interim window width
|
||||
window_width = WindowTextWidth (win, font_id_bold, TITLE)
|
||||
lines = {}
|
||||
|
||||
-- wrap long lines
|
||||
for line in getlines (info.description) do
|
||||
local width = 0
|
||||
local t = {}
|
||||
|
||||
for word in string.gmatch (line, "%S+") do
|
||||
word = word .. " " -- put one space back
|
||||
local word_width = WindowTextWidth (win, font_id, word)
|
||||
|
||||
-- too wide with this word, finish off previous line, start new one
|
||||
if (width + word_width) > MAX_WIDTH then
|
||||
table.insert (lines, table.concat (t))
|
||||
t = {}
|
||||
table.insert (t, " ") -- indent wrapped line
|
||||
width = WindowTextWidth (win, font_id, t [1])
|
||||
end -- if
|
||||
table.insert (t, word)
|
||||
width = width + word_width
|
||||
end -- for each word (ie. something not spaces)
|
||||
|
||||
-- finish previous line
|
||||
table.insert (lines, table.concat (t))
|
||||
end -- for
|
||||
|
||||
-- find maximum line width
|
||||
for _, line in ipairs (lines) do
|
||||
window_width = math.max (window_width, WindowTextWidth (win, font_id, line))
|
||||
end -- for
|
||||
|
||||
-- 10 fixed lines, plus the description lines
|
||||
window_height = 10 + (11 + #lines) * font_height
|
||||
window_width = window_width + GAP + GAP -- 5 pixel margin each side
|
||||
|
||||
-- install the window movement handler, get back the window position
|
||||
windowinfo = movewindow.install (win, miniwin.pos_center_all)
|
||||
|
||||
-- make the "real" window
|
||||
WindowCreate (win, 0, 0, window_width, window_height, miniwin.pos_center_all, 0,
|
||||
WINDOW_BACKGROUND_COLOUR) -- create window
|
||||
|
||||
-- title box
|
||||
WindowRectOp (win, miniwin.rect_fill, 0, 0, 0, font_height + GAP, ColourNameToRGB "tan")
|
||||
|
||||
-- frame it
|
||||
WindowRectOp (win, miniwin.rect_frame, 0, 0, 0, 0, WINDOW_FRAME_COLOUR )
|
||||
|
||||
-- add the drag handler so they can move the window around
|
||||
movewindow.add_drag_handler (win, 0, 0, 0, font_height + GAP)
|
||||
|
||||
-- left margin
|
||||
x = GAP
|
||||
|
||||
-- top margin
|
||||
y = GAP
|
||||
|
||||
WindowText (win, font_id_bold, TITLE, x, y, 0, 0, WINDOW_TEXT_COLOUR )
|
||||
y = y + font_height
|
||||
|
||||
WindowText (win, font_id, "Current version: " .. Version (), x, y, 0, 0, WINDOW_TEXT_COLOUR )
|
||||
y = y + font_height
|
||||
|
||||
WindowText (win, font_id, "Available version: " .. info.version, x, y, 0, 0, WINDOW_TEXT_COLOUR )
|
||||
y = y + font_height
|
||||
|
||||
WindowText (win, font_id, string.format ("Size: %0.2f Mb", info.installer_size / 1024 / 1024), x, y, 0, 0, WINDOW_TEXT_COLOUR )
|
||||
y = y + font_height
|
||||
|
||||
installer_url = info.installer_url
|
||||
|
||||
-- link to download this version
|
||||
make_hyperlink ("Download version " .. info.version,
|
||||
"download",
|
||||
x, y, hyperlink_download, "Download version " .. info.version)
|
||||
y = y + font_height
|
||||
|
||||
-- link to view announcements forum topic
|
||||
make_hyperlink ("Visit announcements forum topic", "announcements", x, y, hyperlink_announcements, "View announcements")
|
||||
y = y + font_height
|
||||
|
||||
-- link to view all release notes
|
||||
make_hyperlink ("View all release notes", "relnotes", x, y, hyperlink_relnotes, "View release notes")
|
||||
y = y + font_height
|
||||
|
||||
-- extra line
|
||||
y = y + font_height
|
||||
|
||||
WindowText (win, font_id_bold, "Improvements:", x, y, 0, 0, WINDOW_TEXT_COLOUR )
|
||||
y = y + font_height
|
||||
|
||||
-- extra line
|
||||
y = y + font_height
|
||||
|
||||
-- show description
|
||||
for _, line in ipairs (lines) do
|
||||
WindowText (win, font_id, line, x, y, 0, 0, WINDOW_TEXT_COLOUR )
|
||||
y = y + font_height
|
||||
end -- for
|
||||
|
||||
make_hyperlink ("Close this window", "close", x, y, hyperlink_close, "Close notification window")
|
||||
y = y + font_height
|
||||
|
||||
-- close box
|
||||
local box_size = font_height - 2
|
||||
x = GAP
|
||||
y = GAP
|
||||
local box_colour = 0x404040
|
||||
WindowRectOp (win, miniwin.rect_frame,
|
||||
x + window_width - box_size - GAP * 2,
|
||||
y,
|
||||
x + window_width - GAP * 2,
|
||||
y + box_size,
|
||||
box_colour)
|
||||
WindowLine (win, x + window_width - box_size - GAP * 2 + 3,
|
||||
y + 3,
|
||||
x + window_width - GAP * 2 - 3,
|
||||
y - 3 + box_size,
|
||||
box_colour,
|
||||
miniwin.pen_solid, 1)
|
||||
WindowLine (win, x - 4 + window_width - GAP * 2,
|
||||
y + 3,
|
||||
x - 1 + window_width - box_size - GAP * 2 + 3,
|
||||
y - 3 + box_size,
|
||||
box_colour,
|
||||
miniwin.pen_solid, 1)
|
||||
|
||||
-- close configuration hotspot
|
||||
WindowAddHotspot(win, "close_box",
|
||||
x + window_width - box_size - GAP * 2,
|
||||
y,
|
||||
x + window_width - GAP * 2,
|
||||
y + box_size,
|
||||
"", "", "", "",
|
||||
"hyperlink_close", -- mouseup
|
||||
"Click to close",
|
||||
miniwin.cursor_hand, 0) -- hand cursor
|
||||
|
||||
-- show the window
|
||||
WindowShow (win, true)
|
||||
|
||||
-- we last checked: now
|
||||
last_check_time = os.time ()
|
||||
|
||||
-- remember when we checked last
|
||||
db = sqlite3.open(GetInfo (82)) -- open preferences
|
||||
db:exec (string.format ('UPDATE prefs SET value = %i WHERE name = "time_last_version_check"',
|
||||
last_check_time))
|
||||
db:close() -- close
|
||||
|
||||
end -- do_version_check
|
||||
|
||||
function check_for_new_version (name)
|
||||
|
||||
-- don't check too often or it will slow us down
|
||||
if os.time () < (last_check_time + CHECK_INTERVAL) then
|
||||
return
|
||||
end -- too soon
|
||||
|
||||
do_version_check () -- check now
|
||||
|
||||
end -- check_for_new_version
|
||||
|
||||
-- check for time to check for new version when loaded,
|
||||
-- and then every 30 minutes if timer enabled
|
||||
check_for_new_version ()
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
BIN
cosmic rage/worlds/plugins/audio.dll
Normal file
BIN
cosmic rage/worlds/plugins/audio.dll
Normal file
Binary file not shown.
107
cosmic rage/worlds/plugins/auto_retyping.xml
Normal file
107
cosmic rage/worlds/plugins/auto_retyping.xml
Normal file
@@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Friday, April 09, 2010, 1:52 PM -->
|
||||
<!-- MuClient version 4.51 -->
|
||||
|
||||
<!-- Plugin "auto_retyping" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="auto_retyping"
|
||||
author="Oriol Gomez"
|
||||
save_state="y"
|
||||
id="369e8998ba42093fcc9231a2"
|
||||
language="Lua"
|
||||
purpose="auto retyping features"
|
||||
date_written="2010-04-09 13:51:50"
|
||||
requires="3.51"
|
||||
version="1.0"
|
||||
>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
<include name="constants.lua"/>
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
match="EnterKey"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>
|
||||
if autort==1 then
|
||||
Note(Send(''))
|
||||
end
|
||||
</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="autoretyping"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>if (GetVariable("autort") == "1") then
|
||||
SetVariable("autort", 0)
|
||||
SaveState()
|
||||
Note("Auto re typing off.")
|
||||
return
|
||||
end
|
||||
if (GetVariable("autort") == "0") then
|
||||
SetVariable("autort", 1)
|
||||
SaveState()
|
||||
Note("Auto re typing on.")
|
||||
return
|
||||
end</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="GetPrevCommand"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>
|
||||
if(c==nil) then
|
||||
|
||||
Note("Sorry, but either auto retyping is currently disabled, or no command has been entered. Please enable auto retyping to paste the last command entered.")
|
||||
else
|
||||
Execute("tts_interrupt "..c)
|
||||
PasteCommand(c)
|
||||
return
|
||||
end
|
||||
</send>
|
||||
</alias>
|
||||
</aliases>
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
function OnPluginCommandEntered(s)
|
||||
if (GetVariable("autort") == "1") then
|
||||
if s == ' ' or s == '\t' or s == '\r' or s == '\n' or s=='' then
|
||||
return c
|
||||
else
|
||||
c=s
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function OnPluginInstall()
|
||||
if(GetVariable("autort")==nil) then
|
||||
SetVariable("autort","1")
|
||||
end
|
||||
Accelerator("ctrl + enter", "autoretyping")
|
||||
Accelerator("ctrl + p", "GetPrevCommand")
|
||||
Accelerator("shift+enter", "EnterKey")
|
||||
end
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
</muclient>
|
||||
615
cosmic rage/worlds/plugins/channel_history.xml
Normal file
615
cosmic rage/worlds/plugins/channel_history.xml
Normal file
@@ -0,0 +1,615 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Friday, April 09, 2010, 3:17 PM -->
|
||||
<!-- MuClient version 4.51 -->
|
||||
|
||||
<!-- Plugin "channel_history" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="channel_history"
|
||||
author="Tyler S, Oriol G, and Weyoun"
|
||||
id="6000a4c6f0e71d31fecf523d"
|
||||
language="Lua"
|
||||
purpose="Allows reading of messages sorted into categories with hotkeys"
|
||||
date_written="2010-04-09 15:14:12"
|
||||
requires="4.51"
|
||||
version="2.2"
|
||||
save_state="y"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
The only alias you should need is history_add. Its syntax is:
|
||||
history_add category=message
|
||||
|
||||
Accelerator keys:
|
||||
alt+right and alt+left - next and previous category buffer
|
||||
shift+alt+right and left - move buffer.
|
||||
alt+Delete - delete a buffer.
|
||||
alt+1 through alt+0 - read 1st to 10th latest message in buffer. pressing one of these keys twice within 0.5 seconds will copy the message to the clipboard, and 3 times will paste it into the command window.
|
||||
Alt+up or Alt+ Down Arrow - move through messages in the current buffer. The latest messages are at the bottom of the buffer.
|
||||
Alt + Pageup or Alt + PageDown: move up or down 10 messages in the current buffer.
|
||||
Alt + Home or Alt + End: Move up or down 2000 messages in the current buffer
|
||||
Alt + Space: Repeat currently selected buffer item
|
||||
Alt + Shift + Space: Copy selected buffer item to clipboard
|
||||
Alt + Enter: Open URLs in the current buffer item if any, otherwise open the world configuration dialog
|
||||
Alt + Shift + Enter: Copy all items in current buffer to an output window
|
||||
Alt + Shift + T: Toggle hearing a relative time announcement after each message, such as 2 minutes ago.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
<include name="constants.lua"/>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="history_delete"
|
||||
match="^history_delete"
|
||||
enabled="y"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
regexp="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
script="category_move"
|
||||
match="^history_move (\w+)"
|
||||
enabled="y"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
regexp="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
script="history_add"
|
||||
match="^history_add (\w[\w ]*)=(.*)"
|
||||
enabled="y"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
regexp="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="ttstoggle"
|
||||
match="config tts"
|
||||
enabled="y"
|
||||
omit_from_command_history="y"
|
||||
keep_evaluating="y"
|
||||
omit_from_log="y"
|
||||
regexp="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="history_get"
|
||||
match="^history_get (\d+)$"
|
||||
enabled="y"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
regexp="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="history_link"
|
||||
match="^history_get_link"
|
||||
enabled="y"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
regexp="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="history_catprev"
|
||||
match="history_catprev"
|
||||
enabled="y"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="history_catnext"
|
||||
match="history_catnext"
|
||||
enabled="y"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="history_msgprev"
|
||||
match="^history_msgprev (\d+)$"
|
||||
enabled="y"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
regexp="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="history_msgnext"
|
||||
match="^history_msgnext (\d+)$"
|
||||
enabled="y"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
regexp="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="history_msgcopy"
|
||||
match="history_msgcopy"
|
||||
enabled="y"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="history_notepad"
|
||||
match="history_notepad"
|
||||
enabled="y"
|
||||
omit_from_command_history="y"
|
||||
omit_from_log="y"
|
||||
omit_from_output="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
match="^(|history\_)timestamps?$"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
send_to="12"
|
||||
ignore_case="y"
|
||||
sequence="100"
|
||||
>
|
||||
<send>if timestamps==true then
|
||||
timestamps=false
|
||||
SetVariable("timestamps", "false")
|
||||
Execute("tts_interrupt Timestamps will no longer be spoken after messages.")
|
||||
else
|
||||
timestamps=true
|
||||
SetVariable("timestamps", "true")
|
||||
Execute("tts_interrupt You will now hear an approximate time after every message.")
|
||||
end</send>
|
||||
</alias>
|
||||
<alias
|
||||
enabled="y"
|
||||
match="^chist changes?(?P<num> \d+)?$"
|
||||
send_to="12"
|
||||
group="help"
|
||||
regexp="y"
|
||||
sequence="100"
|
||||
>
|
||||
<send>
|
||||
require "changelog"
|
||||
require "var"
|
||||
|
||||
display_changelog(nil, "%0", {num="%<num>", lines=var.changelog})
|
||||
|
||||
</send>
|
||||
</alias>
|
||||
|
||||
</aliases>
|
||||
|
||||
<!-- Variables -->
|
||||
|
||||
<variables>
|
||||
<variable name="changelog">Channel History Change log:
|
||||
|
||||
v2.2 - Jun 14, 20
|
||||
Changes from Xera
|
||||
Fix bug in new url opening feature where it was preventing alt+enter from opening world properties.
|
||||
|
||||
v2.1 - Mar 30, 20
|
||||
Changes from Ivey
|
||||
Updated the show info message to include all the current commands.
|
||||
Fixed some bugs
|
||||
Added larger buffer limit
|
||||
Support for opening urls in the current item (Alt+Enter)
|
||||
|
||||
Changes from Xera
|
||||
Added support for displaying a change log
|
||||
</variable>
|
||||
</variables>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
modes = {} -- for keyboard states
|
||||
messages = {}
|
||||
indices = {}
|
||||
current_category = 0 -- not set yet
|
||||
categories = {}
|
||||
if not GetVariable("timestamps") then
|
||||
timestamps=true
|
||||
DoAfterSpecial(30, "Note('You can now toggle off the new relative time announcements in channel history. Press alt+shift+t to turn it on or off. Alternatively, you can just type timestamp.')", 14)
|
||||
SetVariable("timestamps", "true")
|
||||
elseif GetVariable("timestamps") == "false" then
|
||||
timestamps=false
|
||||
Note("Channel history timestamps are disabled.")
|
||||
else
|
||||
timestamps=true
|
||||
Note("Channel history timestamps are enabled.")
|
||||
end
|
||||
|
||||
-- set up accelerators
|
||||
for i = 1, 9 do
|
||||
Accelerator("alt + " .. i, "history_get " .. i)
|
||||
end
|
||||
Accelerator("alt + 0", "history_get 10") -- 10 is a special case
|
||||
Accelerator("alt + right", "history_catnext")
|
||||
Accelerator("alt + left", "history_catprev")
|
||||
Accelerator("alt + down", "history_msgnext 1")
|
||||
Accelerator("alt + up", "history_msgprev 1")
|
||||
Accelerator("alt + pagedown", "history_msgnext 10")
|
||||
Accelerator("alt + pageup", "history_msgprev 10")
|
||||
Accelerator("alt + end", "history_msgnext 2000")
|
||||
Accelerator("alt + home", "history_msgprev 2000")
|
||||
Accelerator("shift+alt + right", "history_move right")
|
||||
Accelerator("shift+alt + left", "history_move left")
|
||||
Accelerator("alt+shift+delete","history_delete")
|
||||
Accelerator("alt + space", "history_msgprev 0")
|
||||
Accelerator("alt+shift+space","history_msgcopy")
|
||||
Accelerator("alt+shift+enter","history_notepad")
|
||||
Accelerator("alt+enter","history_get_link")
|
||||
Accelerator("alt+shift+t","timestamps")
|
||||
|
||||
function history_delete(n,l,w)
|
||||
if #categories == 0 then
|
||||
say("no categories")
|
||||
return
|
||||
end
|
||||
if current_category == 0 then
|
||||
say("No category selected.")
|
||||
return
|
||||
end
|
||||
messages[categories[current_category]] = nil
|
||||
indices[categories[current_category]] = nil
|
||||
table.remove(categories, current_category)
|
||||
if current_category > #categories then
|
||||
current_category = 1
|
||||
end
|
||||
if #categories > 0 then
|
||||
say(categories[current_category])
|
||||
else
|
||||
say("no more categories.")
|
||||
-- Prevent other code from crashing:
|
||||
categories = { }
|
||||
current_category = 0
|
||||
end
|
||||
end
|
||||
|
||||
function category_move(name, line, w)
|
||||
if #categories == 0 then
|
||||
say("no categories")
|
||||
return
|
||||
end
|
||||
if current_category == 0 then
|
||||
say("No category selected.")
|
||||
return
|
||||
end
|
||||
name = categories[current_category]
|
||||
table.remove(categories,current_category)
|
||||
if w[1]=="right" then
|
||||
current_category = current_category + 1
|
||||
if current_category > #categories + 1 then
|
||||
current_category = 2
|
||||
end
|
||||
else
|
||||
current_category = current_category - 1
|
||||
if current_category < 1 then
|
||||
current_category = #categories
|
||||
end
|
||||
end
|
||||
table.insert(categories, current_category, name)
|
||||
say("moved.")
|
||||
end
|
||||
|
||||
function OnPluginInstall()
|
||||
--SetVariable("tts",GetPluginVariable("553a883096da345ce6897740","tts"))
|
||||
SetVariable("tts","1")
|
||||
end
|
||||
|
||||
function ttstoggle(n,l,w)
|
||||
SetVariable("tts",GetPluginVariable("553a883096da345ce6897740","tts"))
|
||||
end
|
||||
|
||||
function history_add(name, line, wc)
|
||||
local cat, msg = wc[1], wc[2]
|
||||
if messages[cat] == nil then
|
||||
messages[cat] = {}
|
||||
indices[cat] = 0
|
||||
table.insert(categories, cat)
|
||||
end
|
||||
table.insert(messages[cat], {["message"]=msg,["time"]=os.clock()})
|
||||
-- if we go over 100 items, remove the oldest one
|
||||
if #messages[cat] > 100000 then
|
||||
table.remove(messages[cat], 1)
|
||||
if indices[cat] > 1 then
|
||||
indices[cat] = indices[cat] - 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- helper function to say stuff
|
||||
function say(x)
|
||||
if(GetVariable("tts")=="1") then
|
||||
Execute("tts_interrupt " .. x)
|
||||
else
|
||||
Note(x)
|
||||
end
|
||||
end
|
||||
|
||||
function history_get(name, line, wc)
|
||||
local str = ""
|
||||
if current_category == 0 and #categories == 0 then
|
||||
say("No categories")
|
||||
return
|
||||
elseif current_category == 0 and #categories > 0 then
|
||||
for i, result in ipairs(categories) do
|
||||
if categories[i] == "all" then
|
||||
current_category = i
|
||||
end
|
||||
end
|
||||
if current_category > 0 then
|
||||
str = str .. "switching to all."
|
||||
else
|
||||
str = str .. "switching to " .. categories[1] .. ". Use alt left and right arrows to change."
|
||||
current_category = 1
|
||||
end
|
||||
end
|
||||
local item = tonumber(wc[1])
|
||||
if #messages[categories[current_category]] < item then
|
||||
say("no message")
|
||||
return
|
||||
end
|
||||
|
||||
-- now that all that's out of the way, we can start our real code which should always succeed.
|
||||
local timeout = 0.5 -- in seconds
|
||||
if modes[item] == nil then
|
||||
modes[item] = {os.clock(), 1}
|
||||
elseif os.clock()-modes[item][1] >= timeout then
|
||||
modes[item][1] = os.clock()
|
||||
modes[item][2] = 1
|
||||
else
|
||||
modes[item][1] = os.clock()
|
||||
modes[item][2] = modes[item][2] + 1
|
||||
end
|
||||
if modes[item][2] > 3 then
|
||||
modes[item][2] = 3
|
||||
end
|
||||
|
||||
local real_item = #messages[categories[current_category]] + 1 - item
|
||||
if modes[item][2] == 1 then
|
||||
sayMsg(str, messages[categories[current_category]][real_item])
|
||||
elseif modes[item][2] == 2 then
|
||||
SetClipboard(messages[categories[current_category]][real_item]["message"])
|
||||
say("copied")
|
||||
elseif modes[item][2] == 3 then
|
||||
PasteCommand(messages[categories[current_category]][real_item]["message"])
|
||||
say("pasted")
|
||||
end
|
||||
end
|
||||
|
||||
function sayMsg(str,m)
|
||||
saythis=str .. " " .. m["message"]
|
||||
if timestamps==true then
|
||||
local lastchar=string.byte(m["message"]:sub(-1))
|
||||
--print(lastchar)
|
||||
if (lastchar>=49 and lastchar<=57) or (lastchar>=65 and lastchar<=91) or (lastchar>=97 and lastchar<=123) then
|
||||
saythis=saythis.."."
|
||||
end
|
||||
saythis=saythis.." "..calculateRelativeTime(os.clock()-m["time"])
|
||||
end
|
||||
say(saythis)
|
||||
end
|
||||
function calculateRelativeTime(t)
|
||||
if t<1 then
|
||||
return "just now"
|
||||
end
|
||||
if t>=1 and t<60 then
|
||||
return math.ceil(t).." seconds ago"
|
||||
end
|
||||
if t>=60 and t<3600 then
|
||||
local min=math.floor(t/60)
|
||||
local sec=math.ceil(math.fmod(t,60))
|
||||
return min.." minutes "..sec.." seconds ago"
|
||||
end
|
||||
if t>=3600 and t<86400 then -- amount of seconds in a day.
|
||||
local hr=math.floor(t/3600)
|
||||
local min=math.floor((t%3600)/60)
|
||||
return hr.." hours "..min.." minutes ago"
|
||||
end
|
||||
if t>86400 then
|
||||
local days=math.floor(t/86400)
|
||||
local hr=math.floor((t-(86400*days))/3600)
|
||||
local min=math.floor(((t-((86400*days)+(3600*hr)))/60))
|
||||
return days.." days, "..hr.." hours, and "..min.." minutes ago"
|
||||
end
|
||||
|
||||
return ""
|
||||
--return os.clock()-t
|
||||
end
|
||||
function history_catnext(name, line, wc)
|
||||
if #categories == 0 then
|
||||
say("no categories")
|
||||
return
|
||||
end
|
||||
current_category = current_category + 1
|
||||
if current_category > #categories then
|
||||
current_category = 1
|
||||
end
|
||||
if indices[categories[current_category]]==0 then indices[categories[current_category]]=1 end
|
||||
say(categories[current_category] ..": "..indices[categories[current_category]] .. " of " .. #messages[categories[current_category]])
|
||||
end
|
||||
|
||||
function history_catprev(name, line, wc)
|
||||
if #categories == 0 then
|
||||
say("no categories")
|
||||
return
|
||||
end
|
||||
current_category = current_category - 1
|
||||
if current_category < 1 then
|
||||
current_category = #categories
|
||||
end
|
||||
if indices[categories[current_category]]==0 then indices[categories[current_category]]=1 end
|
||||
say(categories[current_category] ..": "..indices[categories[current_category]] .. " of " .. #messages[categories[current_category]])
|
||||
end
|
||||
|
||||
function history_msgnext(name, line, wc)
|
||||
local skip = tonumber(wc[1])
|
||||
local str = ""
|
||||
if #categories == 0 then
|
||||
say("no categories")
|
||||
return
|
||||
end
|
||||
if current_category == 0 then
|
||||
say("No category selected.")
|
||||
return
|
||||
end
|
||||
if indices[categories[current_category]] == 0 then
|
||||
indices[categories[current_category]] = #messages[categories[current_category]]
|
||||
end
|
||||
if indices[categories[current_category]] + skip > #messages[categories[current_category]] then
|
||||
indices[categories[current_category]] = #messages[categories[current_category]]
|
||||
str = str .. "Bottom: "
|
||||
else
|
||||
indices[categories[current_category]] = indices[categories[current_category]] + skip
|
||||
end
|
||||
sayMsg(str, messages[categories[current_category]][indices[categories[current_category]]])
|
||||
end
|
||||
|
||||
function history_msgprev(name, line, wc)
|
||||
local skip = tonumber(wc[1])
|
||||
local str = ""
|
||||
if #categories == 0 then
|
||||
say("no categories")
|
||||
return
|
||||
end
|
||||
if current_category == 0 then
|
||||
say("No category selected.")
|
||||
return
|
||||
end
|
||||
if indices[categories[current_category]] == 0 then
|
||||
indices[categories[current_category]] = #messages[categories[current_category]]
|
||||
end
|
||||
if indices[categories[current_category]] - skip < 1 then
|
||||
indices[categories[current_category]] = 1
|
||||
str = str .. "Top: "
|
||||
else
|
||||
indices[categories[current_category]] = indices[categories[current_category]] - skip
|
||||
end
|
||||
sayMsg(str, messages[categories[current_category]][indices[categories[current_category]]])
|
||||
end
|
||||
|
||||
function history_link(name, line, wc)
|
||||
if #categories == 0 then
|
||||
say("no categories")
|
||||
say("opening world configuration")
|
||||
DoAfterSpecial(1,"DoCommand('preferences')",12)
|
||||
return
|
||||
end -- if
|
||||
|
||||
if current_category == 0 then
|
||||
say("No category selected.")
|
||||
say("opening world configuration")
|
||||
DoAfterSpecial(1,"DoCommand('preferences')",12)
|
||||
return
|
||||
end -- if
|
||||
|
||||
if indices[categories[current_category]] == 0 then
|
||||
indices[categories[current_category]] = #messages[categories[current_category]]
|
||||
end -- if
|
||||
|
||||
local hmm=(messages[categories[current_category]][indices[categories[current_category]]]["message"])
|
||||
links={}
|
||||
re=rex.new("(http|ftp|https)://([\\w_-]+(?:(?:\\.[\\w_-]+)+))([\\w.,@?^=%:/~+#-]*[\\w@?^=%/~+#-])?")
|
||||
n=re:gmatch(hmm,function(m, t)
|
||||
table.insert(links,m)
|
||||
end)
|
||||
|
||||
if #links==0 then
|
||||
say("no links, opening world configuration")
|
||||
DoAfterSpecial(1,"DoCommand('preferences')",12)
|
||||
end -- if
|
||||
|
||||
if #links==1 then
|
||||
say("Opening URL: "..links[1])
|
||||
OpenBrowser(links[1])
|
||||
end -- if
|
||||
|
||||
if #links>1 then
|
||||
url=utils.listbox("","Select URL",links,1)
|
||||
if url then
|
||||
OpenBrowser(links[url])
|
||||
end -- if
|
||||
end -- if
|
||||
end -- function
|
||||
|
||||
function history_msgcopy(name, line, wc)
|
||||
if #categories == 0 then
|
||||
say("no categories")
|
||||
return
|
||||
end
|
||||
if current_category == 0 then
|
||||
say("No category selected.")
|
||||
return
|
||||
end
|
||||
if indices[categories[current_category]] == 0 then
|
||||
indices[categories[current_category]] = #messages[categories[current_category]]
|
||||
end
|
||||
SetClipboard(messages[categories[current_category]][indices[categories[current_category]]]["message"])
|
||||
say("copied")
|
||||
end
|
||||
function history_notepad()
|
||||
if #categories == 0 then
|
||||
say("no categories")
|
||||
return
|
||||
end
|
||||
if current_category == 0 then
|
||||
say("No category selected.")
|
||||
return
|
||||
end
|
||||
np = categories[current_category]
|
||||
local nptext="Showing "..#messages[categories[current_category]].." messages:\r\n"
|
||||
for i = 1, #messages[categories[current_category]] do
|
||||
if timestamps==true then
|
||||
nptext = nptext.. "[" .. os.date("%c", (os.time()-os.clock()+messages[categories[current_category]][i]["time"])) .. "] " .. messages[categories[current_category]][i]["message"].."\r\n"
|
||||
else
|
||||
nptext = nptext..messages[categories[current_category]][i]["message"].."\r\n"
|
||||
end
|
||||
end
|
||||
SendToNotepad(np, nptext)
|
||||
NotepadReadOnly(np, true)
|
||||
ActivateNotepad(np)
|
||||
end
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</muclient>
|
||||
965
cosmic rage/worlds/plugins/chat.xml
Normal file
965
cosmic rage/worlds/plugins/chat.xml
Normal file
@@ -0,0 +1,965 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient [
|
||||
<!ENTITY prefix "#" >
|
||||
]>
|
||||
|
||||
<!-- Plugin "Chat" adapted by Nick from the VBscript version -->
|
||||
|
||||
<!-- Change the "prefix" entity above to change the chat alias prefix.
|
||||
The default is "#", so you would enter "#chat Nick Hi", but you
|
||||
could make it "-" for instance. -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Chat"
|
||||
author="Nick Gammon"
|
||||
id="03ca99c4e98d2a3e6d655c7d"
|
||||
language="Lua"
|
||||
purpose="Support for chat feature"
|
||||
date_written="2005-12-18 07:32:00"
|
||||
date_modified="2005-12-21 13:26:00"
|
||||
requires="3.72"
|
||||
version="1.0"
|
||||
>
|
||||
<!--
|
||||
Version 1 - initial release.
|
||||
-->
|
||||
|
||||
<description trim="y">
|
||||
Provides an interface to the chat functions.
|
||||
|
||||
Commands
|
||||
========
|
||||
|
||||
chat:help <-- show this help screen
|
||||
|
||||
For commands affecting a chat connection you can either use their name
|
||||
(eg. Nick) or their connection number (eg. 5). Both appear when you type
|
||||
"&prefix;chats".
|
||||
|
||||
General
|
||||
-------
|
||||
|
||||
&prefix;chats <-- get connected chat list (note chat ID on left)
|
||||
&prefix;chatdetails [who] <-- shows full details for one or all connections
|
||||
&prefix;info <-- shows chat status and chat list
|
||||
|
||||
Accept calls
|
||||
------------
|
||||
|
||||
&prefix;accept <-- accept connections on current port
|
||||
&prefix;accept port <-- accept connections on 'port' eg. &prefix;accept 4052
|
||||
&prefix;nocalls <-- stop accepting incoming calls
|
||||
|
||||
Calling someone
|
||||
---------------
|
||||
|
||||
&prefix;call ip port <-- attempts to call user on at IP address and port
|
||||
&prefix;call ip <-- attempts to call user on at IP address, port 4050
|
||||
&prefix;hangup who <-- hangs up a call
|
||||
&prefix;hangupall <-- hangs up all calls
|
||||
|
||||
|
||||
Chatting
|
||||
--------
|
||||
|
||||
&prefix;chat who xxx <-- sends message to person, eg. &prefix;chat Nick Hi there
|
||||
&prefix;chatall xxxx <-- sends message to all connections
|
||||
&prefix;cg group xxxx <-- sends message to everyone in group 'group'
|
||||
&prefix;emote who xx <-- emotes to one person, eg. &prefix;emote Nick laughs
|
||||
&prefix;emoteall xxx <-- emotes to all, eg. &prefix;emoteall sighs
|
||||
&prefix;eg group xxxx <-- emotes to everyone in group 'group'
|
||||
|
||||
Other
|
||||
-----
|
||||
|
||||
&prefix;command who xxx <-- send command "xxx" to that person
|
||||
&prefix;group who xxx <-- places this person into group "xxx"
|
||||
&prefix;name newname <-- change your chat name, eg. &prefix;name Nick
|
||||
&prefix;peek who <-- peek this person's connections
|
||||
&prefix;paste who <-- paste clipboard to this connection
|
||||
&prefix;pasteall <-- paste clipboard to everybody
|
||||
&prefix;ping who <-- ping this connection
|
||||
&prefix;request who <-- try to connect to this person's connections
|
||||
&prefix;sendfile who <-- send a file to this connection
|
||||
&prefix;stopfile who <-- stop sending a file to this connection
|
||||
&prefix;snoop who <-- start/stop snooping this connection
|
||||
|
||||
Flags
|
||||
-----
|
||||
|
||||
&prefix;allowcommands who <-- allow them to send me commands
|
||||
&prefix;allowfiles who <-- allow them to send me files
|
||||
&prefix;allowsnoop who <-- allow them to snoop me
|
||||
&prefix;ignore who <-- ignore them
|
||||
&prefix;private who <-- mark connection private
|
||||
&prefix;served who <-- mark them as incoming
|
||||
|
||||
&prefix;noallowcommands who <-- turn off above options
|
||||
&prefix;noallowfiles who
|
||||
&prefix;noallowsnoop who
|
||||
&prefix;noignore who
|
||||
&prefix;noprivate who
|
||||
&prefix;noserved who
|
||||
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
match="&prefix;snoop *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatMessage (ChatGetID ("%1"), 30, "")</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;command * *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatMessage (ChatGetID ("%1"), 105, "%2")</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;allowsnoop *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>if SetChatOption (ChatGetID ("%1"), "can_snoop", 1) == 0 then
|
||||
Note "Snooping for %1 enabled"
|
||||
end -- if</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;group * *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>if SetChatOption (ChatGetID ("%1"), "group", "%2") == 0 then
|
||||
Note "%1 is now in group '%2'"
|
||||
end -- if</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;noallowsnoop *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>if SetChatOption (ChatGetID ("%1"), "can_snoop", 0) == 0 then
|
||||
Note "Snooping for %1 disabled"
|
||||
end -- if</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;allowfiles *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>if SetChatOption (ChatGetID ("%1"), "can_send_files", 1) == 0 then
|
||||
Note "File sending for %1 enabled"
|
||||
end -- if</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;noallowfiles *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>if SetChatOption (ChatGetID ("%1"), "can_send_files", 0) == 0 then
|
||||
Note "File sending for %1 disabled"
|
||||
end -- if</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;allowcommands *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>if SetChatOption (ChatGetID ("%1"), "can_send_commands", 1) == 0 then
|
||||
Note "Command sending for %1 enabled"
|
||||
end -- if</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;noallowcommands *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>if SetChatOption (ChatGetID ("%1"), "can_send_commands", 0) == 0 then
|
||||
Note "Command sending for %1 disabled"
|
||||
end -- if</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;ignore *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>if SetChatOption (ChatGetID ("%1"), "ignore", 1) == 0 then
|
||||
Note "Now ignoring %1"
|
||||
end -- if</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;noignore *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>if SetChatOption (ChatGetID ("%1"), "ignore", 0) == 0 then
|
||||
Note "Not ignoring %1"
|
||||
end -- if</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;private *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>if SetChatOption (ChatGetID ("%1"), "private", 1) == 0 then
|
||||
Note "%1 is now marked private"
|
||||
end -- if</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;noprivate *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>if SetChatOption (ChatGetID ("%1"), "private", 0) == 0 then
|
||||
Note "%1 is now NOT private"
|
||||
end -- if</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;served *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>if SetChatOption (ChatGetID ("%1"), "served", 1) == 0 then
|
||||
Note "%1 is now marked as served (incoming)"
|
||||
end -- if</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;noserved *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>if SetChatOption (ChatGetID ("%1"), "served", 0) == 0 then
|
||||
Note "%1 is now NOT marked as served (ie. now outgoing)"
|
||||
end -- if</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;paste *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatPasteText (ChatGetID ("%1"))</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;pasteall"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatPasteEverybody ()</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;ping *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatPing (ChatGetID ("%1"))</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;sendfile *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatSendFile (ChatGetID ("%1"), "")</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;stopfile *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatStopFileTransfer (ChatGetID ("%1"))</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;peek *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatPeekConnections (ChatGetID ("%1"))</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;request *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatRequestConnections (ChatGetID ("%1"))</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;accept *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="90"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatAcceptCalls (%1)</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;accept"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="90"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatAcceptCalls (0)</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;name *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatNameChange "%1"</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;nocalls"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="90"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatStopAcceptingCalls ()</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;chat * *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>ChatPersonal ("%1", "%2", 0)</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;cg * *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>ChatGroup ("%1", "%2", 0)</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;eg * *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>ChatGroup ("%1", "%2", 1)</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="&prefix;chatall *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>ChatEverybody ("%1", 0)</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;chats"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>ChatList ()</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;emoteall *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>ChatEverybody ("%1", 1)</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;hangup *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>ChatDisconnect (ChatGetID ("%1"))</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;hangupall"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatDisconnectAll ()</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;info"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatInfo ()</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;emote * *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>ChatPersonal ("%1", "%2", 1)</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;call *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
>
|
||||
<send>ChatCall ("%1", 0)</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;call * *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="90"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatCall ("%1", %2)</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;chatdetails *"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="90"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ChatDetails (ChatGetID ("%1"))</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="&prefix;chatdetails"
|
||||
enabled="y"
|
||||
send_to="12"
|
||||
sequence="100"
|
||||
echo_alias="y"
|
||||
>
|
||||
<send>ShowChats ()</send>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
function YesNo (what)
|
||||
|
||||
if what then
|
||||
return "Yes"
|
||||
else
|
||||
return "No"
|
||||
end -- if
|
||||
|
||||
end -- function
|
||||
|
||||
function ConvertDate (what)
|
||||
|
||||
if what and what > 0 then
|
||||
return os.date ("%x %X", what)
|
||||
end -- if
|
||||
|
||||
return "(no date)"
|
||||
|
||||
end -- function
|
||||
|
||||
function ChatDetails (id)
|
||||
local sType
|
||||
|
||||
--
|
||||
-- no id - give up
|
||||
--
|
||||
|
||||
if id == 0 then
|
||||
return
|
||||
end -- if no id
|
||||
|
||||
if GetChatInfo (id, 10) == 0 then
|
||||
sType = "MudMaster"
|
||||
else
|
||||
sType = "zChat"
|
||||
end -- if
|
||||
|
||||
Note ("----------------------------------------")
|
||||
Note ("Server : " .. GetChatInfo (id, 1))
|
||||
Note ("User : " .. GetChatInfo (id, 2))
|
||||
Note ("Group : " .. GetChatInfo (id, 3))
|
||||
Note ("Version : " .. GetChatInfo (id, 4))
|
||||
Note ("Call IP : " .. GetChatInfo (id, 5))
|
||||
Note ("Address : " .. GetChatInfo (id, 6))
|
||||
Note ("Port : " .. GetChatInfo (id, 7))
|
||||
Note ("Call port : " .. GetChatInfo (id, 8))
|
||||
Note ("Status : " .. GetChatInfo (id, 9))
|
||||
Note ("Type : " .. sType)
|
||||
Note ("ID : " .. GetChatInfo (id, 11) )
|
||||
Note ("Incoming : " .. YesNo (GetChatInfo (id, 12)))
|
||||
Note ("Can snoop : " .. YesNo (GetChatInfo (id, 13)) )
|
||||
Note ("Snooping : " .. YesNo (GetChatInfo (id, 14)) )
|
||||
Note ("They snoop : " .. YesNo (GetChatInfo (id, 15)) )
|
||||
Note ("Send commands : " .. YesNo (GetChatInfo (id, 16)) )
|
||||
Note ("Private : " .. YesNo (GetChatInfo (id, 17)) )
|
||||
Note ("Can send files : " .. YesNo (GetChatInfo (id, 18)) )
|
||||
Note ("Ignore them : " .. YesNo (GetChatInfo (id, 19)) )
|
||||
Note ("Recent ping : " .. ConvertDate (GetChatInfo (id, 20) ))
|
||||
Note ("Started at : " .. ConvertDate (GetChatInfo (id, 21) ))
|
||||
Note ("Last in : " .. ConvertDate (GetChatInfo (id, 22) ))
|
||||
Note ("Last out : " .. ConvertDate (GetChatInfo (id, 23) ))
|
||||
Note ("Started file : " .. ConvertDate (GetChatInfo (id, 24) ))
|
||||
Note ("Xfer file : " .. YesNo (GetChatInfo (id, 25)) )
|
||||
Note ("Xfer is send : " .. YesNo (GetChatInfo (id, 26)) )
|
||||
Note ("File name : " .. GetChatInfo (id, 27) )
|
||||
Note ("Full file path : " .. GetChatInfo (id, 28) )
|
||||
Note ("File size bytes: " .. GetChatInfo (id, 29) )
|
||||
Note ("File blocks : " .. GetChatInfo (id, 30) )
|
||||
Note ("Blocks xferred : " .. GetChatInfo (id, 31))
|
||||
Note ("Block size : " .. GetChatInfo (id, 32))
|
||||
Note ("Count of incoming:" ..
|
||||
" Personal : " .. GetChatInfo (id, 33) ..
|
||||
", All : " .. GetChatInfo (id, 34) ..
|
||||
", Group : " .. GetChatInfo (id, 35) ..
|
||||
", Messages : " .. GetChatInfo (id, 39) )
|
||||
|
||||
Note ("Count of outgoing:" ..
|
||||
" Personal : " .. GetChatInfo (id, 36) ..
|
||||
", All : " .. GetChatInfo (id, 37) ..
|
||||
", Group : " .. GetChatInfo (id, 38))
|
||||
Note ""
|
||||
|
||||
end -- function
|
||||
|
||||
function ShowChats ()
|
||||
|
||||
local mylist
|
||||
|
||||
mylist = GetChatList ()
|
||||
|
||||
if mylist then
|
||||
|
||||
Note ""
|
||||
ColourNote ("white", "blue", "---- Chat List ----")
|
||||
Note ""
|
||||
|
||||
for _, id in pairs (mylist) do
|
||||
ChatDetails (id)
|
||||
end -- for
|
||||
|
||||
else
|
||||
ColourNote ("white", "red", "No chat sessions")
|
||||
end -- if
|
||||
|
||||
end -- function ShowChats
|
||||
|
||||
function ChatList ()
|
||||
|
||||
local mylist, flags, id
|
||||
|
||||
mylist = GetChatList ()
|
||||
|
||||
local function addflag (id, which, str)
|
||||
|
||||
if GetChatInfo (id, which) then
|
||||
if flags ~= "" then
|
||||
flags = flags .. ", "
|
||||
end -- if
|
||||
flags = flags .. str
|
||||
end -- if
|
||||
|
||||
end -- function addflag
|
||||
|
||||
if mylist then
|
||||
|
||||
Note ""
|
||||
ColourNote ("white", "blue", "---- Chats ----")
|
||||
Note ""
|
||||
|
||||
for _, id in ipairs (mylist) do
|
||||
|
||||
flags = ""
|
||||
|
||||
-- look for flags
|
||||
addflag (id, 17, "private")
|
||||
addflag (id, 12, "served")
|
||||
addflag (id, 13, "can snoop")
|
||||
addflag (id, 14, "snooping")
|
||||
addflag (id, 16, "can send commands")
|
||||
addflag (id, 18, "can send files")
|
||||
addflag (id, 19, "ignore")
|
||||
|
||||
if flags ~= "" then
|
||||
flags = " (" .. flags .. ")"
|
||||
end -- if
|
||||
|
||||
Note (id .. ": " ..
|
||||
GetChatInfo (id, 2) .. " (" ..
|
||||
GetChatInfo (id, 5) .. ", " ..
|
||||
GetChatInfo (id, 8) .. ")" ..
|
||||
flags )
|
||||
|
||||
end -- for
|
||||
|
||||
else
|
||||
ColourNote ("white", "red", "No chat sessions")
|
||||
|
||||
end -- if
|
||||
|
||||
Note ""
|
||||
|
||||
end -- function ChatList
|
||||
|
||||
function ChatInfo ()
|
||||
|
||||
Note ""
|
||||
ColourNote ("white", "blue", "---- Chat Configuration ----")
|
||||
Note ""
|
||||
|
||||
Note ("Accepting incoming connections: " ..
|
||||
YesNo (GetOption ("accept_chat_connections")))
|
||||
Note ("Incoming connections port: " ..
|
||||
GetOption ("chat_port"))
|
||||
Note ("Our chat name: " ..
|
||||
GetAlphaOption ("chat_name"))
|
||||
|
||||
ChatList ()
|
||||
|
||||
end -- function ChatInfo
|
||||
|
||||
--
|
||||
-- Chat callbacks
|
||||
-- --------------
|
||||
--
|
||||
|
||||
-- OnPluginChatAccept
|
||||
-- ------------------
|
||||
--
|
||||
-- MUSHclient has received a connection from IP,name
|
||||
-- Return TRUE to accept it, FALSE to reject it
|
||||
--
|
||||
function OnPluginChatAccept (sText)
|
||||
local theList
|
||||
local username, ip, domain
|
||||
|
||||
theList = utils.split (sText, ",")
|
||||
ip = theList [1]
|
||||
username = theList [2]
|
||||
|
||||
--
|
||||
-- Example of looking up their domain name:
|
||||
--
|
||||
|
||||
-- domain = GetHostName (ip)
|
||||
|
||||
|
||||
--
|
||||
-- Example user notifications:
|
||||
--
|
||||
-- Note "** Received chat call from " .. username .. " at address " .. ip
|
||||
--
|
||||
-- Note "** Received chat call from " .. username .. " at domain " .. domain
|
||||
|
||||
|
||||
--
|
||||
-- Example of rejecting someone (uncomment and change address):
|
||||
--
|
||||
-- if ip == "111.222.10.3" then
|
||||
-- return false
|
||||
-- end -- if
|
||||
--
|
||||
|
||||
return true -- accept it
|
||||
|
||||
end -- function
|
||||
|
||||
-- OnPluginChatMessage
|
||||
-- ------------------
|
||||
--
|
||||
-- MUSHclient has received chat message: id, type, text
|
||||
-- Return TRUE to use the default processing, FALSE to ignore it
|
||||
--
|
||||
--
|
||||
-- The "id" argument supplies the chat id of the connection which sent the
|
||||
-- message.
|
||||
--
|
||||
-- The message code indicating the chat message, where these are likely
|
||||
-- to be received:
|
||||
--
|
||||
|
||||
-- 1 Name_change
|
||||
-- 2 Request_connections
|
||||
-- 3 Connection_list
|
||||
-- 4 Text_everybody
|
||||
-- 5 Text_personal
|
||||
-- 6 Text_group
|
||||
-- 7 Message
|
||||
-- 8 Do_not_disturb
|
||||
-- 9 Send_action
|
||||
-- 10 Send_alias
|
||||
-- 11 Send_macro
|
||||
-- 12 Send_variable
|
||||
-- 13 Send_event
|
||||
-- 14 Send_gag
|
||||
-- 15 Send_highlight
|
||||
-- 16 Send_list
|
||||
-- 17 Send_array
|
||||
-- 18 Send_baritem
|
||||
-- 19 Version
|
||||
-- 20 File_start
|
||||
-- 21 File_deny
|
||||
-- 22 File_block_request
|
||||
-- 23 File_block
|
||||
-- 24 File_end
|
||||
-- 25 File_cancel
|
||||
-- 26 Ping_request
|
||||
-- 27 Ping_response
|
||||
-- 28 Peek_connections
|
||||
-- 29 Peek_list
|
||||
-- 30 Snoop
|
||||
-- 31 Snoop_data
|
||||
-- 105 Send_command
|
||||
|
||||
function OnPluginChatMessage (id, message, sText)
|
||||
|
||||
--
|
||||
-- Example of rejecting a message:
|
||||
--
|
||||
-- if message == 26 then
|
||||
-- return false -- ignore pings
|
||||
-- end -- if
|
||||
--
|
||||
|
||||
return true -- process it
|
||||
|
||||
end -- function
|
||||
|
||||
|
||||
-- OnPluginChatDisplay
|
||||
-- ------------------
|
||||
--
|
||||
-- MUSHclient is about to display message: type, text
|
||||
-- Return TRUE to use the default display, FALSE to not display
|
||||
--
|
||||
-- Note - the message type number, which groups types
|
||||
-- of messages, as follows:
|
||||
--
|
||||
|
||||
-- 0 Connection attempt
|
||||
-- 1 Session start, end
|
||||
-- 2 Name Change
|
||||
-- 3 Message
|
||||
-- 4 Incoming Personal
|
||||
-- 5 Incoming Everybody
|
||||
-- 6 Incoming Group
|
||||
-- 7 Outgoing Personal
|
||||
-- 8 Outgoing Everybody
|
||||
-- 9 Outgoing Group
|
||||
-- 10 Peek List
|
||||
-- 11 Connection List
|
||||
-- 12 Ping
|
||||
-- 13 Information
|
||||
-- 14 File
|
||||
-- 15 Snoop Data
|
||||
-- 16 Command
|
||||
|
||||
function OnPluginChatDisplay (message, sText)
|
||||
|
||||
--
|
||||
-- Example of rejecting a message:
|
||||
--
|
||||
-- if message == 10 then
|
||||
-- return false -- ignore peek lists
|
||||
-- end -- if
|
||||
--
|
||||
|
||||
--
|
||||
-- Example of timestamping messages
|
||||
--
|
||||
-- If an incoming message type is not 1000 we prepend the date and re-display it
|
||||
-- If it is 1000 (our user-assigned type) we simply let MUSHclient display it.
|
||||
--
|
||||
|
||||
-- if message ~= 1000 then
|
||||
-- ChatNote (1000, os.date ("%X %x") .. ": " .. sText)
|
||||
-- return false
|
||||
-- end -- if
|
||||
|
||||
--
|
||||
-- Example of doing something different with it.
|
||||
--
|
||||
-- We will take normal incoming and outgoing chats and emotes, and
|
||||
-- display them in a notepad window, and omit them from the main window
|
||||
--
|
||||
|
||||
-- if message >= 4 and message <= 9 then
|
||||
-- AppendToNotepad ("Chats",
|
||||
-- os.date ("%X %x") .. ": " .. -- optional date/timestamp
|
||||
-- Replace (StripANSI (sText), "\n", "\r\n"), "\r\n")
|
||||
-- return false
|
||||
-- end -- if
|
||||
|
||||
-- If you want to timestamp AND display in the notepad, simply put the date at
|
||||
-- the start of the AppendToNotepad line by uncommenting the line above with os.date in it.
|
||||
|
||||
|
||||
return true -- display it
|
||||
|
||||
end -- function
|
||||
|
||||
|
||||
-- OnPluginChatNewUser
|
||||
-- -------------------
|
||||
--
|
||||
-- A new plugin user has been accepted on: id, name
|
||||
--
|
||||
--
|
||||
-- This script callback has been provided so you can take action if
|
||||
-- you want (such as allowing file transfers).
|
||||
--
|
||||
|
||||
function OnPluginChatNewUser (id, name)
|
||||
|
||||
--
|
||||
-- Example of notifying yourself of a new chat user.
|
||||
--
|
||||
-- Note ("New chat user: " .. name)
|
||||
--
|
||||
|
||||
--
|
||||
-- Example of taking special action
|
||||
--
|
||||
-- If Bruce connects let him send files, and mark as private
|
||||
--
|
||||
|
||||
-- if string.lower (name) == "bruce" then
|
||||
-- SetChatOption (id, "can_send_files", 1)
|
||||
-- SetChatOption (id, "private", 1)
|
||||
-- end -- if
|
||||
|
||||
end -- function
|
||||
|
||||
|
||||
-- OnPluginChatUserDisconnect
|
||||
-- --------------------------
|
||||
--
|
||||
-- This chat user has disconnected for one reason or another.
|
||||
--
|
||||
-- This callback lets you take action (eg. notify others) however
|
||||
-- you cannot send messages to this connection or change any options
|
||||
-- once they have disconnected. The chat id is supplied so you can
|
||||
-- match the id to the one that connected.
|
||||
--
|
||||
-- For each call to OnPluginChatNewUser there should eventually be a
|
||||
-- corresponding call to OnPluginChatUserDisconnect.
|
||||
--
|
||||
function OnPluginChatUserDisconnect (id, name)
|
||||
|
||||
-- Example of notifying yourself someone has left ...
|
||||
--
|
||||
-- Note ("Chat user: " .. name .. " has left the chat system.")
|
||||
--
|
||||
|
||||
end -- function
|
||||
|
||||
|
||||
-- use local date format
|
||||
|
||||
os.setlocale ("", "time")
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="Chat:help"
|
||||
enabled="y"
|
||||
ignore_case = "y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
function OnHelp (sName, sLine, wildcards)
|
||||
Note (GetPluginInfo (GetPluginID (), 3))
|
||||
end -- function
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
159
cosmic rage/worlds/plugins/constants.js
Normal file
159
cosmic rage/worlds/plugins/constants.js
Normal file
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- Constants For use in Jscript scripting -->
|
||||
|
||||
<!DOCTYPE script>
|
||||
<script>
|
||||
<![CDATA[
|
||||
// ----------------------------------------------------------
|
||||
// Error codes returned by various functions
|
||||
// ----------------------------------------------------------
|
||||
|
||||
var eOK = 0; // No error
|
||||
var eWorldOpen = 30001; // The world is already open
|
||||
var eWorldClosed = 30002; // The world is closed, this action cannot be performed
|
||||
var eNoNameSpecified = 30003; // No name has been specified where one is required
|
||||
var eCannotPlaySound = 30004; // The sound file could not be played
|
||||
var eTriggerNotFound = 30005; // The specified trigger name does not exist
|
||||
var eTriggerAlreadyExists = 30006; // Attempt to add a trigger that already exists
|
||||
var eTriggerCannotBeEmpty = 30007; // The trigger "match" string cannot be empty
|
||||
var eInvalidObjectLabel = 30008; // The name of this object is invalid
|
||||
var eScriptNameNotLocated = 30009; // Script name is not in the script file
|
||||
var eAliasNotFound = 30010; // The specified alias name does not exist
|
||||
var eAliasAlreadyExists = 30011; // Attempt to add a alias that already exists
|
||||
var eAliasCannotBeEmpty = 30012; // The alias "match" string cannot be empty
|
||||
var eCouldNotOpenFile = 30013; // Unable to open requested file
|
||||
var eLogFileNotOpen = 30014; // Log file was not open
|
||||
var eLogFileAlreadyOpen = 30015; // Log file was already open
|
||||
var eLogFileBadWrite = 30016; // Bad write to log file
|
||||
var eTimerNotFound = 30017; // The specified timer name does not exist
|
||||
var eTimerAlreadyExists = 30018; // Attempt to add a timer that already exists
|
||||
var eVariableNotFound = 30019; // Attempt to delete a variable that does not exist
|
||||
var eCommandNotEmpty = 30020; // Attempt to use SetCommand with a non-empty command window
|
||||
var eBadRegularExpression = 30021; // Bad regular expression syntax
|
||||
var eTimeInvalid = 30022; // Time given to AddTimer is invalid
|
||||
var eBadMapItem = 30023; // Direction given to AddToMapper is invalid
|
||||
var eNoMapItems = 30024; // No items in mapper
|
||||
var eUnknownOption = 30025; // Option name not found
|
||||
var eOptionOutOfRange = 30026; // New value for option is out of range
|
||||
var eTriggerSequenceOutOfRange = 30027; // Trigger sequence value invalid
|
||||
var eTriggerSendToInvalid = 30028; // Where to send trigger text to is invalid
|
||||
var eTriggerLabelNotSpecified = 30029; // Trigger label not specified/invalid for 'send to variable'
|
||||
var ePluginFileNotFound = 30030; // File name specified for plugin not found
|
||||
var eProblemsLoadingPlugin = 30031; // There was a parsing or other problem loading the plugin
|
||||
var ePluginCannotSetOption = 30032; // Plugin is not allowed to set this option
|
||||
var ePluginCannotGetOption = 30033; // Plugin is not allowed to get this option
|
||||
var eNoSuchPlugin = 30034; // Requested plugin is not installed
|
||||
var eNotAPlugin = 30035; // Only a plugin can do this
|
||||
var eNoSuchRoutine = 30036; // Plugin does not support that subroutine (subroutine not in script)
|
||||
var ePluginDoesNotSaveState = 30037; // Plugin does not support saving state
|
||||
var ePluginCouldNotSaveState = 30037; // Plugin could not save state (eg. no state directory)
|
||||
var ePluginDisabled = 30039; // Plugin is currently disabled
|
||||
var eErrorCallingPluginRoutine = 30040; // Could not call plugin routine
|
||||
var eCommandsNestedTooDeeply = 30041; // Calls to "Execute" nested too deeply
|
||||
var eCannotCreateChatSocket = 30042; // Unable to create socket for chat connection
|
||||
var eCannotLookupDomainName = 30043; // Unable to do DNS (domain name) lookup for chat connection
|
||||
var eNoChatConnections = 30044; // No chat connections open
|
||||
var eChatPersonNotFound = 30045; // Requested chat person not connected
|
||||
var eBadParameter = 30046; // General problem with a parameter to a script call
|
||||
var eChatAlreadyListening = 30047; // Already listening for incoming chats
|
||||
var eChatIDNotFound = 30048; // Chat session with that ID not found
|
||||
var eChatAlreadyConnected = 30049; // Already connected to that server/port
|
||||
var eClipboardEmpty = 30050; // Cannot get (text from the) clipboard
|
||||
var eFileNotFound = 30051; // Cannot open the specified file
|
||||
var eAlreadyTransferringFile = 30052; // Already transferring a file
|
||||
var eNotTransferringFile = 30053; // Not transferring a file
|
||||
var eNoSuchCommand = 30054; // There is not a command of that name
|
||||
var eArrayAlreadyExists = 30055; // Chat session with that ID not found
|
||||
var eArrayDoesNotExist = 30056; // Already connected to that server/port
|
||||
var eArrayNotEvenNumberOfValues = 30057; // Cannot get (text from the) clipboard
|
||||
var eImportedWithDuplicates = 30058; // Cannot open the specified file
|
||||
var eBadDelimiter = 30059; // Already transferring a file
|
||||
var eSetReplacingExistingValue = 30060; // Not transferring a file
|
||||
var eKeyDoesNotExist = 30061; // There is not a command of that name
|
||||
var eCannotImport = 30062; // There is not a command of that name
|
||||
var eItemInUse = 30063; // Cannot delete trigger/alias/timer because it is executing a script
|
||||
var eSpellCheckNotActive = 30064; // Spell checker is not active
|
||||
var eCannotAddFont = 30065; // Cannot create requested font
|
||||
var ePenStyleNotValid = 30066; // Invalid settings for pen parameter
|
||||
var eUnableToLoadImage = 30067; // Bitmap image could not be loaded
|
||||
var eImageNotInstalled = 30068; // Image has not been loaded into window
|
||||
var eInvalidNumberOfPoints = 30069; // Number of points supplied is incorrect
|
||||
var eInvalidPoint = 30070; // Point is not numeric
|
||||
var eHotspotPluginChanged = 30071; // Hotspot processing must all be in same plugin
|
||||
var eHotspotNotInstalled = 30072; // Hotspot has not been defined for this window
|
||||
var eNoSuchWindow = 30073; // Requested miniwindow does not exist
|
||||
var eBrushStyleNotValid = 30074; // Invalid settings for brush parameter
|
||||
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// Flags for AddTrigger
|
||||
// ----------------------------------------------------------
|
||||
|
||||
var eEnabled = 1; // enable trigger
|
||||
var eOmitFromLog = 2; // omit from log file
|
||||
var eOmitFromOutput = 4; // omit trigger from output
|
||||
var eKeepEvaluating = 8; // keep evaluating
|
||||
var eIgnoreCase = 16; // ignore case when matching
|
||||
var eTriggerRegularExpression = 32; // trigger uses regular expression
|
||||
var eExpandVariables = 512; // expand variables like @direction
|
||||
var eReplace = 1024; // replace existing trigger of same name
|
||||
var eLowercaseWildcard = 2048; // wildcards forced to lower-case
|
||||
var eTemporary = 16384; // temporary - do not save to world file
|
||||
var eTriggerOneShot = 32768; // one shot - delete after firing
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// Colours for AddTrigger
|
||||
// ----------------------------------------------------------
|
||||
|
||||
var NOCHANGE = -1;
|
||||
var custom1 = 0;
|
||||
var custom2 = 1;
|
||||
var custom3 = 2;
|
||||
var custom4 = 3;
|
||||
var custom5 = 4;
|
||||
var custom6 = 5;
|
||||
var custom7 = 6;
|
||||
var custom8 = 7;
|
||||
var custom9 = 8;
|
||||
var custom10 = 9;
|
||||
var custom11 = 10;
|
||||
var custom12 = 11;
|
||||
var custom13 = 12;
|
||||
var custom14 = 13;
|
||||
var custom15 = 14;
|
||||
var custom16 = 15;
|
||||
var custom_other = 16; // triggers only
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// Flags for AddAlias
|
||||
// ----------------------------------------------------------
|
||||
|
||||
// var eEnabled = 1; // same as for AddTrigger
|
||||
var eIgnoreAliasCase = 32; // ignore case when matching
|
||||
var eOmitFromLogFile = 64; // omit this alias from the log file
|
||||
var eAliasRegularExpression = 128; // alias is regular expressions
|
||||
var eExpandVariables = 512; // same as for AddTrigger
|
||||
// var eReplace = 1024; // same as for AddTrigger
|
||||
var eAliasSpeedWalk = 2048; // interpret send string as a speed walk string
|
||||
var eAliasQueue = 4096; // queue this alias for sending at the speedwalking delay interval
|
||||
var eAliasMenu = 8192; // this alias appears on the alias menu
|
||||
// var eTemporary = 16384; // same as for AddTrigger
|
||||
var eAliasOneShot = 32768; // one shot - delete after firing
|
||||
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// Flags for AddTimer
|
||||
// ----------------------------------------------------------
|
||||
|
||||
// var eEnabled = 1; // same as for AddTrigger
|
||||
var eAtTime = 2; // if not set, time is "every"
|
||||
var eOneShot = 4; // if set, timer only fires once
|
||||
var eTimerSpeedWalk = 8; // timer does a speed walk when it fires
|
||||
var eTimerNote = 16; // timer does a world.note when it fires
|
||||
var eActiveWhenClosed = 32; // timer fires even when world is disconnected
|
||||
// var eReplace = 1024; // same as for AddTrigger
|
||||
// var eTemporary = 16384; // same as for AddTrigger
|
||||
|
||||
]]>
|
||||
</script>
|
||||
157
cosmic rage/worlds/plugins/constants.lua
Normal file
157
cosmic rage/worlds/plugins/constants.lua
Normal file
@@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- Constants For use in Lua scripting -->
|
||||
|
||||
<!DOCTYPE script>
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
-- ----------------------------------------------------------
|
||||
-- Error codes returned by various functions
|
||||
-- ----------------------------------------------------------
|
||||
|
||||
-- These are preloaded into the "error_code" table.
|
||||
-- Also, the descriptions are available in the "error_desc" table.
|
||||
|
||||
eOK = 0; -- No error
|
||||
eWorldOpen = 30001; -- The world is already open
|
||||
eWorldClosed = 30002; -- The world is closed, this action cannot be performed
|
||||
eNoNameSpecified = 30003; -- No name has been specified where one is required
|
||||
eCannotPlaySound = 30004; -- The sound file could not be played
|
||||
eTriggerNotFound = 30005; -- The specified trigger name does not exist
|
||||
eTriggerAlreadyExists = 30006; -- Attempt to add a trigger that already exists
|
||||
eTriggerCannotBeEmpty = 30007; -- The trigger "match" string cannot be empty
|
||||
eInvalidObjectLabel = 30008; -- The name of this object is invalid
|
||||
eScriptNameNotLocated = 30009; -- Script name is not in the script file
|
||||
eAliasNotFound = 30010; -- The specified alias name does not exist
|
||||
eAliasAlreadyExists = 30011; -- Attempt to add a alias that already exists
|
||||
eAliasCannotBeEmpty = 30012; -- The alias "match" string cannot be empty
|
||||
eCouldNotOpenFile = 30013; -- Unable to open requested file
|
||||
eLogFileNotOpen = 30014; -- Log file was not open
|
||||
eLogFileAlreadyOpen = 30015; -- Log file was already open
|
||||
eLogFileBadWrite = 30016; -- Bad write to log file
|
||||
eTimerNotFound = 30017; -- The specified timer name does not exist
|
||||
eTimerAlreadyExists = 30018; -- Attempt to add a timer that already exists
|
||||
eVariableNotFound = 30019; -- Attempt to delete a variable that does not exist
|
||||
eCommandNotEmpty = 30020; -- Attempt to use SetCommand with a non-empty command window
|
||||
eBadRegularExpression = 30021; -- Bad regular expression syntax
|
||||
eTimeInvalid = 30022; -- Time given to AddTimer is invalid
|
||||
eBadMapItem = 30023; -- Direction given to AddToMapper is invalid
|
||||
eNoMapItems = 30024; -- No items in mapper
|
||||
eUnknownOption = 30025; -- Option name not found
|
||||
eOptionOutOfRange = 30026; -- New value for option is out of range
|
||||
eTriggerSequenceOutOfRange = 30027; -- Trigger sequence value invalid
|
||||
eTriggerSendToInvalid = 30028; -- Where to send trigger text to is invalid
|
||||
eTriggerLabelNotSpecified = 30029; -- Trigger label not specified/invalid for 'send to variable'
|
||||
ePluginFileNotFound = 30030; -- File name specified for plugin not found
|
||||
eProblemsLoadingPlugin = 30031; -- There was a parsing or other problem loading the plugin
|
||||
ePluginCannotSetOption = 30032; -- Plugin is not allowed to set this option
|
||||
ePluginCannotGetOption = 30033; -- Plugin is not allowed to get this option
|
||||
eNoSuchPlugin = 30034; -- Requested plugin is not installed
|
||||
eNotAPlugin = 30035; -- Only a plugin can do this
|
||||
eNoSuchRoutine = 30036; -- Plugin does not support that subroutine (subroutine not in script)
|
||||
ePluginDoesNotSaveState = 30037; -- Plugin does not support saving state
|
||||
ePluginCouldNotSaveState = 30037; -- Plugin could not save state (eg. no state directory)
|
||||
ePluginDisabled = 30039; -- Plugin is currently disabled
|
||||
eErrorCallingPluginRoutine = 30040; -- Could not call plugin routine
|
||||
eCommandsNestedTooDeeply = 30041; -- Calls to "Execute" nested too deeply
|
||||
eCannotCreateChatSocket = 30042; -- Unable to create socket for chat connection
|
||||
eCannotLookupDomainName = 30043; -- Unable to do DNS (domain name) lookup for chat connection
|
||||
eNoChatConnections = 30044; -- No chat connections open
|
||||
eChatPersonNotFound = 30045; -- Requested chat person not connected
|
||||
eBadParameter = 30046; -- General problem with a parameter to a script call
|
||||
eChatAlreadyListening = 30047; -- Already listening for incoming chats
|
||||
eChatIDNotFound = 30048; -- Chat session with that ID not found
|
||||
eChatAlreadyConnected = 30049; -- Already connected to that server/port
|
||||
eClipboardEmpty = 30050; -- Cannot get (text from the) clipboard
|
||||
eFileNotFound = 30051; -- Cannot open the specified file
|
||||
eAlreadyTransferringFile = 30052; -- Already transferring a file
|
||||
eNotTransferringFile = 30053; -- Not transferring a file
|
||||
eNoSuchCommand = 30054; -- There is not a command of that name
|
||||
eArrayAlreadyExists = 30055; -- Chat session with that ID not found
|
||||
eArrayDoesNotExist = 30056; -- Already connected to that server/port
|
||||
eArrayNotEvenNumberOfValues = 30057; -- Cannot get (text from the) clipboard
|
||||
eImportedWithDuplicates = 30058; -- Cannot open the specified file
|
||||
eBadDelimiter = 30059; -- Already transferring a file
|
||||
eSetReplacingExistingValue = 30060; -- Not transferring a file
|
||||
eKeyDoesNotExist = 30061; -- There is not a command of that name
|
||||
eCannotImport = 30062; -- There is not a command of that name
|
||||
eItemInUse = 30063; -- Cannot delete trigger/alias/timer because it is executing a script
|
||||
eSpellCheckNotActive = 30064; -- Spell checker is not active
|
||||
eSpellCheckNotActive = 30064; -- Spell checker is not active
|
||||
eCannotAddFont = 30065; -- Cannot create requested font
|
||||
ePenStyleNotValid = 30066; -- Invalid settings for pen parameter
|
||||
eUnableToLoadImage = 30067; -- Bitmap image could not be loaded
|
||||
eImageNotInstalled = 30068; -- Image has not been loaded into window
|
||||
eInvalidNumberOfPoints = 30069; -- Number of points supplied is incorrect
|
||||
eInvalidPoint = 30070; -- Point is not numeric
|
||||
eHotspotPluginChanged = 30071; -- Hotspot processing must all be in same plugin
|
||||
eHotspotNotInstalled = 30072; -- Hotspot has not been defined for this window
|
||||
eNoSuchWindow = 30073; -- Requested miniwindow does not exist
|
||||
eBrushStyleNotValid = 30074; -- Invalid settings for brush parameter
|
||||
|
||||
|
||||
-- ----------------------------------------------------------
|
||||
-- Flags for AddTrigger
|
||||
-- ----------------------------------------------------------
|
||||
|
||||
-- These are preloaded into the "trigger_flag" table.
|
||||
|
||||
eEnabled = 1; -- enable trigger
|
||||
eOmitFromLog = 2; -- omit from log file
|
||||
eOmitFromOutput = 4; -- omit trigger from output
|
||||
eKeepEvaluating = 8; -- keep evaluating
|
||||
eIgnoreCase = 16; -- ignore case when matching
|
||||
eTriggerRegularExpression = 32; -- trigger uses regular expression
|
||||
eExpandVariables = 512; -- expand variables like @direction
|
||||
eReplace = 1024; -- replace existing trigger of same name
|
||||
eLowercaseWildcard = 2048; -- wildcards forced to lower-case
|
||||
eTemporary = 16384; -- temporary - do not save to world file
|
||||
eTriggerOneShot = 32768; -- one shot - delete after firing
|
||||
|
||||
-- ----------------------------------------------------------
|
||||
-- Colours for AddTrigger
|
||||
-- ----------------------------------------------------------
|
||||
|
||||
-- These are preloaded into the "custom_colour" table.
|
||||
|
||||
NOCHANGE = -1;
|
||||
custom1 = 0;
|
||||
custom2 = 1;
|
||||
custom3 = 2;
|
||||
custom4 = 3;
|
||||
custom5 = 4;
|
||||
custom6 = 5;
|
||||
custom7 = 6;
|
||||
custom8 = 7;
|
||||
custom9 = 8;
|
||||
custom10 = 9;
|
||||
custom11 = 10;
|
||||
custom12 = 11;
|
||||
custom13 = 12;
|
||||
custom14 = 13;
|
||||
custom15 = 14;
|
||||
custom16 = 15;
|
||||
custom_other = 16; -- triggers only
|
||||
|
||||
-- ----------------------------------------------------------
|
||||
-- Flags for AddAlias
|
||||
-- ----------------------------------------------------------
|
||||
|
||||
-- These are preloaded into the "alias_flag" table.
|
||||
|
||||
-- eEnabled = 1; -- same as for AddTrigger
|
||||
eIgnoreAliasCase = 32; -- ignore case when matching
|
||||
eOmitFromLogFile = 64; -- omit this alias from the log file
|
||||
eAliasRegularExpression = 128; -- alias is regular expressions
|
||||
eExpandVariables = 512; -- same as for AddTrigger
|
||||
-- eReplace = 1024; -- same as for AddTrigger
|
||||
eAliasSpeedWalk = 2048; -- interpret send string as a speed walk string
|
||||
eAliasQueue = 4096; -- queue this alias for sending at the speedwalking delay interval
|
||||
eAliasMenu = 8192; -- this alias appears on the alias menu
|
||||
-- eTemporary = 16384; -- same as for AddTrigger
|
||||
eAliasOneShot = 32768; -- one shot - delete after firing
|
||||
|
||||
|
||||
]]>
|
||||
</script>
|
||||
158
cosmic rage/worlds/plugins/constants.pl
Normal file
158
cosmic rage/worlds/plugins/constants.pl
Normal file
@@ -0,0 +1,158 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- Constants For use in Perlscript scripting -->
|
||||
|
||||
<!DOCTYPE script>
|
||||
<script>
|
||||
<![CDATA[
|
||||
# ----------------------------------------------------------
|
||||
# Error codes returned by various functions
|
||||
# ----------------------------------------------------------
|
||||
|
||||
my $eOK = 0; # No error
|
||||
my $eWorldOpen = 30001; # The world is already open
|
||||
my $eWorldClosed = 30002; # The world is closed, this action cannot be performed
|
||||
my $eNoNameSpecified = 30003; # No name has been specified where one is required
|
||||
my $eCannotPlaySound = 30004; # The sound file could not be played
|
||||
my $eTriggerNotFound = 30005; # The specified trigger name does not exist
|
||||
my $eTriggerAlreadyExists = 30006; # Attempt to add a trigger that already exists
|
||||
my $eTriggerCannotBeEmpty = 30007; # The trigger "match" string cannot be empty
|
||||
my $eInvalidObjectLabel = 30008; # The name of this object is invalid
|
||||
my $eScriptNameNotLocated = 30009; # Script name is not in the script file
|
||||
my $eAliasNotFound = 30010; # The specified alias name does not exist
|
||||
my $eAliasAlreadyExists = 30011; # Attempt to add a alias that already exists
|
||||
my $eAliasCannotBeEmpty = 30012; # The alias "match" string cannot be empty
|
||||
my $eCouldNotOpenFile = 30013; # Unable to open requested file
|
||||
my $eLogFileNotOpen = 30014; # Log file was not open
|
||||
my $eLogFileAlreadyOpen = 30015; # Log file was already open
|
||||
my $eLogFileBadWrite = 30016; # Bad write to log file
|
||||
my $eTimerNotFound = 30017; # The specified timer name does not exist
|
||||
my $eTimerAlreadyExists = 30018; # Attempt to add a timer that already exists
|
||||
my $eVariableNotFound = 30019; # Attempt to delete a variable that does not exist
|
||||
my $eCommandNotEmpty = 30020; # Attempt to use SetCommand with a non-empty command window
|
||||
my $eBadRegularExpression = 30021; # Bad regular expression syntax
|
||||
my $eTimeInvalid = 30022; # Time given to AddTimer is invalid
|
||||
my $eBadMapItem = 30023; # Direction given to AddToMapper is invalid
|
||||
my $eNoMapItems = 30024; # No items in mapper
|
||||
my $eUnknownOption = 30025; # Option name not found
|
||||
my $eOptionOutOfRange = 30026; # New value for option is out of range
|
||||
my $eTriggerSequenceOutOfRange = 30027; # Trigger sequence value invalid
|
||||
my $eTriggerSendToInvalid = 30028; # Where to send trigger text to is invalid
|
||||
my $eTriggerLabelNotSpecified = 30029; # Trigger label not specified/invalid for 'send to variable'
|
||||
my $ePluginFileNotFound = 30030; # File name specified for plugin not found
|
||||
my $eProblemsLoadingPlugin = 30031; # There was a parsing or other problem loading the plugin
|
||||
my $ePluginCannotSetOption = 30032; # Plugin is not allowed to set this option
|
||||
my $ePluginCannotGetOption = 30033; # Plugin is not allowed to get this option
|
||||
my $eNoSuchPlugin = 30034; # Requested plugin is not installed
|
||||
my $eNotAPlugin = 30035; # Only a plugin can do this
|
||||
my $eNoSuchRoutine = 30036; # Plugin does not support that subroutine (subroutine not in script)
|
||||
my $ePluginDoesNotSaveState = 30037; # Plugin does not support saving state
|
||||
my $ePluginCouldNotSaveState = 30037; # Plugin could not save state (eg. no state directory)
|
||||
my $ePluginDisabled = 30039; # Plugin is currently disabled
|
||||
my $eErrorCallingPluginRoutine = 30040; # Could not call plugin routine
|
||||
my $eCommandsNestedTooDeeply = 30041; # Calls to "Execute" nested too deeply
|
||||
my $eCannotCreateChatSocket = 30042; # Unable to create socket for chat connection
|
||||
my $eCannotLookupDomainName = 30043; # Unable to do DNS (domain name) lookup for chat connection
|
||||
my $eNoChatConnections = 30044; # No chat connections open
|
||||
my $eChatPersonNotFound = 30045; # Requested chat person not connected
|
||||
my $eBadParameter = 30046; # General problem with a parameter to a script call
|
||||
my $eChatAlreadyListening = 30047; # Already listening for incoming chats
|
||||
my $eChatIDNotFound = 30048; # Chat session with that ID not found
|
||||
my $eChatAlreadyConnected = 30049; # Already connected to that server/port
|
||||
my $eClipboardEmpty = 30050; # Cannot get (text from the) clipboard
|
||||
my $eFileNotFound = 30051; # Cannot open the specified file
|
||||
my $eAlreadyTransferringFile = 30052; # Already transferring a file
|
||||
my $eNotTransferringFile = 30053; # Not transferring a file
|
||||
my $eNoSuchCommand = 30054; # There is not a command of that name
|
||||
my $eArrayAlreadyExists = 30055; # Chat session with that ID not found
|
||||
my $eArrayDoesNotExist = 30056; # Already connected to that server/port
|
||||
my $eArrayNotEvenNumberOfValues = 30057; # Cannot get (text from the) clipboard
|
||||
my $eImportedWithDuplicates = 30058; # Cannot open the specified file
|
||||
my $eBadDelimiter = 30059; # Already transferring a file
|
||||
my $eSetReplacingExistingValue = 30060; # Not transferring a file
|
||||
my $eKeyDoesNotExist = 30061; # There is not a command of that name
|
||||
my $eCannotImport = 30062; # There is not a command of that name
|
||||
my $eItemInUse = 30063; #Cannot delete trigger/alias/timer because it is executing a script
|
||||
my $eSpellCheckNotActive = 30064; # Spell checker is not active
|
||||
my $eCannotAddFont = 30065; # Cannot create requested font
|
||||
my $ePenStyleNotValid = 30066; # Invalid settings for pen parameter
|
||||
my $eUnableToLoadImage = 30067; # Bitmap image could not be loaded
|
||||
my $eImageNotInstalled = 30068; # Image has not been loaded into window
|
||||
my $eInvalidNumberOfPoints = 30069; # Number of points supplied is incorrect
|
||||
my $eInvalidPoint = 30070; # Point is not numeric
|
||||
my $eHotspotPluginChanged = 30071; # Hotspot processing must all be in same plugin
|
||||
my $eHotspotNotInstalled = 30072; # Hotspot has not been defined for this window
|
||||
my $eNoSuchWindow = 30073; # Requested miniwindow does not exist
|
||||
my $eBrushStyleNotValid = 30074; # Invalid settings for brush parameter
|
||||
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Flags for AddTrigger
|
||||
# ----------------------------------------------------------
|
||||
|
||||
my $eEnabled = 1; # enable trigger
|
||||
my $eOmitFromLog = 2; # omit from log file
|
||||
my $eOmitFromOutput = 4; # omit trigger from output
|
||||
my $eKeepEvaluating = 8; # keep evaluating
|
||||
my $eIgnoreCase = 16; # ignore case when matching
|
||||
my $eTriggerRegularExpression = 32; # trigger uses regular expression
|
||||
my $eExpandVariables = 512; # expand variables like @direction
|
||||
my $eReplace = 1024; # replace existing trigger of same name
|
||||
my $eLowercaseWildcard = 2048; # wildcards forced to lower-case
|
||||
my $eTemporary = 16384; # temporary - do not save to world file
|
||||
my $eTriggerOneShot = 32768; # one shot - delete after firing
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Colours for AddTrigger
|
||||
# ----------------------------------------------------------
|
||||
|
||||
my $NOCHANGE = -1;
|
||||
my $custom1 = 0;
|
||||
my $custom2 = 1;
|
||||
my $custom3 = 2;
|
||||
my $custom4 = 3;
|
||||
my $custom5 = 4;
|
||||
my $custom6 = 5;
|
||||
my $custom7 = 6;
|
||||
my $custom8 = 7;
|
||||
my $custom9 = 8;
|
||||
my $custom10 = 9;
|
||||
my $custom11 = 10;
|
||||
my $custom12 = 11;
|
||||
my $custom13 = 12;
|
||||
my $custom14 = 13;
|
||||
my $custom15 = 14;
|
||||
my $custom16 = 15;
|
||||
my $custom_other = 16; # triggers only
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Flags for AddAlias
|
||||
# ----------------------------------------------------------
|
||||
|
||||
# my $eEnabled = 1; # same as for AddTrigger
|
||||
my $eIgnoreAliasCase = 32; # ignore case when matching
|
||||
my $eOmitFromLogFile = 64; # omit this alias from the log file
|
||||
my $eAliasRegularExpression = 128; # alias is regular expressions
|
||||
# my $eExpandVariables = 512; # same as for AddTrigger
|
||||
# my $eReplace = 1024; # same as for AddTrigger
|
||||
my $eAliasSpeedWalk = 2048; # interpret send string as a speed walk string
|
||||
my $eAliasQueue = 4096; # queue this alias for sending at the speedwalking delay interval
|
||||
my $eAliasMenu = 8192; # this alias appears on the alias menu
|
||||
# my $eTemporary = 16384; # same as for AddTrigger
|
||||
my $eAliasOneShot = 32768; # one shot - delete after firing
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Flags for AddTimer
|
||||
# ----------------------------------------------------------
|
||||
|
||||
# my $eEnabled = 1; # same as for AddTrigger
|
||||
my $eAtTime = 2; # if not set, time is "every"
|
||||
my $eOneShot = 4; # if set, timer only fires once
|
||||
my $eTimerSpeedWalk = 8; # timer does a speed walk when it fires
|
||||
my $eTimerNote = 16; # timer does a world.note when it fires
|
||||
my $eActiveWhenClosed = 32; # timer fires even when world is disconnected
|
||||
# my $eReplace = 1024; # same as for AddTrigger
|
||||
# my $eTemporary = 16384; # same as for AddTrigger
|
||||
|
||||
]]>
|
||||
</script>
|
||||
158
cosmic rage/worlds/plugins/constants.pys
Normal file
158
cosmic rage/worlds/plugins/constants.pys
Normal file
@@ -0,0 +1,158 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- Constants For use in Python scripting -->
|
||||
|
||||
<!DOCTYPE script>
|
||||
<script>
|
||||
<![CDATA[
|
||||
# ----------------------------------------------------------
|
||||
# Error codes returned by various functions
|
||||
# ----------------------------------------------------------
|
||||
|
||||
eOK = 0 # No error
|
||||
eWorldOpen = 30001 # The world is already open
|
||||
eWorldClosed = 30002 # The world is closed, this action cannot be performed
|
||||
eNoNameSpecified = 30003 # No name has been specified where one is required
|
||||
eCannotPlaySound = 30004 # The sound file could not be played
|
||||
eTriggerNotFound = 30005 # The specified trigger name does not exist
|
||||
eTriggerAlreadyExists = 30006 # Attempt to add a trigger that already exists
|
||||
eTriggerCannotBeEmpty = 30007 # The trigger "match" string cannot be empty
|
||||
eInvalidObjectLabel = 30008 # The name of this object is invalid
|
||||
eScriptNameNotLocated = 30009 # Script name is not in the script file
|
||||
eAliasNotFound = 30010 # The specified alias name does not exist
|
||||
eAliasAlreadyExists = 30011 # Attempt to add a alias that already exists
|
||||
eAliasCannotBeEmpty = 30012 # The alias "match" string cannot be empty
|
||||
eCouldNotOpenFile = 30013 # Unable to open requested file
|
||||
eLogFileNotOpen = 30014 # Log file was not open
|
||||
eLogFileAlreadyOpen = 30015 # Log file was already open
|
||||
eLogFileBadWrite = 30016 # Bad write to log file
|
||||
eTimerNotFound = 30017 # The specified timer name does not exist
|
||||
eTimerAlreadyExists = 30018 # Attempt to add a timer that already exists
|
||||
eVariableNotFound = 30019 # Attempt to delete a variable that does not exist
|
||||
eCommandNotEmpty = 30020 # Attempt to use SetCommand with a non-empty command window
|
||||
eBadRegularExpression = 30021 # Bad regular expression syntax
|
||||
eTimeInvalid = 30022 # Time given to AddTimer is invalid
|
||||
eBadMapItem = 30023 # Direction given to AddToMapper is invalid
|
||||
eNoMapItems = 30024 # No items in mapper
|
||||
eUnknownOption = 30025 # Option name not found
|
||||
eOptionOutOfRange = 30026 # New value for option is out of range
|
||||
eTriggerSequenceOutOfRange = 30027 # Trigger sequence value invalid
|
||||
eTriggerSendToInvalid = 30028 # Where to send trigger text to is invalid
|
||||
eTriggerLabelNotSpecified = 30029 # Trigger label not specified/invalid for 'send to variable'
|
||||
ePluginFileNotFound = 30030 # File name specified for plugin not found
|
||||
eProblemsLoadingPlugin = 30031 # There was a parsing or other problem loading the plugin
|
||||
ePluginCannotSetOption = 30032 # Plugin is not allowed to set this option
|
||||
ePluginCannotGetOption = 30033 # Plugin is not allowed to get this option
|
||||
eNoSuchPlugin = 30034 # Requested plugin is not installed
|
||||
eNotAPlugin = 30035 # Only a plugin can do this
|
||||
eNoSuchRoutine = 30036 # Plugin does not support that subroutine (subroutine not in script)
|
||||
ePluginDoesNotSaveState = 30037 # Plugin does not support saving state
|
||||
ePluginCouldNotSaveState = 30037 # Plugin could not save state (eg. no state directory)
|
||||
ePluginDisabled = 30039 # Plugin is currently disabled
|
||||
eErrorCallingPluginRoutine = 30040 # Could not call plugin routine
|
||||
eCommandsNestedTooDeeply = 30041 # Calls to "Execute" nested too deeply
|
||||
eCannotCreateChatSocket = 30042 # Unable to create socket for chat connection
|
||||
eCannotLookupDomainName = 30043 # Unable to do DNS (domain name) lookup for chat connection
|
||||
eNoChatConnections = 30044 # No chat connections open
|
||||
eChatPersonNotFound = 30045 # Requested chat person not connected
|
||||
eBadParameter = 30046 # General problem with a parameter to a script call
|
||||
eChatAlreadyListening = 30047 # Already listening for incoming chats
|
||||
eChatIDNotFound = 30048 # Chat session with that ID not found
|
||||
eChatAlreadyConnected = 30049 # Already connected to that server/port
|
||||
eClipboardEmpty = 30050 # Cannot get (text from the) clipboard
|
||||
eFileNotFound = 30051 # Cannot open the specified file
|
||||
eAlreadyTransferringFile = 30052 # Already transferring a file
|
||||
eNotTransferringFile = 30053 # Not transferring a file
|
||||
eNoSuchCommand = 30054 # There is not a command of that name
|
||||
eArrayAlreadyExists = 30055 # Chat session with that ID not found
|
||||
eArrayDoesNotExist = 30056 # Already connected to that server/port
|
||||
eArrayNotEvenNumberOfValues = 30057 # Cannot get (text from the) clipboard
|
||||
eImportedWithDuplicates = 30058 # Cannot open the specified file
|
||||
eBadDelimiter = 30059 # Already transferring a file
|
||||
eSetReplacingExistingValue = 30060 # Not transferring a file
|
||||
eKeyDoesNotExist = 30061 # There is not a command of that name
|
||||
eCannotImport = 30062 # There is not a command of that name
|
||||
eItemInUse = 30063 # Cannot delete trigger/alias/timer because it is executing a script
|
||||
eSpellCheckNotActive = 30064 # Spell checker is not active
|
||||
eCannotAddFont = 30065 # Cannot create requested font
|
||||
ePenStyleNotValid = 30066 # Invalid settings for pen parameter
|
||||
eUnableToLoadImage = 30067 # Bitmap image could not be loaded
|
||||
eImageNotInstalled = 30068 # Image has not been loaded into window
|
||||
eInvalidNumberOfPoints = 30069 # Number of points supplied is incorrect
|
||||
eInvalidPoint = 30070 # Point is not numeric
|
||||
eHotspotPluginChanged = 30071 # Hotspot processing must all be in same plugin
|
||||
eHotspotNotInstalled = 30072 # Hotspot has not been defined for this window
|
||||
eNoSuchWindow = 30073 # Requested miniwindow does not exist
|
||||
eBrushStyleNotValid = 30074 # Invalid settings for brush parameter
|
||||
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Flags for AddTrigger
|
||||
# ----------------------------------------------------------
|
||||
|
||||
eEnabled = 1 # enable trigger
|
||||
eOmitFromLog = 2 # omit from log file
|
||||
eOmitFromOutput = 4 # omit trigger from output
|
||||
eKeepEvaluating = 8 # keep evaluating
|
||||
eIgnoreCase = 16 # ignore case when matching
|
||||
eTriggerRegularExpression = 32 # trigger uses regular expression
|
||||
eExpandVariables = 512 # expand variables like @direction
|
||||
eReplace = 1024 # replace existing trigger of same name
|
||||
eLowercaseWildcard = 2048 # wildcards forced to lower-case
|
||||
eTemporary = 16384 # temporary - do not save to world file
|
||||
eTriggerOneShot = 32768 # one shot - delete after firing
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Colours for AddTrigger
|
||||
# ----------------------------------------------------------
|
||||
|
||||
NOCHANGE = -1
|
||||
custom1 = 0
|
||||
custom2 = 1
|
||||
custom3 = 2
|
||||
custom4 = 3
|
||||
custom5 = 4
|
||||
custom6 = 5
|
||||
custom7 = 6
|
||||
custom8 = 7
|
||||
custom9 = 8
|
||||
custom10 = 9
|
||||
custom11 = 10
|
||||
custom12 = 11
|
||||
custom13 = 12
|
||||
custom14 = 13
|
||||
custom15 = 14
|
||||
custom16 = 15
|
||||
custom_other = 16 # triggers only
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Flags for AddAlias
|
||||
# ----------------------------------------------------------
|
||||
|
||||
# eEnabled = 1 # same as for AddTrigger
|
||||
eIgnoreAliasCase = 32 # ignore case when matching
|
||||
eOmitFromLogFile = 64 # omit this alias from the log file
|
||||
eAliasRegularExpression = 128 # alias is regular expressions
|
||||
# eExpandVariables = 512 # same as for AddTrigger
|
||||
# eReplace = 1024 # same as for AddTrigger
|
||||
eAliasSpeedWalk = 2048 # interpret send string as a speed walk string
|
||||
eAliasQueue = 4096 # queue this alias for sending at the speedwalking delay interval
|
||||
eAliasMenu = 8192 # this alias appears on the alias menu
|
||||
# eTemporary = 16384 # same as for AddTrigger
|
||||
eAliasOneShot = 32768 # one shot - delete after firing
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Flags for AddTimer
|
||||
# ----------------------------------------------------------
|
||||
|
||||
# eEnabled = 1 # same as for AddTrigger
|
||||
eAtTime = 2 # if not set, time is "every"
|
||||
eOneShot = 4 # if set, timer only fires once
|
||||
eTimerSpeedWalk = 8 # timer does a speed walk when it fires
|
||||
eTimerNote = 16 # timer does a world.note when it fires
|
||||
eActiveWhenClosed = 32 # timer fires even when world is disconnected
|
||||
# eReplace = 1024 # same as for AddTrigger
|
||||
# eTemporary = 16384 # same as for AddTrigger
|
||||
|
||||
]]>
|
||||
</script>
|
||||
159
cosmic rage/worlds/plugins/constants.vbs
Normal file
159
cosmic rage/worlds/plugins/constants.vbs
Normal file
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- Constants For use in VB scripting -->
|
||||
|
||||
<!DOCTYPE script>
|
||||
<script>
|
||||
<![CDATA[
|
||||
option explicit
|
||||
|
||||
' ----------------------------------------------------------
|
||||
' Error codes returned by various functions
|
||||
' ----------------------------------------------------------
|
||||
|
||||
const eOK = 0 ' No error
|
||||
const eWorldOpen = 30001 ' The world is already open
|
||||
const eWorldClosed = 30002 ' The world is closed, this action cannot be performed
|
||||
const eNoNameSpecified = 30003 ' No name has been specified where one is required
|
||||
const eCannotPlaySound = 30004 ' The sound file could not be played
|
||||
const eTriggerNotFound = 30005 ' The specified trigger name does not exist
|
||||
const eTriggerAlreadyExists = 30006 ' Attempt to add a trigger that already exists
|
||||
const eTriggerCannotBeEmpty = 30007 ' The trigger "match" string cannot be empty
|
||||
const eInvalidObjectLabel = 30008 ' The name of this object is invalid
|
||||
const eScriptNameNotLocated = 30009 ' Script name is not in the script file
|
||||
const eAliasNotFound = 30010 ' The specified alias name does not exist
|
||||
const eAliasAlreadyExists = 30011 ' Attempt to add a alias that already exists
|
||||
const eAliasCannotBeEmpty = 30012 ' The alias "match" string cannot be empty
|
||||
const eCouldNotOpenFile = 30013 ' Unable to open requested file
|
||||
const eLogFileNotOpen = 30014 ' Log file was not open
|
||||
const eLogFileAlreadyOpen = 30015 ' Log file was already open
|
||||
const eLogFileBadWrite = 30016 ' Bad write to log file
|
||||
const eTimerNotFound = 30017 ' The specified timer name does not exist
|
||||
const eTimerAlreadyExists = 30018 ' Attempt to add a timer that already exists
|
||||
const eVariableNotFound = 30019 ' Attempt to delete a variable that does not exist
|
||||
const eCommandNotEmpty = 30020 ' Attempt to use SetCommand with a non-empty command window
|
||||
const eBadRegularExpression = 30021 ' Bad regular expression syntax
|
||||
const eTimeInvalid = 30022 ' Time given to AddTimer is invalid
|
||||
const eBadMapItem = 30023 ' Direction given to AddToMapper is invalid
|
||||
const eNoMapItems = 30024 ' No items in mapper
|
||||
const eUnknownOption = 30025 ' Option name not found
|
||||
const eOptionOutOfRange = 30026 ' New value for option is out of range
|
||||
const eTriggerSequenceOutOfRange = 30027 ' Trigger sequence value invalid
|
||||
const eTriggerSendToInvalid = 30028 ' Where to send trigger text to is invalid
|
||||
const eTriggerLabelNotSpecified = 30029 ' Trigger label not specified/invalid for 'send to variable'
|
||||
const ePluginFileNotFound = 30030 ' File name specified for plugin not found
|
||||
const eProblemsLoadingPlugin = 30031 ' There was a parsing or other problem loading the plugin
|
||||
const ePluginCannotSetOption = 30032 ' Plugin is not allowed to set this option
|
||||
const ePluginCannotGetOption = 30033 ' Plugin is not allowed to get this option
|
||||
const eNoSuchPlugin = 30034 ' Requested plugin is not installed
|
||||
const eNotAPlugin = 30035 ' Only a plugin can do this
|
||||
const eNoSuchRoutine = 30036 ' Plugin does not support that subroutine (subroutine not in script)
|
||||
const ePluginDoesNotSaveState = 30037 ' Plugin does not support saving state
|
||||
const ePluginCouldNotSaveState = 30037 ' Plugin could not save state (eg. no state directory)
|
||||
const ePluginDisabled = 30039 ' Plugin is currently disabled
|
||||
const eErrorCallingPluginRoutine = 30040 ' Could not call plugin routine
|
||||
const eCommandsNestedTooDeeply = 30041 ' Calls to "Execute" nested too deeply
|
||||
const eCannotCreateChatSocket = 30042 ' Unable to create socket for chat connection
|
||||
const eCannotLookupDomainName = 30043 ' Unable to do DNS (domain name) lookup for chat connection
|
||||
const eNoChatConnections = 30044 ' No chat connections open
|
||||
const eChatPersonNotFound = 30045 ' Requested chat person not connected
|
||||
const eBadParameter = 30046 ' General problem with a parameter to a script call
|
||||
const eChatAlreadyListening = 30047 ' Already listening for incoming chats
|
||||
const eChatIDNotFound = 30048 ' Chat session with that ID not found
|
||||
const eChatAlreadyConnected = 30049 ' Already connected to that server/port
|
||||
const eClipboardEmpty = 30050 ' Cannot get (text from the) clipboard
|
||||
const eFileNotFound = 30051 ' Cannot open the specified file
|
||||
const eAlreadyTransferringFile = 30052 ' Already transferring a file
|
||||
const eNotTransferringFile = 30053 ' Not transferring a file
|
||||
const eNoSuchCommand = 30054 ' There is not a command of that name
|
||||
const eArrayAlreadyExists = 30055 ' Chat session with that ID not found
|
||||
const eArrayDoesNotExist = 30056 ' Already connected to that server/port
|
||||
const eArrayNotEvenNumberOfValues = 30057 ' Cannot get (text from the) clipboard
|
||||
const eImportedWithDuplicates = 30058 ' Cannot open the specified file
|
||||
const eBadDelimiter = 30059 ' Already transferring a file
|
||||
const eSetReplacingExistingValue = 30060 ' Not transferring a file
|
||||
const eKeyDoesNotExist = 30061 ' There is not a command of that name
|
||||
const eCannotImport = 30062 ' There is not a command of that name
|
||||
const eItemInUse = 30063 ' Cannot delete trigger/alias/timer because it is executing a script
|
||||
const eSpellCheckNotActive = 30064 ' Spell checker is not active
|
||||
const eCannotAddFont = 30065 ' Cannot create requested font
|
||||
const ePenStyleNotValid = 30066 ' Invalid settings for pen parameter
|
||||
const eUnableToLoadImage = 30067 ' Bitmap image could not be loaded
|
||||
const eImageNotInstalled = 30068 ' Image has not been loaded into window
|
||||
const eInvalidNumberOfPoints = 30069 ' Number of points supplied is incorrect
|
||||
const eInvalidPoint = 30070 ' Point is not numeric
|
||||
const eHotspotPluginChanged = 30071 ' Hotspot processing must all be in same plugin
|
||||
const eHotspotNotInstalled = 30072 ' Hotspot has not been defined for this window
|
||||
const eNoSuchWindow = 30073 ' Requested miniwindow does not exist
|
||||
const eBrushStyleNotValid = 30074 ' Invalid settings for brush parameter
|
||||
|
||||
|
||||
' ----------------------------------------------------------
|
||||
' Flags for AddTrigger
|
||||
' ----------------------------------------------------------
|
||||
|
||||
const eEnabled = 1 ' enable trigger
|
||||
const eOmitFromLog = 2 ' omit from log file
|
||||
const eOmitFromOutput = 4 ' omit trigger from output
|
||||
const eKeepEvaluating = 8 ' keep evaluating
|
||||
const eIgnoreCase = 16 ' ignore case when matching
|
||||
const eTriggerRegularExpression = 32 ' trigger uses regular expression
|
||||
const eExpandVariables = 512 ' expand variables like @direction
|
||||
const eReplace = 1024 ' replace existing trigger of same name
|
||||
const eLowercaseWildcard = 2048 ' wildcards forced to lower-case
|
||||
const eTemporary = 16384 ' temporary - do not save to world file
|
||||
const eTriggerOneShot = 32768 ' one shot - delete after firing
|
||||
|
||||
' ----------------------------------------------------------
|
||||
' Colours for AddTrigger
|
||||
' ----------------------------------------------------------
|
||||
|
||||
const NOCHANGE = -1
|
||||
const custom1 = 0
|
||||
const custom2 = 1
|
||||
const custom3 = 2
|
||||
const custom4 = 3
|
||||
const custom5 = 4
|
||||
const custom6 = 5
|
||||
const custom7 = 6
|
||||
const custom8 = 7
|
||||
const custom9 = 8
|
||||
const custom10 = 9
|
||||
const custom11 = 10
|
||||
const custom12 = 11
|
||||
const custom13 = 12
|
||||
const custom14 = 13
|
||||
const custom15 = 14
|
||||
const custom16 = 15
|
||||
const custom_other = 16 ' triggers only
|
||||
|
||||
' ----------------------------------------------------------
|
||||
' Flags for AddAlias
|
||||
' ----------------------------------------------------------
|
||||
|
||||
' const eEnabled = 1 ' same as for AddTrigger
|
||||
const eIgnoreAliasCase = 32 ' ignore case when matching
|
||||
const eOmitFromLogFile = 64 ' omit this alias from the log file
|
||||
const eAliasRegularExpression = 128 ' alias is regular expressions
|
||||
' const eExpandVariables = 512 ' same as for AddTrigger
|
||||
' const eReplace = 1024 ' same as for AddTrigger
|
||||
const eAliasSpeedWalk = 2048 ' interpret send string as a speed walk string
|
||||
const eAliasQueue = 4096 ' queue this alias for sending at the speedwalking delay interval
|
||||
const eAliasMenu = 8192 ' this alias appears on the alias menu
|
||||
' const eTemporary = 16384 ' same as for AddTrigger
|
||||
const eAliasOneShot = 32768 ' one shot - delete after firing
|
||||
|
||||
' ----------------------------------------------------------
|
||||
' Flags for AddTimer
|
||||
' ----------------------------------------------------------
|
||||
|
||||
' const eEnabled = 1 ' same as for AddTrigger
|
||||
const eAtTime = 2 ' if not set, time is "every"
|
||||
const eOneShot = 4 ' if set, timer only fires once
|
||||
const eTimerSpeedWalk = 8 ' timer does a speed walk when it fires
|
||||
const eTimerNote = 16 ' timer does a world.note when it fires
|
||||
const eActiveWhenClosed = 32 ' timer fires even when world is disconnected
|
||||
' const eReplace = 1024 ' same as for AddTrigger
|
||||
' const eTemporary = 16384 ' same as for AddTrigger
|
||||
]]>
|
||||
</script>
|
||||
247
cosmic rage/worlds/plugins/direction_plugin.xml
Normal file
247
cosmic rage/worlds/plugins/direction_plugin.xml
Normal file
@@ -0,0 +1,247 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Thursday, May 06, 2010, 9:44 AM -->
|
||||
<!-- MuClient version 4.51 -->
|
||||
|
||||
<!-- Plugin "direction_plugin" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="direction_plugin"
|
||||
author="Oriol Gomez"
|
||||
id="2f99725c36e543654b5e15fc"
|
||||
language="Lua"
|
||||
purpose="alt+letters keypad and mapper"
|
||||
save_state="y"
|
||||
date_written="2010-05-06 09:42:28"
|
||||
requires="3.51"
|
||||
version="1.0"
|
||||
>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
<include name="constants.lua"/>
|
||||
<aliases>
|
||||
<alias
|
||||
match="u"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>Execute("tts_stop")
|
||||
if (map==1) then
|
||||
AppendToNotepad("map", "u;")
|
||||
end
|
||||
lastdir="up"
|
||||
if (stealth==1) then
|
||||
Send("sneak u")
|
||||
return
|
||||
end
|
||||
|
||||
Send("u")</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="s"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>Execute("tts_stop")
|
||||
if (map==1) then
|
||||
AppendToNotepad("map", "s;")
|
||||
end
|
||||
lastdir="south"
|
||||
if (stealth==1) then
|
||||
Send("sneak s")
|
||||
return
|
||||
end
|
||||
|
||||
Send("s")</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="d"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>Execute("tts_stop")
|
||||
if (map==1) then
|
||||
AppendToNotepad("map", "d;")
|
||||
end
|
||||
lastdir="down"
|
||||
if (stealth==1) then
|
||||
Send("sneak d")
|
||||
return
|
||||
end
|
||||
Send("d")</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="e"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>Execute("tts_stop")
|
||||
if (map==1) then
|
||||
AppendToNotepad("map", 'e;')
|
||||
end
|
||||
lastdir="east"
|
||||
if (stealth==1) then
|
||||
Send("sneak e")
|
||||
return
|
||||
end
|
||||
Send("e")</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="nw"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>Execute("tts_stop")
|
||||
if (map==1) then
|
||||
AppendToNotepad("map", "nw;")
|
||||
end
|
||||
lastdir="northwest"
|
||||
if (stealth==1) then
|
||||
Send("sneak nw")
|
||||
return
|
||||
end
|
||||
|
||||
Send("nw")</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="n"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>Execute("tts_stop")
|
||||
if (map==1) then
|
||||
AppendToNotepad("map", "n;")
|
||||
end
|
||||
lastdir="north"
|
||||
if (stealth==1) then
|
||||
Send("sneak n")
|
||||
return
|
||||
end
|
||||
Send("n")</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="w"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>Execute("tts_stop")
|
||||
if (map==1) then
|
||||
AppendToNotepad("map", "w;")
|
||||
end
|
||||
lastdir="west"
|
||||
|
||||
if (stealth==1) then
|
||||
Send("sneak w")
|
||||
return
|
||||
end
|
||||
Send("w")</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="se"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>Execute("tts_stop")
|
||||
if (map==1) then
|
||||
AppendToNotepad("map", "se;")
|
||||
end
|
||||
lastdir="southeast"
|
||||
if (stealth==1) then
|
||||
Send("sneak se")
|
||||
return
|
||||
end
|
||||
|
||||
Send("se")</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="sw"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>Execute("tts_stop")
|
||||
if (map==1) then
|
||||
AppendToNotepad("map", "sw;")
|
||||
end
|
||||
lastdir="southwest"
|
||||
|
||||
if (stealth==1) then
|
||||
Send("sneak sw")
|
||||
return
|
||||
end
|
||||
|
||||
Send("sw")</send>
|
||||
</alias>
|
||||
<alias
|
||||
match="mapping"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>
|
||||
if (map==0) then
|
||||
map=1
|
||||
Note("map on.")
|
||||
Sound(GetInfo(67).."/sounds/luaaudio/on.ogg")
|
||||
else
|
||||
map=0
|
||||
Note("map mode off.")
|
||||
Sound(GetInfo(67).."/sounds/luaaudio/off.ogg")
|
||||
end
|
||||
</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="ne"
|
||||
enabled="y"
|
||||
send_to="14"
|
||||
sequence="100"
|
||||
>
|
||||
<send>Execute("tts_stop")
|
||||
if (map==1) then
|
||||
AppendToNotepad("map", "ne;")
|
||||
end
|
||||
lastdir="northeast"
|
||||
if (stealth==1) then
|
||||
Send("sneak ne")
|
||||
return
|
||||
end
|
||||
Send("ne")</send>
|
||||
</alias>
|
||||
</aliases>
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Accelerator("alt+i", "n")
|
||||
Accelerator("alt+k", "s")
|
||||
Accelerator("alt+l", "e")
|
||||
Accelerator("alt+j", "w")
|
||||
Accelerator("alt+o", "ne")
|
||||
Accelerator("alt+u", "nw")
|
||||
Accelerator("alt+,", "se")
|
||||
Accelerator("alt+n", "sw")
|
||||
Accelerator("alt+r", "u")
|
||||
Accelerator("alt+f", "d")
|
||||
|
||||
Accelerator("alt+shift+m", "mapping")
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
</muclient>
|
||||
250
cosmic rage/worlds/plugins/gag.xml
Normal file
250
cosmic rage/worlds/plugins/gag.xml
Normal file
@@ -0,0 +1,250 @@
|
||||
<?xml version="1.0" encoding="US-ASCII"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Friday, March 19, 2004, 12:02 PM -->
|
||||
<!-- MuClient version 3.46 -->
|
||||
|
||||
<!-- Plugin "Gag" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Gag"
|
||||
author="Nick Gammon"
|
||||
id="36e75e5c438fcd6f6c9f994d"
|
||||
language="VBscript"
|
||||
purpose="Gags annoying players"
|
||||
save_state="y"
|
||||
date_written="2004-03-19 11:58:21"
|
||||
requires="3.46"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
This plugin will automatically customise a trigger to gag players who are annoying you.
|
||||
|
||||
You need to specify the regular expression that matches the text to be gagged, where "!!" represents the list of players whose names are to be gagged.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
gagsetmatch (regular expression)
|
||||
|
||||
eg. gagsetmatch (!!) (says|whispers|tells you).*$
|
||||
|
||||
gag (player) <-- gags a player
|
||||
|
||||
eg. gag turkey
|
||||
|
||||
ungag (player) <-- ungags a player
|
||||
|
||||
eg. ungag turkey
|
||||
|
||||
gagshow <-- shows list of gagged players
|
||||
|
||||
gaginfo <-- shows information about the gag plugin
|
||||
|
||||
gaghelp <-- show this information
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
<include name="constants.vbs"/>
|
||||
|
||||
<!-- Triggers -->
|
||||
|
||||
<triggers>
|
||||
<trigger
|
||||
custom_colour="1"
|
||||
enabled="n"
|
||||
match="will be replaced when you gag someone"
|
||||
name="gags"
|
||||
omit_from_output="y"
|
||||
regexp="y"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnUnGag"
|
||||
match="ungag *"
|
||||
enabled="y"
|
||||
echo_alias="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="OnGag"
|
||||
match="gag *"
|
||||
enabled="y"
|
||||
echo_alias="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="OnShowGags"
|
||||
match="gagshow"
|
||||
enabled="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="OnGagInfo"
|
||||
match="gaginfo"
|
||||
enabled="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="OnGagSetMatch"
|
||||
match="gagsetmatch *"
|
||||
enabled="y"
|
||||
sequence="100"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Variables -->
|
||||
|
||||
<variables>
|
||||
<variable name="regexp">(!!) (says|tells you).*$</variable>
|
||||
</variables>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Sub OnPluginInstall
|
||||
|
||||
ArrayCreate "gags"
|
||||
ArrayImport "gags", GetVariable ("gags"), "|"
|
||||
'
|
||||
' Set up trigger after install
|
||||
'
|
||||
Call MakeTrigger
|
||||
|
||||
ColourNote "white", "maroon", "Gag plugin installed."
|
||||
OnShowGags "","",""
|
||||
|
||||
End Sub
|
||||
|
||||
Sub OnGag (name, line, wildcards)
|
||||
dim who
|
||||
|
||||
who = Trim (Lcase (wildcards (1)))
|
||||
|
||||
If ArrayKeyExists ("gags", who) Then
|
||||
ColourNote "white", "red", who & " is already gagged."
|
||||
Else
|
||||
ArraySet "gags", who, "" ' add to array of gagged players
|
||||
ColourNote "white", "blue", who & " added to list of gagged players."
|
||||
Call MakeTrigger
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Sub OnUnGag (name, line, wildcards)
|
||||
|
||||
dim who
|
||||
|
||||
who = Trim (Lcase (wildcards (1)))
|
||||
|
||||
If Not ArrayKeyExists ("gags", who) Then
|
||||
ColourNote "white", "red", who & " is not gagged."
|
||||
Else
|
||||
ArrayDeleteKey "gags", who ' remove from array of gagged players
|
||||
ColourNote "white", "blue", who & " removed from list of gagged players."
|
||||
Call MakeTrigger
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Sub MakeTrigger
|
||||
|
||||
'
|
||||
' remember gag list in variable for plugin state save
|
||||
'
|
||||
SetVariable "gags", ArrayExport ("gags", "|")
|
||||
'
|
||||
' enable/disable trigger depending on whether we have gagged players
|
||||
'
|
||||
EnableTrigger "gags", ArraySize ("gags") <> 0
|
||||
'
|
||||
' change the trigger match text - replace !! by the gag list
|
||||
'
|
||||
If SetTriggerOption ("gags", "match", _
|
||||
Replace (GetVariable ("regexp"), "!!", _
|
||||
ArrayExportKeys ("gags", "|"))) = eBadRegularExpression Then
|
||||
ColourNote "white", "red", _
|
||||
"Could not set trigger - check regular expression syntax"
|
||||
ColourNote "white", "red", "Regular expression is currently: " _
|
||||
& GetVariable ("regexp")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Sub OnShowGags (name, line, wildcards)
|
||||
dim gaglist
|
||||
|
||||
If ArraySize ("gags") = 0 Then
|
||||
ColourNote "white", "blue", "No gagged players."
|
||||
Else
|
||||
gaglist = Replace (ArrayExportKeys ("gags", ","), ",", ", ")
|
||||
ColourNote "white", "maroon", "You have gagged: " & gaglist
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Sub OnGagSetMatch (name, line, wildcards)
|
||||
|
||||
SetVariable "regexp", wildcards (1)
|
||||
Call MakeTrigger
|
||||
|
||||
End Sub
|
||||
|
||||
Sub OnGagInfo (name, line, wildcards)
|
||||
|
||||
ColourNote "white", "blue", "Number of gagged players = " & _
|
||||
ArraySize ("gags")
|
||||
ColourNote "white", "blue", "Gagging regular expression = " & _
|
||||
GetVariable ("regexp")
|
||||
ColourNote "white", "blue", "(""!!"" will be replaced by gagged player names)"
|
||||
ColourNote "white", "blue", "Number of times gag trigger matched = " & _
|
||||
GetTriggerInfo ("gags", 21)
|
||||
|
||||
End Sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="gaghelp"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Sub OnHelp (sName, sLine, wildcards)
|
||||
world.Note world.GetPluginInfo (world.GetPluginID, 3)
|
||||
End Sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
174
cosmic rage/worlds/plugins/health_bar.xml
Normal file
174
cosmic rage/worlds/plugins/health_bar.xml
Normal file
@@ -0,0 +1,174 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient [
|
||||
<!ENTITY trigger_match
|
||||
"^\<(\d+)\/(\d+) hp (\d+)\/(\d+) m (\d+)\/(\d+) mv\>(.*?)$" >
|
||||
]>
|
||||
|
||||
<!-- Saved on Monday, April 28, 2003, 9:53 AM -->
|
||||
<!-- MuClient version 3.41 -->
|
||||
|
||||
<!-- Plugin "Health_Bar" generated by Plugin Wizard -->
|
||||
|
||||
<!--
|
||||
You will probably need to customise the trigger to match your MUD.
|
||||
|
||||
See ENTITY line near top of file. The above trigger will match on:
|
||||
|
||||
<54/1000 hp 90/100 m 600/750 mv>
|
||||
|
||||
A simpler trigger would be:
|
||||
|
||||
<*/*hp */*m */*mv>
|
||||
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Health_Bar"
|
||||
author="Nick Gammon"
|
||||
id="a2af5216d68563401888e01e"
|
||||
language="VBscript"
|
||||
purpose="Shows HP, Mana, Movement points in a colour bar"
|
||||
date_written="2003-04-28 09:50:05"
|
||||
date_modified="2003-04-28 12:40:05"
|
||||
requires="3.29"
|
||||
version="1.1"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Install this plugin to show an info bar with HP, Mana,
|
||||
and Movement points shown as a bar (between 0 and 10 blocks).
|
||||
|
||||
You need your prompt line to display the appropriate information,
|
||||
naturally. I used this in SMAUG:
|
||||
|
||||
prompt <%h/%H hp %m/%M m %v/%V mv>
|
||||
fprompt <%h/%H hp %m/%M m %v/%V mv>
|
||||
|
||||
"prompt" sets the normal prompt, "fprompt" sets the fight prompt.
|
||||
|
||||
Customise the plugin if you want to match a different sort of prompt line.
|
||||
|
||||
To see this message, type: Health_Bar:help
|
||||
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Triggers -->
|
||||
|
||||
<triggers>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="&trigger_match;"
|
||||
name="InfoBar"
|
||||
regexp="y"
|
||||
script="DoPrompt"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
sub DoGauge (sPrompt, iCurrent, iMax, sGoodColour, sBadColour)
|
||||
dim pc, count
|
||||
|
||||
'
|
||||
' Do prompt in black Arial
|
||||
'
|
||||
InfoColour "black"
|
||||
InfoFont "Arial", 10, 0
|
||||
Info sPrompt
|
||||
|
||||
'
|
||||
' Use Webdings for gauge (black square)
|
||||
'
|
||||
|
||||
InfoFont "Webdings", 10, 0
|
||||
|
||||
pc = CInt ((CInt (iCurrent) / CInt (iMax)) * 10)
|
||||
|
||||
'
|
||||
' Below 20% warn by using different colour
|
||||
'
|
||||
|
||||
if pc < 2 then
|
||||
InfoColour sBadColour
|
||||
else
|
||||
InfoColour sGoodColour
|
||||
end if
|
||||
|
||||
'
|
||||
' Draw active part of gauge
|
||||
'
|
||||
for count = 0 to pc
|
||||
Info "g"
|
||||
next
|
||||
|
||||
'
|
||||
' Draw rest of gauge in grey (ie. unfilled bit)
|
||||
'
|
||||
|
||||
InfoColour "dimgray"
|
||||
while count <= 10
|
||||
count = count + 1
|
||||
Info "g"
|
||||
wend
|
||||
|
||||
end sub
|
||||
|
||||
sub DoPrompt (sName, sLine, wildcards)
|
||||
|
||||
InfoClear
|
||||
|
||||
'
|
||||
' World name
|
||||
'
|
||||
|
||||
InfoFont "Arial", 12, 1 ' 12 point Arial *bold*
|
||||
InfoColour "purple"
|
||||
Info GetInfo (2) ' world name
|
||||
|
||||
DoGauge " HP: ", wildcards (1), wildcards (2), "darkgreen", "maroon"
|
||||
DoGauge " Mana: ", wildcards (3), wildcards (4), "mediumblue", "mediumblue"
|
||||
DoGauge " Move: ", wildcards (5), wildcards (6), "gold", "gold"
|
||||
|
||||
end sub
|
||||
|
||||
'
|
||||
' Do this once
|
||||
'
|
||||
ShowInfoBar vbTrue
|
||||
|
||||
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="Health_Bar:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Sub OnHelp (sName, sLine, wildcards)
|
||||
world.Note world.GetPluginInfo (world.GetPluginID, 3)
|
||||
End Sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
165
cosmic rage/worlds/plugins/idle_message.xml
Normal file
165
cosmic rage/worlds/plugins/idle_message.xml
Normal file
@@ -0,0 +1,165 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Thursday, August 29, 2002, 8:49 AM -->
|
||||
<!-- MuClient version 3.26 -->
|
||||
|
||||
<!-- Plugin "Idle_Message" generated by Plugin Wizard -->
|
||||
|
||||
<!--
|
||||
To customise the script so that the message is shown repeatedly (eg. every 10 seconds), then you need to remove the "one-shot" flag.
|
||||
|
||||
ie.
|
||||
|
||||
Change the line below:
|
||||
|
||||
world.addtimer "idletimer", hours, minutes, seconds, what, 1029, ""
|
||||
|
||||
to
|
||||
|
||||
world.addtimer "idletimer", hours, minutes, seconds, what, 1025, ""
|
||||
|
||||
|
||||
(that is, change 1029 to 1025).
|
||||
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Idle_Message"
|
||||
author="Nick Gammon"
|
||||
id="4ea415972d64ffe602170f89"
|
||||
language="VBscript"
|
||||
purpose="Sends a message when you are idle"
|
||||
date_written="2002-08-29 08:44:25"
|
||||
requires="3.25"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Sends a message to the MUD (once) after you are idle for a nominated amount of time.
|
||||
|
||||
You can specify the time as hours, minutes, or seconds, like this:
|
||||
|
||||
OnIdle 30 say Gone AFK <-- after 30 seconds
|
||||
OnIdle 1 20 say Gone AFK <-- after 1 minute 20 seconds
|
||||
OnIdle 1 10 20 say Gone AFK <-- after 1 hour, 10 minutes, 20 seconds
|
||||
|
||||
OnIdle <-- deletes the idle message
|
||||
|
||||
Idle_Message:help <-- this help
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnIdleTime"
|
||||
match="^OnIdle( [[:digit:]]{1,2})?( [[:digit:]]{1,2})?( [[:digit:]]{1,2}) (.*?)$"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="DeleteIdleMessage"
|
||||
match="OnIdle"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Function OnPluginCommand (sText)
|
||||
world.resettimer "idletimer" ' not idle right now
|
||||
OnPluginCommand = vbTrue ' process it
|
||||
End Function
|
||||
|
||||
sub DeleteIdleMessage (name, output, wildcards)
|
||||
if world.deletetimer ("idletimer") = 0 then
|
||||
world.note "Idle message deleted"
|
||||
else
|
||||
world.note "No idle message was set up"
|
||||
end if
|
||||
end sub
|
||||
|
||||
'
|
||||
' sub to add an "idle" timer
|
||||
' the timer is reset when the player types something
|
||||
'
|
||||
sub OnIdleTime (name, output, wildcards)
|
||||
dim hours, minutes, seconds, what
|
||||
|
||||
hours = trim (wildcards (1))
|
||||
minutes = trim (wildcards (2))
|
||||
seconds = trim (wildcards (3))
|
||||
what = wildcards (4)
|
||||
|
||||
if hours = "" then hours = 0
|
||||
if minutes = "" then minutes = 0
|
||||
if seconds = "" then seconds = 0
|
||||
|
||||
if hours > 23 then
|
||||
world.note "Idle hours cannot exceed 23, you entered " & hours
|
||||
exit sub
|
||||
end if
|
||||
|
||||
if minutes > 59 then
|
||||
world.note "Idle minutes cannot exceed 59, you entered " & minutes
|
||||
exit sub
|
||||
end if
|
||||
|
||||
if seconds > 59 then
|
||||
world.note "Idle seconds cannot exceed 59, you entered " & seconds
|
||||
exit sub
|
||||
end if
|
||||
|
||||
if (hours = 0) and (minutes = 0) and (seconds = 0) then
|
||||
world.note "Idle time cannot be zero"
|
||||
exit sub
|
||||
end if
|
||||
|
||||
' flags:
|
||||
' 1 = enabled
|
||||
' 4 = one-shot
|
||||
' 1024 = replace existing
|
||||
|
||||
world.addtimer "idletimer", hours, minutes, seconds, what, 1029, ""
|
||||
|
||||
world.note "When we are idle for " _
|
||||
& hours & "h " _
|
||||
& minutes & "m " _
|
||||
& seconds & "s " _
|
||||
& "we will send '" & what & "'"
|
||||
|
||||
end sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="Idle_Message:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Sub OnHelp (sName, sLine, wildcards)
|
||||
World.Note World.GetPluginInfo (World.GetPluginID, 3)
|
||||
End Sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
167
cosmic rage/worlds/plugins/msp.xml
Normal file
167
cosmic rage/worlds/plugins/msp.xml
Normal file
@@ -0,0 +1,167 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Friday, August 09, 2002, 1:00 PM -->
|
||||
<!-- MuClient version 3.25 -->
|
||||
|
||||
<!-- Plugin "msp" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="msp"
|
||||
author="Nick Gammon"
|
||||
id="7da63d78d9f91bebb5285127"
|
||||
language="VBscript"
|
||||
purpose="Emulates MSP (MUD Sound Protocol)"
|
||||
save_state="y"
|
||||
date_written="2002-08-09 12:58:11"
|
||||
requires="3.24"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Type: "msp:help" to see this help.
|
||||
|
||||
See: http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=783 for a more complete description.
|
||||
|
||||
You will need to get the sound files manually (ie. from the MUD) and install them before using this. The plugin is configured to look for them in c:\mushclient\msp, but you can change that by typing:
|
||||
|
||||
set_msp_path new_path
|
||||
|
||||
eg.
|
||||
|
||||
set_msp_path d:\muds\mushclient\msp
|
||||
|
||||
You may need to enable MSP manually, as this plugin does not do telnet negotiation. eg. On Dawn Of Time MUDs, type:
|
||||
|
||||
msp on
|
||||
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
<include name="constants.vbs"/>
|
||||
|
||||
<!-- Triggers -->
|
||||
|
||||
<triggers>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^(.*)\!\!SOUND\(([A-Za-z0-9./]+).*\)(.*)$"
|
||||
name="sound"
|
||||
omit_from_output="y"
|
||||
regexp="y"
|
||||
script="OnSound"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="On_set_MSP_path"
|
||||
match="set_msp_path *"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Variables -->
|
||||
|
||||
<variables>
|
||||
<variable name="msp_path">c:\mushclient\msp\</variable>
|
||||
</variables>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
'
|
||||
' Trigger script to simulate MSP (MUD Sound Protocol)
|
||||
'
|
||||
|
||||
sub OnSound (strName, strLine, aryWildcards)
|
||||
dim sBefore, sSound, sAfter, iColourFore, iColourBack
|
||||
|
||||
' extract text from wildcards
|
||||
' wildcard 1 is the text before the sound
|
||||
' wildcard 2 is the sound file name
|
||||
' wildcard 3 is the text after the sound
|
||||
|
||||
sBefore = aryWildcards (1) ' what arrived before the !!SOUND directive
|
||||
sSound = replace (aryWildcards (2), "/", "\") ' sound file to play
|
||||
sAfter = aryWildcards (3) ' what arrived after the !!SOUND directive
|
||||
|
||||
' play sound - directory in variable
|
||||
|
||||
world.Sound (world.getvariable ("msp_path") & sSound)
|
||||
|
||||
' remember current world.note colours
|
||||
|
||||
iColourFore = world.notecolourfore
|
||||
iColourBack = world.notecolourback
|
||||
|
||||
' set note colour to default text colour
|
||||
|
||||
world.NoteColourRGB world.NormalColour (8), world.NormalColour (1)
|
||||
|
||||
' display the text surrounding the sound
|
||||
|
||||
world.note sBefore & sAfter
|
||||
|
||||
' set note colour back to what it was
|
||||
|
||||
world.NoteColourRGB iColourFore, iColourBack
|
||||
|
||||
end sub
|
||||
|
||||
sub On_set_MSP_path (strName, strLine, aryWildcards)
|
||||
|
||||
dim sPath
|
||||
|
||||
sPath = aryWildcards (1)
|
||||
|
||||
'
|
||||
' ensure trailing backslash
|
||||
'
|
||||
|
||||
if right (sPath, 1) <> "\" then
|
||||
sPath = sPath & "\"
|
||||
end if
|
||||
|
||||
world.setvariable "msp_path", sPath
|
||||
world.note "MSP sound files will be obtained from " & _
|
||||
sPath
|
||||
end sub
|
||||
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="msp:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Sub OnHelp (sName, sLine, wildcards)
|
||||
World.Note World.GetPluginInfo (World.GetPluginID, 3)
|
||||
End Sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
119
cosmic rage/worlds/plugins/multiple_send.xml
Normal file
119
cosmic rage/worlds/plugins/multiple_send.xml
Normal file
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Wednesday, August 28, 2002, 10:48 AM -->
|
||||
<!-- MuClient version 3.26 -->
|
||||
|
||||
<!-- Plugin "Multiple_Send" generated by Plugin Wizard -->
|
||||
|
||||
<!--
|
||||
See forum post
|
||||
|
||||
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=1403
|
||||
|
||||
for more details about this script.
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Multiple_Send"
|
||||
author="Nick Gammon"
|
||||
id="33e3ed2a4a9751329b048b5c"
|
||||
language="VBscript"
|
||||
purpose="Sends commands to multiple worlds"
|
||||
date_written="2002-08-28 10:44:11"
|
||||
date_modified="2003-04-21 08:37:30"
|
||||
requires="3.39"
|
||||
version="1.1"
|
||||
>
|
||||
<!--
|
||||
Version 1 - initial release.
|
||||
Version 1.1 - changed to use WorldGetIDList so it would still work
|
||||
if you had multiple worlds of the same name.
|
||||
-->
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
You can send a command to one or more worlds, or all worlds, like this:
|
||||
|
||||
#all say Goodnight All <-- sends to all open worlds
|
||||
#1 say Hi everyone <-- sends to world #1
|
||||
#123 say Follow Me <-- sends to worlds #1, #2 and #3
|
||||
|
||||
Multiple_Send:help <-- this help screen
|
||||
|
||||
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="SendToWlds"
|
||||
match="#* *"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
'
|
||||
' based on a script by Shadowfyr (with minor corrections)
|
||||
'
|
||||
|
||||
sub SendToWlds(name, output, wildcards)
|
||||
dim z, wrld
|
||||
|
||||
select case wildcards(1)
|
||||
case "all"
|
||||
for each wrld in world.getworldIDlist
|
||||
set sndworld = world.getworldbyid(wrld)
|
||||
sndworld.send wildcards(2)
|
||||
next
|
||||
case else
|
||||
if isnumeric(wildcards(1)) then
|
||||
count = 1
|
||||
for each wrld in world.getworldIDlist
|
||||
if instr (wildcards (1), cstr (count)) and count < 10 then
|
||||
set sndworld = world.getworldbyid(wrld)
|
||||
sndworld.send wildcards(2)
|
||||
end if
|
||||
count = count + 1
|
||||
next
|
||||
else
|
||||
world.note "Error! Unable to determine world to send to."
|
||||
end if
|
||||
end select
|
||||
end sub
|
||||
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="Multiple_Send:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Sub OnHelp (sName, sLine, wildcards)
|
||||
World.Note World.GetPluginInfo (World.GetPluginID, 3)
|
||||
End Sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
205
cosmic rage/worlds/plugins/mush_teleport.xml
Normal file
205
cosmic rage/worlds/plugins/mush_teleport.xml
Normal file
@@ -0,0 +1,205 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Sunday, September 22, 2002, 1:49 PM -->
|
||||
<!-- MuClient version 3.26 -->
|
||||
|
||||
<!-- Plugin "MUSH_teleport" generated by Plugin Wizard -->
|
||||
|
||||
<!--
|
||||
If your MUD uses a different system of teleporting (eg. goto vnum) change the line that does a '@teleport dbref' to 'goto vnum'
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="MUSH_teleport"
|
||||
author="Nick Gammon"
|
||||
id="f210c046e780c0d769eaf0fa"
|
||||
language="VBscript"
|
||||
purpose="Lets you teleport to a list of rooms that you can set up"
|
||||
save_state="y"
|
||||
date_written="2002-09-22 13:43:36"
|
||||
requires="3.25"
|
||||
version="1.2"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
This lets you maintain a list of destinations of interest to teleport to and go to them by name. This is intended for MUSHes but could be adapted for other MUD types.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
addtel name room_number
|
||||
|
||||
eg. addtel town_square 1862
|
||||
|
||||
teleport name
|
||||
|
||||
eg. teleport town_square
|
||||
|
||||
teleport <- on its own lists all available destinations
|
||||
|
||||
|
||||
MUSH_teleport:help <- this help screen
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
<include name="constants.vbs"/>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
name="AddTeleport"
|
||||
script="OnAddTeleport"
|
||||
match="^addtel( .*?)?( .*?)?$"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
name="Teleport"
|
||||
script="OnTeleport"
|
||||
match="^teleport(.*)$"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
' ---------------------------------------------------------
|
||||
' Teleport to a room.
|
||||
'
|
||||
' ---------------------------------------------------------
|
||||
sub OnTeleport (thename, theoutput, thewildcards)
|
||||
|
||||
dim sDestination
|
||||
dim sRoomList
|
||||
dim sHelp
|
||||
dim iSubscript
|
||||
dim iRoom
|
||||
|
||||
sDestination = Trim (thewildcards (1))
|
||||
|
||||
' if nothing entered echo possible destinations
|
||||
if sDestination = "" then
|
||||
world.note "-------- TELEPORT destinations ----------"
|
||||
|
||||
' find list of all variables
|
||||
sRoomList = world.GetVariableList
|
||||
|
||||
if not IsEmpty (sRoomList) then
|
||||
|
||||
' loop through each variable, and add to help if it starts with "teleport_"
|
||||
for iSubscript = lbound (sRoomList) to ubound (sRoomList)
|
||||
if Left (sRoomList (iSubscript), 9) = "teleport_" then
|
||||
if sHelp <> "" then
|
||||
sHelp = sHelp & ", "
|
||||
end if
|
||||
sHelp = sHelp & Mid (sRoomList (iSubscript), 10)
|
||||
end if ' variable starts with "teleport_"
|
||||
next ' loop through sRoomList
|
||||
|
||||
end if ' having at least one room
|
||||
|
||||
' if no destinations found, tell them
|
||||
if sHelp = "" then
|
||||
sHelp = "<no rooms in teleport list>"
|
||||
end if ' no destinations found in list
|
||||
world.note sHelp
|
||||
exit sub
|
||||
|
||||
end if ' no destination supplied
|
||||
|
||||
' get contents of the destination variable
|
||||
iRoom = world.GetVariable ("teleport_" & lCase (sDestination))
|
||||
|
||||
' if not found, or invalid name, that isn't in the list
|
||||
if IsEmpty (iRoom) or IsNull (iRoom) then
|
||||
world.note "******** Destination " & sDestination & " unknown *********"
|
||||
exit sub
|
||||
end if
|
||||
|
||||
world.note "------> Teleporting to " & sDestination
|
||||
world.send "@teleport #" & cstr (iRoom)
|
||||
|
||||
end sub
|
||||
|
||||
' ---------------------------------------------------------
|
||||
' Add a room to the teleport list
|
||||
'
|
||||
' eg. ADD_TELEPORT dungeon 1234
|
||||
'
|
||||
' ---------------------------------------------------------
|
||||
sub OnAddTeleport (thename, theoutput, thewildcards)
|
||||
|
||||
dim sDestination
|
||||
dim iRoom
|
||||
dim iStatus
|
||||
dim sCurrentLocation
|
||||
|
||||
' wildcard one is the destination
|
||||
sDestination = Trim (thewildcards (1))
|
||||
|
||||
' if nothing entered tell them command syntax
|
||||
if sDestination = "" then
|
||||
world.note "Syntax: addtel name dbref"
|
||||
world.note " eg. addtel LandingBay 4421"
|
||||
exit sub
|
||||
end if
|
||||
|
||||
' wildcard 2 is the room to go to
|
||||
iRoom= Trim (thewildcards (2))
|
||||
|
||||
if not IsNumeric (iRoom) then
|
||||
world.note "Room to teleport to must be a number, you entered: " & iRoom
|
||||
exit sub
|
||||
end if
|
||||
|
||||
' add room and destination location to variable list
|
||||
iStatus = world.SetVariable ("teleport_" & sDestination, iRoom)
|
||||
|
||||
if iStatus <> 0 then
|
||||
world.note "Room name must be alphabetic, you entered: " & sDestination
|
||||
exit sub
|
||||
end if
|
||||
|
||||
world.note "Teleport location " & sDestination & "(#" _
|
||||
& iRoom & ") added to teleport list"
|
||||
|
||||
end sub
|
||||
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="MUSH_teleport:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Sub OnHelp (sName, sLine, wildcards)
|
||||
World.Note World.GetPluginInfo (World.GetPluginID, 3)
|
||||
End Sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
441
cosmic rage/worlds/plugins/output_functions.xml
Normal file
441
cosmic rage/worlds/plugins/output_functions.xml
Normal file
@@ -0,0 +1,441 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Tuesday, April 06, 2010, 8:39 AM -->
|
||||
<!-- MuClient version 4.46 -->
|
||||
|
||||
<!-- Plugin "output_functions" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="output_functions"
|
||||
author="Weyoun"
|
||||
id="54846c23d8b15594e7eb4b8a"
|
||||
save_state="y"
|
||||
language="Lua"
|
||||
purpose="provides functions to help tts users."
|
||||
date_written="2010-04-06 08:37:40"
|
||||
requires="4.46"
|
||||
version="1.0"
|
||||
>
|
||||
|
||||
</plugin>
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
match="Line_Get *"
|
||||
enabled="y"
|
||||
script="LineGet"
|
||||
omit_from_output="y"
|
||||
omit_from_log="y"
|
||||
omit_from_command_history="y"
|
||||
send_to="12"
|
||||
sequence="100">
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="clearoutputbuffer"
|
||||
enabled="y"
|
||||
script="clearlines"
|
||||
omit_from_output="y"
|
||||
omit_from_log="y"
|
||||
omit_from_command_history="y"
|
||||
send_to="12"
|
||||
sequence="100">
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="clearoutputwindow"
|
||||
enabled="y"
|
||||
script="clearwindow"
|
||||
omit_from_output="y"
|
||||
omit_from_log="y"
|
||||
omit_from_command_history="y"
|
||||
send_to="12"
|
||||
sequence="100">
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="prevline"
|
||||
enabled="y"
|
||||
script="prev_line"
|
||||
omit_from_output="y"
|
||||
omit_from_log="y"
|
||||
omit_from_command_history="y"
|
||||
send_to="12"
|
||||
sequence="100">
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="toggleoutput"
|
||||
enabled="y"
|
||||
script="output_toggle"
|
||||
omit_from_output="y"
|
||||
omit_from_log="y"
|
||||
omit_from_command_history="y"
|
||||
send_to="12"
|
||||
sequence="100">
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="toggleinterrupt"
|
||||
enabled="y"
|
||||
script="interrupt_toggle"
|
||||
omit_from_output="y"
|
||||
omit_from_log="y"
|
||||
omit_from_command_history="y"
|
||||
send_to="12"
|
||||
sequence="100">
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="curline"
|
||||
enabled="y"
|
||||
script="cur_line"
|
||||
omit_from_output="y"
|
||||
omit_from_log="y"
|
||||
omit_from_command_history="y"
|
||||
send_to="12"
|
||||
sequence="100">
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="select *"
|
||||
enabled="y"
|
||||
omit_from_output="y"
|
||||
omit_from_log="y"
|
||||
omit_from_command_history="y"
|
||||
send_to="12"
|
||||
sequence="100">
|
||||
<send>
|
||||
if "%1" == "space" then
|
||||
selectscr(" ")
|
||||
else
|
||||
selectscr("\\r\\n")
|
||||
end
|
||||
</send>
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="nextline"
|
||||
enabled="y"
|
||||
script="next_line"
|
||||
omit_from_output="y"
|
||||
omit_from_log="y"
|
||||
omit_from_command_history="y"
|
||||
send_to="12"
|
||||
sequence="100">
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="whichline"
|
||||
enabled="y"
|
||||
script="which_line"
|
||||
omit_from_output="y"
|
||||
omit_from_log="y"
|
||||
omit_from_command_history="y"
|
||||
send_to="12"
|
||||
sequence="100">
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="topline"
|
||||
enabled="y"
|
||||
script="top_line"
|
||||
omit_from_output="y"
|
||||
omit_from_log="y"
|
||||
omit_from_command_history="y"
|
||||
send_to="12"
|
||||
sequence="100">
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="snap_shot"
|
||||
enabled="y"
|
||||
script="snapshot"
|
||||
omit_from_output="y"
|
||||
omit_from_log="y"
|
||||
omit_from_command_history="y"
|
||||
send_to="12"
|
||||
sequence="100">
|
||||
</alias>
|
||||
|
||||
<alias
|
||||
match="endline"
|
||||
enabled="y"
|
||||
script="end_line"
|
||||
omit_from_output="y"
|
||||
omit_from_log="y"
|
||||
omit_from_command_history="y"
|
||||
send_to="12"
|
||||
sequence="100">
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
<include name="constants.lua"/>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
for i = 1, 9 do
|
||||
Accelerator("ctrl + "..tostring(i), "Line_Get "..tostring(i))
|
||||
end
|
||||
Accelerator("ctrl +0", "Line_Get 10")
|
||||
Accelerator("ctrl + shift + c", "clearoutputbuffer")
|
||||
Accelerator("ctrl + alt + shift + c", "clearoutputwindow")
|
||||
Accelerator("ctrl+shift+o","nextline")
|
||||
Accelerator("ctrl+alt+enter","toggleinterrupt")
|
||||
Accelerator("ctrl+alt+o","toggleoutput")
|
||||
Accelerator("ctrl+shift+i","curline")
|
||||
Accelerator("ctrl+shift+space","select line")
|
||||
Accelerator("ctrl+shift+alt+space","select space")
|
||||
Accelerator("ctrl+shift+u","prevline")
|
||||
Accelerator("ctrl+shift+n","endline")
|
||||
Accelerator("ctrl+shift+y","topline")
|
||||
Accelerator("ctrl+shift+h","whichline")
|
||||
Accelerator("ctrl+shift+alt+s","snap_shot")
|
||||
|
||||
function selectscr(eol)
|
||||
buffercheck()
|
||||
if selecting ~= 1 then
|
||||
selecting = 1
|
||||
Execute("tts_interrupt selection start.")
|
||||
tselect = {}
|
||||
sline = cline
|
||||
else
|
||||
if eol == " " then
|
||||
Execute("tts_interrupt Selection coppied without line breaks.")
|
||||
else
|
||||
Execute("tts_interrupt Selection coppied.")
|
||||
end
|
||||
for i = sline, cline do
|
||||
table.insert(tselect, GetLineInfo(i, 1))
|
||||
end
|
||||
SetClipboard(table.concat(tselect, eol))
|
||||
selecting = 0
|
||||
tselect = {}
|
||||
end
|
||||
end
|
||||
|
||||
function output_toggle()
|
||||
if GetVariable("output") ~= "1" then
|
||||
SetVariable("output", "1")
|
||||
Note("output notepad on")
|
||||
else
|
||||
SetVariable("output", "0")
|
||||
Note("output notepad off")
|
||||
end
|
||||
end
|
||||
|
||||
function interrupt_toggle()
|
||||
if GetVariable("interrupt") ~= "1" then
|
||||
SetVariable("interrupt", "1")
|
||||
Note("interrupt on enter on")
|
||||
else
|
||||
SetVariable("interrupt", "0")
|
||||
Note("interrupt on enter off")
|
||||
end
|
||||
end
|
||||
|
||||
function LineGet(name, line, wc)
|
||||
lines = GetLinesInBufferCount()
|
||||
line = GetLineInfo(lines - wc[1], 1)
|
||||
if line == nil then
|
||||
Sound(GetInfo(67).."sounds/pm/bonk.ogg")
|
||||
return
|
||||
end
|
||||
wc = wc[1]
|
||||
local timeout = 0.4 -- in seconds
|
||||
if modes[wc] == nil then
|
||||
modes[wc] = {os.clock(), 1}
|
||||
elseif os.clock()-modes[wc][1] >= timeout then
|
||||
modes[wc][1] = os.clock()
|
||||
modes[wc][2] = 1
|
||||
else
|
||||
modes[wc][1] = os.clock()
|
||||
modes[wc][2] = modes[wc][2] + 1
|
||||
end
|
||||
if modes[wc][2] >= 3 then
|
||||
PasteCommand(line)
|
||||
Execute("tts_interrupt pasted.")
|
||||
end
|
||||
if modes[wc][2] == 2 then
|
||||
SetClipboard(line)
|
||||
Execute("tts_interrupt copied.")
|
||||
end
|
||||
if modes[wc][2] == 1 then
|
||||
Execute("tts_interrupt "..line)
|
||||
end
|
||||
end
|
||||
|
||||
function OnPluginCommandEntered(s)
|
||||
if world.GetVariable("interrupt") == "1" then
|
||||
Execute("tts_stop")
|
||||
end
|
||||
end
|
||||
|
||||
function OnPluginInstall()
|
||||
if GetVariable("output") == nil then
|
||||
SetVariable("output","1")
|
||||
end
|
||||
modes = {}
|
||||
msgbuffer = {}
|
||||
cline = 1
|
||||
lastcount=0
|
||||
line = 0
|
||||
selecting = 0
|
||||
end
|
||||
|
||||
function OnPluginScreendraw(t,l,line)
|
||||
buffercheck()
|
||||
if(GetVariable("output")=="0") then
|
||||
return
|
||||
end
|
||||
if GetInfo(113) then
|
||||
AppendToNotepad("output", line.."\r\n")
|
||||
else
|
||||
table.insert(msgbuffer, line)
|
||||
end
|
||||
end
|
||||
|
||||
function OnPluginGetFocus()
|
||||
if GetVariable("output") == "0" then
|
||||
return
|
||||
end
|
||||
if #msgbuffer > 0 then
|
||||
for i, buffered in ipairs(msgbuffer) do
|
||||
AppendToNotepad("output", buffered.."\r\n")
|
||||
end
|
||||
msgbuffer={}
|
||||
end
|
||||
end
|
||||
|
||||
function prev_line()
|
||||
buffercheck()
|
||||
oline = cline
|
||||
cline = skipblanklines(cline - 1, 'b')
|
||||
line = GetLineInfo(cline, 1)
|
||||
if cline == oline then
|
||||
Sound(GetInfo(67).."sounds/pm/bonk.ogg")
|
||||
end
|
||||
Execute("tts_interrupt "..line)
|
||||
end
|
||||
|
||||
function cur_line()
|
||||
buffercheck()
|
||||
line = GetLineInfo(cline, 1)
|
||||
Execute("tts_interrupt "..line)
|
||||
end
|
||||
|
||||
function next_line()
|
||||
buffercheck()
|
||||
oline = cline
|
||||
cline = skipblanklines(cline + 1, 'f')
|
||||
line=GetLineInfo(cline,1)
|
||||
if cline == oline then
|
||||
Sound(GetInfo(67).."sounds/pm/bonk.ogg")
|
||||
end
|
||||
Execute("tts_interrupt "..line)
|
||||
end
|
||||
|
||||
function end_line()
|
||||
cline = skipblanklines(GetLinesInBufferCount(), 'b')
|
||||
line=GetLineInfo(cline,1)
|
||||
Execute("tts_interrupt Bottom: "..line)
|
||||
end
|
||||
|
||||
function which_line()
|
||||
buffercheck()
|
||||
Execute("tts_interrupt line "..cline.." of "..GetLinesInBufferCount() -1)
|
||||
end
|
||||
|
||||
function top_line()
|
||||
cline=skipblanklines(0, 'f')
|
||||
line=GetLineInfo(cline,1)
|
||||
Execute("tts_interrupt top: "..line)
|
||||
end
|
||||
|
||||
function snapshot()
|
||||
require "wait"
|
||||
wait.make(function()
|
||||
Execute("tts_interrupt Beginning snapshot, please wait....")
|
||||
wait.time(0.5)
|
||||
for snapline=1, GetLinesInBufferCount() - 1 do
|
||||
AppendToNotepad("snapshot",GetLineInfo(snapline,1).."\r\n")
|
||||
end
|
||||
ActivateNotepad("snapshot")
|
||||
end)
|
||||
end
|
||||
|
||||
function clearlines(n,l,w)
|
||||
world.DeleteOutput()
|
||||
world.Note("output buffer cleared")
|
||||
cline=1
|
||||
lastcount=0
|
||||
line=GetLineInfo(cline,1)
|
||||
selecting = 0
|
||||
end
|
||||
|
||||
function clearwindow()
|
||||
ReplaceNotepad("output")
|
||||
Execute("tts_interrupt output window cleared")
|
||||
end
|
||||
|
||||
function skipblanklines(ln, dir)
|
||||
count = GetLinesInBufferCount()
|
||||
if ln < 1 then
|
||||
return skipblanklines(1, 'f')
|
||||
elseif ln > count - 1 then
|
||||
return skipblanklines(count - 1, 'b')
|
||||
end
|
||||
i = ln
|
||||
while i > 0 and i < count and GetLineInfo(i, 1) == "" do
|
||||
if dir == 'b' then
|
||||
i = i - 1
|
||||
else
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
if i == 0 or i == count then
|
||||
if GetLineInfo(ln, 1) ~= "" then
|
||||
return ln
|
||||
elseif i == 0 then
|
||||
return skipblanklines(1, 'f')
|
||||
elseif i == count then
|
||||
return skipblanklines(count - 1, 'b')
|
||||
end
|
||||
else
|
||||
return i
|
||||
end
|
||||
end
|
||||
|
||||
function buffercheck()
|
||||
curcount = GetLinesInBufferCount()
|
||||
if curcount < lastcount then
|
||||
if cline > 100 then
|
||||
cline = cline - 100
|
||||
else
|
||||
cline = 1
|
||||
end
|
||||
if selecting == 1 then
|
||||
if sline > 100 then
|
||||
sline = sline - 100
|
||||
else
|
||||
sline = 1
|
||||
end
|
||||
end
|
||||
end
|
||||
lastcount = curcount
|
||||
end
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
</muclient>
|
||||
100
cosmic rage/worlds/plugins/plugin_list.xml
Normal file
100
cosmic rage/worlds/plugins/plugin_list.xml
Normal file
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient>
|
||||
<muclient>
|
||||
<plugin name="Plugin_list"
|
||||
author="Nick Gammon"
|
||||
language="vbscript"
|
||||
id = "636a1df5adb9fb54adb38d8b"
|
||||
purpose = "Lists installed plugins"
|
||||
date_written = "2002-06-03 11:00:00"
|
||||
date_modified = "2002-06-13 09:25"
|
||||
version = "1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Type "plugin_list" to list installed plugins.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Alias: plugin_list
|
||||
Script: OnPluginList
|
||||
Purpose: Lists plugins
|
||||
|
||||
============================================= -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnPluginList"
|
||||
match="plugin_list"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
sub OnPluginList (sName, sLine, wildcards)
|
||||
dim count
|
||||
|
||||
count = 0
|
||||
world.colournote "orangered", "", _
|
||||
"------------- List of plugins ------------"
|
||||
world.note ""
|
||||
|
||||
for each x in world.GetPluginList
|
||||
|
||||
count = count + 1
|
||||
|
||||
world.colournote "white", "", _
|
||||
"Plugin " & count & ": " & world.getplugininfo (x, 1)
|
||||
world.note "Author: " & world.getplugininfo (x, 2)
|
||||
world.note "Purpose: " & world.getplugininfo (x, 8)
|
||||
world.note "Language: " & world.getplugininfo (x, 5)
|
||||
world.note "ID: " & world.getplugininfo (x, 7)
|
||||
world.note "Triggers: " & world.getplugininfo (x, 9)
|
||||
world.note "Aliases: " & world.getplugininfo (x, 10)
|
||||
world.note "Timers: " & world.getplugininfo (x, 11)
|
||||
world.note "Variables: " & world.getplugininfo (x, 12)
|
||||
world.note "Written on: " & world.getplugininfo (x, 13)
|
||||
world.note "Save state: " & world.getplugininfo (x, 15)
|
||||
world.note "Requires: " & world.getplugininfo (x, 18)
|
||||
world.note "Version: " & world.getplugininfo (x, 19)
|
||||
|
||||
world.note ""
|
||||
next
|
||||
|
||||
end sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Alias: plugin_list:help
|
||||
Script: OnHelp
|
||||
Purpose: Shows plugin help
|
||||
|
||||
============================================= -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="plugin_list:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
sub OnHelp (sName, sLine, wildcards)
|
||||
world.note world.getplugininfo (world.getpluginid, 3)
|
||||
end sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
</muclient>
|
||||
89
cosmic rage/worlds/plugins/plugin_summary.xml
Normal file
89
cosmic rage/worlds/plugins/plugin_summary.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient>
|
||||
<muclient>
|
||||
<plugin name="Plugin_Summary"
|
||||
author="Nick Gammon"
|
||||
language="vbscript"
|
||||
id = "402d5b187f593a46bc68beb9"
|
||||
purpose = "Summarizes installed plugins"
|
||||
date_written = "2002-08-12 07:48"
|
||||
version = "1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
Type "plugins" to summarize installed plugins.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Alias: plugins
|
||||
Script: OnPluginSummary
|
||||
Purpose: Lists plugins
|
||||
|
||||
============================================= -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnPluginSummary"
|
||||
match="plugins"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
sub OnPluginSummary (sName, sLine, wildcards)
|
||||
dim count, version
|
||||
|
||||
count = 0
|
||||
|
||||
for each x in world.GetPluginList
|
||||
|
||||
count = count + 1
|
||||
|
||||
world.tell world.getplugininfo (x, 1) ' name
|
||||
version = world.getplugininfo (x, 19)
|
||||
if version <> 0 then
|
||||
world.tell " v" & version
|
||||
end if
|
||||
world.note " - " & world.getplugininfo (x, 8) ' purpose
|
||||
next
|
||||
|
||||
world.note count & " plugin(s)"
|
||||
|
||||
end sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Alias: plugins:help
|
||||
Script: OnHelp
|
||||
Purpose: Shows plugin help
|
||||
|
||||
============================================= -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="plugins:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
sub OnHelp (sName, sLine, wildcards)
|
||||
world.note world.getplugininfo (world.getpluginid, 3)
|
||||
end sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
</muclient>
|
||||
324
cosmic rage/worlds/plugins/random_socials.xml
Normal file
324
cosmic rage/worlds/plugins/random_socials.xml
Normal file
@@ -0,0 +1,324 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient [
|
||||
<!ENTITY socials_command "socials" >
|
||||
<!ENTITY end_socials_regexp "\>" >
|
||||
<!ENTITY timer_interval "30" >
|
||||
]>
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
Customising (change above entities) ...
|
||||
|
||||
Change "socials_command" to whatever sends a list of socials.
|
||||
Default: socials
|
||||
|
||||
Change "end_socials_regexp" to whatever will *not* be in a socials line.
|
||||
Default: >
|
||||
|
||||
Change "timer_interval" to be the number of seconds between checking for socials.
|
||||
Default: 10 seconds
|
||||
|
||||
(Note - every "timer_interval" seconds there is a 20% chance that the social will be sent.)
|
||||
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin name="Random_Socials"
|
||||
author="Nick Gammon"
|
||||
language="vbscript"
|
||||
id = "982581e59ab42844527eec80"
|
||||
purpose = "Displays a random social from time to time"
|
||||
save_state = "y"
|
||||
version = "1.1"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
|
||||
This plugin checks to see if it has a list of socials (in the "socials" variable).
|
||||
|
||||
If not, it sends "socials" to the MUD to build a list.
|
||||
|
||||
Then, every 10 seconds it has a 20% chance of displaying one picked at random.
|
||||
|
||||
Commands
|
||||
--------
|
||||
|
||||
socials:help - shows this description in the output window
|
||||
socials:remove:all - removes all socials (ie. reloads the list)
|
||||
socials:remove X - removes social X from the list (eg. social:remove burp)
|
||||
]]>
|
||||
</description>
|
||||
</plugin>
|
||||
|
||||
<!-- Get our standard VB constants -->
|
||||
<include name="constants.vbs"/>
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Sub "SocialsList" - collects a list of socials.
|
||||
|
||||
============================================= -->
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
dim SocialsList ' store list of socials
|
||||
|
||||
Randomize ' Initialize random-number generator.
|
||||
|
||||
sub GetSocials
|
||||
world.setvariable "socials", ""
|
||||
world.enabletrigger "Collect_Socials", 1
|
||||
'
|
||||
' cancel CDATA so we can use the entity (from DOCTYPE header)
|
||||
'
|
||||
]]>
|
||||
world.send "&socials_command;"
|
||||
<![CDATA[
|
||||
world.note "Collecting list of socials ..."
|
||||
end sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Timer: RandomSocial
|
||||
Script: DoRandomSocial
|
||||
Purpose: Chooses a social at random, builds the list if necessary
|
||||
|
||||
============================================= -->
|
||||
|
||||
<timers>
|
||||
<timer
|
||||
name="RandomSocial"
|
||||
script="DoRandomSocial"
|
||||
enabled="y"
|
||||
second="&timer_interval;"
|
||||
>
|
||||
</timer>
|
||||
</timers>
|
||||
<script>
|
||||
<![CDATA[
|
||||
Sub DoRandomSocial (strTimerName)
|
||||
|
||||
'
|
||||
' Wait a minute after connecting to let them put in the character name and password
|
||||
'
|
||||
|
||||
If DateDiff ("n", World.GetInfo (301), Now) < 1 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'
|
||||
' If collecting socials, list, just wait for it to finish
|
||||
'
|
||||
|
||||
If World.GetTriggerInfo ("Collect_Socials", 8) then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'
|
||||
' If no socials list, get one
|
||||
'
|
||||
|
||||
If IsEmpty (SocialsList) Then
|
||||
If world.getvariable ("socials") = "" Then
|
||||
Call GetSocials
|
||||
Else
|
||||
SocialsList = split (world.getvariable ("socials"))
|
||||
End If
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'
|
||||
' Do a random social
|
||||
'
|
||||
|
||||
If Rnd < 0.2 Then
|
||||
World.Send SocialsList ( Rnd * Ubound (SocialsList))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Trigger: Collect_Socials
|
||||
Script: Do_Collect_Socials
|
||||
Purpose: Matches a line of socials
|
||||
|
||||
============================================= -->
|
||||
|
||||
<triggers>
|
||||
<trigger
|
||||
custom_colour="2"
|
||||
match="^[A-Za-z ]+$"
|
||||
name="Collect_Socials"
|
||||
regexp="y"
|
||||
script="Do_Collect_Socials"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
sub Do_Collect_Socials (sName, sLine, wildcards)
|
||||
world.enabletrigger "End_Socials", 1
|
||||
sLine = Trim (sLine)
|
||||
while Instr (sLine, " ") > 0
|
||||
sLine = world.Replace (sLine, " ", " ", 1)
|
||||
wend
|
||||
world.setvariable "socials", _
|
||||
world.getvariable ("socials") & " " & sLine
|
||||
end sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Trigger: End_Socials
|
||||
Script: Do_End_Socials
|
||||
Purpose: Detects end of socials list - in this case we look for the < at the
|
||||
start of a MUD prompt, but you could look for anything that wouldn't be
|
||||
a social line.
|
||||
|
||||
============================================= -->
|
||||
|
||||
<triggers>
|
||||
<trigger
|
||||
custom_colour="1"
|
||||
match="&end_socials_regexp;"
|
||||
name="End_Socials"
|
||||
regexp="y"
|
||||
script="Do_End_Socials"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
</triggers>
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
sub Do_End_Socials (sName, sLine, wildcards)
|
||||
world.note "End of socials list detected. Random socials now active."
|
||||
world.enabletrigger "Collect_Socials", 0
|
||||
world.enabletrigger "End_Socials", 0
|
||||
|
||||
SocialsList = split (world.getvariable ("socials"))
|
||||
|
||||
end sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Alias: Remove_Social
|
||||
Script: Do_Remove_Social
|
||||
Purpose: Removes a social from the list (eg. it might be inappropriate)
|
||||
|
||||
============================================= -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
name="Remove_Social"
|
||||
script="Do_Remove_Social"
|
||||
match="^socials\:remove ([A-Za-z]+)$"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
sub Do_Remove_Social (sName, sLine, wildcards)
|
||||
|
||||
If not Instr (world.GetVariable ("socials") & " ", wildcards (1) & " ") > 0 then
|
||||
world.note "Social " & wildcards (1) & " was not in the list."
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'
|
||||
' Remove the specified social from the list
|
||||
'
|
||||
world.SetVariable "socials", _
|
||||
Trim (world.Replace (world.GetVariable ("socials") & " ", _
|
||||
wildcards (1) & " ", "", 1))
|
||||
|
||||
world.note "Removed social " & wildcards (1) & " from the list."
|
||||
|
||||
'
|
||||
' Regenerate the list
|
||||
'
|
||||
|
||||
SocialsList = split (world.getvariable ("socials"))
|
||||
|
||||
end sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Alias: Remove_All_Socials
|
||||
Script: Do_Remove_All_Socials
|
||||
Purpose: Removes all socials (ie. forces list to be regenerated)
|
||||
|
||||
============================================= -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
name="Remove_All_Socials"
|
||||
script="Do_Remove_All_Socials"
|
||||
match="socials:remove:all"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
sub Do_Remove_All_Socials (sName, sLine, wildcards)
|
||||
|
||||
World.SetVariable "socials", ""
|
||||
SocialsList = Empty
|
||||
World.Note "All socials removed from list."
|
||||
|
||||
end sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Alias: socials:help
|
||||
Script: OnHelp
|
||||
Purpose: Shows plugin help
|
||||
|
||||
============================================= -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="socials:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
sub OnHelp (sName, sLine, wildcards)
|
||||
world.note world.getplugininfo (world.getpluginid, 3)
|
||||
end sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
220
cosmic rage/worlds/plugins/reverse_speedwalk.xml
Normal file
220
cosmic rage/worlds/plugins/reverse_speedwalk.xml
Normal file
@@ -0,0 +1,220 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient
|
||||
[
|
||||
<!ENTITY speedwalk_alias "#" >
|
||||
<!ENTITY reverse_speedwalk_alias "##" >
|
||||
<!ENTITY echo_speedwalk "-1" >
|
||||
]>
|
||||
<!-- Saved on Saturday, August 10, 2002, 9:00 PM -->
|
||||
<!-- MuClient version 3.25 -->
|
||||
|
||||
<!-- Plugin "reverse_speedwalk" generated by Plugin Wizard -->
|
||||
|
||||
<!--
|
||||
Written for forum posting "Simple speedwalk reverse", see:
|
||||
|
||||
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=1617
|
||||
|
||||
Customise by changing the ENTITY definitions above.
|
||||
|
||||
Default is:
|
||||
|
||||
# <speedwalk> <- do a speedwalk
|
||||
## <speedwalk> <- do a reverse speedwalk
|
||||
|
||||
You could change that, say if you wanted /w to be a speedwalk, and /r
|
||||
to be a reverse speedwalk, change the entity above (in the DOCTYPE header)
|
||||
to:
|
||||
|
||||
<!ENTITY speedwalk_alias "/w" >
|
||||
<!ENTITY reverse_speedwalk_alias "/r" >
|
||||
|
||||
If you do not want the actual speedwalk command echoed in the output window,
|
||||
change the entity above (in the DOCTYPE header) to:
|
||||
|
||||
<!ENTITY echo_speedwalk "0" >
|
||||
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Reverse_Speedwalk"
|
||||
author="Nick Gammon"
|
||||
id="bc3d7990489bf6e3fa6d847e"
|
||||
language="VBscript"
|
||||
purpose="Takes a speedwalk string and sends it, reversed"
|
||||
date_written="2002-08-10 20:56:54"
|
||||
requires="3.24"
|
||||
version="2.0"
|
||||
>
|
||||
<description trim="y">
|
||||
This provides a simple alias "&reverse_speedwalk_alias;" that sends a reversed speedwalk to the MUD.
|
||||
|
||||
eg.
|
||||
|
||||
&reverse_speedwalk_alias; 2s 3e
|
||||
|
||||
Would send:
|
||||
w
|
||||
w
|
||||
w
|
||||
n
|
||||
n
|
||||
|
||||
Usage:
|
||||
|
||||
&speedwalk_alias; <speedwalk string> <-- normal speedwalk
|
||||
&reverse_speedwalk_alias; <speedwalk string> <-- reverse speedwalk
|
||||
reverse_speedwalk:help <-- this help screen
|
||||
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="On_Normal_Speedwalk"
|
||||
match="&speedwalk_alias; *"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
<alias
|
||||
script="On_Reverse_Speedwalk"
|
||||
match="&reverse_speedwalk_alias; *"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
' -----------------------------------
|
||||
' Normal Speedwalk
|
||||
' -----------------------------------
|
||||
|
||||
Sub On_Normal_Speedwalk (aliasname, full_line, wildcards)
|
||||
|
||||
dim speedwalk
|
||||
'
|
||||
' echo speedwalk on screen
|
||||
'
|
||||
]]>
|
||||
If &echo_speedwalk; Then
|
||||
<![CDATA[
|
||||
world.ColourNote _
|
||||
World.RGBColourToName (World.CustomColourText(World.GetOption("echo_colour"))), _
|
||||
World.RGBColourToName (World.CustomColourBackground(World.GetOption("echo_colour"))), _
|
||||
wildcards (10)
|
||||
End If
|
||||
'
|
||||
' Evaluate it
|
||||
'
|
||||
|
||||
speedwalk = world.EvaluateSpeedwalk (wildcards (1))
|
||||
'
|
||||
' If first character is an asterisk, there was an error in the speedwalk string
|
||||
'
|
||||
|
||||
if Left (speedwalk, 1) = "*" then
|
||||
world.ColourNote "red", "lightblue", speedwalk
|
||||
exit sub
|
||||
end if
|
||||
'
|
||||
' Otherwise, send it
|
||||
'
|
||||
world.Send speedwalk
|
||||
|
||||
End Sub
|
||||
|
||||
' -----------------------------------
|
||||
' Reverse Speedwalk
|
||||
' -----------------------------------
|
||||
|
||||
Sub On_Reverse_Speedwalk (aliasname, full_line, wildcards)
|
||||
|
||||
dim speedwalk
|
||||
'
|
||||
' echo speedwalk on screen
|
||||
'
|
||||
]]>
|
||||
If &echo_speedwalk; Then
|
||||
<![CDATA[
|
||||
world.ColourNote _
|
||||
World.RGBColourToName (World.CustomColourText(World.GetOption("echo_colour"))), _
|
||||
World.RGBColourToName (World.CustomColourBackground(World.GetOption("echo_colour"))), _
|
||||
wildcards (10)
|
||||
End If
|
||||
'
|
||||
' Reverse it
|
||||
'
|
||||
|
||||
speedwalk = world.ReverseSpeedwalk (wildcards (1))
|
||||
'
|
||||
' If first character is an asterisk, there was an error in the speedwalk string
|
||||
'
|
||||
|
||||
if Left (speedwalk, 1) = "*" then
|
||||
world.ColourNote "red", "lightblue", speedwalk
|
||||
exit sub
|
||||
end if
|
||||
'
|
||||
' Otherwise, evaluate and send it
|
||||
'
|
||||
world.Send world.EvaluateSpeedwalk (speedwalk)
|
||||
|
||||
End Sub
|
||||
|
||||
' -----------------------------------
|
||||
' On installation, disable built-in speedwalk
|
||||
' -----------------------------------
|
||||
|
||||
dim Original_Enable_Speedwalk_Option
|
||||
|
||||
Sub OnPluginInstall
|
||||
Original_Enable_Speedwalk_Option = _
|
||||
world.GetCurrentValue ("enable_speed_walk")
|
||||
world.SetOption "enable_speed_walk", 0
|
||||
world.DoAfterNote 1, "Plugin " & world.getpluginname & " installed."
|
||||
world.DoAfterNote 1, "Version number " & _
|
||||
world.getplugininfo (world.getpluginid, 19)
|
||||
End Sub
|
||||
|
||||
' -----------------------------------
|
||||
' On exit, re-enable built-in speedwalk (if originally enabled)
|
||||
' -----------------------------------
|
||||
|
||||
Sub OnPluginClose
|
||||
world.SetOption "enable_speed_walk", Original_Enable_Speedwalk_Option
|
||||
End Sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="reverse_speedwalk:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Sub OnHelp (sName, sLine, wildcards)
|
||||
World.Note World.GetPluginInfo (World.GetPluginID, 3)
|
||||
End Sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
139
cosmic rage/worlds/plugins/scan.xml
Normal file
139
cosmic rage/worlds/plugins/scan.xml
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient [
|
||||
<!ENTITY timer_interval "5" >
|
||||
]>
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
Plugin to do a "scan" every 5 seconds.
|
||||
|
||||
Change the "5" in "timer_interval" above to make it happen after a different
|
||||
number of seconds.
|
||||
|
||||
-->
|
||||
|
||||
<muclient>
|
||||
<plugin name="Scan"
|
||||
author="Nick Gammon"
|
||||
language="vbscript"
|
||||
id = "5f2ab730145c150a2535677d"
|
||||
purpose = "Does a "scan" every &timer_interval; seconds"
|
||||
version = "1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
This plugin does a "scan" every &timer_interval; seconds.
|
||||
|
||||
Commands
|
||||
--------
|
||||
|
||||
scan:help - shows this description in the output window
|
||||
scanon - enables scanning
|
||||
scanoff - disables scanning (for battle)
|
||||
</description>
|
||||
</plugin>
|
||||
|
||||
<!-- Get our standard VB constants -->
|
||||
<include name="constants.vbs"/>
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Timer: scan
|
||||
|
||||
============================================= -->
|
||||
|
||||
<timers>
|
||||
<timer name="scan"
|
||||
enabled="y"
|
||||
second="&timer_interval;" >
|
||||
<send>scan</send>
|
||||
|
||||
</timer>
|
||||
</timers>
|
||||
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Alias: scanon
|
||||
Script: do_scanon
|
||||
Purpose: Enables scanning timer
|
||||
|
||||
============================================= -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="do_scanon"
|
||||
match="scanon"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
sub do_scanon (sName, sLine, wildcards)
|
||||
world.enabletimer "scan", 1
|
||||
world.note "Scanning enabled"
|
||||
end sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Alias: scanoff
|
||||
Script: do_scanoff
|
||||
Purpose: Disables scan timer (during battle)
|
||||
|
||||
============================================= -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="do_scanoff"
|
||||
match="scanoff"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
sub do_scanoff (sName, sLine, wildcards)
|
||||
world.enabletimer "scan", 0
|
||||
world.note "Scanning disabled"
|
||||
end sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- =============================================
|
||||
|
||||
Alias: scan:help
|
||||
Script: OnHelp
|
||||
Purpose: Shows plugin help
|
||||
|
||||
============================================= -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="scan:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
sub OnHelp (sName, sLine, wildcards)
|
||||
world.note world.getplugininfo (world.getpluginid, 3)
|
||||
end sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
63
cosmic rage/worlds/plugins/showactivity.xml
Normal file
63
cosmic rage/worlds/plugins/showactivity.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="US-ASCII"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Tuesday, March 23, 2004, 11:06 AM -->
|
||||
<!-- MuClient version 3.47 -->
|
||||
|
||||
<!-- Plugin "ShowActivity" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="ShowActivity"
|
||||
author="Nick Gammon"
|
||||
id="5365175f17f932736cbd30f0"
|
||||
language="VBscript"
|
||||
purpose="Shows worlds with new activity in Info Bar"
|
||||
date_written="2004-03-23 11:05:04"
|
||||
requires="3.29"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
This automatically updates the Info Bar every 2 seconds to show the names of worlds with new activity.
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Timers -->
|
||||
|
||||
<timers>
|
||||
<timer enabled="y" second="2" send_to="12"
|
||||
active_closed="y" >
|
||||
<send>active = ""
|
||||
|
||||
'
|
||||
' check all worlds
|
||||
'
|
||||
for each id in world.GetWorldIdList
|
||||
set thisworld = GetWorldById (id)
|
||||
if not (thisworld is nothing) then
|
||||
if thisworld.GetInfo (202) > 0 then
|
||||
if active <> "" then active = active & ", "
|
||||
active = active & thisworld.GetInfo (2)
|
||||
end if
|
||||
set thisworld = nothing
|
||||
end if
|
||||
next
|
||||
|
||||
'
|
||||
' display results
|
||||
'
|
||||
InfoClear
|
||||
if active <> "" then
|
||||
InfoFont "", 0, 1 ' bold font
|
||||
Info "Activity: "
|
||||
InfoFont "", 0, 0 ' normal font
|
||||
Info active
|
||||
end if</send>
|
||||
|
||||
</timer>
|
||||
</timers>
|
||||
|
||||
</muclient>
|
||||
3
cosmic rage/worlds/plugins/state/.gitkeep
Normal file
3
cosmic rage/worlds/plugins/state/.gitkeep
Normal file
@@ -0,0 +1,3 @@
|
||||
cosmic rage/worlds/plugins/state/*.xmlcosmic rage/worlds/plugins/state/*
|
||||
|
||||
!cosmic rage/worlds/plugins/state/.gitkeep
|
||||
160
cosmic rage/worlds/plugins/status_bar_prompt.xml
Normal file
160
cosmic rage/worlds/plugins/status_bar_prompt.xml
Normal file
@@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="US-ASCII"?>
|
||||
|
||||
<!DOCTYPE muclient [
|
||||
<!ENTITY regexp_match
|
||||
"^\<\-?(\d+)\/(\d+) hp \-?(\d+)\/(\d+) m \-?(\d+)\/(\d+) mv\>(.*?)$"
|
||||
>
|
||||
]>
|
||||
|
||||
<!-- Saved on Friday, February 13, 2004, 4:48 PM -->
|
||||
<!-- MuClient version 3.44 -->
|
||||
|
||||
<!--
|
||||
You will probably need to customise the regular expression to match your MUD.
|
||||
|
||||
See ENTITY line near top of file. The above regular expression will match on:
|
||||
|
||||
<54/1000 hp 90/100 m 600/750 mv>
|
||||
|
||||
A simpler trigger would be:
|
||||
|
||||
<*/*hp */*m */*mv>
|
||||
|
||||
-->
|
||||
|
||||
<!-- Plugin "Status_Bar_Prompt" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Status_Bar_Prompt"
|
||||
author="Nick Gammon"
|
||||
id="ff9331b06c15ab21046be001"
|
||||
language="VBscript"
|
||||
purpose="Updates the status bar from the prompt"
|
||||
date_written="2004-02-13 16:41:24"
|
||||
requires="3.44"
|
||||
version="1.0"
|
||||
>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
sub DoGauge (sPrompt, iCurrent, iMax, sGoodColour, sBadColour)
|
||||
dim pc, count
|
||||
|
||||
'
|
||||
' Do prompt in black Arial
|
||||
'
|
||||
InfoColour "black"
|
||||
InfoFont "Arial", 10, 0
|
||||
Info sPrompt
|
||||
|
||||
'
|
||||
' Use Webdings for gauge (black square)
|
||||
'
|
||||
|
||||
InfoFont "Webdings", 10, 0
|
||||
|
||||
pc = CInt ((CInt (iCurrent) / CInt (iMax)) * 10)
|
||||
|
||||
'
|
||||
' Below 20% warn by using different colour
|
||||
'
|
||||
|
||||
if pc < 2 then
|
||||
InfoColour sBadColour
|
||||
else
|
||||
InfoColour sGoodColour
|
||||
end if
|
||||
|
||||
'
|
||||
' Draw active part of gauge
|
||||
'
|
||||
for count = 0 to pc
|
||||
Info "g"
|
||||
next
|
||||
|
||||
'
|
||||
' Draw rest of gauge in grey (ie. unfilled bit)
|
||||
'
|
||||
|
||||
InfoColour "dimgray"
|
||||
while count <= 10
|
||||
count = count + 1
|
||||
Info "g"
|
||||
wend
|
||||
|
||||
end sub
|
||||
|
||||
sub OnPluginPartialLine (sText)
|
||||
Dim regEx, Matches, Match
|
||||
|
||||
'
|
||||
' Make a regular expression to match on the line:
|
||||
'
|
||||
'
|
||||
Set regEx = New RegExp
|
||||
|
||||
'
|
||||
' exit CDATA block so we can use the trigger entity
|
||||
'
|
||||
]]>
|
||||
|
||||
regEx.Pattern = "®exp_match;"
|
||||
|
||||
<![CDATA[
|
||||
|
||||
'
|
||||
' Execute regular expression
|
||||
'
|
||||
|
||||
Set Matches = regEx.Execute (sText)
|
||||
|
||||
'
|
||||
' Exit if no match
|
||||
'
|
||||
|
||||
if Matches.Count = 0 then
|
||||
Set regEx = Nothing
|
||||
Set Matches = Nothing
|
||||
exit sub
|
||||
end if
|
||||
|
||||
Set Match = Matches.Item (0)
|
||||
|
||||
Set regEx = Nothing
|
||||
Set Matches = Nothing
|
||||
|
||||
InfoClear
|
||||
|
||||
'
|
||||
' World name
|
||||
'
|
||||
|
||||
InfoFont "Arial", 12, 1 ' 12 point Arial *bold*
|
||||
InfoColour "purple"
|
||||
Info GetInfo (2) ' world name
|
||||
|
||||
DoGauge " HP: ", Match.SubMatches (0), Match.SubMatches (1), "darkgreen", "maroon"
|
||||
DoGauge " Mana: ", Match.SubMatches (2), Match.SubMatches (3), "mediumblue", "mediumblue"
|
||||
DoGauge " Move: ", Match.SubMatches (4), Match.SubMatches (5), "gold", "gold"
|
||||
|
||||
Set Match = Nothing
|
||||
|
||||
end sub
|
||||
|
||||
'
|
||||
' Do this once
|
||||
'
|
||||
ShowInfoBar vbTrue
|
||||
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
147
cosmic rage/worlds/plugins/timer.xml
Normal file
147
cosmic rage/worlds/plugins/timer.xml
Normal file
@@ -0,0 +1,147 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Thursday, March 04, 2004, 7:32 AM -->
|
||||
<!-- MuClient version 3.42 -->
|
||||
|
||||
<!-- Plugin "Timer" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="Timer"
|
||||
author="Nick Gammon"
|
||||
id="cc98cbe576474a19d1715a02"
|
||||
language="VBscript"
|
||||
purpose="Shows elapsed time in status bar"
|
||||
date_written="2004-03-04 07:29:18"
|
||||
requires="3.30"
|
||||
version="1.0"
|
||||
>
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
This plugin displays time connected in the status bar. It can be reset to zero when you like.
|
||||
|
||||
The time is shown as hours and minutes (eg. 4h 22m) - if you are connected for more than a day then it will show more than 24 hours. You could amend it slightly to change that if you wanted.
|
||||
|
||||
Commands
|
||||
--------
|
||||
|
||||
timerreset - reset timer to zero
|
||||
Timer:help - show this help
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="TimerToZero"
|
||||
match="resettimer"
|
||||
enabled="y"
|
||||
send_to="2"
|
||||
sequence="100"
|
||||
>
|
||||
<send>Timer reset.</send>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Timers -->
|
||||
|
||||
<timers>
|
||||
<timer name="StatusBarTimer" script="ElapsedTimer" enabled="y" second="30" >
|
||||
|
||||
</timer>
|
||||
</timers>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
'
|
||||
' Timer showing when we last connected
|
||||
'
|
||||
|
||||
dim tConnected
|
||||
|
||||
tConnected = Now
|
||||
|
||||
'
|
||||
' This world has been connected (to the MUD)
|
||||
'
|
||||
sub OnPluginConnect
|
||||
tConnected = Now
|
||||
Call ElapsedTimer ("StatusBarTimer")
|
||||
end sub
|
||||
|
||||
'
|
||||
' Plugin has been installed
|
||||
'
|
||||
sub OnPluginInstall
|
||||
Call OnPluginConnect
|
||||
end sub
|
||||
|
||||
'
|
||||
' Called by alias to zero timer
|
||||
'
|
||||
Sub TimerToZero (sName, sLine, wildcards)
|
||||
Call OnPluginConnect
|
||||
End Sub
|
||||
|
||||
'
|
||||
' Called when timer fires
|
||||
'
|
||||
Sub ElapsedTimer (sName)
|
||||
|
||||
dim Minutes, Hours
|
||||
|
||||
'
|
||||
' Calculate how long in minutes
|
||||
'
|
||||
Minutes = DateDiff ("n", tConnected, Now)
|
||||
|
||||
'
|
||||
' Convert to hours and minutes
|
||||
'
|
||||
Hours = Int (Minutes / 60)
|
||||
Minutes = Minutes - (Hours * 60)
|
||||
|
||||
'
|
||||
' Update status bar
|
||||
'
|
||||
SetStatus "Timer: " & Hours & "h " & Minutes & "m"
|
||||
End Sub
|
||||
|
||||
'
|
||||
' Plugin is being removed (closed)
|
||||
'
|
||||
sub OnPluginClose
|
||||
SetStatus "Ready"
|
||||
end sub
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Plugin help -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
script="OnHelp"
|
||||
match="Timer:help"
|
||||
enabled="y"
|
||||
>
|
||||
</alias>
|
||||
</aliases>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
Sub OnHelp (sName, sLine, wildcards)
|
||||
world.Note world.GetPluginInfo (world.GetPluginID, 3)
|
||||
End Sub
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
Reference in New Issue
Block a user