mIRC Home    About    Download    Register    News    Help

Print Thread
(TWITCH) Addcom that can use $nick, $2, etc.. #259253 23/10/16 11:45 AM
Joined: Aug 2016
Posts: 6
B
Blinakk Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Aug 2016
Posts: 6
Hi, so I'm using a simple addcom script.
But it doesn't seem to that you can use $nick and stuff like that.

For example: !addcom !test Testing some stuff, $nick $+ .

Thanks.

Re: (TWITCH) Addcom that can use $nick, $2, etc.. [Re: Blinakk] #259254 23/10/16 12:36 PM
Joined: Jun 2015
Posts: 84
F
Fonic_Artes Offline
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
To allow it to use things like $nick would allow it to be very unsafe if you're reading from files.

Now, you could instead have it say read aliases that would replace a specific phrase (ex. @user@ would replace it with their $nick) which using $replace for it would work.

Here's an example of what I have for calling commands.

Code:
on $*:text:/^!.*/iS:#: {
  var %file = data\Commands\commands_ [ $+ [ $mid(#,2) ] ] $+ .ini
  var %command = $mid($1,2)
  var %opList = $read(data\Operators_List\Op_List_ [ $+ [ $mid(#,2) ] ] $+ .txt, nw, $nick)
  var %rCommand = $readini(%file, n,%command,command)
  var %head = $ini(%file,%command)
  var %level = $readini(%file, n,%command,level)
  var %eCommand = $replace(%rcommand, @user, $displayName($nick), @target, $iif($followName($2), $followName($2),$captial($2-)))
  if (%flood. [ $+ [ $mid(#,2) ] $+ $1 $+ ]) { halt }
  if (%level == Moderator && %opList) { set -u5 %flood. $+ $mid($1,2) | msg # %eCommand }
  if (%level == Owner && $nick == $mid(#,2)) { set -u5 %flood. $+ $mid($1,2) | msg # %eCommand }
  if (%level == Everyone) { set -u5 %flood. $+ $mid($1,2) | msg # %eCommand }

}