mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2013
Posts: 61
E
Babel fish
OP Offline
Babel fish
E
Joined: Sep 2013
Posts: 61
Hey Guys, I've spent the last hour trying to figure this out, and I seem to be getting nowhere.

I've got a custom twitch bot, and the Mod commands have stopped working, so I've re-written them, but, I can't seem to get the code to recognise when the bot is moderated in the channel.

The code I'm using is:

Quote:
on *:TEXT:!purge *:#: {
if ($nick isop #) { | if (eggbot_v1 !isop #) ( | .msg # I am currently not a moderator of the chat. To use these commands, please make me a moderator. | return } | { if ($$2 isop #) { .msg # This user is a moderator of the chat. I am unable to purge them | return } | else { .msg # /timeout $$2 1 | .msg # User: $$2 has been purged | /splay kick-mark.mp3 } } }


Once the bot is moderated, it's still displaying the Not a moderator text, and not following the code correctly.

If anyone can help, you'd be a lifesaver, as I need the bot to be working again lol

-Eggy


Twitch Live-Streamer:
Synth Riders
Beat Saber
www.twitch.tv/eggfriedcheese
Joined: Jun 2015
Posts: 84
F
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
This should work for you, just replace that current code with this.

Code:
on *:TEXT:!purge *:#: {
  if ($nick !isop #) { return }
  if ($me !isop #) {
    msg # /me - I am currently not a moderator of the chat. To use these commands, please make me a moderator.
    return 
  }
  if ($$2 isop #) { 
    msg # /me - This user is a moderator of the chat. I am unable to purge them. 
    return 
  }
  else { 
    msg # /timeout $$2 1
    msg # User: $$2 has been purged
    /splay kick-mark.mp3
  }
}


That should work, and $me will refer to eggbot_v1 instead of hardcoding it in.

I use a similar method for the channel owner as $mid(#,2).

I usually have it poll for mods every 12 hours, or on command, and update a text file which I can easily poll and check.
Code provided.

Code:
;Mod List Creation

on *:TEXT:!chatmods:#: {
  if ($nick == $mid(#,2)) { msg # .mods }
}

on *:NOTICE:The moderators of this room are*:#: {
  var %i = $remove($7-, $chr(44))
  var %ops = $replace(%i, $chr(32), $crlf)
  var %owner = $mid(#,2)
  var %file = data\Operators_List\OP_List_ $+ $mid(#,2) $+ .txt

  write -c %file
  write %file %ops
  write %file %owner
}

;Read File

;($nick isop #) = $read(data\Operators_List\OP_List_ [ $+ [ $mid(#,2) ] ] $+ .txt,nw,$nick)
;($2 isop #) = $read(data\Operators_List\OP_List_ [ $+ [ $mid(#,2) ] ] $+ .txt,nw,$2)

Last edited by Fonic_Artes; 05/06/16 12:48 PM. Reason: Adjusted to Ensure that Only Mods Can Use
Joined: Sep 2013
Posts: 61
E
Babel fish
OP Offline
Babel fish
E
Joined: Sep 2013
Posts: 61
You're an absolute legend, I've spent ages trying to get this working, and it's been driving me mad laugh


Twitch Live-Streamer:
Synth Riders
Beat Saber
www.twitch.tv/eggfriedcheese
Joined: Jun 2015
Posts: 84
F
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
I should note I made a slight error, adjusting on the previous post now.

Joined: Sep 2013
Posts: 61
E
Babel fish
OP Offline
Babel fish
E
Joined: Sep 2013
Posts: 61
I did notice, I adjusted it myself, it's all good :P


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

Link Copied to Clipboard