Creating temporary link permission system for Twitch bot using mIRC scripting

I’m trying to build a system where moderators can give users temporary permission to share links without getting automatically banned. The idea is that when a mod uses a specific command, it should allow that user to post one link within the next 20 seconds. If someone tries to post a link without getting this permission first, they should receive a timeout.

I also want to create a separate command that gives permanent link posting privileges to certain users.

I’m pretty new to mIRC scripting and could use some guidance. Here’s my current attempt:

on *:TEXT:!allow *:#: {
  if (($nick isop #mychannel)) 
  { msg # User $+ $2 can now share a link for the next 20 seconds }
}

This basic structure shows the permission message but doesn’t actually track the timing or enforce the link blocking. How can I expand this to work properly?

The main issue is you’re missing the actual link detection and enforcement. After setting your temp permission variable, you need a separate TEXT event to catch messages and scan for URLs. Something like on *:TEXT:*:#: { if ($regex($1-,/https?:\/\//i)) { ... } } catches most links. Inside that block, check if the user has permanent or temp permissions before taking action. For timeouts, use /ban -u300 #channel $nick or similar depending on your network. One gotcha I hit - variable naming needs to stay consistent. Make sure you’re using the same format when setting and checking permission variables across all events.

That approach works, but the timer syntax is wrong. You need to escape the variable properly - use /timer 1 20 /unset %allow. $+ $2 $+ # instead. For catching links, I’d use regex patterns in your TEXT event like *http* or *www.* to grab most URLs. Don’t forget the permanent permission system - check a separate variable first before the temporary one. Add something like if (%perm. [ $+ [ $nick ] ] [ $+ [ # ] ]) { halt } at the start of your link checking event. Also make sure your channel ops have proper access levels set up, or the isop check might fail depending on your network.

you’ll need timers and variables to track this. add set %allow. $+ $2 $+ # 1 right after your message command, then use .timer 1 20 unset %allow. $+ $2 $+ # to clear it after 20 sec. for link checking, create an on text event that searches for http/www patterns and checks if the variable exists first.