mIRC Home    About    Download    Register    News    Help

Print Thread
#171406 24/02/07 12:00 AM
Joined: Feb 2007
Posts: 9
M
Mogar Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Feb 2007
Posts: 9
trying to make my own script but it seems my theme and my random color script dont like to work together
Code:
ON *:INPUT:#:{
  if (($left($1,1) == $readini(mirc.ini,text,commandchar)) && (!$ctrlenter) || ($active == Status Window)) return
  haltdef
  echo -t # 4[15 $+ $me $+ 4]4 $1-
  .msg #  $1-
}


and
Code:
alias cotalk {
  if (%cotalk) {
    unset %cotalk
    echo -ac info * Color Talker: Off
  }
  else {
    set %cotalk 1
    echo -ac info * Color Talker: On
  }
}
on *:input:*: {
  if (%cotalk) && ($left($1-,1) != /) {
    if ($left($1-,1) isnum) {
      msg $active $+($chr(3) $+ $r(1,15) $+ $chr(32) $+ $1- $+ $chr(3))
      halt
    } 
    else {
      msg $active $+($chr(3) $+ $r(1,15) $+ $1- $+ $chr(3))
      halt
    }
  }
}




can anyone help me make them work together?

Last edited by Mogar; 24/02/07 12:11 AM.
Mogar #171407 24/02/07 12:13 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Try this (untested):

Code:
ON *:INPUT:#:{
  if (($left($1,1) == $readini(mirc.ini,text,commandchar)) && (!$ctrlenter) || ($active == Status Window)) return
  var %text = $1-
  if (%cotalk) {
    if ($left($1-,1) isnum) {
      var %text = $+($chr(3),$r(1,15),$chr(32),$1-,$chr(3))
    } 
    else {
      var %text = $+($chr(3),$r(1,15),$1-,$chr(3))
    }
  }
  echo -t # 4[15 $+ $me $+ 4]4 %text
  .msg # %text
  haltdef
}


Keep your alias as-is.

Btw, look at how I did the $+( ) parts. The reason you would use $+( ) is to avoid a lot of $+'s between different things that you want combined.


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2007
Posts: 9
M
Mogar Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Feb 2007
Posts: 9
still didnt fix the conflict

Quote:
[19:34:11] <Mogar> 13testing
[19:34:11] 4[15Mogar4]4 11testing


but now it half works lol

Last edited by Mogar; 24/02/07 12:35 AM.
Mogar #171413 24/02/07 02:39 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Make sure you don't have another on INPUT event that is conflicting. I just tested this and it's working fine.

Quote:

[21:34:41] 4[15ClassyBot4]4 8test
[21:34:41] 4[15ClassyBot4]4 5test
[21:34:43] 4[15ClassyBot4]4 13test


Also, one thing I'll suggest is to make the colors 2-digit or you'll run into problems.

Change your hardcoded colors (4) to double digit (04). And replace both occurences of $r(1,15) with:

$base($r(1,15),10,10,2)

That will guarantee that you won't have problems with the colors and text starting with a number.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard