mIRC Home    About    Download    Register    News    Help

Print Thread
#230490 11/03/11 11:41 AM
Joined: Mar 2011
Posts: 1
S
Mostly harmless
OP Offline
Mostly harmless
S
Joined: Mar 2011
Posts: 1
I have a Script I have carried around for years that I happily give cudos to NyghtWulf who created it, but I have never seen any updates for it.
Could anyone help me update it to still be able to use it:
I am only using mirc 6.2 but know I will have to update eventually and it doesn't work all the time.

; Ghalerion Script
; By Kouketsu
;_________________________________________________________
;Currently Viewing: Roleplaying Scripts
;Description: Includes the mistake aliases for /me, a cut script, and a WPM calculator for you speed fighters out there.
;Aliases Defined: em, wpmcalc, disptxt, wpmcount, countstart, countend, stats
;Dialogs Included: wpm
;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
alias em { /me $1- }
alias ooc { msg $active (( $1- )) }
;Text cutter/colorer
;Made to keep from 'over running' the irc text buffer.
;There is no commands for this script. On any /me statement containing certain quote formats, it will activate and color them acordingly
;The script also detects if the current channel has +c (colorban) and if it does, it turns the color featuer off.
;On any post longer then 420 characters, the script will chop the text at the closest space, then post the runoff a second later.
;
;The quote coloring works like this:
; ((text)) for out of character or OOC text
; [text] for 'AI' text
; <text> for telepathic text
; "text" for normal speech text
; .oO( text ) for 'thought' bubble text (As requested by Draconia)
;
;
;I wrote this mostly for RolePlayers to stop the 'you got cut off' and such on IRC
;If you'd like more types of text quotes to be added, I can be contacted at nyghtwulf@gmail.com
;


on 1:input:*:{
;force script to only work with /me statements.
;if you would like to remove this restriction, comment out the following line,
;AND the marked line towards the end of this script
if ($1 == /me) {

;this section turns the text coloring engine on and off.
;If you would like to do this manualy, comment out these lines
;and set %AutoFormatting to either 'ON' or 'OFF'

if (c isincs $chan($chan).mode) {
%AutoFormatting = OFF
}
else {
%AutoFormatting = ON
}

;-------------------------------------------------------------
;Settings for the text parser engine

; Modify %CutStyle to your liking.
%CutStyle = 15,1(8-7=4C5u4t7=8-15)

;Modify %CStrailer to your liking.
%CStrailer = 6 11-12Continued2->

if ($mid(%AutoFormatting,1,1) != O) {
%AutoFormatting = ON
}

;The following sets colors and formatting for quoted text.
;Don't change the characters or things will look funny

%actioncolor = 14
%whisperTone = 13[

;telepath color set
%softTone = 5<

;normal speech color set
%normalTone = 7"4

;OOC color setting
%loudTone = 10((

;Cloud Text
%cloudTone = 12.oO(

;sets colors off at end *DO NOT CHANGE*
%endTone = 7 $+ " $+ %actioncolor
%endTone2 = > $+ %actioncolor
%endTone3 = ] $+ %actioncolor
%endTone4 = )) $+ %actioncolor
%endtone5 = ) $+ %actioncolor


; The following sets the search codes for automatic text coloring.
;DO NOT CHANGE BELOW THIS LINE!
;-----------------------------------------------------------------
%whisperQuote = [
%softQuote = <
%normalQuote = "
%loudQuote = ((
%cloudQuote = .oO(

%endquote = "
%endquote2 = >
%endquote3 = ]6
%endquote4 = ))
%endquote5 = )

%n = 1
%act = 0
%cut = 0
%QEnc = 0
%codes = $chr(0)
%chr = $chr(0)

if (($mid($1,1,2) == ) || ($mid($1,1,1) == ") || ($mid($1,2,1) == ")) {
%QEnc = 1
}

if ($1 == /me) {
%codes = $chr(3) $+ 6
%act = 1
%QEnc = 1
%len = 424 - $len($me)
}
else {
%act = 0
%len = 430 - $len($me)
}
if ($len($1-) > %len) {
%cut = 1
while (%chr != $chr(32)) {
%len = %len - 1
%chr = $mid($1-,%len,1)
}
%scantext = $left($1-,%len)
%lefttext = %scantext
%cuttext = $right($1-,$mid($1-,%len,0))
}
else {
%lefttext = $1-
}

if ((%AutoFormatting == ON) && (%QEnc == 1)) {
%scantext = $QuoteEncode(%scantext)
%lefttext = $QuoteEncode(%lefttext)
%cuttext = $QuoteEncode(%cuttext)
}

while (%n != 0) {
%n = $regsub(scan,%scantext,/([?]|\d{1 $+ $chr(44) $+ 2} $+ $chr(44) $+ ?\d?\d?)/,$chr(0),%scantext)
%codes = %codes $+ $regml(scan,1)
}
if (%cut == 1) {
.timerCutScript 1 1 /say %CutStyle $+  $+ %codes %cuttext
%lefttext = %lefttext $+ %CSTrailer
}
if (%act == 1) {
/me %actioncolor $+ [ $deltok(%lefttext,1,32) ]
/halt
}
else {
if ($mid(%lefttext,1,1) != /) {
/say %lefttext
/halt
}
}
}
;comment out the following one line to allow the script to act on all text that is inputed
}

