mIRC Home    About    Download    Register    News    Help

Print Thread
#177774 31/05/07 04:39 AM
B
bojak71730
bojak71730
B
ok i have a two questions. i was wonder is there a way that i can make a script so i can type in a certain color all the time? and is there a way you can make it so that it only does the colors on a certain server my colors i picked are 2,3

#177792 31/05/07 11:42 AM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Code:
on *:input:*: {
  if (/* iswm $1) { return }
  if ($network == Undernet) {
    msg $active 02,03 $+ $1-
    halt
  }
}


Change Undernet to whatever network you're using. To make sure you use the correct name, go to your network and type:

//echo -a $network

Last edited by Riamus2; 31/05/07 11:46 AM.
Riamus2 #177819 31/05/07 07:28 PM
B
bojak71730
bojak71730
B
is there any way to have multiple networks

#177834 31/05/07 10:12 PM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
change
Code:
if ($network == Undernet)
to
Code:
if $istok(network1 network2 network3 network4,$network,32)

RusselB #177839 01/06/07 12:02 AM
B
bojak71730
bojak71730
B
Code:
 on *:input:*: {
  if (/* iswm $1) { return }
  if ($network == Undernet) {
    msg $active 02,03 $+ $1-
    halt
  }
}
 
with the code givin above is there a way i can create an on and off switch like !on would do the colors 2,3 and !off just do black text only and again thanks for helpin me

#177841 01/06/07 12:32 AM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Code:
on *:input:*: {
  if ($1 == !on) { set %colorinput On | return }
  elseif ($1 == !off) { set %colorinput Off | return }
  if (%colorinput != On) { return }
  if (/* iswm $1) { return }
  if ($network == Undernet) {
    msg $active 02,03 $+ $1-
    halt
  }
}

Riamus2 #177844 01/06/07 12:58 AM
B
bojak71730
bojak71730
B
the !off command works however the !on command does not

#177849 01/06/07 02:22 AM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Paste what you have.

Riamus2 #177875 01/06/07 04:10 PM
B
bojak71730
bojak71730
B
Code:
  *:input:*: {
  if ($1 == !on) { set %colorinput On | return }
  elseif ($1 == !off) { set %colorinput Off | return }
  if (%colorinput != On) { return }
  if (/* iswm $1) { return }
  if ($network == Undernet) {
    msg $active 02,03 $+ $1-
    halt
  }
}
 


thats what i have the on switch doesnt work

#177891 01/06/07 11:10 PM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
You're missing the ON parameter of the ON INPUT event.

change the very first line to
Code:
on *:input:*:{

#207715 29/12/08 03:53 AM
B
bojak71730
bojak71730
B
Originally Posted By: bojak71730
Code:
 on *:input:*: {
  if ($1 == !on) { set %colorinput On | return }
  elseif ($1 == !off) { set %colorinput Off | return }
  if (%colorinput != On) { return }
  if (/* iswm $1) { return }
  if ($network == Undernet) {
    msg $active 02,03 $+ $1-
    halt
  }
}
 




how would i get the above script to do all of that plus be in more detail to add so it only works for a certain channel?

#207718 29/12/08 05:02 AM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
To limit it to a single channel, change $active to the channel name.

Here's a little re-write
Code:
on *:input:#channel:{
  set colorinput $iif($1 == !on,$true,$iif($1 == !off,$false,%colorinput))
  if %colorinput {
    if (/* !iswm $1) {
      if ($network == Undernet) {
        msg $chan 02,03 $+ $1-
        halt
      }
    }
  }
}

RusselB #207720 29/12/08 05:41 AM
B
bojak71730
bojak71730
B
Code:
 on *:input:#channel:{
  set colorinput $iif($1 == !on,$true,$iif($1 == !off,$false,%colorinput))
  if %colorinput {
    if (/* !iswm $1) {
      if ($network == Undernet) {
        msg #tcmafia 02,03 $+ $1-
        halt
      }
    }
  }
}


so this is the correct code that will work only on this channel?

#207721 29/12/08 06:31 AM
Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
Change
Code:
on *:input:#channel:{


to
Code:
on *:input:#tcmafia:{



Tomao #207723 29/12/08 07:20 AM
B
bojak71730
bojak71730
B
Code:
 on *:input:#tcmafia:{
  set colorinput $iif($1 == !on,$true,$iif($1 == !off,$false,%colorinput))
  if %colorinput {
    if (/* !iswm $1) {
      if ($network == Undernet) {
        msg $chan 02,03 $+ $1-
        halt
      }
    }
  }
}
that didnt work so well it gave me this error .. * /set: invalid parameters (line 2, script1.ini)

#207724 29/12/08 08:00 AM
Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
RusselB has missed a % in his code:

Quote:
on *:input:#tcmafia:{
set %colorinput $iif($1 == !on,$true,$iif($1 == !off,$false,%colorinput))
if %colorinput {
if (/* !iswm $1) {
if ($network == Undernet) {
msg $chan 02,03 $+ $1-
halt
}
}
}
}


That should fix the error.


Link Copied to Clipboard