Also, the file is a "temporary hold" for additional commands. The bot is being used in other channels, so giving them the flexibility to create basic chat commands that will respond is the idea here. Removing commands is just there for the user to remove, if they've made a mistake or something.

As I'll still be having control over the commands, I can move them into the main remote.ini file after the fact. The reason I have the .txt loaded, is if I don't load the file, and /reload after every edit, the command doesn't work in the chat. It's just a workaround, as I'm not giving people access to write to remote.ini (Which I don't think you can anyway).

I'll be honest, I'm probably going to re-code this into it's own API script in the future using c#, but that's a lot of work, and it's already coded quite well in mIRC, I'm not touching it for a while.

Code:

Code
on *:TEXT:!addcommand *:#: {
  if ($nick != eggfriedcheese) { return }
  .msg # ! Adding new command. Please Wait...
  write C:\Users\danie\AppData\Roaming\mIRC\additionalcommands.txt on *:TEXT:! [ $+ [ $remove($2,$chr(33)) ] ] [ $+ [ $chr(58) ] ] [ $+ [ $chan ] ] [ $+ [ $chr(58) ] ] [ $+ [ $chr(32) ] ] [ $+ [ $chr(123) ] ] [ $+ [ $chr(32) ] ] .msg # [ $+ [ $chr(32) ] ] [ $+ [ $remove($3-,$chr(124),$chr(123),$chr(125),$chr(91),$chr(93)) $chr(32) ] ] [ $+ [ $chr(125) ] ]
  .timer 1 2 .msg # ! The bot is reloading the command list, please wait...
  .timer 1 3 /reload -rs C:\Users\danie\AppData\Roaming\mIRC\additionalcommands.txt
  .timer 1 5 .msg # Command List Refreshed. Command ! [ $+ [ $remove($2,$chr(33)) ] ]  is now active.
}

on *:TEXT:!addcommandfull *:#: {
  if ($nick != eggfriedcheese) { return }
  .msg # ! Adding new command. Please Wait...
  write C:\Users\danie\AppData\Roaming\mIRC\additionalcommands.txt $2-
  .timer 1 2 .msg # The bot is reloading the command list, please wait...
  .timer 1 3 /reload -rs C:\Users\danie\AppData\Roaming\mIRC\additionalcommands.txt
  .timer 1 5 .msg # Command List Refreshed. Command is now active.
}

on *:TEXT:!removecommand *:#: {
  if ($nick != eggfriedcheese) { return }
  .msg # ! Removing command: $+ $chr(32) $+ ! $+ $remove($2,$chr(33)) $+ . Please Wait...
  var %match $+(on,$chr(32),*,:,TEXT,:,!,$remove($2,$chr(33)),:,$chan,:)
  var %match $read(additionalcommands.txt,nts,%match)
  if (%match != $null) write -dl $+ $readn additionalcommands.txt
  if (%match = $null) { .msg # Command not found in the database. | return }
  .timer 1 2 .msg # The bot is reloading the command list, please wait...
  .timer 1 3 /reload -rs C:\Users\danie\AppData\Roaming\mIRC\additionalcommands.txt
  .timer 1 5 .msg # Command List Refreshed. Command: ! [ $+ [ $remove($2,$chr(33)) $chr(32) ] ] has been removed.
}

on *:TEXT:!reload:#: {
  if ($nick != eggfriedcheese) { return }
  .msg # Reloading commands. Please Wait
  /reload -rs C:\Users\danie\AppData\Roaming\mIRC\additionalcommands.txt
  .timer 1 5 .msg # Commands Reloaded Manually.
}

Last edited by EggFriedCheese; 03/06/22 04:05 PM.

Twitch Live-Streamer:
Synth Riders
Beat Saber
www.twitch.tv/eggfriedcheese