mIRC Home    About    Download    Register    News    Help

Print Thread
(Twitch) Help #261073 26/07/17 04:07 AM
Joined: Sep 2016
Posts: 33
P
Predatorfusion Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Sep 2016
Posts: 33
Anyone have a !addcom !delcom and !editcom script that works with $2 $nick etc?

Re: (Twitch) Help [Re: Predatorfusion] #261234 20/08/17 02:47 PM
Joined: Jan 2017
Posts: 43
K
KubosKube Offline
Ameglian cow
Offline
Ameglian cow
K
Joined: Jan 2017
Posts: 43
Assuming that "com" is "command",

and assuming that users can pick their command,

and assuming each user only gets one command,

and assuming you only want the command to return plain text,

This code will write to CustomCommands.ini and will reply with the saved command when prompted with "!cc" or "!customcommand".

You can optionally specify to use someone else's command.

For !delcom, only the user with a nick named Predatorfusion can delete a custom command that is not their own.
i.e., DarthVader can only delete DarthVader's custom command, but Predatorfusion can delete DarthVader's command AND DarthMaul's command.

As for "!editcom", you can just re-submit !addcom and it will overwrite the old command.

Code:
on *:TEXT:!c*c*:#: {
  if ($1 == !customcommand || $1 == !cc) {
    set %temp $nick
    if ($2) { set %temp $2 }
    msg $chan /me $readini(C:\FilePath\CustomCommands.ini, Commands, %temp)
  }
}

on *:TEXT:!addcom*:#: {
  writeini C:\FilePath\CustomCommands.ini Commands $nick $2-
}

on *:TEXT:!delcom*:#: {
  if ($nick == Predatorfusion) {
    remini C:\FilePath\CustomCommands.ini Commands $2
  }
  else {
    remini C:\FilePath\CustomCommands.ini Commands $nick
  }
}

Re: (Twitch) Help [Re: KubosKube] #261235 20/08/17 02:54 PM
Joined: Jul 2006
Posts: 3,574
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,574
Watch out for the tricky Mike


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net