alias QuoteEncode {
%CSQtext = $1-
%CSQtext = $replace(%CSQtext,$chr(32) $+ %whisperQuote,$chr(32) $+ %whisperTone)
%CSQtext = $replace(%CSQtext,$chr(32) $+ %softQuote,$chr(32) $+ %softTone)
%CSQtext = $replace(%CSQtext,$chr(32) $+ %normalQuote,$chr(32) $+ %normalTone)
%CSQtext = $replace(%CSQtext,$chr(32) $+ %loudQuote,$chr(32) $+ %loudTone)
%CSQtext = $replace(%CSQtext,$chr(32) $+ %CLoudQuote,$chr(32) $+ %cloudTone)

%CSQtext = $replace(%CSQtext,%endQuote $+ $chr(32),%endTone $+ $chr(32))
%CSQtext = $replace(%CSQtext,%endQuote2 $+ $chr(32),%endTone2 $+ $chr(32))
%CSQtext = $replace(%CSQtext,%endQuote3 $+ $chr(32),%endTone3 $+ $chr(32))
%CSQtext = $replace(%CSQtext,%endQuote4 $+ $chr(32),%endTone4 $+ $chr(32))
%CSQtext = $replace(%CSQtext,%endQuote5 $+ $chr(32),%endTone5 $+ $chr(32))
/return %CSQtext
}

dialog wpm {
title "IRC WPM Calculator"
size -1 -1 280 70
option dbu
edit "Press start or Alt + S to begin the counter. Hit the 'Enter' key to stop it.", 1, 4 40 241 10, autohs
edit "Your text will appear here.", 3, 4 4 241 30, read, return, multi
button "Stop", 2, 246 40 30 10, disable, hide, default
text "Speed:", 5, 4 57 17 10
edit "", 6, 22 56 20 10, read, autohs
text "Avg. Speed:", 7, 44 57 30 10
edit "", 8, 75 56 21 10, read, autohs
text "Peak:" 9, 139 57 15 10
edit "", 10, 154 56 20 10, read, autohs
text "Time Elapsed:", 11, 178 57 35

edit "", 12, 213 56 30 10, read, autohs
button "Reset", 13, 246 56 30 10
button "&Start", 14, 246 40 30 10, default
button "Print Current Stats", 15, 246 4 30 30, multi
text "Words:", 16, 98 57 17 10
edit "", 17, 116 56 20 10, read, autohs
}
on *:dialog:wpm:init:*: {
set %wpm.use 0
set %wpm.add 0
set %wpm.avg 0
did -ra wpm 10 %wpm.peak
}
on *:dialog:wpm:edit:1: {
did -e wpm 2
}
on *:dialog:wpm:sclick:*: {
if ($did == 14) {
countstart
did -r wpm 1
did -f wpm 1
did -bh wpm 14
did -ev wpm 2
}
if ($did == 2) {
countend
disptxt $did(wpm,1).text
stats
did -bh wpm 2
did -ev wpm 14
}
if ($did == 13) {
set %wpm.use 0
set %wpm.add 0
set %wpm.avg 0
set %wpm.peak 0
did -ra wpm 10 %wpm.peak
did -ra wpm 8 %wpm.avg
did -ra wpm 12 0
did -ra wpm 6 0
}
if ($did == 15) {
msg $active $gtalk(Ghalerion Script WPM Calculator Statistics:) $gtalk(Latest WPM: %wpm.end) $gtalk(Average WPM: %wpm.avg) $gtalk(Peak WPM: %wpm.peak)
}
}
alias wpmcalc {
if ($dialog(wpm) != $null) { dialog -v wpm | halt }
else { dialog -md wpm wpm }
}
alias disptxt {
if ($1 == /me) {
did -ra wpm 3 $replace($did(wpm,1).text,/me,$me)
}
else {
did -ra wpm 3 $did(wpm,1).text
}
}
alias wpmcount { set %time.elapsed $calc(%time.end - %time.start) }
alias countstart { set %time.start $ctime }
alias countend { set %time.end $ctime }
alias stats {
wpmcount
if (%time.elapsed == 0) {
did -ra wpm 6 Error
did -ra wpm 12 $duration(%time.elapsed)
}
else {
did -ra wpm 12 $duration(%time.elapsed)
set %txt.def $did(wpm,1).text
set %words.def $numtok(%txt.def,32)
did -ra wpm 17 %words.def
set %wpm.def $calc((%words.def / %time.elapsed) * 60)
set %wpm.end $int(%wpm.def)
did -ra wpm 6 %wpm.end
set %wpm.use $calc(%wpm.use + 1)
set %wpm.add $calc(%wpm.add + %wpm.end)
set %wpm.avg $calc(%wpm.add / %wpm.use)
did -ra wpm 8 $int(%wpm.avg)
if (%wpm.end > %wpm.peak) {
set %wpm.peak %wpm.end
did -ra wpm 10 %wpm.peak
}
}

Last edited by Shadeonyx; 11/03/11 11:42 AM.

Everything happens for a reason....Everything has a price
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Try to help us to help you. the problem where is it? what it does not working?


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Sep 2006
Posts: 59
R
Babel fish
Offline
Babel fish
R
Joined: Sep 2006
Posts: 59
mIRC Versions 7 and above chop the text and send the rest anyway so this doesn't need to be coded, as far as the checking of the colour ban mode you can just use something along the lines of..

Code:
on *:INPUT:*:{
 if (c isincs $chan($chan).mode) {
  if ($1 == /me) { privmsg $active $+($chr(1),ACTION $strip($2-),$chr(1)) }
 }
}


and so on...

Last edited by Rewtor; 11/03/11 02:11 PM.

Link Copied to Clipboard