mIRC Homepage
Posted By: Trixar_za How can I have commands work with this? - 22/02/07 11:51 AM
Is there a way I can get mIRC's commands and the server's commands to work without losing the functionality of the other? Is there also a way I can reduce all the on text and on action's? Seems redundent to use so many.

Code:
on *:INPUT:*:{ 
  if / isin $1- { if $1 == /me { .describe $active $2- | echo -tc $active 12* $me $2- | halt } 
    if : isin $1 { goto p1 | halt }
    else { .quote $remove($1-,/) | halt }
    haltdef
  } 
  :p1
  echo -tmc $nick 4[ $+ $me $+ 4] $1-
  .msg $active $1-
  haltdef
}
on ^*:TEXT:*:#:{
  var %channel = #
  echo -tlbf %channel 7[ $+ $nick $+ 7] $1-
  haltdef
}
on ^*:ACTION:*:#:{
  var %channel = #
  echo -tlbf %channel 12* $nick $1- 
  haltdef
}
on ^*:TEXT:*:?:{
  var %nickname = $nick
  echo -tlbf %nickname 7[ $+ $nick $+ 7] $1-
  haltdef
}
on ^*:ACTION:*:?:{
  var %nickname = $nick
  echo -tlbf %nickname 12* $nick $1- 
  haltdef
}
on ^*:CHAT:*:{
  var %chatin = $nick
  echo -tlbf = $+ %chatin 7[ $+ $nick $+ 7] $1-
  haltdef
}
on ^*:ACTION:*:=:{
  var %chatin = $nick
  echo -tlbf = $+ %chatin 12* $nick $1- 
  haltdef
}
Posted By: Riamus2 Re: How can I have commands work with this? - 22/02/07 02:15 PM
Well, you can do this:

Code:
on *:INPUT:*:{ 
  if ($left($1,1) == /) {
    if ($1 == /me) {
      .describe $active $2-
      echo -tc $active 12* $me $2-
    } 
    elseif (: isin $1) {
      echo -tmc $nick 4[ $+ $me $+ 4] $1-
      .msg $active $1-
    }
    else { .quote $remove($1-,/) }
    haltdef
  } 
}
on ^*:TEXT:*:*:{
  var %target = $iif($chan,$chan,$nick)
  echo -tlbf %target 7[ $+ $nick $+ 7] $1-
  haltdef
}
on ^*:ACTION:*:=:{
  echo -tlbf =$nick 12* $nick $1- 
  haltdef
}
on ^*:ACTION:*:*:{
  var %target = $iif($chan,$chan,$nick)
  echo -tlbf %target 12* $nick $1- 
  haltdef
}
on ^*:CHAT:*:{
  echo -tlbf =$nick 7[ $+ $nick $+ 7] $1-
  haltdef
}


Yes, I did adjust your on INPUT event so you weren't doing many things on a single line because I like reading it spread out. If you don't like that, you can use the pipes (|) again.
Code:
on *:INPUT:*:{ 
  if ($left($1,1) == /) {
    if ($1 == /me) {
      .describe $active $2-
      echo -tc $active 12* $me $2-
    } 
    elseif (: isin $1) {
      echo -tmc $nick 4[ $+ $me $+ 4] $1-
      .msg $active $1-
    }
    else { .quote $remove($1-,/) }
    haltdef
  } 
}


Slight error in this part of the script, now the script only changes the <> around my nickname when : is in front of the text, I only added that in to ensure I can use the smiley smirk. Btw all I have access to now is server commands.

-- Sorry if the above sounded harsh, I have termanal foot in mouth disease, really need to learn to think about what I'm going to say instead of just typing smirk. Anyway Thanx to all that helped smile
Posted By: Riamus2 Re: How can I have commands work with this? - 22/02/07 09:45 PM
Code:
on *:INPUT:*:{ 
  if ($1 == /me) {
    .describe $active $2-
    echo -tc $active 12* $me $2-
  } 
  else { .quote $remove($1-,/) | haltdef }
  echo -tmc $nick 4[ $+ $me $+ 4] $1-
  .msg $active $1-
  haltdef
}


Well, I removed the first IF as it really isn't necessary. I'm not sure why you're removing /'s from text. Perhaps an explanation as to why you want to remove them would be helpful.

I also adjusted the : part as I misunderstood what you were after. This should handle that correctly now. If not, please give some examples showing what it currently does and what you want it to do instead.
Generally to get the following effect:

[11:17am][Trixar_za] these*
[11:17am][Cheeky_Bratz] oh

Seems it is easy to do the one for the other chatters, but hard for oneself smirk

The reason I removed the / is to get access to (server) commands, which for some odd reason doesn't work when using this method to replace the < > around one's nickname. Only thing is I lost the mIRC commands like /msg. Is there any way I can check for mIRC commands without having to code them all in?
Posted By: Riamus2 Re: How can I have commands work with this? - 23/02/07 02:19 PM
Ok, I had time to work with it. This seems to do what you need:

Code:
on *:INPUT:*:{ 
  if ($1 == /me) {
    .describe $active $2-
    echo -tc $active 12* $me $2-
    halt
  }
  elseif ($left($1-,1) == /) { return }
  echo -tmc $nick 4[ $+ $me $+ 4] $1-
  .msg $active $1-
  haltdef
}
Just need a simple return and not a halt? lol. It's always something simple, isn't it? Odd, How I complicated it for myself :P

Anyway thank you Riamus2 for your all your help smile
Posted By: Riamus2 Re: How can I have commands work with this? - 23/02/07 10:54 PM
Np. Sorry for the confusion. I wasn't able to test it until later, so I wasn't seeing the problem. smile
© mIRC Discussion Forums