mIRC Home    About    Download    Register    News    Help

Print Thread
Option for scripts #176410 09/05/07 04:36 PM
Joined: Jan 2007
Posts: 280
DuXxXieJ Offline OP
Fjord artisan
OP Offline
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.
Re: Option for scripts [Re: DuXxXieJ] #176412 09/05/07 04:50 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Code:
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:
Code:
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
Re: Option for scripts [Re: Riamus2] #176413 09/05/07 04:59 PM
Joined: Jan 2007
Posts: 280
DuXxXieJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2007
Posts: 280
Thanks smile


Squee whenever a squee squee's. Squee whenever a squee does not squee.
Re: Option for scripts [Re: Riamus2] #207513 20/12/08 01:07 PM
Joined: Jan 2007
Posts: 280
DuXxXieJ Offline OP
Fjord artisan
OP Offline
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:

Code:
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:


Code:
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.
Re: Option for scripts [Re: DuXxXieJ] #207515 20/12/08 02:34 PM
Joined: Dec 2005
Posts: 58
S
SCNDRL Offline
Babel fish
Offline
Babel fish
S
Joined: Dec 2005
Posts: 58
Code:
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
Re: Option for scripts [Re: SCNDRL] #207516 20/12/08 02:51 PM
Joined: Jul 2006
Posts: 3,764
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,764
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 :

Code:
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
 }
}




Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Option for scripts [Re: Wims] #207592 23/12/08 08:24 PM
Joined: Jan 2007
Posts: 280
DuXxXieJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2007
Posts: 280
Thanks! This one works fine smile


Squee whenever a squee squee's. Squee whenever a squee does not squee.
Re: Option for scripts [Re: Wims] #208308 18/01/09 01:48 PM
Joined: Jan 2007
Posts: 280
DuXxXieJ Offline OP
Fjord artisan
OP Offline
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:
Code:
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 VHos

The LAST one (VHos) should be VHostShow. So it doesn't fit frown


Last edited by DuXxXieJ; 18/01/09 01:51 PM.

Squee whenever a squee squee's. Squee whenever a squee does not squee.
Re: Option for scripts [Re: DuXxXieJ] #208312 18/01/09 02:15 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
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.

Code:
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.

Re: Option for scripts [Re: Horstl] #208313 18/01/09 02:22 PM
Joined: Jan 2007
Posts: 280
DuXxXieJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2007
Posts: 280
Yes, thank you! smile 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.
Re: Option for scripts [Re: DuXxXieJ] #208314 18/01/09 02:29 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
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:
Code:
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 }
}