An autotalker for any program/game, for mIRC. Activate it in mirc and add everything you want. Press start and open the window you want it to type to. There you go.
alias autotalker { dialog -dm autotalker autotalker }
dialog autotalker {
title "mIRC AutoTalker V2.1"
size -1 -1 300 300
list 1, 50 22 200 200
button "Add" 2, 25 230 50 20
button "Delete" 3, 25 260 50 20
button "Options" 4, 220 230 60 20
button "Start" 5, 100 230 100 55
button "Save/Load list", 6, 210 260 80 20
Button "Delete all" 7, 60 2 80 20
}
on *:Dialog:autotalker:sclick:6:{
dialog -m Save Save
}
on *:dialog:save:sclick:2:{
/var %dir = $sfile($mircdir $+ Autotalker\,Select your file,Load)
if ($mircdir $+ Autotalker !isin %dir) || (HElpfile isin %dir) || ($mircdir $+ Autotalker\Autotext.txt == %dir) || (.txt != $right(%dir,4)) { /noop $input(Error! Illegal file!) | halt }
var %x = 1
while (%x <= $lines(%dir)) {
did -a autotalker 1 $read(%dir,%x)
inc %x
}
dialog -x Save
}
on *:dialog:autotalker:sclick:7:{
if ($input(Do you wanna save this list?,y)) {
if (!$did(Autotalker,1).lines) { /noop $input(Error! No text found!) | halt }
var %contin = $true
var %filename = $remove($?="Filename?",.txt)
if (%filename == AutoText) || (%filename isin $did(3)) { /noop $input(Error! Reserved file name!) | halt }
if ($findfile($Mircdir $+ Autotalker,$replace(%filename,$chr(32),_) $+ .txt,1)) var %contin $?!="This file already exists, do you want to overwrite it?"
if (%contin != $True) halt
write -c Autotalker\ $+ $replace(%filename,$chr(32),_) $+ .txt
var %x = 1
while (%x <= $did(Autotalker,1).lines) {
write AutoTalker\ $+ $replace(%filename,$chr(32),_) $+ .txt $did(Autotalker,1,%x)
inc %x
}
}
elseif (!$input(Are you sure you wanna delete this list?,y)) halt
did -r autotalker 1
}
on *:Dialog:save:sclick:1:{
if (!$did(Autotalker,1).lines) || (!$did(3)) { /noop $input(Error! No text/filename found!) | halt }
var %contin = $true
if ($did(3) == AutoText) || (Helpfile isin $did(3)) { /noop $input(Error! Reserved file name!) | halt }
if ($findfile($Mircdir $+ Autotalker,$replace($did(3),$chr(32),_) $+ .txt,1)) var %contin $?!="This file already exists, do you want to overwrite it?"
if (%contin != $True) halt
write -c Autotalker\ $+ $replace($did(3),$chr(32),_) $+ .txt
var %x = 1
while (%x <= $did(Autotalker,1).lines) {
write AutoTalker\ $+ $replace($did(3),$chr(32),_) $+ .txt $did(Autotalker,1,%x)
inc %x
}
dialog -x Save
did -r autotalker 1
}
on *:dialog:autotalker:init:*:{
if (!%optionsec) set %optionsec 10
var %x = 1
while (%x <= $lines(AutoTalker\autotext.txt)) {
did -a $dname 1 $read(AutoTalker\autotext.txt,%x)
inc %x
}
if (!$finddir($mircdir,Autotalker,1)) {
set %optionsec 10
mkdir AutoTalker
.copy $remove($Script,$mircdir) AutoTalker\AutoTalkerScript.ini
.remove $nopath($Script)
}
}
on *:dialog:autotalker:close:*:{
stopautotalk
var %x = 1
/write -c AutoTalker\autotext.txt
var %x = 1
while ($did(1,%x)) {
write AutoTalker\AutoText.txt $v1
inc %x
}
}
dialog Save {
title "Save/Load lists"
size -1 -1 200 50
edit "Filename" 3, 00 1 200 20
Button "Save", 1, 0 30 85 20
Button "Load", 2, 85 30 85 20
}
on *:dialog:autotalker:sclick:3:{ /did -d autotalker 1 $did(1).sel }
on *:dialog:autotalker:sclick:5:{ if (%Atalk == on) stopautotalk
else /startautotalk }
on *:dialog:autotalker:sclick:2:{ dialog -m add add }
on *:dialog:autotalker:sclick:4:{ dialog -m options options }
dialog options {
title "Options"
size -1 -1 120 50
text "Sec/Message" 1, 5 10 80 15
check "Random Message" 2, 5 30 120 15
edit "" 3, 75 8 20 18
}
on *:dialog:options:init:*:{
/did -a options 3 %optionsec
if (%optionrandom) { did -c options 2 }
}
on *:dialog:options:close:*:{
if ($did(3)) set %optionsec $did(3)
set %optionrandom $did(2).state
}
dialog add {
title "Add lines"
size -1 -1 200 50
edit "" 1, 00 1 200 20, autohs
combo 2, 0 30 85 20, drop
combo 3, 85 30 85 20, drop
button "Add" 15, 170 30 30 20
}
on *:dialog:add:init:*:{ /did -ca add 2 None
/did -a add 2 White
/did -a add 2 Green
/did -a add 2 Purple
/did -a add 2 Red
/did -a add 2 Cyan
/did -a add 2 Glow1
/did -a add 2 Glow2
/did -a add 2 Glow3
/did -a add 2 Flash1
/did -a add 2 Flash2
/did -a add 2 Flash3
/did -ca add 3 None
/did -a add 3 Wave
/did -a add 3 Wave2
/did -a add 3 Slide
/did -a add 3 Shake
/did -a add 3 Scroll
}
on *:dialog:add:sclick:15:{
if ($did(2).seltext != none) /var %code = $did(2).seltext $+ :
if ($did(3).seltext != none) /var %code = %code $+ $did(3).seltext $+ :
/var %code = %code $+ $did(1)
/did -a autotalker 1 %code
did -r add 1
}
alias startautotalk { did -ra autotalker 5 Stop
set %atalk on
set %line 1
.timerautotalk 0 $calc($iif(%optionsec,$v1,10) - ($r(8,15) / 10)) /chooseline
}
alias chooseline {
if (%optionrandom) set %nextmsg $r(1,$did(autotalker,1).lines)
else set %nextmsg $iif(%nextmsg >= $did(autotalker,1).lines,1,$calc(%nextmsg + 1))
Lasttalk $did(autotalker,1,%nextmsg).text
}
alias stopautotalk { did -ra autotalker 5 Start
unset %atalk
.timerautotalk off }
alias Lasttalk {
if (!$appactive) { .comopen a WScript.Shell | .comclose a $com(a,SendKeys,3,bstr,$1- {ENTER}) }
}
Thanks for your feedback Bielie, but i made this script a long time ago and people were asking if I could give them the script. All the things you said I do know (now), but I can't be bothered editing.
I don't think it is neccesairy to write to scriptdir, aslong as you're using $read(ini) with the same dir. Correct me if i'm wrong.
You guys were right about the message part. I changed it ($active to $appactive), works now
Honestly, i didn't try your snippet but when i was reading your code, i thought these tips might be useful for you:
1) This alias will cause an error if the dialog is already open:
alias autotalker { dialog -dm autotalker autotalker }
It's better to write like this:
alias autotalker {
dialog $iif($dialog(autotalker),-v,-dm autotalker) autotalker
}
2) When you want to add some items in a ComboBox, you can use /didtok instead of adding your items one by one
/did -ca add 2 None
/did -a add 2 White
/did -a add 2 Green
/did -a add 2 Purple
/did -a add 2 Red
/did -a add 2 Cyan
/did -a add 2 Glow1
/did -a add 2 Glow2
/did -a add 2 Glow3
/did -a add 2 Flash1
/did -a add 2 Flash2
/did -a add 2 Flash3
/did -ca add 3 None
/did -a add 3 Wave
/did -a add 3 Wave2
/did -a add 3 Slide
/did -a add 3 Shake
/did -a add 3 Scroll
Could be:
didtok $dname 2 32 None White Green Purple Red Cyan Glow1 Glow2 Glow3 Flash1 Flash2 Flash3
did -c $dname 2 1
didtok $dname 3 32 None Wave Wave2 Slide Shake Scroll
did -c $dname 3 1
3) And all off those slashes are useless in remote.
4) When you're writing an addon or a snippet, you MUST use $scriptdir to save your data, but you're using mIRC's root directory.
while ($did(1,%x)) {
write AutoTalker\AutoText.txt $v1
inc %x
}
This can be done by adding a $scriptdir in your code like this:
while ($did(1,%x)) {
write $scriptdirAutoText.txt $v1
inc %x
}
Hope i could help you a bit to improve your snippet.
Good Luck.