[script]
n0=;x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x
n1=; Ghalerion Script
n2=; By Kouketsu
n3=;_________________________________________________________
n4=;Currently Viewing: Roleplaying Scripts
n5=;Description: Includes the mistake aliases for /me, a cut script, and a WPM calculator for you speed fighters out there.
n6=;Aliases Defined: em, wpmcalc, disptxt, wpmcount, countstart, countend, stats
n7=;Dialogs Included: wpm
n8=;x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x
n9=alias em { /me $1- }
n10=alias ooc { msg $active (( $1- )) }
n11=;Text cutter/colorer
n12=;Made to keep from 'over running' the irc text buffer.
n13=;There is no commands for this script. On any /me statement containing certain quote formats, it will activate and color them acordingly
n14=;The script also detects if the current channel has +c (colorban) and if it does, it turns the color featuer off.
n15=;On any post longer then 420 characters, the script will chop the text at the closest space, then post the runoff a second later.
n16=;
n17=;The quote coloring works like this:
n18=; ((text)) for out of character or OOC text
n19=; [text] for 'AI' text
n20=; <text> for telepathic text
n21=; "text" for normal speech text
n22=; .oO( text ) for 'thought' bubble text (As requested by Draconia)
n23=;
n24=;
n25=;I wrote this mostly for RolePlayers to stop the 'you got cut off' and such on IRC
n26=;If you'd like more types of text quotes to be added, I can be contacted at nyghtwulf@gmail.com
n27=;
n28=
n29=
n30=on 1:input:*:{
n31= ;force script to only work with /me statements.
n32= ;if you would like to remove this restriction, comment out the following line,
n33= ;AND the marked line towards the end of this script
n34= if ($1 == /me) {
n35=
n36= ;this section turns the text coloring engine on and off.
n37= ;If you would like to do this manualy, comment out these lines
n38= ;and set %AutoFormatting to either 'ON' or 'OFF'
n39=
n40= if (c isincs $chan($chan).mode) {
n41= %AutoFormatting = OFF
n42= }
n43= else {
n44= %AutoFormatting = ON
n45= }
n46=
n47= ;-------------------------------------------------------------
n48= ;Settings for the text parser engine
n49=
n50= ; Modify %CutStyle to your liking.
n51= %CutStyle = --
n52=
n53= ;Modify %CStrailer to your liking.
n54= %CStrailer = 6 ...
n55=
n56= if ($mid(%AutoFormatting,1,1) != O) {
n57= %AutoFormatting = ON
n58= }
n59=
n60= ;The following sets colors and formatting for quoted text.
n61= ;Don't change the characters or things will look funny
n62=
n63= %whisperTone = 13[
n64=
n65= ;telepath color set
n66= %softTone = 5<
n67=
n68= ;normal speech color set
n69= %normalTone = 14"
n70=
n71= ;OOC color setting
n72= %loudTone = 10((
n73=
n74= ;Cloud Text
n75= %cloudTone = 12.oO(
n76=
n77= ;sets colors off at end *DO NOT CHANGE*
n78= %endTone = "6
n79= %endTone2 = >6
n80= %endTone3 = ]6
n81= %endTone4 = ))6
n82= %endtone5 = )6
n83=
n84=
n85= ; The following sets the search codes for automatic text coloring.
n86= ;DO NOT CHANGE BELOW THIS LINE!
n87= ;-----------------------------------------------------------------
n88= %whisperQuote = [
n89= %softQuote = <
n90= %normalQuote = "
n91= %loudQuote = ((
n92= %cloudQuote = .oO(
n93=
n94= %endquote = "
n95= %endquote2 = >
n96= %endquote3 = ]
n97= %endquote4 = ))
n98= %endquote5 = )
n99=
n100= %n = 1
n101= %act = 0
n102= %cut = 0
n103= %QEnc = 0
n104= %codes = $chr(0)
n105= %chr = $chr(0)
n106=
n107= if (($mid($1,1,2) == 6) || ($mid($1,1,1) == ") || ($mid($1,2,1) == ")) {
n108= %QEnc = 1
n109= }
n110=
n111= if ($1 == /me) {
n112= %codes = $chr(3) $+ 6
n113= %act = 1
n114= %QEnc = 1
n115= %len = 424 - $len($me)
n116= }
n117= else {
n118= %act = 0
n119= %len = 430 - $len($me)
n120= }
n121= if ($len($1-) > %len) {
n122= %cut = 1
n123= while (%chr != $chr(32)) {
n124= %len = %len - 1
n125= %chr = $mid($1-,%len,1)
n126= }
n127= %scantext = $left($1-,%len)
n128= %lefttext = %scantext
n129= %cuttext = $right($1-,$mid($1-,%len,0))
n130= }
n131= else {
n132= %lefttext = $1-
n133= }
n134=
n135= if ((%AutoFormatting == ON) && (%QEnc == 1)) {
n136= %scantext = $QuoteEncode(%scantext)
n137= %lefttext = $QuoteEncode(%lefttext)
n138= %cuttext = $QuoteEncode(%cuttext)
n139= }
n140=
n141= while (%n != 0) {
n142= %n = $regsub(scan,%scantext,/([]|\d{1 $+ $chr(44) $+ 2} $+ $chr(44) $+ ?\d?\d?)/,$chr(0),%scantext)
n143= %codes = %codes $+ $regml(scan,1)
n144= }
n145= if (%cut == 1) {
n146= /timerCutScript 1 1 /say %CutStyle $+ $+ %codes %cuttext
n147= %lefttext = %lefttext $+ %CSTrailer
n148= }
n149= if (%act == 1) {
n150= /me $deltok(%lefttext,1,32)
n151= /halt
n152= }
n153= else {
n154= if ($mid(%lefttext,1,1) != /) {
n155= /say %lefttext
n156= /halt
n157= }
n158= }
n159= }
n160= ;comment out the following one line to allow the script to act on all text that is inputed
n161=}
n162=
n163=alias QuoteEncode {
n164= %CSQtext = $1-
n165= %CSQtext = $replace(%CSQtext,$chr(32) $+ %whisperQuote,$chr(32) $+ %whisperTone)
n166= %CSQtext = $replace(%CSQtext,$chr(32) $+ %softQuote,$chr(32) $+ %softTone)
n167= %CSQtext = $replace(%CSQtext,$chr(32) $+ %normalQuote,$chr(32) $+ %normalTone)
n168= %CSQtext = $replace(%CSQtext,$chr(32) $+ %loudQuote,$chr(32) $+ %loudTone)
n169= %CSQtext = $replace(%CSQtext,$chr(32) $+ %CLoudQuote,$chr(32) $+ %cloudTone)
n170=
n171= %CSQtext = $replace(%CSQtext,%endQuote $+ $chr(32),%endTone $+ $chr(32))
n172= %CSQtext = $replace(%CSQtext,%endQuote2 $+ $chr(32),%endTone2 $+ $chr(32))
n173= %CSQtext = $replace(%CSQtext,%endQuote3 $+ $chr(32),%endTone3 $+ $chr(32))
n174= %CSQtext = $replace(%CSQtext,%endQuote4 $+ $chr(32),%endTone4 $+ $chr(32))
n175= %CSQtext = $replace(%CSQtext,%endQuote5 $+ $chr(32),%endTone5 $+ $chr(32))
n176= /return %CSQtext
n177=}
n178=
n179=dialog wpm {
n180= title "IRC WPM Calculator"
n181= size -1 -1 280 70
n182= option dbu
n183= edit "Press start or Alt + S to begin the counter. Hit the 'Enter' key to stop it.", 1, 4 40 241 10, autohs
n184= edit "Your text will appear here.", 3, 4 4 241 30, read, return, multi
n185= button "Stop", 2, 246 40 30 10, disable, hide, default
n186= text "Speed:", 5, 4 57 17 10
n187= edit "", 6, 22 56 20 10, read, autohs
n188= text "Avg. Speed:", 7, 44 57 30 10
n189= edit "", 8, 75 56 21 10, read, autohs
n190= text "Peak:" 9, 139 57 15 10
n191= edit "", 10, 154 56 20 10, read, autohs
n192= text "Time Elapsed:", 11, 178 57 35 10
n193= edit "", 12, 213 56 30 10, read, autohs
n194= button "Reset", 13, 246 56 30 10
n195= button "&Start", 14, 246 40 30 10, default
n196= button "Print Current Stats", 15, 246 4 30 30, multi
n197= text "Words:", 16, 98 57 17 10
n198= edit "", 17, 116 56 20 10, read, autohs
n199=}
n200=on *:dialog:wpm:init:*: {
n201= set %wpm.use 0
n202= set %wpm.add 0
n203= set %wpm.avg 0
n204= did -ra wpm 10 %wpm.peak
n205=}
n206=on *:dialog:wpm:edit:1: {
n207= did -e wpm 2
n208=}
n209=on *:dialog:wpm:sclick:*: {
n210= if ($did == 14) {
n211= countstart
n212= did -r wpm 1
n213= did -f wpm 1
n214= did -bh wpm 14
n215= did -ev wpm 2
n216= }
n217= if ($did == 2) {
n218= countend
n219= disptxt $did(wpm,1).text
n220= stats
n221= did -bh wpm 2
n222= did -ev wpm 14
n223= }
n224= if ($did == 13) {
n225= set %wpm.use 0
n226= set %wpm.add 0
n227= set %wpm.avg 0
n228= set %wpm.peak 0
n229= did -ra wpm 10 %wpm.peak
n230= did -ra wpm 8 %wpm.avg
n231= did -ra wpm 12 0
n232= did -ra wpm 6 0
n233= }
n234= if ($did == 15) {
n235= msg $active $gtalk(Ghalerion Script WPM Calculator Statistics:) $gtalk(Latest WPM: %wpm.end) $gtalk(Average WPM: %wpm.avg) $gtalk(Peak WPM: %wpm.peak)
n236= }
n237=}
n238=alias wpmcalc {
n239= if ($dialog(wpm) != $null) { dialog -v wpm | halt }
n240= else { dialog -md wpm wpm }
n241=}
n242=alias disptxt {
n243= if ($1 == /me) {
n244= did -ra wpm 3 $replace($did(wpm,1).text,/me,$me)
n245= }
n246= else {
n247= did -ra wpm 3 $did(wpm,1).text
n248= }
n249=}
n250=alias wpmcount { set %time.elapsed $calc(%time.end - %time.start) }
n251=alias countstart { set %time.start $ctime }
n252=alias countend { set %time.end $ctime }
n253=alias stats {
n254= wpmcount
n255= if (%time.elapsed == 0) {
n256= did -ra wpm 6 Error
n257= did -ra wpm 12 $duration(%time.elapsed)
n258= }
n259= else {
n260= did -ra wpm 12 $duration(%time.elapsed)
n261= set %txt.def $did(wpm,1).text
n262= set %words.def $numtok(%txt.def,32)
n263= did -ra wpm 17 %words.def
n264= set %wpm.def $calc((%words.def / %time.elapsed) * 60)
n265= set %wpm.end $int(%wpm.def)
n266= did -ra wpm 6 %wpm.end
n267= set %wpm.use $calc(%wpm.use + 1)
n268= set %wpm.add $calc(%wpm.add + %wpm.end)
n269= set %wpm.avg $calc(%wpm.add / %wpm.use)
n270= did -ra wpm 8 $int(%wpm.avg)
n271= if (%wpm.end > %wpm.peak) {
n272= set %wpm.peak %wpm.end
n273= did -ra wpm 10 %wpm.peak
n274= }
n275= }
n276=}