|
Joined: Jan 2007
Posts: 280
Fjord artisan
|
OP
Fjord artisan
Joined: Jan 2007
Posts: 280 |
Is there an Option/Script for:
When you're typing !Scripts the bot will say all the scripts that are loaded or are in remote?
Like:
<TesT> !Scripts <TesT2> mirc.ini mirc1.ini mirc4.ini
That stuff
Last edited by DuXxXieJ; 09/05/07 04:36 PM.
Squee whenever a squee squee's. Squee whenever a squee does not squee.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
on *:text:!scripts:#:{
var %cnt = $script(0)
while (%cnt) {
var %scripts = $nopath($script(%cnt)) %scripts
dec %cnt
}
msg $chan %scripts
}
Or, if you want it easier to read, you can add colors:
on *:text:!scripts:#:{
var %cnt = $script(0)
while (%cnt) {
var %scripts = $+ $rand(3,15) $nopath($script(%cnt)) %scripts
dec %cnt
}
msg $chan %scripts
}
Keep in mind that either method will have problems if you have too many scripts loaded -- * /set : line too long or whatever the error is. However, you'll need either a LOT of scripts loaded or else really long filenames for them. I have 31 loaded and it works fine and that's more scripts than most people keep loaded.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jan 2007
Posts: 280
Fjord artisan
|
OP
Fjord artisan
Joined: Jan 2007
Posts: 280 |
Thanks
Squee whenever a squee squee's. Squee whenever a squee does not squee.
|
|
|
|
Joined: Jan 2007
Posts: 280
Fjord artisan
|
OP
Fjord artisan
Joined: Jan 2007
Posts: 280 |
Maybe a late reply, but I was busy this year. Today I tried to make it from a TEXT to a INPUT script, but it doesn't work. What's wrong with:
on *:INPUT:!scripts:{
var %cnt = $script(0)
while (%cnt) {
var %scripts = $+ $rand(3,15) $nopath($script(%cnt)) %scripts
dec %cnt
halt
}
echo -a %scripts
halt
} I added halt functions so my input wont be seen in a channel <so it wont be posted in a channel>.I also tried this: on *:INPUT:*:{
if $1 == !scripts {
var %cnt = $script(0)
while (%cnt) {
var %scripts = $+ $rand(3,15) $nopath($script(%cnt)) %scripts
dec %cnt
halt
}
echo -a %scripts
halt
}
}
Squee whenever a squee squee's. Squee whenever a squee does not squee.
|
|
|
|
Joined: Dec 2005
Posts: 58
Babel fish
|
Babel fish
Joined: Dec 2005
Posts: 58 |
on *:INPUT:!scripts:{
var %cnt = $script(0)
while (%cnt) {
var %scripts = $+ $rand(3,15) $nopath($script(%cnt)) %scripts
dec %cnt
}
echo -a %scripts
halt
}
i like that
|
|
|
|
Joined: Jul 2006
Posts: 4,145
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,145 |
You've corrected the fact that he was halting the script before to echo %scripts, but you don't correct the fact that the on input event does not work like that (on *:input:!trigger:{). Also, little thing like this could be done with one $regsubex : on *:INPUT:*:{
if ($1- == !scripts) {
echo -a $regsubex($str(a,$script(0)),/a/g,$+($chr(3),$r(3,14),$nopath($script(\n)),$chr(15),$chr(32)))
halt
}
}
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Jan 2007
Posts: 280
Fjord artisan
|
OP
Fjord artisan
Joined: Jan 2007
Posts: 280 |
Thanks! This one works fine
Squee whenever a squee squee's. Squee whenever a squee does not squee.
|
|
|
|
Joined: Jan 2007
Posts: 280
Fjord artisan
|
OP
Fjord artisan
Joined: Jan 2007
Posts: 280 |
Ok, I still use it and it shows perfectly my bot's loaded scripts. But, I've got like 40 scripts loaded and now it doesn't fit anymore when he needs to say it xD. How can I get it to 2 single messages? Example: <DJ-Serv> SCRIPTS: script1 script2 script3 (untill it doesn't fit anymore) <DJ-Serv> SCRIPTS: script40 script41 (untill it doesn't fit anymore again)Script: on 20:text:.scripts:#:{
var %cnt = $script(0)
while (%cnt) {
var %scripts = $+ $rand(3,15) $+ $nopath($script(%cnt)) %scripts
dec %cnt
}
msg $chan SCRIPTS: %scripts
}
-EDIT- This is what he shows when it doesn't fit: <+DJ-Serv> SCRIPTS: Load Disconnect QueryAccess TotalScripts Modes Nickchanger Scripts Nickcheck EightBall Network Highlight AddVar DLLCheck Annoy Open First Unset NTWRK-Echo Upgrade001 Reconnect Connect [De]Oper Killing ChanCentral ChannelAccess OperHelp Calc FunCom Weather2 AutoVoice Topic Loggin AddUrl Annoy3 Idle Access RulesList NTWRK WhoisKill AdminShow VHosThe LAST one (VHos) should be VHostShow. So it doesn't fit
Last edited by DuXxXieJ; 18/01/09 01:51 PM.
Squee whenever a squee squee's. Squee whenever a squee does not squee.
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
The max. text lengh per line varies from network to network. Below, "250" is used (to play safe), you may try putting a higher number there. on 20:text:.scripts:#:{
var %cnt = 1, %scripts
; loop scripts
while ($script(%cnt)) {
; add the currently processed script to the variable
var %scripts = %scripts $+(,$base($rand(3,15),10,10,2),$nopath($v1))
; if the variable reached a certain length: output, clear variable
if ($len(%scripts) > 250) {
msg $chan SCRIPTS: %scripts
var %scripts
}
inc %cnt
}
; all scripts processed. if there is remaining data in the variable: output
if (%scripts) { msg $chan SCRIPTS: %scripts }
} "$base(N,10,10, 2)" is used to ensure numbers are in 2-digit-format (e.g. "05" instead of "5") for the random colors.
|
|
|
|
Joined: Jan 2007
Posts: 280
Fjord artisan
|
OP
Fjord artisan
Joined: Jan 2007
Posts: 280 |
Yes, thank you! I have changed the 250 first to 300, that worked fine, then I made it to 400. Works fine too. No errors given so. Another question: When the second message is full ("doesn't fit anymore"), wil it automaticly msg a new msg? So not 2 message's but 3 message's -Bad in english-
Squee whenever a squee squee's. Squee whenever a squee does not squee.
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
Yepp, it will. Note that at the moment it won't delay the output of the lines itself - so if you want to send a large list (a dozen lines), the script may count the lines and delay each line with a timer: on 20:text:.scripts:#:{
var %cnt = 1, %scripts, %lines = 0
; loop scripts
while ($script(%cnt)) {
; add the currently processed script to the variable
var %scripts = %scripts $+(,$base($rand(3,15),10,10,2),$nopath($v1))
; if the variable reached a certain length: output, clear variable
if ($len(%scripts) > 250) {
.timer 1 %lines msg $chan SCRIPTS: %scripts
var %scripts
inc %lines
}
inc %cnt
}
; all scripts processed. if there is remaining data in the variable: output
if (%scripts) { .timer 1 %lines msg $chan SCRIPTS: %scripts }
}
|
|
|
|
|